Skip to content

Commit 7363192

Browse files
committed
IT WORKS SOMEWHAT
1 parent 1713415 commit 7363192

3 files changed

Lines changed: 34 additions & 48 deletions

File tree

src/lib/components/features/SkillsSection.svelte

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
import SkillIcon from "$lib/components/ui/SkillIcon.svelte";
66
import BlinkingCursor from "$lib/components/ui/BlinkingCursor.svelte";
77
import DecoBG from "$lib/components/ui/DecoBG/DecoBG.svelte";
8+
import ControllerSvgDefs from "../ui/DecoBG/ControllerSvgDefs.svelte";
89
</script>
910

1011
<Section id="skills" title={$t("skills.title")}>
@@ -16,6 +17,9 @@
1617
<div class="mt-12 grid grid-cols-1 gap-10 md:grid-cols-3">
1718
<SkillCard title={$t("skills.engines")} theme="mauve">
1819
<DecoBG>
20+
<svelte:fragment slot="defs">
21+
<ControllerSvgDefs />
22+
</svelte:fragment>
1923
<div
2024
class="flex flex-wrap items-center justify-center gap-4 p-4"
2125
>
Lines changed: 26 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -1,52 +1,32 @@
11
<script lang="ts">
22
import DreamcastController from "$lib/icons/ryan-beck-dreamcast-controller.svg?component";
33
import GamecubeController from "$lib/icons/ryan-beck-gamecube-controller.svg?component";
4-
import NintendoController from "$lib/icons/ryan-beck-nintendo-controller.svg?component";
4+
import WiiController from "$lib/icons/ryan-beck-wii-controller.svg?component";
5+
import NesController from "$lib/icons/ryan-beck-nes-controller.svg?component";
6+
import NSFController from "$lib/icons/ryan-beck-n64-controller.svg?component";
57
</script>
68

7-
<svg width="0" height="0" style="position:absolute; overflow:hidden;">
8-
<defs>
9-
<symbol id="icon-dreamcast" viewBox="0 0 24 24">
10-
<DreamcastController />
11-
</symbol>
12-
<symbol id="icon-gamecube" viewBox="0 0 24 24">
13-
<GamecubeController />
14-
</symbol>
15-
<symbol id="icon-nintendo" viewBox="0 0 100 100">
16-
<NintendoController />
17-
</symbol>
9+
<defs>
10+
<symbol id="icon-dreamcast" viewBox="0 0 24 24"
11+
><DreamcastController /></symbol
12+
>
13+
<symbol id="icon-gamecube" viewBox="0 0 24 24"
14+
><GamecubeController /></symbol
15+
>
16+
<symbol id="icon-wii" viewBox="0 0 100 100"><WiiController /></symbol>
17+
<symbol id="icon-nes" viewBox="0 0 100 100"><NesController /></symbol>
18+
<symbol id="icon-n64" viewBox="0 0 100 100"><NSFController /></symbol>
1819

19-
<pattern
20-
id="controller-pattern"
21-
patternUnits="userSpaceOnUse"
22-
width="250"
23-
height="250"
24-
color="var(--pattern-color, currentColor)"
25-
>
26-
<use
27-
href="#icon-dreamcast"
28-
x="25"
29-
y="50"
30-
width="75"
31-
height="75"
32-
fill="currentColor"
33-
/>
34-
<use
35-
href="#icon-gamecube"
36-
x="125"
37-
y="125"
38-
width="75"
39-
height="75"
40-
fill="currentColor"
41-
/>
42-
<use
43-
href="#icon-nintendo"
44-
x="75"
45-
y="200"
46-
width="75"
47-
height="75"
48-
fill="currentColor"
49-
/>
50-
</pattern>
51-
</defs>
52-
</svg>
20+
<pattern
21+
id="controller-pattern"
22+
patternUnits="userSpaceOnUse"
23+
width="250"
24+
height="250"
25+
>
26+
<use href="#icon-dreamcast" x="25" y="50" width="75" height="75" />
27+
<use href="#icon-gamecube" x="125" y="125" width="75" height="75" />
28+
<use href="#icon-wii" x="81" y="224" width="75" height="75" />
29+
<use href="#icon-nes" x="84" y="214" width="75" height="75" />
30+
<use href="#icon-n64" x="86" y="208" width="75" height="75" />
31+
</pattern>
32+
</defs>

src/lib/components/ui/DecoBG/DecoBG.svelte

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,16 @@
11
<script lang="ts">
22
/** Controls the overall opacity of the pattern. */
3-
export let density: number = 0.1;
3+
export let density: number = 1;
44
</script>
55

66
<div
77
class="absolute inset-0 z-0 text-ctp-surface1 dark:text-ctp-surface2"
8-
style="opacity: {density}; --pattern-color: currentColor;"
8+
style="opacity: {density};"
99
aria-hidden="true"
1010
>
1111
<svg width="100%" height="100%">
12+
<slot name="defs"></slot>
13+
<!-- might need class="fill-current" -->
1214
<rect width="100%" height="100%" fill="url(#controller-pattern)" />
1315
</svg>
1416
</div>

0 commit comments

Comments
 (0)