Rolling dice
How do I make an rolling dice?
UTF-8 dice and setInterval. What is a rolling dice? How do you make a rolling dice? This script and codes were developed by Josep Llodrà on 16 January 2023, Monday.
Rolling dice - Script Codes HTML Codes
<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>Rolling dice</title> <link rel="stylesheet" href="css/style.css">
</head>
<body> <!-- https://twitter.com/josep_llodra -->
<div>Click on the dice...</div>
<div id="dice" onclick="javascript:stopstart()"></div> <script src="js/index.js"></script>
</body>
</html>
Rolling dice - Script Codes CSS Codes
body { text-align: center; font-family: Helvetica, sans-serif;
}
#dice { font-size: 320px;
}
#dice:hover { cursor: pointer;
}
Rolling dice - Script Codes JS Codes
var dice;
var dices = ['⚀', '⚁', '⚂', '⚃', '⚄', '⚅' ];
var stopped = true;
var t;
function change() { var random = Math.floor(Math.random()*6); dice.innerHTML = dices[random];
}
function stopstart() { if(stopped) { stopped = false; t = setInterval(change, 100); } else { clearInterval(t); stopped = true; }
}
window.onload = function() { dice = document.getElementById("dice"); stopstart();
}
Developer | Josep Llodrà |
Username | jllodra |
Uploaded | January 16, 2023 |
Rating | 3 |
Size | 1,889 Kb |
Views | 10,120 |
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 |
Boxes with css arrows | 3,121 Kb |
3D Pythagoras tree | 3,678 Kb |
Twisted text | 3,072 Kb |
Hypnotic animation | 4,016 Kb |
3D Pythagoras tree II | 3,941 Kb |
Dielectric breakdown model | 3,295 Kb |
Designed by Apple in California | 2,319 Kb |
A worm in the sand | 3,577 Kb |
Mesmerizing octopus | 3,549 Kb |
UTF-8 Recycle animation | 1,643 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 |
A Pen by Sooba | Sooba | 2,516 Kb |
Vertically rotating text with CSS | Nopr | 2,141 Kb |
Confirm Close Of Foundation Reveal Modal | Winghouchan | 1,818 Kb |
Jstam.com Home Page | Jstam | 10,558 Kb |
Sass random color animation | Jotavejv | 4,827 Kb |
A Pen by Matt Popovich | Mpopv | 3,349 Kb |
Social buttons | Flacu | 2,022 Kb |
Experiment - SCSS SVG Background Image with Variables | See8ch | 3,270 Kb |
Sign Up Form | Sicontis | 5,272 Kb |
CSS-Flexbox-Demo | Sstiglets | 1,709 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!