generated from projects/testosmaximus
Compare commits
2 Commits
8f403680f2
...
eeb00379bb
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
eeb00379bb | ||
|
|
202c5163db |
4
source/package-lock.json
generated
4
source/package-lock.json
generated
@ -1,12 +1,12 @@
|
||||
{
|
||||
"name": "@funky-flask-test/funky-flask-test",
|
||||
"version": "1.0.0",
|
||||
"version": "1.0.1",
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "@funky-flask-test/funky-flask-test",
|
||||
"version": "1.0.0",
|
||||
"version": "1.0.1",
|
||||
"devDependencies": {
|
||||
"typescript": "^5.0.0",
|
||||
"vite": "^5.0.0"
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@funky-flask-test/funky-flask-test",
|
||||
"version": "1.0.0",
|
||||
"version": "1.0.1",
|
||||
"type": "module",
|
||||
"main": "./dist/index.js",
|
||||
"exports": {
|
||||
@ -10,7 +10,9 @@
|
||||
}
|
||||
},
|
||||
"types": "./dist/index.d.ts",
|
||||
"files": ["dist"],
|
||||
"files": [
|
||||
"dist"
|
||||
],
|
||||
"scripts": {
|
||||
"dev": "vite",
|
||||
"build": "tsc",
|
||||
|
||||
@ -12,13 +12,26 @@ export function insertRickLabel(target: HTMLElement | string = document.body): v
|
||||
cursor: 'pointer',
|
||||
boxShadow: '0 0 5px rgba(0,0,0,0.1)',
|
||||
width: 'fit-content',
|
||||
userSelect: 'none'
|
||||
userSelect: 'none',
|
||||
transition: 'all 0.3s ease'
|
||||
})
|
||||
|
||||
label.onclick = () => {
|
||||
clickCount++
|
||||
label.textContent = `Rickroll Me (${clickCount})`
|
||||
window.open('https://www.youtube.com/watch?v=dQw4w9WgXcQ', '_blank')
|
||||
|
||||
const url =
|
||||
clickCount >= 69
|
||||
? 'https://youtu.be/soKTQx0p7_Q?list=RDsoKTQx0p7_Q'
|
||||
: 'https://www.youtube.com/watch?v=dQw4w9WgXcQ'
|
||||
|
||||
if (clickCount === 69) {
|
||||
// Activate rainbow effect via CSS animation
|
||||
label.style.animation = 'rainbowBackground 3s linear infinite'
|
||||
label.style.color = 'white'
|
||||
}
|
||||
|
||||
window.open(url, '_blank')
|
||||
}
|
||||
|
||||
if (typeof target === 'string') {
|
||||
@ -26,4 +39,22 @@ export function insertRickLabel(target: HTMLElement | string = document.body): v
|
||||
} else {
|
||||
target.appendChild(label)
|
||||
}
|
||||
|
||||
// Inject rainbow animation into page if not already there
|
||||
if (!document.getElementById('rainbow-style')) {
|
||||
const style = document.createElement('style')
|
||||
style.id = 'rainbow-style'
|
||||
style.textContent = `
|
||||
@keyframes rainbowBackground {
|
||||
0% { background: red; }
|
||||
16% { background: orange; }
|
||||
32% { background: yellow; }
|
||||
48% { background: green; }
|
||||
64% { background: blue; }
|
||||
80% { background: indigo; }
|
||||
100% { background: violet; }
|
||||
}
|
||||
`
|
||||
document.head.appendChild(style)
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user