mirror of
https://github.com/zen-browser/www
synced 2026-04-25 17:14:56 +02:00
feat: remove js-confetti dependency and related code from DownloadScript.astro
This commit is contained in:
@@ -45,7 +45,6 @@
|
||||
"date-fns": "4.1.0",
|
||||
"free-astro-components": "1.2.0",
|
||||
"jiti": "2.4.2",
|
||||
"js-confetti": "0.12.0",
|
||||
"lefthook": "1.11.13",
|
||||
"postcss": "8.5.1",
|
||||
"react": "19.1.0",
|
||||
|
||||
1016
pnpm-lock.yaml
generated
1016
pnpm-lock.yaml
generated
File diff suppressed because it is too large
Load Diff
@@ -12,6 +12,13 @@ overrides:
|
||||
astro@>=5.2.0 <5.12.8: ">=5.12.8"
|
||||
devalue@<5.3.2: ">=5.3.2"
|
||||
form-data@>=4.0.0 <4.0.4: ">=4.0.4"
|
||||
glob@>=10.2.0 <10.5.0: ">=10.5.0"
|
||||
h3@<=1.15.4: ">=1.15.5"
|
||||
js-yaml@>=4.0.0 <4.1.1: ">=4.1.1"
|
||||
lodash@>=4.0.0 <=4.17.22: ">=4.17.23"
|
||||
playwright@<1.55.1: ">=1.55.1"
|
||||
undici@<6.23.0: ">=6.23.0"
|
||||
undici@>=7.0.0 <7.18.2: ">=7.18.2"
|
||||
vite@>=6.0.0 <=6.3.5: ">=6.3.6"
|
||||
vite@>=6.0.0 <=6.4.0: ">=6.4.1"
|
||||
wrangler@>=4.0.0 <4.59.1: ">=4.59.1"
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
<script>
|
||||
import JSConfetti from 'js-confetti'
|
||||
import { UAParser } from 'ua-parser-js'
|
||||
|
||||
// Handle platform selection
|
||||
@@ -29,25 +28,10 @@
|
||||
return { os: detectedOS, cpu: arch }
|
||||
}
|
||||
|
||||
function getRandomNumber(min: number, max: number) {
|
||||
return Math.floor(Math.random() * (max - min + 1)) + min
|
||||
}
|
||||
|
||||
// Initialize platform based on user's OS
|
||||
async function initializePlatform() {
|
||||
const detectedOS = detectOS()
|
||||
selectPlatform(detectedOS.os, detectedOS.cpu)
|
||||
|
||||
for (const button of document.querySelectorAll('.download-button')) {
|
||||
button.addEventListener('click', () => {
|
||||
const jsConfetti = new JSConfetti()
|
||||
jsConfetti.addConfetti({
|
||||
confettiNumber: 100,
|
||||
// If we get a 1 to 10k chance, show only burger confetti
|
||||
...(getRandomNumber(1, 10000) === 1 ? { emojis: ['🍔'] } : {}),
|
||||
})
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
// Function to select a platform
|
||||
|
||||
Reference in New Issue
Block a user