diff --git a/site/routes/api/user.js b/site/routes/api/user.js deleted file mode 100644 index 73d2695..0000000 --- a/site/routes/api/user.js +++ /dev/null @@ -1,11 +0,0 @@ -/** - * `./routes/api/` - * ...is where we put file-based REST API endpoints - * this one is accessible via https:///api/user - */ -export default eventHandler(() => { - return { - user: "AYO", - date: new Date(), - }; -}); diff --git a/site/src/components/my-quote.js b/site/src/components/my-quote.js new file mode 100644 index 0000000..8c47beb --- /dev/null +++ b/site/src/components/my-quote.js @@ -0,0 +1,38 @@ +class MyQuote extends WebComponent { + static properties = ['type']; + + /** + * @type {HTMLElement} + */ + get wrapper() { + return this.querySelector('#wrapper'); + } + + afterViewInit() { + /** + * @type {Partial} + */ + const style = { + background: "#f5f2f0", + padding: "1em", + margin: "1em 0", + fontSize: "large", + overflow: "auto", + borderRadius: '5px' + }; + + Object.keys(style).forEach((rule) => { + this.wrapper.style[rule] = style[rule]; + }); + + } + + get template() { + const trimmed = this.innerHTML.trim(); + return ` +
+ ${trimmed} +
+ `; + } +} diff --git a/site/src/pages/index.html b/site/src/pages/index.html index b5bd232..cdd3a67 100644 --- a/site/src/pages/index.html +++ b/site/src/pages/index.html @@ -26,6 +26,7 @@
+

By extending our base class, you get an easy authoring experience as you would expect in writing your components:

    @@ -35,6 +36,17 @@
  • Provided out-of-the-box with McFly, a powerful no-framework framework
+ +

+ Version 2.0.0-beta is out! 🎉 +

+

+ We are now able to attach "side effects" to property value changes, from inside the component and outside. +

+

+ Play on CodePen. +

+