Skip to content

Commit

Permalink
Merge pull request #382 from DishpitDev/chore/formatting
Browse files Browse the repository at this point in the history
formatting
  • Loading branch information
Dishpit authored Jan 6, 2025
2 parents 27019ac + b79a207 commit 24089b4
Show file tree
Hide file tree
Showing 18 changed files with 59,301 additions and 1,369 deletions.
2 changes: 1 addition & 1 deletion LIVE/.htmlhintrc
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@
"src-not-empty": true,
"attr-no-duplication": true,
"title-require": true
}
}
2 changes: 1 addition & 1 deletion LIVE/.stylelintrc.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{ "extends": ["stylelint-config-standard"] }
{ "extends": ["stylelint-config-standard"] }
321 changes: 184 additions & 137 deletions LIVE/MDMCK10's worst nightmare.html
Original file line number Diff line number Diff line change
@@ -1,158 +1,206 @@
<!DOCTYPE html>
<!doctype html>
<html lang="en">

<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<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 randomNumber(from, to) {
return Math.floor(from + Math.random() * (to - from));
}

function randomFloat(from, to) {
return from + Math.random() * (to - from);
}
function randomFloat(from, to) {
return from + Math.random() * (to - from);
}

function getRandomElement(li) {
return li[randomNumber(0, li.length)];
}
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 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;
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 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 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 getCompatibleDirection(behaviour) {
if (behaviour === "alternate") {
return getRandomElement([
...horizontalDirections,
...verticalDirections,
]);
} else {
return getRandomElement(horizontalDirections);
}
}

function updateExistingMarquees() {
const marquees = document.querySelectorAll('marquee');
marquees.forEach((marq) => {
let behaviour = getRandomElement(behaviours);
let direction = getCompatibleDirection(behaviour);
let width, height;
function updateExistingMarquees() {
const marquees = document.querySelectorAll("marquee");
marquees.forEach((marq) => {
let behaviour = getRandomElement(behaviours);
let direction = getCompatibleDirection(behaviour);
let width, height;

if (verticalDirections.includes(direction)) {
width = randomNumber(minWidth, maxWidth / 4);
height = randomNumber(minHeight, maxHeight);
} else {
width = randomNumber(minWidth, maxWidth);
height = randomNumber(minHeight, maxHeight / 4);
}
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 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` +
')';
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 updated";
});
}

document.addEventListener('DOMContentLoaded', function () {
updateExistingMarquees();
setInterval(updateExistingMarquees, REFRESH_INTERVAL);
});
marq.setAttribute("behavior", behaviour);
marq.setAttribute("direction", direction);
marq.setAttribute(
"scrollamount",
randomNumber(minScrollAmount, maxScrollAmount),
);
marq.setAttribute("style", styleatr);
marq.textContent = "marquee updated";
});
}

document.addEventListener("DOMContentLoaded", function () {
updateExistingMarquees();
setInterval(updateExistingMarquees, REFRESH_INTERVAL);
});
</script>
</head>
</head>

<body>
<body>
<p>problem?</p>
<audio loop autoplay>
<source src="/trololololo.mp3" type="audio/mpeg">
Your browser does not suppor t the audio element.
<source src="/trololololo.mp3" type="audio/mpeg" />
Your browser does not suppor t the audio element.
</audio>

<marquee></marquee>
Expand Down Expand Up @@ -355,6 +403,5 @@
<marquee></marquee>
<marquee></marquee>
<marquee></marquee>
</body>

</html>
</body>
</html>
32,864 changes: 32,862 additions & 2 deletions LIVE/assets/css/bulma.min.css

Large diffs are not rendered by default.

Loading

0 comments on commit 24089b4

Please sign in to comment.