Force Counter
How do I make an force counter?
What is a force counter? How do you make a force counter? This script and codes were developed by Ken Lauguico on 22 December 2022, Thursday.
Force Counter - Script Codes HTML Codes
<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>Force Counter</title> <link rel="stylesheet" href="css/style.css">
</head>
<body> <audio preload="auto"> <source src="https://www.google.com/images/egg/beyond/byns0.mp3" type="audio/mpeg" />
</audio>
<span>
<div class="pretext">FORCE HAS BEEN SAID</div>
<div id="shot-count">0</div>
<div class="subtext">TIMES</div>
</span> <script src='http://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js'></script> <script src="js/index.js"></script>
</body>
</html>
Force Counter - Script Codes CSS Codes
body { background: #000 url(//cssanimation.rocks/demo/starwars/images/bg.jpg); overflow:hidden;
}
#shot-count { color: white; margin: auto; text-align: center; font-size: 35vw;
}
span { display:block; transform: perspective(500px) rotateX(50deg); height:66.5vw;width:100%; position:absolute; margin:auto; left:0;right:0;bottom:0;top:0;
}
.pretext, .subtext { color: yellow; font-size: 5vw; text-align: center; font-family:sans-serif;
}
.subtext { margin-top:-4.5vw;
}
/* Animations */
.fade-in { -webkit-animation: fade-in 5s 3s backwards; -moz-animation: fade-in 5s 3s backwards; animation: fade-in 5s 3s backwards;
}
@-moz-keyframes fade-in { from { -moz-transform: translateY(30px); opacity: 0; } to { -moz-transform: translateY(0); opacity: 1; }
}
@-webkit-keyframes fade-in { from { -webkit-transform: translateY(30px); opacity: 0; } to { -webkit-transform: translateY(0); opacity: 1; }
}
@keyframes fade-in { from { transform: translateY(30px); opacity: 0; } to { transform: translateY(0); opacity: 1; }
}
.grow-fade-in { -webkit-animation: grow-fade-in 4s backwards ease-out; -moz-animation: grow-fade-in 4s backwards ease-out; animation: grow-fade-in 4s backwards ease-out;
}
@-moz-keyframes grow-fade-in { from { -moz-transform: scale(0.7); opacity: 0; } to { -moz-transform: scale(1); opacity: 1; }
}
@-webkit-keyframes grow-fade-in { from { -webkit-transform: scale(0.7); opacity: 0; } to { -webkit-transform: scale(1); opacity: 1; }
}
@keyframes grow-fade-in { from { transform: scale(0.7); opacity: 0; } to { transform: scale(1); opacity: 1; }
}
Force Counter - Script Codes JS Codes
// Created this tool for a Star Wars Marathon where every time Force has been said, the entire party has to take a drink/shot!
var shotCount = (localStorage.getItem("forceCount")) ? localStorage.getItem("forceCount") : 0;
$("#shot-count").text(shotCount);
var timeout;
$(document).keydown(function(event) { if (event.keyCode == 32) { resetAnimations(); turnOnSiren(); playSoundBite(); setTimeout(function() { increaseShotCount(); animate(); }, 1); } if (event.keyCode == 38) increaseShotCount(); if (event.keyCode == 40) decreaseShotCount();
});
function increaseShotCount() { shotCount++; checkSingular(); $("#shot-count").text(shotCount); saveCount();
}
function decreaseShotCount() { if (!shotCount) return; shotCount--; checkSingular(); $("#shot-count").text(shotCount); saveCount();
}
function saveCount() { localStorage.setItem("forceCount", shotCount);
}
function checkSingular() { if (shotCount == 1) $(".subtext").text("TIME"); else $(".subtext").text("TIMES");
}
function playSoundBite() { var audio = $(document).find("audio").get(0); audio.volume = 1; audio.currentTime = 0; audio.play(); clearTimeout(timeout); timeout = setTimeout(function() { $("audio").animate({volume: 0}, 1000, function () { audio.pause(); resetAnimations(); }); }, 15500);
}
function turnOnSiren() { $.post("");
}
function animate() { $('.pretext, .subtext').addClass("fade-in"); $('#shot-count').addClass("grow-fade-in");
}
function resetAnimations() { $('.pretext, .subtext').removeClass("fade-in"); $('#shot-count').removeClass("grow-fade-in");
}
Developer | Ken Lauguico |
Username | kenlauguico |
Uploaded | December 22, 2022 |
Rating | 3 |
Size | 2,732 Kb |
Views | 8,096 |
Find the perfect freelance services for your business! Fiverr's mission is to change how the world works together. Fiverr connects businesses with freelancers offering digital services in 500+ categories. Find Developer!
Name | Size |
Just an animated underline | 2,229 Kb |
Fourground Logo | 3,072 Kb |
Simple Dot Loader | 2,272 Kb |
A Pen by Ken Lauguico | 4,517 Kb |
A Responsive Menu | 3,590 Kb |
Pure CSS Image Slider | 3,208 Kb |
Animated Captions via data- Attribute | 2,502 Kb |
Protoshow.js Demo | 1,984 Kb |
Typing Simulator | 2,910 Kb |
Flat Email Form | 3,415 Kb |
Jasper is the AI Content Generator that helps you and your team break through creative blocks to create amazing, original content 10X faster. Discover all the ways the Jasper AI Content Platform can help streamline your creative workflows. Start For Free!
Name | Username | Size |
Starfield using KineticJS | Asp | 3,512 Kb |
SCSS Simple Animated Drop-In | Danwarfel | 2,175 Kb |
Basic HTML5 Structure | YuvarajTana | 1,289 Kb |
DFF Website | Hawcubite | 10,123 Kb |
Portfolio Landing Page | FDfranklin | 3,585 Kb |
Pure CSS candle light animation by One element | Ksksoft | 2,193 Kb |
Cool audio | Bigliam | 1,868 Kb |
Fluid Layout with Float | Jxqr97 | 1,785 Kb |
Faux column absolute wrapper | Yurimorini | 1,823 Kb |
Automatic scroll | Skeurentjes | 4,042 Kb |
Surf anonymously, prevent hackers from acquiring your IP address, send anonymous email, and encrypt your Internet connection. High speed, ultra secure, and easy to use. Instant setup. Hide Your IP Now!