Skip to content

Commit 8453f34

Browse files
E
1 parent af04c03 commit 8453f34

File tree

6 files changed

+21
-53
lines changed

6 files changed

+21
-53
lines changed

bun.lockb

1.6 KB
Binary file not shown.

package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,9 @@
4242
"typescript": "^5.0.0",
4343
"unocss": "^0.64.1",
4444
"unocss-preset-animations": "^1.1.0",
45-
"vite": "^5.0.3"
45+
"vite": "^5.0.3",
46+
"vite-imagetools": "^7.0.4",
47+
"vite-plugin-image-optimizer": "^1.1.8"
4648
},
4749
"dependencies": {
4850
"moment": "^2.30.1",

src/components/Person.svelte

Lines changed: 13 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -1,59 +1,27 @@
11
<script lang="ts">
2-
import { inview, type Options, type ObserverEventDetails } from "svelte-inview";
32
import { fly } from "svelte/transition";
43
54
const { avatar, name, github }: { avatar: string; name: string; github?: string } = $props();
6-
7-
let isInView = $state(false);
85
const animDelay = Math.random() * 200;
9-
10-
const inviewOpts: Options = {
11-
unobserveOnEnter: true,
12-
rootMargin: "-20%",
13-
};
14-
15-
const inviewChange = ({ detail }: CustomEvent<ObserverEventDetails>) => {
16-
isInView = detail.inView;
17-
};
186
</script>
197

208
{#if github}
21-
<div
22-
class="flex flex-col items-center justify-center"
23-
use:inview={inviewOpts}
24-
oninview_change={inviewChange}
9+
<a
10+
in:fly={{ x: 20, delay: animDelay }}
11+
href="https://github.com/{github}"
12+
target="_blank"
13+
class="flex flex-col items-center justify-start bg-slate-9 py-4 w-full rounded-lg transition-all hover:scale-110 hover:bg-slate-8 cursor-pointer decoration-none color-white"
2514
>
26-
{#if isInView}
27-
<a
28-
in:fly={{ x: 20, delay: animDelay }}
29-
href="https://github.com/{github}"
30-
target="_blank"
31-
class="flex flex-col items-center justify-start bg-slate-9 py-4 w-full h-full rounded-lg transition-all hover:scale-110 hover:bg-slate-8 cursor-pointer decoration-none color-white"
32-
>
33-
<img class="w-60 rounded-lg h-60 object-cover object-top" src={avatar} alt={name} />
34-
<p class="text-lg font-bold mb-0">{name}</p>
35-
<p class="mt-0 color-blue-3">@{github}</p>
36-
</a>
37-
{:else}
38-
<div class="w-full h-full"></div>
39-
{/if}
40-
</div>
15+
<img class="w-60 rounded-lg h-60 object-cover object-top" src={avatar} alt={name} />
16+
<p class="text-lg font-bold mb-0">{name}</p>
17+
<p class="mt-0 color-blue-3">@{github}</p>
18+
</a>
4119
{:else}
4220
<div
43-
class="flex flex-col items-center justify-center"
44-
use:inview={inviewOpts}
45-
oninview_change={inviewChange}
21+
in:fly={{ x: 20, delay: animDelay }}
22+
class="w-full flex flex-col items-center justify-start bg-slate-9 py-4 rounded-lg decoration-none color-white"
4623
>
47-
{#if isInView}
48-
<div
49-
in:fly={{ x: 20, delay: animDelay }}
50-
class="w-full h-full flex flex-col items-center justify-start bg-slate-9 py-4 rounded-lg decoration-none color-white"
51-
>
52-
<img class="w-60 rounded-lg h-60 object-cover object-top" src={avatar} alt={name} />
53-
<p class="text-lg font-bold mb-0">{name}</p>
54-
</div>
55-
{:else}
56-
<div class="w-full h-full"></div>
57-
{/if}
24+
<img class="w-60 rounded-lg h-60 object-cover object-top" src={avatar} alt={name} />
25+
<p class="text-lg font-bold mb-0">{name}</p>
5826
</div>
5927
{/if}

src/routes/+page.svelte

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33

44
<svelte:head>
55
<title>Create Technomancy</title>
6+
<meta name="description" content="A Create addon blending the themes of magic and technology into one!" />
67
</svelte:head>
78

89
<div class="w-full min-h-screen flex flex-col items-center justify-start bg-img-technomancy">

uno.config.ts

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ import presetAnim from "unocss-preset-animations";
33
import extractSvelte from "@unocss/extractor-svelte";
44
import presetIcons from "@unocss/preset-icons";
55
import presetWebFonts from "@unocss/preset-web-fonts";
6-
// import { createLocalFontProcessor } from "@unocss/preset-web-fonts/local";
76

87
export default defineConfig({
98
presets: [
@@ -13,12 +12,6 @@ export default defineConfig({
1312
fonts: {
1413
ubuntu: "Ubuntu",
1514
},
16-
17-
// processors: createLocalFontProcessor({
18-
// cacheDir: "node_modules/.cache/unocss/fonts",
19-
// fontAssetsDir: "public/assets/fonts",
20-
// fontServeBaseUrl: "/assets/fonts",
21-
// }),
2215
}),
2316

2417
presetIcons(),

vite.config.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
import { sveltekit } from "@sveltejs/kit/vite";
22
import { defineConfig } from "vite";
33
import { starlightSkinPlugin } from "./vite/starlight-skins";
4+
import { ViteImageOptimizer } from "vite-plugin-image-optimizer";
5+
import { imagetools } from "vite-imagetools";
46
import uno from "@unocss/svelte-scoped/vite";
57

68
export default defineConfig({
@@ -12,6 +14,8 @@ export default defineConfig({
1214
}),
1315
starlightSkinPlugin(),
1416
sveltekit(),
17+
imagetools(),
18+
ViteImageOptimizer(),
1519
],
1620

1721
build: {

0 commit comments

Comments
 (0)