🎨 Format using Biome

This commit is contained in:
2025-07-01 19:45:02 +02:00
parent cae5e408bd
commit fafc48cfce
6 changed files with 97 additions and 101 deletions

View File

@ -1,17 +1,17 @@
<script lang="ts">
// TODO move to types?
interface Option<Key> {
key: Key
value: string
}
// TODO move to types?
interface Option<Key> {
key: Key
value: string
}
interface Props<Key = string> {
selected: Key
options?: Option<Key>[]
class?: string
}
interface Props<Key = string> {
selected: Key
options?: Option<Key>[]
class?: string
}
let { selected = $bindable(), options = [], class: clazz }: Props = $props()
let { selected = $bindable(), options = [], class: clazz }: Props = $props()
</script>
<select

View File

@ -1,80 +1,76 @@
<script lang="ts">
import { onMount } from "svelte"
import { onMount } from "svelte"
let history: string[] = []
let currentDir = "~"
let history: string[] = []
let currentDir = "~"
type Command = "help" | "about" | "skills" | "projects" | "contact" | "clear"
type Command = "help" | "about" | "skills" | "projects" | "contact" | "clear"
const commands: Record<Command, () => string> = {
help: () => `Available commands:
const commands: Record<Command, () => string> = {
help: () => `Available commands:
about - Display information about me
skills - List my technical skills
projects - Show my notable projects
contact - Display my contact information
clear - Clear the terminal screen`,
about: () => `Hi, I'm John Doe!
about: () => `Hi, I'm John Doe!
I'm a passionate software developer with 5 years of experience.
I love creating elegant solutions to complex problems.`,
skills: () => `My technical skills include:
skills: () => `My technical skills include:
- JavaScript/TypeScript
- React & Next.js
- Node.js
- Python
- SQL & NoSQL databases`,
projects: () => `Some of my notable projects:
projects: () => `Some of my notable projects:
1. E-commerce Platform (React, Node.js, MongoDB)
2. Weather App (React Native, OpenWeatherMap API)
3. Task Management System (Python, Django, PostgreSQL)`,
contact: () => `You can reach me at:
contact: () => `You can reach me at:
Email: john.doe@example.com
GitHub: github.com/johndoe
LinkedIn: linkedin.com/in/johndoe`,
clear: () => {
clear: () => {
history = []
return ""
},
}
const executeCommand = (input: string) => {
const [command, ...args] = input.trim().split(" ")
if (command in commands) {
return commands[command as Command]()
}
return `Command not found: ${command}. Type 'help' for available commands.`
}
let input = ""
let inputRef: HTMLInputElement | null = null
const handleSubmit = (e: Event) => {
e.preventDefault()
if (input.trim()) {
if (input === "clear") {
history = []
return ""
},
}
const executeCommand = (input: string) => {
const [command, ...args] = input.trim().split(" ")
if (command in commands) {
return commands[command as Command]()
} else {
history = [...history, `${currentDir} $ ${input}`, executeCommand(input)]
}
return `Command not found: ${command}. Type 'help' for available commands.`
input = ""
}
}
let input = ""
let inputRef: HTMLInputElement | null = null
onMount(() => {
history = [
"Welcome to John Doe's Terminal Portfolio!",
"Type 'help' to see available commands.",
]
})
const handleSubmit = (e: Event) => {
e.preventDefault()
if (input.trim()) {
if (input === "clear") {
history = []
} else {
history = [
...history,
`${currentDir} $ ${input}`,
executeCommand(input),
]
}
input = ""
}
}
onMount(() => {
history = [
"Welcome to John Doe's Terminal Portfolio!",
"Type 'help' to see available commands.",
]
})
$: {
if (inputRef) {
inputRef.scrollIntoView({ behavior: "smooth" })
}
$: {
if (inputRef) {
inputRef.scrollIntoView({ behavior: "smooth" })
}
}
</script>
<div class="min-h-screen bg-black text-green-500 p-4 font-mono">

View File

@ -1,12 +1,12 @@
<script lang="ts">
import type { Snippet } from "svelte"
import type { Snippet } from "svelte"
interface Props {
title?: string
children: Snippet
}
interface Props {
title?: string
children: Snippet
}
const { title = "", children }: Props = $props()
const { title = "", children }: Props = $props()
</script>
<details class="collapse collapse-arrow bg-base-200">

View File

@ -1,12 +1,12 @@
<script lang="ts">
import Collapse from "@/components/collapse/Collapse.svelte"
import Collapse from "@/components/collapse/Collapse.svelte"
interface Props {
items?: string[]
title?: string
}
interface Props {
items?: string[]
title?: string
}
const { items = [], title = "" }: Props = $props()
const { items = [], title = "" }: Props = $props()
</script>
<Collapse {title}>