@skathi-native/cli 0.1.0-beta.1 → 0.1.0-beta.2

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.
Files changed (40) hide show
  1. package/cli/create.ts +100 -184
  2. package/cli/help.ts +160 -0
  3. package/cli/sk.ts +19 -85
  4. package/package.json +3 -2
  5. package/templates/minimal/assets/hello.txt +1 -0
  6. package/templates/minimal/src/App.vue +142 -0
  7. package/templates/minimal/src/main.ts +4 -0
  8. package/templates/showcase/assets/hello.txt +1 -0
  9. package/templates/showcase/assets/media/aurora.png +0 -0
  10. package/templates/showcase/assets/media/clip.mp4 +0 -0
  11. package/templates/showcase/assets/media/sticker.tgs +0 -0
  12. package/templates/showcase/src/App.vue +128 -0
  13. package/templates/showcase/src/components/Card.vue +41 -0
  14. package/templates/showcase/src/components/Icon.vue +29 -0
  15. package/templates/showcase/src/components/Missing.vue +26 -0
  16. package/templates/showcase/src/components/Page.vue +41 -0
  17. package/templates/showcase/src/components/Titlebar.vue +128 -0
  18. package/templates/showcase/src/engine.ts +33 -0
  19. package/templates/showcase/src/icons.ts +22 -0
  20. package/templates/showcase/src/main.ts +7 -0
  21. package/templates/showcase/src/pages/AudioPage.vue +124 -0
  22. package/templates/showcase/src/pages/FilesPage.vue +91 -0
  23. package/templates/showcase/src/pages/FormsPage.vue +139 -0
  24. package/templates/showcase/src/pages/GraphicsPage.vue +156 -0
  25. package/templates/showcase/src/pages/HomePage.vue +141 -0
  26. package/templates/showcase/src/pages/LocalePage.vue +71 -0
  27. package/templates/showcase/src/pages/MediaPage.vue +85 -0
  28. package/templates/showcase/src/pages/MotionPage.vue +199 -0
  29. package/templates/showcase/src/pages/NetworkPage.vue +103 -0
  30. package/templates/showcase/src/pages/PermissionsPage.vue +80 -0
  31. package/templates/showcase/src/pages/StoragePage.vue +117 -0
  32. package/templates/showcase/src/pages/StylesPage.vue +199 -0
  33. package/templates/showcase/src/pages/SystemPage.vue +89 -0
  34. package/templates/showcase/src/pages/TrayPage.vue +66 -0
  35. package/templates/showcase/src/pages/WindowPage.vue +128 -0
  36. package/templates/showcase/src/product.ts +2 -0
  37. package/templates/showcase/src/router.ts +149 -0
  38. package/templates/showcase/src/stores/counter.ts +9 -0
  39. package/templates/showcase/src/stores/desktop.ts +115 -0
  40. package/templates/showcase/src/styles.css +140 -0
