Skip to content

Commit

Permalink
Merge pull request #30 from Freakybob-Team/dev
Browse files Browse the repository at this point in the history
full rewrite
  • Loading branch information
wish13yt authored Dec 24, 2024
2 parents 1366a90 + c3ab948 commit 1a017a9
Show file tree
Hide file tree
Showing 20 changed files with 1,450 additions and 468 deletions.
10 changes: 10 additions & 0 deletions 404.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,14 @@
<meta content="#006b79" data-react-helmet="true" name="theme-color" />
<title>404</title>
<link rel="stylesheet" href="css/404.css">
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Poppins:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&display=swap" rel="stylesheet">
</head>
<body onload="getRandomImage()">
<div id="particles-js"></div>
<h1>Oops! A 404 Page!</h1>
<div id="container">
<p>we'll meet again
<br>
dont know where
Expand All @@ -23,8 +28,11 @@ <h1>Oops! A 404 Page!</h1>
<br>
just kidding! this page will likely never exist.. or theres an issue.. just let us know idk</p>
<span id="result" align="center"> </span>
<div class="button-container">
<a href="https://freakybob.site" id="index">Go to main page</a>
<a href="https://github.com/Freakybob-Team/Freakybob.site/issues/new" id="issue">Make an issue</a>
</div>
</div>
<audio autoplay loop><source src="https://freakybob.site/audio/EEK!.ogg" type="audio/ogg"></audio>
<script>
function getRandomImage() {
Expand All @@ -49,5 +57,7 @@ <h1>Oops! A 404 Page!</h1>
return document.getElementById('result').innerHTML = '<img src="' + randomImage[number]+'" />';
}
</script>
<script type="text/javascript" src="particles.js"></script>
<script type="text/javascript" src="app.js"></script>
</body>
</html>
327 changes: 327 additions & 0 deletions clicker.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,327 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Freakybob Clicker</title>
<style>
body {
font-family: Arial, sans-serif;
background-color: #e4d501;
color: #bdca02;
margin: 0;
padding: 0;
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
overflow: hidden;
}
#container {
display: flex;
justify-content: center;
align-items: center;
flex-direction: row;
width: 80%;
max-width: 1200px;
background-color: #776607;
border-radius: 10px;
padding: 20px;
}
#shop {
width: 300px;
background-color: #a008ad;
border-radius: 10px;
padding: 10px;
box-shadow: 0 0 10px rgba(10, 10, 0, 0.5);
margin-right: 20px;
}
#click-area {
display: flex;
flex-direction: column;
align-items: center;
width: 100%;
}
#clicker {
width: 200px;
height: 200px;
background-image: url('freaky (1).webp');
background-size: cover;
background-position: center;
cursor: pointer;
margin-bottom: 20px;
border: 2px solid #01b4eb;
border-radius: 50%;
}
#stats, #achievements {
margin-bottom: 20px;
}
button {
background-color: #4a6f8c;
color: #ffffff;
border: none;
padding: 10px;
border-radius: 5px;
cursor: pointer;
margin-top: 10px;
display: block;
}
button:hover:not(.disabled) {
background-color: #3a5e7a;
}
button.disabled {
background-color: #6c757d;
cursor: not-allowed;
}

button.enabled {
background-color: #4a6f8c;
cursor: pointer;
}

