-
-
Notifications
You must be signed in to change notification settings - Fork 135
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #367 from Nasko-5/mdmck10
MDMCK10's worst nightmare fanum 🔥
- Loading branch information
Showing
3 changed files
with
196 additions
and
37 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,174 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
|
||
<head> | ||
<meta charset="UTF-8"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
<title>Document</title> | ||
<script> | ||
function randomNumber(from, to) { | ||
return Math.floor(from + Math.random() * (to - from)); | ||
} | ||
|
||
function randomFloat(from, to) { | ||
return from + Math.random() * (to - from); | ||
} | ||
|
||
function getRandomElement(li) { | ||
return li[randomNumber(0, li.length)]; | ||
} | ||
|
||
const verticalDirections = ["up", "down"]; | ||
const horizontalDirections = ["left", "right"]; | ||
const behaviours = ["scroll", "slide", "alternate"]; | ||
const fontFamilies = [ | ||
"serif", "sans-serif", "monospace", "cursive", "fantasy", | ||
"system-ui", "Times New Roman", "Georgia", "Garamond", | ||
"Arial", "Helvetica", "Verdana", "Tahoma", "Courier New", | ||
"Lucida Console", "Consolas", "Segoe UI", "DejaVu Sans", | ||
"Liberation Serif", "Liberation Mono", "Times", "Courier" | ||
]; | ||
const textTransforms = [ | ||
"none", "capitalize", "uppercase", "lowercase", | ||
"full-width", "full-size-kana", "math-auto" | ||
]; | ||
const borderStyles = ["solid", "dotted", "dashed", "double", "groove", "ridge", "inset", "outset"]; | ||
const textDecorations = ["none", "underline", "overline", "line-through", "underline overline"]; | ||
const filterEffects = ["none", "blur(2px)", "brightness(1.2)", "contrast(150%)", "sepia(50%)", "hue-rotate(90deg)"]; | ||
|
||
const minWidth = 20; | ||
const maxWidth = 700; | ||
const minHeight = 20; | ||
const maxHeight = 700; | ||
const minScrollAmount = 2; | ||
const maxScrollAmount = 15; | ||
const minFontSize = 12; | ||
const maxFontSize = 41; | ||
const translate3dRanges = [10, 10, 10]; | ||
const rotate3dRanges = [30, 30, 30]; | ||
const scale3dRanges = [0.5, 0.5, 0.5]; | ||
const REFRESH_INTERVAL = 5000; // 5 seconds | ||
const NUMBER_OF_MARQUEES = 200; | ||
|
||
function getRandomRGBA(minAlpha = 0, maxAlpha = 1) { | ||
return `rgba(${randomNumber(0, 255)},${randomNumber(0, 255)},${randomNumber(0, 255)},${randomFloat(minAlpha, maxAlpha)})`; | ||
} | ||
|
||
function getRandomBoxShadow() { | ||
const x = randomNumber(-10, 10); | ||
const y = randomNumber(-10, 10); | ||
const blur = randomNumber(0, 20); | ||
const spread = randomNumber(0, 10); | ||
const color = getRandomRGBA(0.3, 0.7); | ||
return `${x}px ${y}px ${blur}px ${spread}px ${color}`; | ||
} | ||
|
||
function getCompatibleDirection(behaviour) { | ||
if (behaviour === "alternate") { | ||
return getRandomElement([...horizontalDirections, ...verticalDirections]); | ||
} else { | ||
return getRandomElement(horizontalDirections); | ||
} | ||
} | ||
|
||
function createMarquee() { | ||
var marq = document.createElement('marquee'); | ||
|
||
let behaviour = getRandomElement(behaviours); | ||
let direction = getCompatibleDirection(behaviour); | ||
let width = 0; | ||
let height = 0; | ||
|
||
if (verticalDirections.includes(direction)) { | ||
width = randomNumber(minWidth, maxWidth / 4); | ||
height = randomNumber(minHeight, maxHeight); | ||
} else { | ||
width = randomNumber(minWidth, maxWidth); | ||
height = randomNumber(minHeight, maxHeight / 4); | ||
} | ||
|
||
let borderWidth = randomNumber(1, 5); | ||
let borderRadius = randomNumber(0, 20); | ||
let borderStyle = getRandomElement(borderStyles); | ||
let borderColor = getRandomRGBA(0.5, 1); | ||
let boxShadow = Math.random() > 0.5 ? getRandomBoxShadow() : 'none'; | ||
let textDecoration = getRandomElement(textDecorations); | ||
let filter = getRandomElement(filterEffects); | ||
let letterSpacing = randomNumber(-2, 4); | ||
|
||
let styleatr = | ||
`position:fixed;` + | ||
`top:${randomNumber(0, window.innerHeight)}px;` + | ||
`left:${randomNumber(0, window.innerWidth)}px;` + | ||
`font-family:${getRandomElement(fontFamilies)};` + | ||
`font-size:${randomNumber(minFontSize, maxFontSize)}px;` + | ||
`text-transform:${getRandomElement(textTransforms)};` + | ||
`width:${width}px;` + | ||
`height:${height}px;` + | ||
`background:${getRandomRGBA()};` + | ||
`color:${getRandomRGBA(0.8, 1)};` + | ||
`border:${borderWidth}px ${borderStyle} ${borderColor};` + | ||
`border-radius:${borderRadius}px;` + | ||
`box-shadow:${boxShadow};` + | ||
`text-decoration:${textDecoration};` + | ||
`filter:${filter};` + | ||
`letter-spacing:${letterSpacing}px;` + | ||
`padding:${randomNumber(5, 15)}px;` + | ||
'transform: ' + | ||
'scale3d(' + | ||
`${1 + randomFloat(-scale3dRanges[0], scale3dRanges[0])},` + | ||
`${1 + randomFloat(-scale3dRanges[1], scale3dRanges[1])},` + | ||
`${1 + randomFloat(-scale3dRanges[2], scale3dRanges[2])}` + | ||
') ' + | ||
'rotate3d(' + | ||
`${randomFloat(-rotate3dRanges[0], rotate3dRanges[0])},` + | ||
`${randomFloat(-rotate3dRanges[1], rotate3dRanges[1])},` + | ||
`${randomFloat(-rotate3dRanges[2], rotate3dRanges[2])}` + | ||
', ' + | ||
`${randomFloat(-30, 30)}deg` + | ||
') ' + | ||
'translate3d(' + | ||
`${randomFloat(-translate3dRanges[0], translate3dRanges[0])}px,` + | ||
`${randomFloat(-translate3dRanges[1], translate3dRanges[1])}px,` + | ||
`${randomFloat(-translate3dRanges[2], translate3dRanges[2])}px` + | ||
')'; | ||
|
||
marq.setAttribute('behavior', behaviour); | ||
marq.setAttribute('direction', direction); | ||
marq.setAttribute('scrollamount', randomNumber(minScrollAmount, maxScrollAmount)); | ||
marq.setAttribute('style', styleatr); | ||
marq.textContent = "marquee"; | ||
|
||
return marq; | ||
} | ||
|
||
function createAllMarquees() { | ||
const body = document.body; | ||
const existingMarquees = document.querySelectorAll('marquee'); | ||
existingMarquees.forEach(marquee => { | ||
setTimeout(() => marquee.remove(), 500); | ||
}); | ||
setTimeout(() => { | ||
for (let i = 0; i < NUMBER_OF_MARQUEES; i++) { | ||
const marq = createMarquee(); | ||
body.appendChild(marq); | ||
} | ||
}, 500); | ||
} | ||
|
||
document.addEventListener('DOMContentLoaded', function () { | ||
createAllMarquees(); | ||
setInterval(createAllMarquees, REFRESH_INTERVAL); | ||
}); | ||
</script> | ||
</head> | ||
|
||
<body> | ||
<p>problem?</p> | ||
<audio loop autoplay> | ||
<source src="/LIVE/trolololo.mp3" type="audio/mpeg"> | ||
Your browser does not support the audio element. | ||
</audio> | ||
</body> | ||
|
||
</html> |
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
Binary file not shown.