lightview 2.0.8 → 2.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +47 -1283
- package/build-bundles.mjs +109 -0
- package/cdom/helpers/array.js +70 -0
- package/cdom/helpers/compare.js +26 -0
- package/cdom/helpers/conditional.js +34 -0
- package/cdom/helpers/datetime.js +54 -0
- package/cdom/helpers/format.js +20 -0
- package/cdom/helpers/logic.js +24 -0
- package/cdom/helpers/lookup.js +25 -0
- package/cdom/helpers/math.js +34 -0
- package/cdom/helpers/network.js +41 -0
- package/cdom/helpers/state.js +77 -0
- package/cdom/helpers/stats.js +39 -0
- package/cdom/helpers/string.js +49 -0
- package/cdom/parser.js +602 -0
- package/components/actions/button.js +19 -6
- package/components/actions/dropdown.js +6 -6
- package/components/actions/modal.js +9 -9
- package/components/actions/swap.js +31 -8
- package/components/daisyui.js +1 -1
- package/components/data-display/accordion.js +6 -6
- package/components/data-display/alert.js +17 -7
- package/components/data-display/avatar.js +7 -7
- package/components/data-display/badge.js +14 -6
- package/components/data-display/card.js +7 -7
- package/components/data-display/carousel.js +4 -4
- package/components/data-display/chart.js +8 -8
- package/components/data-display/chat.js +7 -7
- package/components/data-display/collapse.js +5 -5
- package/components/data-display/countdown.js +3 -3
- package/components/data-display/diff.js +6 -6
- package/components/data-display/kbd.js +12 -6
- package/components/data-display/loading.js +14 -6
- package/components/data-display/progress.js +14 -6
- package/components/data-display/radial-progress.js +15 -6
- package/components/data-display/stats.js +9 -9
- package/components/data-display/table.js +9 -9
- package/components/data-display/timeline.js +8 -8
- package/components/data-display/toast.js +3 -3
- package/components/data-display/tooltip.js +20 -3
- package/components/data-input/checkbox.js +5 -5
- package/components/data-input/file-input.js +3 -3
- package/components/data-input/input.js +5 -5
- package/components/data-input/radio.js +9 -9
- package/components/data-input/range.js +3 -3
- package/components/data-input/rating.js +3 -3
- package/components/data-input/select.js +5 -5
- package/components/data-input/textarea.js +3 -3
- package/components/data-input/toggle.js +5 -5
- package/components/layout/divider.js +24 -4
- package/components/layout/drawer.js +7 -7
- package/components/layout/footer.js +5 -5
- package/components/layout/hero.js +5 -5
- package/components/layout/indicator.js +18 -4
- package/components/layout/join.js +4 -4
- package/components/layout/navbar.js +6 -6
- package/components/navigation/breadcrumbs.js +4 -4
- package/components/navigation/dock.js +5 -5
- package/components/navigation/menu.js +6 -6
- package/components/navigation/pagination.js +3 -3
- package/components/navigation/steps.js +4 -4
- package/components/navigation/tabs.js +296 -21
- package/components/theme/theme-switch.js +30 -30
- package/docs/about.html +141 -7
- package/docs/api/computed.html +1 -6
- package/docs/api/effects.html +1 -7
- package/docs/api/elements.html +130 -58
- package/docs/api/enhance.html +1 -6
- package/docs/api/hypermedia.html +182 -23
- package/docs/api/index.html +11 -12
- package/docs/api/nav.html +35 -4
- package/docs/api/signals.html +1 -6
- package/docs/api/state.html +1 -6
- package/docs/assets/js/examplify-sandbox.html +2 -2
- package/docs/assets/js/examplify.js +15 -15
- package/docs/cdom-nav.html +29 -0
- package/docs/cdom.html +362 -0
- package/docs/components/accordion.html +4 -4
- package/docs/components/alert.html +12 -12
- package/docs/components/avatar.html +4 -4
- package/docs/components/badge.html +59 -4
- package/docs/components/breadcrumbs.html +3 -3
- package/docs/components/button.html +83 -97
- package/docs/components/card.html +4 -4
- package/docs/components/carousel.html +3 -3
- package/docs/components/chart-area.html +6 -6
- package/docs/components/chart-bar.html +6 -6
- package/docs/components/chart-column.html +6 -6
- package/docs/components/chart-line.html +6 -6
- package/docs/components/chart-pie.html +6 -6
- package/docs/components/chart.html +2 -2
- package/docs/components/chat.html +4 -4
- package/docs/components/checkbox.html +4 -4
- package/docs/components/collapse.html +4 -4
- package/docs/components/component-nav.html +1 -1
- package/docs/components/countdown.html +4 -4
- package/docs/components/diff.html +3 -3
- package/docs/components/divider.html +68 -24
- package/docs/components/dock.html +3 -3
- package/docs/components/drawer.html +4 -4
- package/docs/components/dropdown.html +4 -4
- package/docs/components/file-input.html +4 -4
- package/docs/components/footer.html +3 -3
- package/docs/components/gallery.html +2 -2
- package/docs/components/hero.html +3 -3
- package/docs/components/index.css +5 -3
- package/docs/components/index.html +4 -4
- package/docs/components/indicator.html +88 -34
- package/docs/components/input.html +4 -4
- package/docs/components/join.html +3 -3
- package/docs/components/kbd.html +67 -28
- package/docs/components/loading.html +59 -43
- package/docs/components/menu.html +4 -4
- package/docs/components/modal.html +4 -4
- package/docs/components/navbar.html +3 -3
- package/docs/components/pagination.html +3 -3
- package/docs/components/progress.html +48 -7
- package/docs/components/radial-progress.html +35 -15
- package/docs/components/radio.html +4 -4
- package/docs/components/range.html +4 -4
- package/docs/components/rating.html +4 -4
- package/docs/components/select.html +4 -4
- package/docs/components/sidebar-setup.js +1 -1
- package/docs/components/spinner.html +4 -4
- package/docs/components/stats.html +4 -4
- package/docs/components/steps.html +3 -3
- package/docs/components/swap.html +187 -104
- package/docs/components/switch.html +4 -4
- package/docs/components/table.html +4 -4
- package/docs/components/tabs.html +147 -279
- package/docs/components/text-input.html +4 -4
- package/docs/components/textarea.html +4 -4
- package/docs/components/timeline.html +4 -4
- package/docs/components/toast.html +4 -4
- package/docs/components/toggle.html +4 -4
- package/docs/components/tooltip.html +75 -35
- package/docs/examples/getting-started-example.html +1 -1
- package/docs/examples/index.html +1 -2
- package/docs/getting-started/index.html +112 -19
- package/docs/index.html +1 -6
- package/docs/router-nav.html +13 -0
- package/docs/router.html +60 -17
- package/docs/styles/index.html +2 -7
- package/docs/syntax-nav.html +10 -0
- package/docs/syntax.html +146 -0
- package/functions/_middleware.js +17 -10
- package/functions/processServerScripts.js +127 -0
- package/index.html +8 -8
- package/lightview-all.js +1 -0
- package/lightview-cdom.js +1 -0
- package/lightview-router.js +71 -22
- package/lightview-x.js +1 -1247
- package/lightview.js +1 -760
- package/lightview.js.bak +1 -0
- package/package.json +37 -26
- package/scripts/analysis/README.md +2 -0
- package/scripts/analysis/analyze.js +266 -0
- package/scripts/analysis/latest_metrics.md +185 -0
- package/src/lightview-all.js +10 -0
- package/src/lightview-cdom.js +305 -0
- package/src/lightview-x.js +1581 -0
- package/src/lightview.js +694 -0
- package/src/reactivity/signal.js +133 -0
- package/src/reactivity/state.js +217 -0
- package/test-text-tag.js +6 -0
- package/tests/cdom/fixtures/helpers.cdomc +62 -0
- package/tests/cdom/fixtures/user.cdom +14 -0
- package/tests/cdom/fixtures/user.cdomc +12 -0
- package/tests/cdom/fixtures/user.odom +18 -0
- package/tests/cdom/fixtures/user.vdom +11 -0
- package/tests/cdom/helpers.test.js +121 -0
- package/tests/cdom/loader.test.js +125 -0
- package/tests/cdom/parser.test.js +108 -0
- package/tests/cdom/reactivity.test.js +186 -0
- package/tests/text-tag.test.js +77 -0
- package/vite.config.mjs +52 -0
- package/wrangler.toml +6 -0
- package/components/data-display/skeleton.js +0 -66
- package/docs/components/skeleton.html +0 -447
- package/docs/playground.html +0 -416
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<!-- SEO-friendly SPA Shim -->
|
|
2
2
|
<script src="/lightview-router.js"></script>
|
|
3
3
|
<script>
|
|
4
|
-
if (
|
|
4
|
+
if (globalThis.LightviewRouter) {
|
|
5
5
|
LightviewRouter.base('/index.html');
|
|
6
6
|
}
|
|
7
7
|
</script>
|
|
@@ -61,16 +61,17 @@
|
|
|
61
61
|
Perfect for toggle buttons, theme switchers, and animated icons.
|
|
62
62
|
</p>
|
|
63
63
|
|
|
64
|
-
<!--
|
|
64
|
+
<!-- Swap Example with Examplify -->
|
|
65
65
|
<div class="card bg-base-200" style="margin-bottom: 2rem;">
|
|
66
66
|
<div class="card-body">
|
|
67
|
-
<h2 class="card-title">
|
|
68
|
-
<p class="text-sm" style="opacity: 0.7; margin-bottom: 1rem;">Swap with
|
|
67
|
+
<h2 class="card-title">Usage Example</h2>
|
|
68
|
+
<p class="text-sm" style="opacity: 0.7; margin-bottom: 1rem;">Swap with transition effects
|
|
69
|
+
and state binding.</p>
|
|
69
70
|
|
|
70
71
|
<!-- Tabs -->
|
|
71
72
|
<script>
|
|
72
|
-
|
|
73
|
-
const tabs = ['tagged', 'vdom', 'object'];
|
|
73
|
+
globalThis.switchSyntaxTab = (tabId) => {
|
|
74
|
+
const tabs = ['tagged', 'vdom', 'object', 'html'];
|
|
74
75
|
tabs.forEach(t => {
|
|
75
76
|
const tabEl = document.getElementById(`tab-btn-${t}`);
|
|
76
77
|
const contentEl = document.getElementById(`syntax-${t}`);
|
|
@@ -90,8 +91,9 @@
|
|
|
90
91
|
<button id="tab-btn-vdom" role="tab" class="syntax-tab"
|
|
91
92
|
onclick="switchSyntaxTab('vdom')">vDOM</button>
|
|
92
93
|
<button id="tab-btn-object" role="tab" class="syntax-tab"
|
|
93
|
-
onclick="switchSyntaxTab('object')">Object
|
|
94
|
-
|
|
94
|
+
onclick="switchSyntaxTab('object')">Object DOM</button>
|
|
95
|
+
<button id="tab-btn-html" role="tab" class="syntax-tab"
|
|
96
|
+
onclick="switchSyntaxTab('html')">HTML</button>
|
|
95
97
|
</div>
|
|
96
98
|
|
|
97
99
|
<!-- Tagged Syntax -->
|
|
@@ -102,31 +104,42 @@
|
|
|
102
104
|
scripts: ['/lightview.js', '/lightview-x.js'],
|
|
103
105
|
styles: ['https://cdn.jsdelivr.net/npm/daisyui@3.9.4/dist/full.min.css'],
|
|
104
106
|
type: 'module',
|
|
105
|
-
minHeight:
|
|
107
|
+
minHeight: 180,
|
|
106
108
|
autoRun: true
|
|
107
109
|
});
|
|
108
110
|
</script><code contenteditable="true">await import('/components/actions/swap.js');
|
|
109
|
-
|
|
110
|
-
|
|
111
|
+
await import('/components/actions/button.js');
|
|
112
|
+
|
|
113
|
+
const { signal, tags, $ } = Lightview;
|
|
114
|
+
const { div, p, Swap, Button } = tags;
|
|
115
|
+
|
|
116
|
+
const isActive = signal(false);
|
|
111
117
|
|
|
112
|
-
//
|
|
113
|
-
const
|
|
114
|
-
|
|
115
|
-
|
|
118
|
+
// Controlled swap
|
|
119
|
+
const swap = Swap({
|
|
120
|
+
effect: 'flip',
|
|
121
|
+
class: 'text-6xl',
|
|
122
|
+
active: () => isActive.value,
|
|
123
|
+
onChange: (checked) => { isActive.value = checked; }
|
|
124
|
+
},
|
|
125
|
+
Swap.On({}, '🥳'),
|
|
126
|
+
Swap.Off({}, '😭')
|
|
116
127
|
);
|
|
117
128
|
|
|
118
|
-
//
|
|
119
|
-
const
|
|
120
|
-
|
|
121
|
-
|
|
129
|
+
// External control
|
|
130
|
+
const demo = div({ style: 'display: flex; flex-direction: column; gap: 1rem; align-items: center' },
|
|
131
|
+
swap,
|
|
132
|
+
p({ class: 'text-sm' },
|
|
133
|
+
() => isActive.value ? 'Party time! 🎉' : 'So sad... 💔'
|
|
134
|
+
),
|
|
135
|
+
Button({
|
|
136
|
+
color: 'primary',
|
|
137
|
+
size: 'sm',
|
|
138
|
+
onclick: () => { isActive.value = !isActive.value; }
|
|
139
|
+
}, 'Toggle from button')
|
|
122
140
|
);
|
|
123
141
|
|
|
124
|
-
$('#example').content(
|
|
125
|
-
div({ style: 'display: flex; gap: 2rem; align-items: center' },
|
|
126
|
-
emojiSwap,
|
|
127
|
-
playPause
|
|
128
|
-
)
|
|
129
|
-
);</code></pre>
|
|
142
|
+
$('#example').content(demo);</code></pre>
|
|
130
143
|
</div>
|
|
131
144
|
|
|
132
145
|
<!-- vDOM Syntax -->
|
|
@@ -137,35 +150,50 @@ $('#example').content(
|
|
|
137
150
|
scripts: ['/lightview.js', '/lightview-x.js'],
|
|
138
151
|
styles: ['https://cdn.jsdelivr.net/npm/daisyui@3.9.4/dist/full.min.css'],
|
|
139
152
|
type: 'module',
|
|
140
|
-
minHeight:
|
|
153
|
+
minHeight: 180
|
|
141
154
|
});
|
|
142
155
|
</script><code contenteditable="true">await import('/components/actions/swap.js');
|
|
143
|
-
|
|
144
|
-
const {
|
|
156
|
+
await import('/components/actions/button.js');
|
|
157
|
+
const { signal, $, tags } = Lightview;
|
|
158
|
+
const { Swap, Button, div, p } = tags;
|
|
145
159
|
|
|
146
|
-
const
|
|
147
|
-
tag: Swap,
|
|
148
|
-
attributes: { effect: 'rotate', class: 'text-4xl' },
|
|
149
|
-
children: [
|
|
150
|
-
{ tag: Swap.On, children: ['😈'] },
|
|
151
|
-
{ tag: Swap.Off, children: ['😇'] }
|
|
152
|
-
]
|
|
153
|
-
};
|
|
160
|
+
const isActive = signal(false);
|
|
154
161
|
|
|
155
|
-
const
|
|
156
|
-
tag:
|
|
157
|
-
attributes: {
|
|
162
|
+
const demo = {
|
|
163
|
+
tag: div,
|
|
164
|
+
attributes: { style: 'display: flex; flex-direction: column; gap: 1rem; align-items: center' },
|
|
158
165
|
children: [
|
|
159
|
-
{
|
|
160
|
-
|
|
166
|
+
{
|
|
167
|
+
tag: Swap,
|
|
168
|
+
attributes: {
|
|
169
|
+
effect: 'flip',
|
|
170
|
+
class: 'text-6xl',
|
|
171
|
+
active: () => isActive.value,
|
|
172
|
+
onChange: (checked) => { isActive.value = checked; }
|
|
173
|
+
},
|
|
174
|
+
children: [
|
|
175
|
+
{ tag: Swap.On, children: ['🥳'] },
|
|
176
|
+
{ tag: Swap.Off, children: ['😭'] }
|
|
177
|
+
]
|
|
178
|
+
},
|
|
179
|
+
{
|
|
180
|
+
tag: p,
|
|
181
|
+
attributes: { class: 'text-sm' },
|
|
182
|
+
children: [() => isActive.value ? 'Party time! 🎉' : 'So sad... 💔']
|
|
183
|
+
},
|
|
184
|
+
{
|
|
185
|
+
tag: Button,
|
|
186
|
+
attributes: {
|
|
187
|
+
color: 'primary',
|
|
188
|
+
size: 'sm',
|
|
189
|
+
onclick: () => { isActive.value = !isActive.value; }
|
|
190
|
+
},
|
|
191
|
+
children: ['Toggle from button']
|
|
192
|
+
}
|
|
161
193
|
]
|
|
162
194
|
};
|
|
163
195
|
|
|
164
|
-
$('#example').content(
|
|
165
|
-
tag: div,
|
|
166
|
-
attributes: { style: 'display: flex; gap: 2rem; align-items: center' },
|
|
167
|
-
children: [emojiSwap, playPause]
|
|
168
|
-
});</code></pre>
|
|
196
|
+
$('#example').content(demo);</code></pre>
|
|
169
197
|
</div>
|
|
170
198
|
|
|
171
199
|
<!-- Object DOM Syntax -->
|
|
@@ -176,33 +204,42 @@ $('#example').content({
|
|
|
176
204
|
scripts: ['/lightview.js', '/lightview-x.js'],
|
|
177
205
|
styles: ['https://cdn.jsdelivr.net/npm/daisyui@3.9.4/dist/full.min.css'],
|
|
178
206
|
type: 'module',
|
|
179
|
-
minHeight:
|
|
207
|
+
minHeight: 180
|
|
180
208
|
});
|
|
181
209
|
</script><code contenteditable="true">await import('/components/actions/swap.js');
|
|
182
|
-
|
|
210
|
+
await import('/components/actions/button.js');
|
|
211
|
+
const { signal, $ } = Lightview;
|
|
212
|
+
|
|
213
|
+
const isActive = signal(false);
|
|
183
214
|
|
|
184
215
|
const demo = {
|
|
185
216
|
div: {
|
|
186
|
-
style: 'display: flex; gap:
|
|
217
|
+
style: 'display: flex; flex-direction: column; gap: 1rem; align-items: center',
|
|
187
218
|
children: [
|
|
188
219
|
{
|
|
189
220
|
Swap: {
|
|
190
|
-
effect: '
|
|
191
|
-
class: 'text-
|
|
221
|
+
effect: 'flip',
|
|
222
|
+
class: 'text-6xl',
|
|
223
|
+
active: () => isActive.value,
|
|
224
|
+
onChange: (checked) => { isActive.value = checked; },
|
|
192
225
|
children: [
|
|
193
|
-
{ 'Swap.On': { children: ['
|
|
194
|
-
{ 'Swap.Off': { children: ['
|
|
226
|
+
{ 'Swap.On': { children: ['🥳'] } },
|
|
227
|
+
{ 'Swap.Off': { children: ['😭'] } }
|
|
195
228
|
]
|
|
196
229
|
}
|
|
197
230
|
},
|
|
198
231
|
{
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
232
|
+
p: {
|
|
233
|
+
class: 'text-sm',
|
|
234
|
+
children: [() => isActive.value ? 'Party time! 🎉' : 'So sad... 💔']
|
|
235
|
+
}
|
|
236
|
+
},
|
|
237
|
+
{
|
|
238
|
+
Button: {
|
|
239
|
+
color: 'primary',
|
|
240
|
+
size: 'sm',
|
|
241
|
+
onclick: () => { isActive.value = !isActive.value; },
|
|
242
|
+
children: ['Toggle from button']
|
|
206
243
|
}
|
|
207
244
|
}
|
|
208
245
|
]
|
|
@@ -211,6 +248,54 @@ const demo = {
|
|
|
211
248
|
|
|
212
249
|
$('#example').content(demo);</code></pre>
|
|
213
250
|
</div>
|
|
251
|
+
|
|
252
|
+
<!-- HTML Syntax -->
|
|
253
|
+
<div id="syntax-html" style="display: none;">
|
|
254
|
+
<pre><script>
|
|
255
|
+
examplify(document.currentScript.nextElementSibling, {
|
|
256
|
+
at: document.currentScript.parentElement,
|
|
257
|
+
scripts: ['/lightview.js', '/lightview-x.js'],
|
|
258
|
+
styles: ['https://cdn.jsdelivr.net/npm/daisyui@3.9.4/dist/full.min.css'],
|
|
259
|
+
type: 'module',
|
|
260
|
+
language: 'html',
|
|
261
|
+
minHeight: 180
|
|
262
|
+
});
|
|
263
|
+
</script><code contenteditable="true" class="language-html"><!-- Import components -->
|
|
264
|
+
<script type="module" src="/components/actions/swap.js"></script>
|
|
265
|
+
<script type="module" src="/components/actions/button.js"></script>
|
|
266
|
+
|
|
267
|
+
<div id="demo-root" style="display: flex; flex-direction: column; gap: 1rem; align-items: center">
|
|
268
|
+
<lv-swap id="my-swap" effect="flip" class="text-6xl">
|
|
269
|
+
<on>🥳</on>
|
|
270
|
+
<off>😭</off>
|
|
271
|
+
</lv-swap>
|
|
272
|
+
|
|
273
|
+
<p id="status-text" class="text-sm">Waiting...</p>
|
|
274
|
+
|
|
275
|
+
<lv-button id="toggle-btn" color="primary" size="sm">Toggle State</lv-button>
|
|
276
|
+
</div>
|
|
277
|
+
|
|
278
|
+
<script type="module">
|
|
279
|
+
const { signal, effect, $ } = Lightview;
|
|
280
|
+
const isActive = signal(false);
|
|
281
|
+
|
|
282
|
+
// Link swap state
|
|
283
|
+
const swap = document.getElementById('my-swap');
|
|
284
|
+
swap.addEventListener('change', (e) => { isActive.value = e.target.checked; });
|
|
285
|
+
|
|
286
|
+
// External toggle
|
|
287
|
+
document.getElementById('toggle-btn').onclick = () => {
|
|
288
|
+
isActive.value = !isActive.value;
|
|
289
|
+
};
|
|
290
|
+
|
|
291
|
+
// Reactive sync
|
|
292
|
+
effect(() => {
|
|
293
|
+
swap.setAttribute('active', isActive.value);
|
|
294
|
+
document.getElementById('status-text').textContent =
|
|
295
|
+
isActive.value ? 'Party time! 🎉' : 'So sad... 💔';
|
|
296
|
+
});
|
|
297
|
+
</script></code></pre>
|
|
298
|
+
</div>
|
|
214
299
|
</div>
|
|
215
300
|
</div>
|
|
216
301
|
|
|
@@ -223,7 +308,7 @@ $('#example').content(demo);</code></pre>
|
|
|
223
308
|
|
|
224
309
|
<!-- Tabs -->
|
|
225
310
|
<script>
|
|
226
|
-
|
|
311
|
+
globalThis.switchReactiveSyntaxTab = (tabId) => {
|
|
227
312
|
const tabs = ['tagged', 'vdom', 'object'];
|
|
228
313
|
tabs.forEach(t => {
|
|
229
314
|
const tabEl = document.getElementById(`reactive-tab-btn-${t}`);
|
|
@@ -459,59 +544,57 @@ $('#example').content(demo);</code></pre>
|
|
|
459
544
|
</table>
|
|
460
545
|
</div>
|
|
461
546
|
|
|
462
|
-
<!--
|
|
463
|
-
<h2 class="text-xl font-bold" style="margin-bottom: 1rem;">
|
|
547
|
+
<!-- Swap Gallery -->
|
|
548
|
+
<h2 class="text-xl font-bold" style="margin-bottom: 1rem;">Swap Gallery</h2>
|
|
549
|
+
<p class="text-sm" style="opacity: 0.7; margin-bottom: 1.5rem;">
|
|
550
|
+
Live examples using <code><lv-swap></code> custom elements.
|
|
551
|
+
</p>
|
|
552
|
+
|
|
553
|
+
<script type="module" src="/components/actions/swap.js"></script>
|
|
554
|
+
|
|
555
|
+
<h3 class="text-lg font-semibold" style="margin-bottom: 0.75rem;">Effects</h3>
|
|
464
556
|
<div class="example-flex" style="margin-bottom: 2rem;">
|
|
465
557
|
<div class="text-center">
|
|
466
558
|
<p class="text-sm opacity-70 mb-2">Rotate</p>
|
|
467
|
-
<
|
|
468
|
-
<
|
|
469
|
-
<
|
|
470
|
-
|
|
471
|
-
</label>
|
|
559
|
+
<lv-swap effect="rotate" class="text-4xl">
|
|
560
|
+
<on>😈</on>
|
|
561
|
+
<off>😇</off>
|
|
562
|
+
</lv-swap>
|
|
472
563
|
</div>
|
|
473
564
|
<div class="text-center">
|
|
474
565
|
<p class="text-sm opacity-70 mb-2">Flip</p>
|
|
475
|
-
<
|
|
476
|
-
<
|
|
477
|
-
<
|
|
478
|
-
|
|
479
|
-
</label>
|
|
566
|
+
<lv-swap effect="flip" class="text-4xl">
|
|
567
|
+
<on>🥳</on>
|
|
568
|
+
<off>😭</off>
|
|
569
|
+
</lv-swap>
|
|
480
570
|
</div>
|
|
481
571
|
</div>
|
|
482
572
|
|
|
483
|
-
|
|
484
|
-
<
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
<
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
<
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
</svg>
|
|
507
|
-
<svg class="swap-on h-10 w-10 fill-current" xmlns="http://www.w3.org/2000/svg"
|
|
508
|
-
viewBox="0 0 24 24">
|
|
509
|
-
<path
|
|
510
|
-
d="M21.64,13a1,1,0,0,0-1.05-.14,8.05,8.05,0,0,1-3.37.73A8.15,8.15,0,0,1,9.08,5.49a8.59,8.59,0,0,1,.25-2A1,1,0,0,0,8,2.36,10.14,10.14,0,1,0,22,14.05,1,1,0,0,0,21.64,13Zm-9.5,6.69A8.14,8.14,0,0,1,7.08,5.22v.27A10.15,10.15,0,0,0,17.22,15.63a9.79,9.79,0,0,0,2.1-.22A8.11,8.11,0,0,1,12.14,19.73Z" />
|
|
511
|
-
</svg>
|
|
512
|
-
</label>
|
|
573
|
+
<h3 class="text-lg font-semibold" style="margin-bottom: 0.75rem;">Interactive Icons</h3>
|
|
574
|
+
<div style="display: flex; gap: 1rem; align-items: center; margin-bottom: 2rem;">
|
|
575
|
+
<lv-swap effect="rotate" class="btn btn-circle">
|
|
576
|
+
<on>
|
|
577
|
+
<svg class="fill-current" xmlns="http://www.w3.org/2000/svg" width="32" height="32"
|
|
578
|
+
viewBox="0 0 512 512">
|
|
579
|
+
<polygon
|
|
580
|
+
points="400 145.49 366.51 112 256 222.51 145.49 112 112 145.49 222.51 256 112 366.51 145.49 400 256 289.49 366.51 400 400 366.51 289.49 256 400 145.49" />
|
|
581
|
+
</svg>
|
|
582
|
+
</on>
|
|
583
|
+
<off>
|
|
584
|
+
<svg class="fill-current" xmlns="http://www.w3.org/2000/svg" width="32" height="32"
|
|
585
|
+
viewBox="0 0 512 512">
|
|
586
|
+
<path d="M64,384H448V341.33H64Zm0-106.67H448V234.67H64ZM64,128v42.67H448V128Z" />
|
|
587
|
+
</svg>
|
|
588
|
+
</off>
|
|
589
|
+
</lv-swap>
|
|
590
|
+
|
|
591
|
+
<lv-swap class="text-4xl">
|
|
592
|
+
<on>❤️</on>
|
|
593
|
+
<off>🤍</off>
|
|
594
|
+
</lv-swap>
|
|
595
|
+
</div>
|
|
513
596
|
</div>
|
|
514
597
|
</div>
|
|
515
598
|
</div>
|
|
516
599
|
</div>
|
|
517
|
-
</div>
|
|
600
|
+
</div>
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
<!-- SEO-friendly SPA Shim -->
|
|
2
2
|
<script src="/lightview-router.js"></script>
|
|
3
3
|
<script>
|
|
4
|
-
if (
|
|
5
|
-
|
|
4
|
+
if (globalThis.LightviewRouter) {
|
|
5
|
+
globalThis.location.replace('/docs/components/toggle');
|
|
6
6
|
} else {
|
|
7
|
-
|
|
7
|
+
globalThis.location.href = 'toggle.html';
|
|
8
8
|
}
|
|
9
9
|
</script>
|
|
10
10
|
|
|
@@ -65,4 +65,4 @@
|
|
|
65
65
|
</div>
|
|
66
66
|
</div>
|
|
67
67
|
</div>
|
|
68
|
-
</div>
|
|
68
|
+
</div>
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<!-- SEO-friendly SPA Shim -->
|
|
2
2
|
<script src="/lightview-router.js"></script>
|
|
3
3
|
<script>
|
|
4
|
-
if (
|
|
4
|
+
if (globalThis.LightviewRouter) {
|
|
5
5
|
LightviewRouter.base('/index.html');
|
|
6
6
|
}
|
|
7
7
|
</script>
|
|
@@ -70,7 +70,7 @@
|
|
|
70
70
|
|
|
71
71
|
<!-- Tabs -->
|
|
72
72
|
<script>
|
|
73
|
-
|
|
73
|
+
globalThis.switchSyntaxTab = (tabId) => {
|
|
74
74
|
const tabs = ['tagged', 'vdom', 'object'];
|
|
75
75
|
tabs.forEach(t => {
|
|
76
76
|
const tabEl = document.getElementById(`tab-btn-${t}`);
|
|
@@ -262,7 +262,7 @@ $('#example').content(table);</code></pre>
|
|
|
262
262
|
|
|
263
263
|
<!-- Tabs -->
|
|
264
264
|
<script>
|
|
265
|
-
|
|
265
|
+
globalThis.switchReactiveSyntaxTab = (tabId) => {
|
|
266
266
|
const tabs = ['tagged', 'vdom', 'object'];
|
|
267
267
|
tabs.forEach(t => {
|
|
268
268
|
const tabEl = document.getElementById(`reactive-tab-btn-${t}`);
|
|
@@ -665,4 +665,4 @@ $('#example').content(demo);</code></pre>
|
|
|
665
665
|
</div>
|
|
666
666
|
</div>
|
|
667
667
|
</div>
|
|
668
|
-
</div>
|
|
668
|
+
</div>
|