#mute-button {
position: fixed;
top: 10px;
right: 10px;
padding: 10px 15px;
background-color: rgb(1, 170, 128);
border: none;
border-radius: 5px;
cursor: pointer;
font-size: 14px;
z-index: 1001;
}
#mute-button.muted {
background-color: #ff4d4d;
}
#achievements p {
background-color: #2a3c5d;
padding: 5px;
border-radius: 5px;
margin: 5px 0;
}
@keyframes slide-in-right {
0% {
transform: translateX(100%);
opacity: 0;
}
100% {
transform: translateX(0);
opacity: 1;
}
}
@keyframes slide-out-right {
0% {
transform: translateX(0);
opacity: 1;
}
100% {
transform: translateX(100%);
opacity: 0;
}
}
.achievement {
background-color: #2a3c5d;
padding: 5px;
border-radius: 5px;
margin: 5px 0;
color: white;
animation: slide-in-right 0.5s forwards;
}
.achievement.out {
animation: slide-out-right 0.5s forwards;
}
</style>
</head>
<body>
<!-- Audio elements without controls, autoplay and preload set -->
<audio id="background-music" loop autoplay preload="auto">
<source src="Sneaky-Snitch(chosic.com).mp3" type="audio/mp3">
</audio>

<audio id="click-sound" src="https://github.com/5quirre1/Freakybob.site/raw/main/i%E2%80%99m-spongebob-made-with-Voicemod.mp3"></audio>
<div id="container">
<div id="shop">
<h2>Shop</h2>
<button id="buy-autoclicker" class="disabled">Buy Autoclicker (100 clicks)</button>
<button id="buy-freakystar" class="disabled">Buy Freaky Star (300 clicks)</button>
<h3>Upgrades</h3>
<button id="buy-multiplier-1" class="disabled">1+ Clicks Multiplier (15 clicks)</button>
<button id="buy-multiplier-8" class="disabled">8+ Clicks Multiplier (120 clicks)</button>
</div>
<div id="click-area">
<div id="clicker"></div>
<div id="stats">
<p>Clicks: <span id="click-count">0</span></p>
<p>Clicks Per Second: <span id="clicks-per-second">0</span></p>
</div>
<div id="achievements">
<h2>Achievements</h2>
</div>
</div>
</div>
<!-- Mute/Unmute Button -->
<button id="mute-button">Mute Music</button>

<script>
let clickCount = 0;
let clicksPerSecond = 0;
let autoClicker = false;
let freakyStar = { owned: false, clicksPerSecond: 0 };
let clickMultiplier = 1;
let multipliers = {
1: { count: 0, max: 3, cost: 15, increment: 1 },
8: { count: 0, max: 3, cost: 120, increment: 8 }
};
const achievements = [
{ name: 'Started this Journey', clicks: 1 },
{ name: 'Beginner Clicker', clicks: 300 },
{ name: 'You must love clicking freakybob', clicks: 900 },
{ name: 'First 1000!', clicks: 1000 },
{ name: 'Finger destroyer', clicks: 3000 },
{ name: 'Intermediate clicker', clicks: 7000 },
{ name: 'Mouse destroyer', clicks: 13000 },
{ name: 'First 20,000!', clicks: 20000 },
{ name: 'Beginner Freakybob', clicks: 27000 },
{ name: 'King clicker', clicks: 70000 },
{ name: "THE ULTIMATE FINGER DESTROYER!!", clicks: 100000 },
{ name: 'Freakybob of the year!', clicks: 117000 },
{ name: 'The literal Freakybob god', clicks: 130000 },
{ name: 'The mouse is not dead yet!', clicks: 135000 },
{ name: 'Freakybob of the century', clicks: 140000 },
{ name: 'Freakybob of the millennium', clicks: 150000 },
{ name: 'The ultimate Freakybob', clicks: 160000 },
{ name: 'Freakybob of the universe', clicks: 190000 },
{ name: 'The Freakybob God', clicks: 217000 },
{ name: 'The..end..?', clicks: 240000 },
{ name: 'For now...', clicks: 260000 }
];

const unlockedAchievements = new Set();
let isMuted = false; // Default to unmuted

function playClickSound() {
if (isMuted) return; // Prevent sound if muted

const clickSound = new Audio('https://github.com/5quirre1/Freakybob.site/raw/main/i%E2%80%99m-spongebob-made-with-Voicemod.mp3');
clickSound.play().catch(err => console.error(err));
}

