Skip to content

Commit

Permalink
added moon.js demo project
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelsboost committed Aug 10, 2024
1 parent 52ddd92 commit d5c66ba
Show file tree
Hide file tree
Showing 4 changed files with 102 additions and 7 deletions.
22 changes: 19 additions & 3 deletions go/dist/App.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions go/dist/App.min.js.map

Large diffs are not rendered by default.

52 changes: 52 additions & 0 deletions go/imgs/frameworks/moon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
31 changes: 29 additions & 2 deletions go/src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -775,7 +775,8 @@ function Demos() {
"hyperapp",
"aurelia",
"lit",
"knockout"
"knockout",
"moon"
]

let buttonHTML = "";
Expand Down Expand Up @@ -2228,7 +2229,7 @@ enableProdMode();
selector: 'app-root',
template: \`
<div class="flex flex-col items-center justify-center absolute inset-0">
<h1 class="text-3xl font-thin mb-4">👋 Hello, ${capitalizedTitle}! 🌎</h1>
<h1 class="text-3xl font-thin mb-4">👋 Hello, Angular 11! 🌎</h1>
<p class="text-xl mb-4">Counter: <span id="counter" class="font-mono">{{ counter }}</span></p>
<button
id="incrementButton"
Expand Down Expand Up @@ -2487,6 +2488,32 @@ customElements.define('my-element', MyElement);`;
ko.applyBindings(new AppViewModel());`;
}
if (name === 'moon') {
project.meta = `<script src="https://unpkg.com/moonjs"></script>`;
project.libraries = [
"https://cdnjs.cloudflare.com/ajax/libs/picocss/2.0.6/pico.min.css",
"https://michaelsboost.com/TailwindCSSMod/tailwind-mod-noreset.min.js",
];
project.html = `<div id="root" class="flex flex-col items-center justify-center absolute inset-0">
<h1 class="text-3xl font-thin mb-4">👋 Hello, Moon.js! 🌎</h1>
<p class="text-xl mb-4">Counter: <span class="font-mono">{{ count }}</span></p>
<button class="px-4 py-2 bg-blue-500 text-white rounded hover:bg-blue-700 transition" m-on:click="increment">
+
</button>
</div>`;
project.css = ``;
project.javascript = `var app = new Moon({
el: '#root',
data: {
count: 0
},
methods: {
increment() {
this.set('count', this.get('count') + 1);
}
}
});`;
}

dispatchChanges(editorManager.htmlEditor, project.html);
dispatchChanges(editorManager.cssEditor, project.css);
Expand Down

0 comments on commit d5c66ba

Please sign in to comment.