About
Explore
Events & Classes
Support Us
Join
Sign In
purple_ghost
View Project Page
Run
Fullscreen
Virtual Donut!
HTML
CSS
JS
<!-- Created by purple_ghost, subject to copyright. FOR MY VERY SPECIAL 20 FOLLOWERS ONLY --> <!DOCTYPE HTML> <html> <head> <title>Page Title</title> <meta charset="utf-8"> <meta name="author" content="purple_ghost"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> </head> <body> <h1>Simply click to munch!</h1> <p>Munches: <span>0</span></p> <div onclick="resetClicks()" class="reset">reset</div> <br> <div onclick="clicked()" class="donut"> <div class="donut-icing"></div> </div> </body> </html>
body { justify-content: center; align-items: center; font-family: "montserrat", arial; user-select: none; text-align: center; } .donut { border: 80px #f5ff70 solid; width: 200px; height: 200px; cursor: pointer; border-radius: 50%; justify-content: center; align-items: center; display: block; margin: auto; } .donut-icing { width: 100px; height: 100px; border-radius: 50%; margin: auto; position: relative; left: -40px; top: -40px; display: block; border: 90px #ff9efa solid; } .reset { color: red; border: 10px solid red; text-transform: uppercase; display: block; width: 54px; margin: auto; padding: 5px; border-radius: 5px; cursor: pointer; } p { text-align: center; } @keyframes example { from {top:-100px;opacity: 0;} to {top:0px;opacity:1;} } .modal { display: none; position: fixed; left: 0; top: 0; width: 100%; height: 100%; overflow: auto; background-color: rgb(0, 0, 0); background-color: rgba(0, 0, 0, 0.4); } .modal:target { display: table; position: absolute; } .modal-dialog { display: table-cell; vertical-align: middle; } .modal-dialog .modal-content { margin: auto; background-color: #f3f3f3; position: relative; padding: 0; outline: 0; border: 1px #777 solid; text-align: justify; width: 80%; box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19); -webkit-animation-name: example; -webkit-animation-duration: 0.5s; animation-name: example; animation-duration: 0.5s; } .closebtn { text-decoration: none; float: right; font-size: 35px; font-weight: bold; color: #fff; } .closebtn:hover, .closebtn:focus { color: #000; text-decoration: none; cursor: pointer; } .container { padding: 2px 16px; } header { background-color: #5cb85c; font-size: 25px; color: white; } .open-modal { color: white; background-color: green; text-decoration: none; padding: 5px; display: block; width: 81px; margin: auto; }
var donut_icing = document.querySelector(".donut-icing"); var para1 = document.getElementsByTagName("span")[0]; var mode1 = "#ff9efa"; var score = 0; var click = new Audio('https://justcodaborate.org/project_assets/click.wav'); function resetClicks() { score = 0; para1.innerHTML = "0"; } function clicked() { click.play(); score++; para1.innerHTML = score; }