function toggleMute() {
isMuted = !isMuted;
document.getElementById('mute-button').classList.toggle('muted', isMuted);
document.getElementById('background-music').muted = isMuted;
document.getElementById('mute-button').textContent = isMuted ? 'Unmute Music' : 'Mute Music';
}

function updateStats() {
document.getElementById('click-count').textContent = clickCount;
document.getElementById('clicks-per-second').textContent = clicksPerSecond;
}

function updateAchievements() {
const achievementsContainer = document.getElementById('achievements');
achievements.forEach(achievement => {
if (clickCount >= achievement.clicks && !unlockedAchievements.has(achievement.name)) {
unlockedAchievements.add(achievement.name);
const achievementElement = document.createElement('p');
achievementElement.textContent = achievement.name;
achievementElement.className = 'achievement';
achievementsContainer.appendChild(achievementElement);
setTimeout(() => {
achievementElement.classList.add('out');
setTimeout(() => achievementElement.remove(), 500);
}, 5000); // 5 seconds before fade out
}
});
}

function updateButtonStates() {
document.getElementById('buy-autoclicker').classList.toggle('disabled', clickCount < 100 || autoClicker);
document.getElementById('buy-freakystar').classList.toggle('disabled', clickCount < 300 || freakyStar.owned);
document.getElementById('buy-multiplier-1').classList.toggle('disabled', clickCount < multipliers[1].cost || multipliers[1].count >= multipliers[1].max);
document.getElementById('buy-multiplier-8').classList.toggle('disabled', clickCount < multipliers[8].cost || multipliers[8].count >= multipliers[8].max);
}

function buyItem(cost, itemName, enableNext) {
if (clickCount >= cost) {
clickCount -= cost;
updateButtonStates(); // Update button states after buying an item
if (enableNext) {
document.getElementById(enableNext).classList.remove('disabled');
document.getElementById(enableNext).classList.add('enabled');
}
updateStats();
updateAchievements();
}
}

function handleClick() {
playClickSound();
clickCount += 1 * clickMultiplier;
updateStats();
updateAchievements();
updateButtonStates(); // Update button states after a click
}

// Initialize game
function initialize() {
document.getElementById('clicker').addEventListener('click', handleClick);
document.getElementById('buy-autoclicker').addEventListener('click', function() {
if (clickCount >= 100 && !autoClicker) {
autoClicker = true;
buyItem(100, 'buy-autoclicker', 'buy-freakystar');
}
});
document.getElementById('buy-freakystar').addEventListener('click', function() {
if (clickCount >= 300 && !freakyStar.owned) {
freakyStar.owned = true;
freakyStar.clicksPerSecond = 40;
buyItem(300, 'buy-freakystar', null);
}
});
document.getElementById('buy-multiplier-1').addEventListener('click', function() {
const upgrade = multipliers[1];
if (clickCount >= upgrade.cost && upgrade.count < upgrade.max) {
clickMultiplier += upgrade.increment;
upgrade.count += 1;
buyItem(upgrade.cost, 'buy-multiplier-1', null);
}
});
document.getElementById('buy-multiplier-8').addEventListener('click', function() {
const upgrade = multipliers[8];
if (clickCount >= upgrade.cost && upgrade.count < upgrade.max) {
clickMultiplier += upgrade.increment;
upgrade.count += 1;
buyItem(upgrade.cost, 'buy-multiplier-8', null);
}
});

// Auto-clicker and Freaky Star logic
setInterval(() => {
if (autoClicker) {
clickCount += 1 * clickMultiplier;
updateStats();
updateAchievements();
}
}, 1000);

setInterval(() => {
if (freakyStar.owned) {
clickCount += freakyStar.clicksPerSecond;
updateStats();
updateAchievements();
}
}, 2000);

updateButtonStates(); // Set initial button states
}

initialize();

// Add event listener for mute/unmute
document.getElementById('mute-button').addEventListener('click', toggleMute);

</script>
</body>
</html>
Loading

0 comments on commit 1a017a9

Please sign in to comment.