@@ -0,0 +1,156 @@
1
+ <script setup lang="ts">
2
+ import { onMounted, onUnmounted, ref, shallowRef } from "vue";
3
+ import Card from "../components/Card.vue";
4
+ import Missing from "../components/Missing.vue";
5
+ import Page from "../components/Page.vue";
6
+ import { describe, everyFrame, gpu } from "../engine";
7
+
8
+ const W = 640;
9
+ const H = 220;
10
+ const dpr = devicePixelRatio;
11
+
12
+ const pad = shallowRef<SkCanvasElement | null>(null);
13
+ let ctx: SkCanvas2D | null = null;
14
+ let last: { x: number; y: number } | null = null;
15
+ let hue = 220;
16
+
17
+ function clear() {
18
+ if (!ctx) return;
19
+ const bg = ctx.createLinearGradient(0, 0, W, H);
20
+ bg.addColorStop(0, "#14141c");
21
+ bg.addColorStop(1, "#1c1630");
22
+ ctx.fillStyle = bg;
23
+ ctx.fillRect(0, 0, W, H);
24
+ ctx.fillStyle = "#ffffff40";
25
+ ctx.font = "13px Segoe UI";
26
+ ctx.fillText("Drag to draw", 16, 26);
27
+ }
28
+
29
+ const at = (e: SkMouseEvent) => {
30
+ const rect = pad.value!.getBoundingClientRect();
31
+ return { x: e.clientX - rect.left, y: e.clientY - rect.top };
32
+ };
33
+ const down = (e: SkMouseEvent) => (last = at(e));
34
+ const up = () => (last = null);
35
+ function move(e: SkMouseEvent) {
36
+ if (!ctx || !last) return;
37
+ const next = at(e);
38
+ hue = (hue + 2) % 360;
39
+ ctx.strokeStyle = `hsl(${hue}, 90%, 68%)`;
40
+ ctx.lineWidth = 6;
41
+ ctx.lineCap = "round";
42
+ ctx.beginPath();
43
+ ctx.moveTo(last.x, last.y);
44
+ ctx.lineTo(next.x, next.y);
45
+ ctx.stroke();
46
+ last = next;
47
+ }
48
+
49
+ onMounted(() => {
50
+ ctx = pad.value?.getContext("2d") ?? null;
51
+ ctx?.scale(dpr, dpr);
52
+ clear();
53
+ });
54
+
55
+ const SHADER = /* wgsl */ `
56
+ struct Uniforms { time: f32, aspect: f32 }
57
+ @group(0) @binding(0) var<uniform> u: Uniforms;
58
+
59
+ struct Varying { @builtin(position) position: vec4f, @location(0) uv: vec2f }
60
+
61
+ @vertex fn vs(@builtin(vertex_index) i: u32) -> Varying {
62
+ var corners = array<vec2f, 3>(vec2f(-1.0, -3.0), vec2f(-1.0, 1.0), vec2f(3.0, 1.0));
63
+ var out: Varying;
64
+ out.position = vec4f(corners[i], 0.0, 1.0);
65
+ out.uv = corners[i] * 0.5 + 0.5;
66
+ return out;
67
+ }
68
+
69
+ @fragment fn fs(v: Varying) -> @location(0) vec4f {
70
+ let p = (v.uv - 0.5) * vec2f(u.aspect, 1.0) * 6.0;
71
+ let t = u.time;
72
+ let w = sin(p.x + t) + sin(p.y * 1.3 - t * 0.8) + sin(length(p) * 1.5 - t * 1.2);
73
+ let c = 0.5 + 0.5 * cos(vec3f(0.0, 2.1, 4.2) + w + t * 0.3);
74
+ return vec4f(c * vec3f(0.55, 0.6, 1.0), 1.0);
75
+ }`;
76
+
77
+ const surface = shallowRef<SkCanvasElement | null>(null);
78
+ const adapterName = ref("");
79
+ let stopGpu: (() => void) | null = null;
80
+
81
+ async function startGpu(api: SkGPU, canvas: SkCanvasElement) {
82
+ const adapter = await api.requestAdapter();
83
+ const context = canvas.getContext("webgpu");
84
+ if (!adapter || !context || !GPUBufferUsage) throw new Error("No GPU adapter for WebGPU on this machine");
85
+ adapterName.value = adapter.info.description;
86
+ const device = await adapter.requestDevice();
87
+ const format = api.getPreferredCanvasFormat();
88
+ context.configure({ device, format, alphaMode: "opaque" });
89
+ const module = device.createShaderModule({ code: SHADER });
90
+ const pipeline = device.createRenderPipeline({
91
+ layout: "auto",
92
+ vertex: { module, entryPoint: "vs" },
93
+ fragment: { module, entryPoint: "fs", targets: [{ format }] },
94
+ });
95
+ const uniforms = device.createBuffer({ size: 16, usage: GPUBufferUsage.UNIFORM | GPUBufferUsage.COPY_DST });
96
+ const bindings = device.createBindGroup({
97
+ layout: pipeline.getBindGroupLayout(0),
98
+ entries: [{ binding: 0, resource: { buffer: uniforms } }],
99
+ });
100
+ const stop = everyFrame((time) => {
101
+ device.queue.writeBuffer(uniforms, 0, new Float32Array([time / 1000, W / H, 0, 0]));
102
+ const encoder = device.createCommandEncoder();
103
+ const pass = encoder.beginRenderPass({
104
+ colorAttachments: [{ view: context.getCurrentTexture().createView(), loadOp: "clear", storeOp: "store" }],
105
+ });
106
+ pass.setPipeline(pipeline);
107
+ pass.setBindGroup(0, bindings);
108
+ pass.draw(3);
109
+ pass.end();
110
+ device.queue.submit([encoder.finish()]);
111
+ });
112
+ stopGpu = () => {
113
+ stop();
114
+ device.destroy();
115
+ };
116
+ }
117
+
118
+ onMounted(() => {
119
+ if (gpu && surface.value) startGpu(gpu, surface.value).catch((e: unknown) => (adapterName.value = describe(e)));
120
+ });
121
+ onUnmounted(() => stopGpu?.());
122
+ </script>
123
+
124
+ <template>
125
+ <Page title="Graphics" lead="Canvas 2D and WebGPU draw into the same GPU-composited tree as the rest of the page.">
126
+ <Card title="Canvas 2D" api="getContext('2d')">
127
+ <canvas
128
+ ref="pad"
129
+ class="canvas"
130
+ :width="W * dpr"
131
+ :height="H * dpr"
132
+ @mousedown="down"
133
+ @mousemove="move"
134
+ @mouseup="up"
135
+ @mouseleave="up"
136
+ />
137
+ <div class="row">
138
+ <button class="btn" @click="clear">Clear</button>
139
+ </div>
140
+ </Card>
141
+
142
+ <Card title="WebGPU" :api="adapterName || 'navigator.gpu'">
143
+ <canvas v-if="gpu" ref="surface" class="canvas" :width="W * dpr" :height="H * dpr" />
144
+ <Missing v-else part="webgpu" />
145
+ <p class="faint">A WGSL fragment shader, redrawn every frame with the time in a uniform buffer.</p>
146
+ </Card>
147
+ </Page>
148
+ </template>
149
+
150
+ <style scoped>
151
+ .canvas {
152
+ width: 640px;
153
+ height: 220px;
154
+ border-radius: 10px;
155
+ }
156
+ </style>
@@ -0,0 +1,141 @@
1
+ <script setup lang="ts">
2
+ import { onMounted, ref } from "vue";
3
+ import Icon from "../components/Icon.vue";
4
+ import { http } from "../engine";
5
+ import { productName } from "../product";
6
+ import { pages } from "../router";
7
+ import { useCounter } from "../stores/counter";
8
+
9
+ const counter = useCounter();
10
+ const features = pages.filter((p) => p.blurb);
11
+
12
+ // A relative URL resolves against the app root in dev and against the packaged assets in a build.
13
+ const greeting = ref("");
14
+ onMounted(async () => {
15
+ const res = await http("assets/hello.txt");
16
+ if (res.ok) greeting.value = (await res.text()).trim();
17
+ });
18
+ </script>
19
+
20
+ <template>
21
+ <section class="home">
22
+ <div class="hero">
23
+ <div class="logo">{{ productName.charAt(0) }}</div>
24
+ <h1 class="title">{{ productName }}</h1>
25
+ <p class="lead">
26
+ Vue 3 on a native GPU renderer, with no browser inside. Every page in the sidebar shows one part of Skathi in a
27
+ few lines of code; open <span class="mono">src/pages</span> next to it and change things while
28
+ <span class="mono">sk dev</span> runs.
29
+ </p>
30
+ <div class="row">
31
+ <button class="btn primary" @click="counter.increment()">Count up · {{ counter.count }}</button>
32
+ <button class="btn" :disabled="counter.count === 0" @click="counter.reset()">Reset</button>
33
+ </div>
34
+ <p class="faint">
35
+ The count is a pinia store: the pop-out window, the tray menu and the global hotkey all change the same one.
36
+ </p>
37
+ <p v-if="greeting" class="faint">{{ greeting }}</p>
38
+ </div>
39
+
40
+ <div class="grid">
41
+ <RouterLink v-for="page in features" :key="page.path" :to="page.path" class="feature">
42
+ <span class="badge"><Icon :name="page.icon" /></span>
43
+ <span class="name">{{ page.title }}</span>
44
+ <span class="blurb">{{ page.blurb }}</span>
45
+ </RouterLink>
46
+ </div>
47
+ </section>
48
+ </template>
49
+
50
+ <style scoped>
51
+ .home {
52
+ display: flex;
53
+ flex-direction: column;
54
+ gap: 32px;
55
+ padding: 40px 32px;
56
+ }
57
+ .hero {
58
+ display: flex;
59
+ flex-direction: column;
60
+ align-items: center;
61
+ gap: 14px;
62
+ text-align: center;
63
+ }
64
+ .logo {
65
+ width: 72px;
66
+ height: 72px;
67
+ border-radius: 20px;
68
+ display: flex;
69
+ align-items: center;
70
+ justify-content: center;
71
+ background: linear-gradient(135deg, var(--accent), #b48cff);
72
+ box-shadow: 0 14px 36px #6d7cff55;
73
+ color: #ffffff;
74
+ font-size: 34px;
75
+ font-weight: 700;
76
+ animation: float 5s ease-in-out infinite;
77
+ }
78
+ @keyframes float {
79
+ 50% {
80
+ transform: translateY(-6px);
81
+ }
82
+ }
83
+ .title {
84
+ margin: 0;
85
+ font-size: 32px;
86
+ font-weight: 700;
87
+ }
88
+ .lead {
89
+ margin: 0;
90
+ max-width: 560px;
91
+ font-size: 14px;
92
+ line-height: 22px;
93
+ color: var(--text-muted);
94
+ }
95
+ .grid {
96
+ display: flex;
97
+ flex-wrap: wrap;
98
+ justify-content: center;
99
+ gap: 12px;
100
+ }
101
+ .feature {
102
+ width: 220px;
103
+ display: flex;
104
+ flex-direction: column;
105
+ gap: 6px;
106
+ padding: 16px;
107
+ border-radius: var(--radius);
108
+ border: 1px solid var(--line);
109
+ background: var(--surface);
110
+ cursor: pointer;
111
+ transition:
112
+ background-color 150ms ease,
113
+ border-color 150ms ease,
114
+ transform 150ms ease;
115
+ }
116
+ .feature:hover {
117
+ background: var(--surface-hover);
118
+ border-color: var(--line-strong);
119
+ transform: translateY(-2px);
120
+ }
121
+ .badge {
122
+ width: 30px;
123
+ height: 30px;
124
+ border-radius: 9px;
125
+ display: flex;
126
+ align-items: center;
127
+ justify-content: center;
128
+ background: var(--accent-soft);
129
+ color: var(--accent);
130
+ }
131
+ .name {
132
+ font-size: 14px;
133
+ font-weight: 600;
134
+ color: var(--text);
135
+ }
136
+ .blurb {
137
+ font-size: 12px;
138
+ line-height: 17px;
139
+ color: var(--text-muted);
140
+ }
141
+ </style>
@@ -0,0 +1,71 @@
1
+ <script setup lang="ts">
2
+ import { appLocale } from "@skathi-native/runtime";
3
+ import { computed, ref } from "vue";
4
+ import Card from "../components/Card.vue";
5
+ import Page from "../components/Page.vue";
6
+ import { nav } from "../engine";
7
+ import { productName } from "../product";
8
+
9
+ // `{name}` is filled from the arguments to t(). `sk.*` keys reword the SDK's own text (its dialogs and prompts).
10
+ appLocale.define({
11
+ en: { greeting: "Welcome to {name}", files: "{count} files selected", today: "Today is a good day to ship." },
12
+ de: { greeting: "Willkommen bei {name}", files: "{count} Dateien ausgewählt", today: "Heute ist ein guter Tag." },
13
+ es: { greeting: "Bienvenido a {name}", files: "{count} archivos seleccionados", today: "Hoy es un buen día." },
14
+ ja: { greeting: "{name} へようこそ", files: "{count} 個のファイルを選択", today: "今日はリリース日和です。" },
15
+ });
16
+
17
+ const LANGUAGES = [null, "en", "de", "es", "ja"] as const;
18
+ const language = ref(appLocale.language);
19
+ const count = ref(3);
20
+
21
+ function choose(tag: (typeof LANGUAGES)[number]) {
22
+ appLocale.language = tag;
23
+ language.value = tag;
24
+ }
25
+
26
+ // appLocale is not reactive: reading `language` is what makes this recompute after a switch.
27
+ const text = computed(() => {
28
+ void language.value;
29
+ return {
30
+ resolved: appLocale.resolved,
31
+ greeting: appLocale.t("greeting", { name: productName }),
32
+ files: appLocale.t("files", { count: count.value }),
33
+ today: appLocale.t("today"),
34
+ };
35
+ });
36
+ </script>
37
+
38
+ <template>
39
+ <Page title="Locale" lead="A message catalog per language; t() picks the best match for the user's languages.">
40
+ <Card title="Language" :api="`resolved: ${text.resolved}`">
41
+ <div class="row">
42
+ <button
43
+ v-for="tag in LANGUAGES"
44
+ :key="tag ?? 'auto'"
45
+ class="btn"
46
+ :class="{ on: language === tag }"
47
+ @click="choose(tag)"
48
+ >
49
+ {{ tag ?? "System" }}
50
+ </button>
51
+ </div>
52
+ <p class="faint">System follows navigator.languages: {{ nav.languages?.join(", ") }}</p>
53
+ </Card>
54
+
55
+ <Card title="Messages" api="appLocale.t()">
56
+ <div class="greeting">{{ text.greeting }}</div>
57
+ <div class="row">
58
+ <button class="btn" @click="count++">+1</button>
59
+ <span class="muted">{{ text.files }}</span>
60
+ </div>
61
+ <p class="muted">{{ text.today }}</p>
62
+ </Card>
63
+ </Page>
64
+ </template>
65
+
66
+ <style scoped>
67
+ .greeting {
68
+ font-size: 22px;
69
+ font-weight: 700;
70
+ }
71
+ </style>
@@ -0,0 +1,85 @@
1
+ <script setup lang="ts">
2
+ import { ref } from "vue";
3
+ import Card from "../components/Card.vue";
4
+ import Page from "../components/Page.vue";
5
+
6
+ const video = ref<SkMediaElement | null>(null);
7
+ const playing = ref(true);
8
+ const toggleVideo = () => {
9
+ if (!video.value) return;
10
+ if (video.value.paused) video.value.play();
11
+ else video.value.pause();
12
+ playing.value = !video.value.paused;
13
+ };
14
+
15
+ const stickerPlaying = ref(true);
16
+ const speed = ref(1);
17
+ </script>
18
+
19
+ <template>
20
+ <Page
21
+ title="Media"
22
+ lead="Images, video and Lottie animations, loaded from assets/media. sk.config.json puts that folder in its own pack, media.skpk, beside the exe."
23
+ >
24
+ <div class="tiles">
25
+ <Card class="tile" title="Image" api="<img>">
26
+ <img class="shot zoom" src="assets/media/aurora.png" alt="Aurora" />
27
+ </Card>
28
+
29
+ <Card class="tile" title="Video" api="<video>">
30
+ <video ref="video" class="shot" src="assets/media/clip.mp4" autoplay loop muted />
31
+ <div class="row">
32
+ <button class="btn" @click="toggleVideo">{{ playing ? "Pause" : "Play" }}</button>
33
+ <span class="faint">Decoded by the OS media stack.</span>
34
+ </div>
35
+ </Card>
36
+
37
+ <Card class="tile" title="Lottie sticker" api="<lottie>">
38
+ <div class="stage">
39
+ <lottie class="sticker" src="assets/media/sticker.tgs" loop :autoplay="stickerPlaying" :speed="speed" />
40
+ </div>
41
+ <div class="row">
42
+ <button class="btn" @click="stickerPlaying = !stickerPlaying">{{ stickerPlaying ? "Pause" : "Play" }}</button>
43
+ <button v-for="s in [0.5, 1, 2]" :key="s" class="btn" :class="{ on: speed === s }" @click="speed = s">
44
+ {{ s }}×
45
+ </button>
46
+ </div>
47
+ </Card>
48
+ </div>
49
+ </Page>
50
+ </template>
51
+
52
+ <style scoped>
53
+ .tiles {
54
+ display: flex;
55
+ flex-wrap: wrap;
56
+ gap: 16px;
57
+ }
58
+ .tile {
59
+ width: 320px;
60
+ }
61
+ .shot {
62
+ width: 100%;
63
+ height: 160px;
64
+ border-radius: 10px;
65
+ object-fit: cover;
66
+ }
67
+ .zoom {
68
+ transition: transform 300ms ease;
69
+ }
70
+ .zoom:hover {
71
+ transform: scale(1.04);
72
+ }
73
+ .stage {
74
+ height: 160px;
75
+ display: flex;
76
+ align-items: center;
77
+ justify-content: center;
78
+ border-radius: 10px;
79
+ background: radial-gradient(circle, #8b9dff30, #00000000);
80
+ }
81
+ .sticker {
82
+ width: 120px;
83
+ height: 120px;
84
+ }
85
+ </style>
@@ -0,0 +1,199 @@
1
+ <script setup lang="ts">
2
+ import { ref, shallowRef } from "vue";
3
+ import Card from "../components/Card.vue";
4
+ import Page from "../components/Page.vue";
5
+
6
+ const expanded = ref(false);
7
+
8
+ const target = shallowRef<SkElement | null>(null);
9
+ const shake = () =>
10
+ target.value?.animate(
11
+ [
12
+ { transform: "translateX(0px)" },
13
+ { transform: "translateX(-10px)" },
14
+ { transform: "translateX(10px)" },
15
+ { transform: "translateX(0px)" },
16
+ ],
17
+ { duration: 360, easing: "ease-in-out", iterations: 2 },
18
+ );
19
+ const spin = () =>
20
+ target.value?.animate([{ transform: "rotate(0deg) scale(1)" }, { transform: "rotate(360deg) scale(1.15)" }], {
21
+ duration: 700,
22
+ easing: "cubic-bezier(0.34, 1.56, 0.64, 1)",
23
+ });
24
+
25
+ const shown = ref(true);
26
+ const words = ["Native", "Fast", "Small", "Vue"];
27
+ const word = ref(0);
28
+ const nextWord = () => (word.value = (word.value + 1) % words.length);
29
+ </script>
30
+
31
+ <template>
32
+ <Page
33
+ title="Motion"
34
+ lead="CSS transitions and keyframes run in the renderer; the Web Animations API drives them from script."
35
+ >
36
+ <Card title="Transition" api="transition">
37
+ <div class="track" @click="expanded = !expanded">
38
+ <div class="thumb" :class="{ expanded }">{{ expanded ? "wide" : "narrow" }} · click</div>
39
+ </div>
40
+ </Card>
41
+
42
+ <Card title="Keyframes" api="@keyframes">
43
+ <div class="row gap">
44
+ <div class="pulse" />
45
+ <div class="orbit"><div class="moon" /></div>
46
+ <div class="shimmer">Loading…</div>
47
+ </div>
48
+ </Card>
49
+
50
+ <Card title="Web Animations" api="element.animate()">
51
+ <div class="row gap">
52
+ <div ref="target" class="box">✦</div>
53
+ <button class="btn" @click="shake">Shake</button>
54
+ <button class="btn" @click="spin">Spin</button>
55
+ </div>
56
+ </Card>
57
+
58
+ <Card title="Vue transitions" api="<Transition>">
59
+ <div class="row">
60
+ <button class="btn" @click="shown = !shown">{{ shown ? "Hide" : "Show" }} the panel</button>
61
+ <button class="btn" @click="nextWord">Next word</button>
62
+ </div>
63
+ <Transition name="fade">
64
+ <div v-if="shown" class="panel">Enter and leave classes, as in a browser.</div>
65
+ </Transition>
66
+ <Transition name="swap" mode="out-in">
67
+ <div :key="word" class="word">{{ words[word] }}</div>
68
+ </Transition>
69
+ </Card>
70
+ </Page>
71
+ </template>
72
+
73
+ <style scoped>
74
+ .gap {
75
+ gap: 20px;
76
+ }
77
+ .track {
78
+ height: 44px;
79
+ padding: 4px;
80
+ border-radius: 12px;
81
+ background: #00000040;
82
+ cursor: pointer;
83
+ }
84
+ .thumb {
85
+ width: 160px;
86
+ height: 36px;
87
+ display: flex;
88
+ align-items: center;
89
+ justify-content: center;
90
+ border-radius: 9px;
91
+ background: var(--surface-strong);
92
+ font-size: 12px;
93
+ color: var(--text-muted);
94
+ transition:
95
+ width 420ms cubic-bezier(0.34, 1.56, 0.64, 1),
96
+ background-color 420ms ease,
97
+ color 420ms ease;
98
+ }
99
+ .thumb.expanded {
100
+ width: 420px;
101
+ background: var(--accent-strong);
102
+ color: #ffffff;
103
+ }
104
+ @keyframes pulse {
105
+ 0% {
106
+ transform: scale(0.8);
107
+ opacity: 1;
108
+ }
109
+ 100% {
110
+ transform: scale(1.6);
111
+ opacity: 0;
112
+ }
113
+ }
114
+ .pulse {
115
+ width: 28px;
116
+ height: 28px;
117
+ border-radius: 14px;
118
+ background: var(--accent);
119
+ animation: pulse 1.4s ease-out infinite;
120
+ }
121
+ @keyframes spin {
122
+ to {
123
+ transform: rotate(360deg);
124
+ }
125
+ }
126
+ .orbit {
127
+ width: 48px;
128
+ height: 48px;
129
+ border-radius: 24px;
130
+ border: 1px dashed var(--line-strong);
131
+ animation: spin 3s linear infinite;
132
+ }
133
+ .moon {
134
+ width: 12px;
135
+ height: 12px;
136
+ margin-left: 18px;
137
+ margin-top: -6px;
138
+ border-radius: 6px;
139
+ background: #b48cff;
140
+ }
141
+ @keyframes shimmer {
142
+ 50% {
143
+ opacity: 0.35;
144
+ }
145
+ }
146
+ .shimmer {
147
+ padding: 8px 14px;
148
+ border-radius: 8px;
149
+ background: var(--surface-strong);
150
+ font-size: 12px;
151
+ animation: shimmer 1.6s ease-in-out infinite;
152
+ }
153
+ .box {
154
+ width: 52px;
155
+ height: 52px;
156
+ display: flex;
157
+ align-items: center;
158
+ justify-content: center;
159
+ border-radius: 14px;
160
+ background: linear-gradient(135deg, var(--accent), #b48cff);
161
+ color: #ffffff;
162
+ font-size: 22px;
163
+ }
164
+ .panel {
165
+ padding: 14px;
166
+ border-radius: 10px;
167
+ background: var(--accent-soft);
168
+ font-size: 13px;
169
+ }
170
+ .fade-enter-active,
171
+ .fade-leave-active {
172
+ transition:
173
+ opacity 250ms ease,
174
+ transform 250ms ease;
175
+ }
176
+ .fade-enter-from,
177
+ .fade-leave-to {
178
+ opacity: 0;
179
+ transform: translateY(-6px);
180
+ }
181
+ .word {
182
+ font-size: 28px;
183
+ font-weight: 700;
184
+ }
185
+ .swap-enter-active,
186
+ .swap-leave-active {
187
+ transition:
188
+ opacity 180ms ease,
189
+ transform 180ms ease;
190
+ }
191
+ .swap-enter-from {
192
+ opacity: 0;
193
+ transform: translateY(10px);
194
+ }
195
+ .swap-leave-to {
196
+ opacity: 0;
197
+ transform: translateY(-10px);
198
+ }
199
+ </style>