Skip to content

Commit a0acb04

Browse files
committed
chore: fmt
1 parent d493ec2 commit a0acb04

15 files changed

Lines changed: 347 additions & 152 deletions

components/NavBar.tsx

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,21 +28,24 @@ export default function NavBar() {
2828
class="text-subtext1 hover:text-text transition-all duration-300 font-medium text-sm relative group"
2929
>
3030
Features
31-
<span class="absolute -bottom-1 left-0 w-0 h-0.5 bg-blue transition-all duration-300 group-hover:w-full"></span>
31+
<span class="absolute -bottom-1 left-0 w-0 h-0.5 bg-blue transition-all duration-300 group-hover:w-full">
32+
</span>
3233
</a>
3334
<a
3435
href="/docs/index"
3536
class="text-subtext1 hover:text-text transition-all duration-300 font-medium text-sm relative group"
3637
>
3738
Documentation
38-
<span class="absolute -bottom-1 left-0 w-0 h-0.5 bg-green transition-all duration-300 group-hover:w-full"></span>
39+
<span class="absolute -bottom-1 left-0 w-0 h-0.5 bg-green transition-all duration-300 group-hover:w-full">
40+
</span>
3941
</a>
4042
<a
4143
href="/blog"
4244
class="text-subtext1 hover:text-text transition-all duration-300 font-medium text-sm relative group"
4345
>
4446
Blog
45-
<span class="absolute -bottom-1 left-0 w-0 h-0.5 bg-yellow transition-all duration-300 group-hover:w-full"></span>
47+
<span class="absolute -bottom-1 left-0 w-0 h-0.5 bg-yellow transition-all duration-300 group-hover:w-full">
48+
</span>
4649
</a>
4750
<a
4851
href="https://github.com/tryandromeda/andromeda"

islands/AnimatedCodeBlock.tsx

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { useState, useEffect } from "preact/hooks";
1+
import { useEffect, useState } from "preact/hooks";
22

33
const codeLines = [
44
{ text: "// hello.ts - TypeScript works out of the box", type: "comment" },
@@ -21,12 +21,12 @@ export default function AnimatedCodeBlock() {
2121
useEffect(() => {
2222
const animateLines = async () => {
2323
setIsTyping(true);
24-
24+
2525
for (let i = 0; i <= codeLines.length; i++) {
26-
await new Promise(resolve => setTimeout(resolve, 400));
26+
await new Promise((resolve) => setTimeout(resolve, 400));
2727
setVisibleLines(i);
2828
}
29-
29+
3030
setIsTyping(false);
3131
};
3232

@@ -41,14 +41,18 @@ export default function AnimatedCodeBlock() {
4141
if (type === "comment") {
4242
return <span class="text-green opacity-80 italic">{text}</span>;
4343
}
44-
44+
4545
if (type === "code") {
4646
// Simple syntax highlighting
47-
const parts = text.split(/(\bconst\b|\blet\b|\bvar\b|\bnew\b|\bfunction\b|"[^"]*"|'[^']*'|\/\/.*$|\d+)/g);
48-
47+
const parts = text.split(
48+
/(\bconst\b|\blet\b|\bvar\b|\bnew\b|\bfunction\b|"[^"]*"|'[^']*'|\/\/.*$|\d+)/g,
49+
);
50+
4951
return parts.map((part, index) => {
5052
if (part.match(/\bconst\b|\blet\b|\bvar\b|\bnew\b|\bfunction\b/)) {
51-
return <span key={index} class="text-purple font-semibold">{part}</span>;
53+
return (
54+
<span key={index} class="text-purple font-semibold">{part}</span>
55+
);
5256
} else if (part.match(/"[^"]*"|'[^']*'/)) {
5357
return <span key={index} class="text-green">{part}</span>;
5458
} else if (part.match(/\d+/)) {
@@ -59,7 +63,7 @@ export default function AnimatedCodeBlock() {
5963
return <span key={index} class="text-text">{part}</span>;
6064
});
6165
}
62-
66+
6367
return <span class="text-text">{text}</span>;
6468
};
6569

@@ -75,13 +79,13 @@ export default function AnimatedCodeBlock() {
7579
<span>🚀</span> Your First Program
7680
</h4>
7781
</div>
78-
82+
7983
<div class="p-4">
8084
<pre class="text-sm font-mono leading-relaxed overflow-x-auto text-text whitespace-pre-wrap break-words min-h-[240px]">
8185
<code>
8286
{codeLines.slice(0, visibleLines).map((line, index) => (
83-
<div
84-
key={index}
87+
<div
88+
key={index}
8589
class={`transition-all duration-300 ${index === visibleLines - 1 ? 'animate-fade-in-up' : ''}`}
8690
>
8791
{highlightSyntax(line.text, line.type)}

islands/CodeCopyButton.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ export function CodeCopyButton({ code, className = "" }: CodeCopyButtonProps) {
2121

2222
return (
2323
<button
24+
type="button"
2425
onClick={copyToClipboard}
2526
className={`inline-flex items-center gap-2 px-3 py-1.5 text-xs font-medium rounded-lg transition-all duration-200 ${
2627
copied

islands/DocNav.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// deno-lint-ignore-file no-explicit-any no-explicit-any no-explicit-any
22
import Fuse from "npm:fuse.js";
33
import { useEffect, useState } from "preact/hooks";
4-
import { ArrowLeft, Book, ExternalLink, Menu, Search, X } from "lucide-preact";
4+
import { ArrowLeft, ExternalLink, Menu, Search, X } from "lucide-preact";
55

66
interface DocEntry {
77
name: string;
@@ -123,6 +123,7 @@ export function DocNav({
123123
</div>
124124
</div>
125125
<button
126+
type="button"
126127
onClick={closeNav}
127128
class="md:hidden p-2 hover:bg-surface0 rounded-lg transition-colors"
128129
aria-label="Close navigation"
@@ -146,6 +147,7 @@ export function DocNav({
146147
/>
147148
{searchTerm && (
148149
<button
150+
type="button"
149151
onClick={() => setSearchTerm("")}
150152
class="absolute right-3 top-1/2 transform -translate-y-1/2 text-subtext0 hover:text-text"
151153
>
@@ -211,6 +213,7 @@ export function DocNav({
211213
return (
212214
<div key={topicName} class="space-y-1">
213215
<button
216+
type="button"
214217
onClick={() => toggleSection(topicName)}
215218
class={`w-full flex items-center justify-between py-3 px-4 rounded-lg text-sm font-semibold transition-all duration-200 ${
216219
hasCurrentPage

islands/InstallToggle.tsx

Lines changed: 18 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { useState, useEffect } from "preact/hooks";
1+
import { useEffect, useState } from "preact/hooks";
22
import { Copy, Download, Monitor, Terminal, Zap } from "lucide-preact";
33

44
interface Platform {
@@ -51,9 +51,9 @@ export default function InstallToggle() {
5151
const command = currentPlatform.command;
5252
setIsTyping(true);
5353
setDisplayedCommand("");
54-
54+
5555
let typeInterval: number;
56-
56+
5757
const typeCommand = () => {
5858
let i = 0;
5959
typeInterval = setInterval(() => {
@@ -68,7 +68,7 @@ export default function InstallToggle() {
6868
};
6969

7070
const timeout = setTimeout(typeCommand, 200); // Small delay before typing starts
71-
71+
7272
return () => {
7373
clearTimeout(timeout);
7474
if (typeInterval) {
@@ -137,7 +137,8 @@ export default function InstallToggle() {
137137
backgroundColor: `var(--color-${platform.color})`,
138138
borderColor: `var(--color-${platform.color})`,
139139
color: "var(--color-base)",
140-
boxShadow: `0 0 20px color-mix(in srgb, var(--color-${platform.color}) 40%, transparent), 0 8px 25px rgba(0, 0, 0, 0.15)`,
140+
boxShadow:
141+
`0 0 20px color-mix(in srgb, var(--color-${platform.color}) 40%, transparent), 0 8px 25px rgba(0, 0, 0, 0.15)`,
141142
}
142143
: {
143144
color: "var(--color-text)",
@@ -206,8 +207,12 @@ export default function InstallToggle() {
206207
}}
207208
title="Download script"
208209
>
209-
<div class="absolute inset-0 bg-gradient-to-r from-transparent via-white/20 to-transparent -translate-x-full group-hover:translate-x-full transition-transform duration-700"></div>
210-
<Download size={16} class="group-hover:rotate-12 transition-transform duration-300" />
210+
<div class="absolute inset-0 bg-gradient-to-r from-transparent via-white/20 to-transparent -translate-x-full group-hover:translate-x-full transition-transform duration-700">
211+
</div>
212+
<Download
213+
size={16}
214+
class="group-hover:rotate-12 transition-transform duration-300"
215+
/>
211216
<span class="hidden sm:inline relative z-10">Download</span>
212217
</button>{" "}
213218
<button
@@ -220,8 +225,12 @@ export default function InstallToggle() {
220225
}}
221226
title="Copy to clipboard"
222227
>
223-
<div class="absolute inset-0 bg-gradient-to-r from-transparent via-white/20 to-transparent -translate-x-full group-hover:translate-x-full transition-transform duration-700"></div>
224-
<Copy size={16} class="group-hover:scale-125 transition-transform duration-300" />
228+
<div class="absolute inset-0 bg-gradient-to-r from-transparent via-white/20 to-transparent -translate-x-full group-hover:translate-x-full transition-transform duration-700">
229+
</div>
230+
<Copy
231+
size={16}
232+
class="group-hover:scale-125 transition-transform duration-300"
233+
/>
225234
<span class="hidden sm:inline relative z-10">Copy</span>
226235
</button>
227236
</div>

islands/ParticleBackground.tsx

Lines changed: 23 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -29,28 +29,33 @@ export default function ParticleBackground() {
2929

3030
const createParticles = () => {
3131
const particles: Particle[] = [];
32-
const particleCount = Math.min(50, Math.floor(globalThis.innerWidth / 20));
33-
32+
const particleCount = Math.min(
33+
50,
34+
Math.floor(globalThis.innerWidth / 20),
35+
);
36+
3437
// Get theme colors from CSS custom properties
3538
const getThemeColor = (colorName: string) => {
36-
return getComputedStyle(document.documentElement).getPropertyValue(`--color-${colorName}`).trim();
39+
return getComputedStyle(document.documentElement).getPropertyValue(
40+
`--color-${colorName}`,
41+
).trim();
3742
};
38-
43+
3944
const colors = [
4045
getThemeColor("teal"),
41-
getThemeColor("blue"),
46+
getThemeColor("blue"),
4247
getThemeColor("green"),
4348
getThemeColor("yellow"),
4449
getThemeColor("mauve"),
4550
getThemeColor("sky"),
46-
getThemeColor("lavender")
47-
].filter(color => color); // Filter out any empty colors
48-
51+
getThemeColor("lavender"),
52+
].filter((color) => color); // Filter out any empty colors
53+
4954
// Fallback colors if theme colors aren't available (more theme-appropriate)
5055
if (colors.length === 0) {
5156
colors.push("#45b7d1", "#4ecdc4", "#96c93d", "#f39c12", "#8839ef");
5257
}
53-
58+
5459
for (let i = 0; i < particleCount; i++) {
5560
particles.push({
5661
x: Math.random() * canvas.width,
@@ -62,39 +67,39 @@ export default function ParticleBackground() {
6267
color: colors[Math.floor(Math.random() * colors.length)],
6368
});
6469
}
65-
70+
6671
particlesRef.current = particles;
6772
};
6873

6974
const animate = () => {
7075
ctx.clearRect(0, 0, canvas.width, canvas.height);
71-
76+
7277
particlesRef.current.forEach((particle, index) => {
7378
// Update position
7479
particle.x += particle.vx;
7580
particle.y += particle.vy;
76-
81+
7782
// Wrap around edges
7883
if (particle.x < 0) particle.x = canvas.width;
7984
if (particle.x > canvas.width) particle.x = 0;
8085
if (particle.y < 0) particle.y = canvas.height;
8186
if (particle.y > canvas.height) particle.y = 0;
82-
87+
8388
// Draw particle
8489
ctx.beginPath();
8590
ctx.arc(particle.x, particle.y, particle.size, 0, Math.PI * 2);
8691
ctx.fillStyle = particle.color;
8792
ctx.globalAlpha = particle.opacity;
8893
ctx.fill();
89-
94+
9095
// Draw connections to nearby particles
9196
particlesRef.current.forEach((otherParticle, otherIndex) => {
9297
if (index === otherIndex) return;
93-
98+
9499
const dx = particle.x - otherParticle.x;
95100
const dy = particle.y - otherParticle.y;
96101
const distance = Math.sqrt(dx * dx + dy * dy);
97-
102+
98103
if (distance < 100) {
99104
ctx.beginPath();
100105
ctx.moveTo(particle.x, particle.y);
@@ -106,7 +111,7 @@ export default function ParticleBackground() {
106111
}
107112
});
108113
});
109-
114+
110115
ctx.globalAlpha = 1;
111116
animationIdRef.current = requestAnimationFrame(animate);
112117
};
@@ -134,7 +139,7 @@ export default function ParticleBackground() {
134139
<canvas
135140
ref={canvasRef}
136141
class="fixed inset-0 pointer-events-none z-0"
137-
style={{
142+
style={{
138143
background: "transparent",
139144
opacity: 0.6,
140145
}}

islands/QuickNav.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { useEffect, useState } from "preact/hooks";
1+
import { useState } from "preact/hooks";
22
import { ChevronDown, ChevronUp } from "lucide-preact";
33

44
interface QuickNavProps {
@@ -53,6 +53,7 @@ export function QuickNav({ sections, currentPath }: QuickNavProps) {
5353
</div>
5454

5555
<button
56+
type="button"
5657
onClick={() => setIsOpen(!isOpen)}
5758
class="bg-surface1 hover:bg-surface2 text-text p-3 rounded-full shadow-lg transition-all duration-200 hover:scale-105 border border-surface0"
5859
title="Quick Navigation"

islands/ScrollAnimations.tsx

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
// deno-lint-ignore-file no-window
12
import { useEffect } from "preact/hooks";
23

34
export default function ScrollAnimations() {
@@ -42,7 +43,7 @@ export default function ScrollAnimations() {
4243
}
4344
};
4445

45-
window.addEventListener("scroll", handleScroll, { passive: true });
46+
addEventListener("scroll", handleScroll, { passive: true });
4647

4748
const handleParallax = () => {
4849
const scrollY = window.scrollY;
@@ -60,7 +61,7 @@ export default function ScrollAnimations() {
6061
}
6162
};
6263

63-
window.addEventListener("scroll", handleParallax, { passive: true });
64+
addEventListener("scroll", handleParallax, { passive: true });
6465

6566
const handlePageLoad = () => {
6667
document.body.classList.add("page-loaded");
@@ -69,14 +70,14 @@ export default function ScrollAnimations() {
6970
if (document.readyState === "complete") {
7071
handlePageLoad();
7172
} else {
72-
window.addEventListener("load", handlePageLoad);
73+
addEventListener("load", handlePageLoad);
7374
}
7475

7576
return () => {
7677
animateOnScroll.disconnect();
77-
window.removeEventListener("scroll", handleScroll);
78-
window.removeEventListener("scroll", handleParallax);
79-
window.removeEventListener("load", handlePageLoad);
78+
removeEventListener("scroll", handleScroll);
79+
removeEventListener("scroll", handleParallax);
80+
removeEventListener("load", handlePageLoad);
8081
};
8182
}, []);
8283

islands/ScrollProgress.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
// deno-lint-ignore-file no-window
12
import { useEffect, useState } from "preact/hooks";
23

34
export function ScrollProgress() {
@@ -12,10 +13,10 @@ export function ScrollProgress() {
1213
setScrollProgress(progress);
1314
};
1415

15-
window.addEventListener("scroll", updateScrollProgress);
16+
addEventListener("scroll", updateScrollProgress);
1617
updateScrollProgress(); // Initial calculation
1718

18-
return () => window.removeEventListener("scroll", updateScrollProgress);
19+
return () => removeEventListener("scroll", updateScrollProgress);
1920
}, []);
2021

2122
return (

0 commit comments

Comments
 (0)