mirror of
https://github.com/xHyroM/website.git
synced 2024-12-22 20:41:05 +01:00
feat: add Fireworks, Snow components
This commit is contained in:
parent
baf6ad9812
commit
180c58b5a8
4 changed files with 33 additions and 16 deletions
15
src/components/widgets/Fireworks.astro
Normal file
15
src/components/widgets/Fireworks.astro
Normal file
|
@ -0,0 +1,15 @@
|
|||
<script>
|
||||
import { Fireworks } from "fireworks-js";
|
||||
|
||||
export const fireworksContainer =
|
||||
document.querySelector<HTMLDivElement>(".fireworks-container")!;
|
||||
|
||||
const fireworks = new Fireworks(fireworksContainer, {
|
||||
rocketsPoint: {
|
||||
min: 0,
|
||||
max: 100,
|
||||
},
|
||||
autoresize: true,
|
||||
});
|
||||
fireworks.start();
|
||||
</script>
|
3
src/components/widgets/Snow.astro
Normal file
3
src/components/widgets/Snow.astro
Normal file
|
@ -0,0 +1,3 @@
|
|||
<script>
|
||||
import "../../scripts/snow.js";
|
||||
</script>
|
|
@ -1,4 +1,15 @@
|
|||
---
|
||||
import Snow from "../components/widgets/Snow.astro";
|
||||
import Fireworks from "../components/widgets/Fireworks.astro";
|
||||
|
||||
const date = new Date();
|
||||
|
||||
const fireworks =
|
||||
(date.getMonth() === 11 && date.getDate() === 31) ||
|
||||
(date.getMonth() === 0 && date.getDate() <= 3);
|
||||
const snow =
|
||||
(date.getMonth() === 11 && date.getDate() === 10) ||
|
||||
(date.getMonth() === 0 && date.getDate() <= 3);
|
||||
---
|
||||
|
||||
<!DOCTYPE html>
|
||||
|
@ -57,22 +68,6 @@
|
|||
</div>
|
||||
<script>
|
||||
import "../scripts/menu.js";
|
||||
import "../scripts/sidebarToggle.js";
|
||||
/* import "../scripts/snow.js"; */
|
||||
|
||||
import { Fireworks } from "fireworks-js";
|
||||
|
||||
export const fireworksContainer =
|
||||
document.querySelector<HTMLDivElement>(".fireworks-container")!;
|
||||
|
||||
const fireworks = new Fireworks(fireworksContainer, {
|
||||
rocketsPoint: {
|
||||
min: 0,
|
||||
max: 100,
|
||||
},
|
||||
autoresize: true,
|
||||
});
|
||||
fireworks.start();
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
@ -32,3 +32,7 @@ const {
|
|||
</div>
|
||||
</Container>
|
||||
</Layout>
|
||||
|
||||
<script>
|
||||
import "../../scripts/sidebarToggle.js";
|
||||
</script>
|
||||
|
|
Loading…
Reference in a new issue