-
Notifications
You must be signed in to change notification settings - Fork 46
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
bfc6481
commit 51f49f3
Showing
13 changed files
with
70 additions
and
88 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
/* eslint-disable @typescript-eslint/ban-ts-comment */ | ||
import { lightMode } from "$lib/runes"; | ||
import { snow } from "./snow"; | ||
|
||
export async function makeItSnow() { | ||
if (lightMode.value === "light") { | ||
snow.background.color = "#ffffff"; // White background for light mode | ||
snow.particles.color.value = "#e8d1d2"; // Red snowflakes in light mode | ||
} else { | ||
snow.background.color = "#000000"; // Black background for dark mode | ||
snow.particles.color.value = "#ffffff"; // White snowflakes in dark mode | ||
} | ||
|
||
// @ts-expect-error | ||
// eslint-disable-next-line no-undef | ||
await loadSnowPreset(tsParticles); | ||
// @ts-expect-error | ||
// eslint-disable-next-line no-undef | ||
tsParticles.load({ | ||
id: "tsparticles", | ||
options: { | ||
//preset: "snow", | ||
...snow, | ||
fullScreen: { | ||
enable: true, | ||
zIndex: -1 // Set z-index here | ||
} | ||
} | ||
}); | ||
} | ||
|
||
export async function makeItStopSnowing() { | ||
const element = document.getElementById("tsparticles"); | ||
if (element) { | ||
element.remove(); | ||
} | ||
} |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters