Skip to content

Commit 07cef71

Browse files
committed
feat(site): move back to separate view/viewmodel, show html
We need to highlight the simplicity of Aurelia
1 parent d0cf12f commit 07cef71

File tree

3 files changed

+26
-25
lines changed

3 files changed

+26
-25
lines changed
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
<p>Current count: ${count}</p>
2+
<button click.trigger="increment()">Increment</button>

aurelia-apps/src/examples/simple-counter.ts

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,3 @@
1-
import { customElement } from 'aurelia';
2-
3-
@customElement({
4-
name: 'simple-counter',
5-
template: `
6-
<p style="margin-top:0;">Current count: \${count}</p>
7-
<button click.trigger="increment()">Increment</button>
8-
`,
9-
shadowOptions: {
10-
mode: 'open',
11-
},
12-
})
131
export class SimpleCounter {
142
count = 0;
153

themes/aurelia-theme/layouts/index.html

Lines changed: 24 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -90,28 +90,39 @@ <h1 class="text-4xl sm:text-6xl font-bold mb-6">
9090
<!-- Right Column: Interactive Demo -->
9191
<div class="hidden lg:block w-full max-w-lg">
9292
<div class="relative">
93-
<!-- Code Preview -->
93+
<!-- Code Preview Tabs -->
9494
<div class="rounded-xl bg-gray-900 p-4 shadow-2xl transform hover:-translate-y-1 transition-transform">
95-
<div class="flex items-center gap-1.5 mb-4">
96-
<div class="w-3 h-3 rounded-full bg-red-500"></div>
97-
<div class="w-3 h-3 rounded-full bg-yellow-500"></div>
98-
<div class="w-3 h-3 rounded-full bg-green-500"></div>
95+
<div class="flex items-center justify-between mb-4">
96+
<div class="flex items-center gap-1.5">
97+
<div class="w-3 h-3 rounded-full bg-red-500"></div>
98+
<div class="w-3 h-3 rounded-full bg-yellow-500"></div>
99+
<div class="w-3 h-3 rounded-full bg-green-500"></div>
100+
</div>
101+
<div class="flex gap-2 text-xs text-gray-400">
102+
<span class="px-2 py-1 rounded bg-gray-800 text-aurelia">simple-counter.ts</span>
103+
<span class="px-2 py-1 rounded bg-gray-800/50">simple-counter.html</span>
104+
</div>
99105
</div>
100-
<pre class="text-sm font-mono"><code class="language-typescript text-gray-300">import { customElement } from 'aurelia';
101-
102-
@customElement({
103-
name: 'simple-counter',
104-
template: `<p>Current count: \${count}</p><button click.trigger="increment()">Increment</button>`
105-
})
106-
export class SimpleCounter {
106+
<pre class="text-sm font-mono"><code class="language-typescript text-gray-300">export class Counter {
107107
count = 0;
108108

109109
increment() {
110110
this.count++;
111111
}
112112
}</code></pre>
113+
114+
<div class="mt-4 pt-4 border-t border-gray-800">
115+
<div class="flex gap-2 text-xs text-gray-400 mb-2">
116+
<span class="px-2 py-1 rounded bg-gray-800/50">simple-counter.ts</span>
117+
<span class="px-2 py-1 rounded bg-gray-800 text-aurelia">simple-counter.html</span>
118+
</div>
119+
<pre class="text-sm font-mono"><code class="language-html text-gray-300">&lt;p&gt;Current count: ${count}&lt;/p&gt;
120+
&lt;button click.trigger="increment()"&gt;
121+
Increment
122+
&lt;/button&gt;</code></pre>
123+
</div>
113124
</div>
114-
125+
115126
<!-- Result Preview -->
116127
<div class="mt-4 rounded-xl bg-white p-6 shadow-xl border border-gray-200">
117128
<div data-aurelia-app="simple-counter"></div>

0 commit comments

Comments
 (0)