Skip to content

Commit

Permalink
Merge pull request #162 from MuKulsoop/fix-title
Browse files Browse the repository at this point in the history
Added a chaotic title
  • Loading branch information
vansh-codes authored Oct 22, 2024
2 parents 87ef52c + ed98566 commit 97fc180
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 10 deletions.
27 changes: 25 additions & 2 deletions chaosweb-v@2/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,35 @@
<html lang="en">
<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
<link rel="icon" type="image/svg+xml" href="/logo.png" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Vite + React</title>
<title>ChaosWeb</title>
</head>
<body>
<div id="root"></div>
<script type="module" src="/src/main.jsx"></script>
<script>
// The base title that should not fully change
const titleText = "Chaotic Title!";
const characters = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789!@#$%^&*()";

// Function to randomize certain characters only
function randomizeTitle() {
let chaoticTitle = '';
for (let i = 0; i < titleText.length; i++) {
// Randomize only certain characters, while leaving others untouched
if (titleText[i] !== ' ' && Math.random() > 0.7) { // Adjust randomness threshold here (0.7)
chaoticTitle += characters.charAt(Math.floor(Math.random() * characters.length));
} else {
chaoticTitle += titleText[i]; // Keep the original character
}
}
// Set the new title in the document
document.title = chaoticTitle;
}

// Update the title every 500 milliseconds
setInterval(randomizeTitle, 500);
</script>
</body>
</html>
7 changes: 0 additions & 7 deletions chaosweb-v@2/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file added chaosweb-v@2/public/logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 0 additions & 1 deletion chaosweb-v@2/public/vite.svg

This file was deleted.

0 comments on commit 97fc180

Please sign in to comment.