Pure CSS shooting gallery (WIP)

Developer
Size
2,588 Kb
Views
22,264

How do I make an pure css shooting gallery (wip)?

This uses a checkbox hack (hiding the checkbox itself, but styling the label to look like tomato cans) to achieve interactivity in pure CSS, which is neat. Just added a score counter(). When I have time I'm going to come back and add variety to the animations, and selectable backdrops.. What is a pure css shooting gallery (wip)? How do you make a pure css shooting gallery (wip)? This script and codes were developed by Eli Fitch on 28 October 2022, Friday.

Pure CSS shooting gallery (WIP) Previews

Pure CSS shooting gallery (WIP) - Script Codes HTML Codes

<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>Pure CSS shooting gallery (WIP)</title> <link rel="stylesheet" href="css/style.css">
</head>
<body> <body>
<!-- <h1>CSS SHOOTING GALLERY</h1> -->
<input type="checkbox" id="button1" />
<label class="can" for="button1" onclick>	<div class="lower"></div>
</label>
<input type="checkbox" id="button2" />
<label class="can" for="button2" onclick>	<div class="lower"></div>
</label>
<input type="checkbox" id="button3" />
<label class="can" for="button3" onclick>	<div class="lower"></div>
</label>
<input type="checkbox" id="button4" />
<label class="can" for="button4" onclick>	<div class="lower"></div>
</label>
<input type="checkbox" id="button5" />
<label class="can" for="button5" onclick>	<div class="lower"></div>
</label>
<input type="checkbox" id="button6" />
<label class="can" for="button6" onclick>	<div class="lower"></div>
</label>
<div class="score">Score: </div>
</body>
</body>
</html>

Pure CSS shooting gallery (WIP) - Script Codes CSS Codes

* { margin: 0; padding: 0; cursor: crosshair; box-sizing: border-box;
}
body { background-color: black; -webkit-animation: bugfix infinite 1s; } @-webkit-keyframes bugfix { from {padding:0;} to {padding:0;}
}
input[type=checkbox] { display: none;
}
/* styling */
h1 { position:fixed; z-index:-1; top:.25em; left:8em; font-size:1.3em; width:14em; color:#666;
}
.can { display: inline-block; position: relative; height: 195px; width: 150px; margin: 25px; background: red;
}
.can:before { content: ""; position: absolute; left: 50%; margin-left: -25px; top: 52%; margin-top: -25px; height: 50px; width: 50px; border-radius: 100%; background-color: #FFD700; z-index: 5;
}
.can:after { top: -5px; content: ""; width: 100%; height: 10px; position: absolute; border-radius: 100%; background-color: #808080; z-index: 10;
}
.lower { width: 100%; height: 100px; position: absolute; top: 95px; background-color: #fffee4; z-index: 2;
}
.lower:before { width: 100%; height: 10px; position: absolute; border-radius: 100%; background-color: #F00; top: -5px; z-index: 0; content: "";
}
.lower:after { content: ""; width: 100%; height: 10px; position: absolute; border-radius: 100%; background-color: #FFFEE4; top: 95px; z-index: -2;
}
.score{ position: fixed; bottom: 0; left: 75%; color: #fff;
}
/*--------------checked---------*/
input:checked + label { -webkit-animation-duration: .5s; -moz-animation-duration: .5s; -o-animation-duration: .5s; animation-duration: .5s; -webkit-animation-fill-mode: both; -moz-animation-fill-mode: both; -o-animation-fill-mode: both; animation-fill-mode: both; -webkit-animation-name: hit; -moz-animation-name: hit;
}
input:checked + label { counter-increment: bang;
}
input:checked ~ .score:after { content: counter(bang);
}
/********ANIMATION STYLES*********/
@-webkit-keyframes hit { 0% {-webkit-transform: scale(1); opacity: 1;} 10% {-webkit-transform: scale(0.9) rotate(72deg); opacity: 1;} 20% {-webkit-transform: scale(0.8) rotate(144deg); opacity: 1;} 30% {-webkit-transform: scale(0.7) rotate(216deg); opacity: 1;} 40% {-webkit-transform: scale(0.6) rotate(288deg); opacity: 1;} 50% {-webkit-transform: scale(0.5) rotate(360deg); opacity: 1;} 60% {-webkit-transform: scale(0.4) rotate(432deg); opacity: 1;} 70% {-webkit-transform: scale(0.3) rotate(504deg); opacity: 0.75;} 80% {-webkit-transform: scale(0.2) rotate(576deg); opacity: 0.5;} 90% {-webkit-transform: scale(0.1) rotate(648deg); opacity: 0.25;} 100% {-webkit-transform: scale(0) rotate(720deg); opacity: 0; display: none;}
}
@-moz-keyframes hit { 0% {-moz-transform: scale(1); opacity: 1;} 10% {-moz-transform: scale(0.9) rotate(72deg); opacity: 1;} 20% {-moz-transform: scale(0.8) rotate(144deg); opacity: 1;} 30% {-moz-transform: scale(0.7) rotate(216deg); opacity: 1;} 40% {-moz-transform: scale(0.6) rotate(288deg); opacity: 1;} 50% {-moz-transform: scale(0.5) rotate(360deg); opacity: 1;} 60% {-moz-transform: scale(0.4) rotate(432deg); opacity: 1;} 70% {-moz-transform: scale(0.3) rotate(504deg); opacity: 0.75;} 80% {-moz-transform: scale(0.2) rotate(576deg); opacity: 0.5;} 90% {-moz-transform: scale(0.1) rotate(648deg); opacity: 0.25;} 100% {-moz-transform: scale(0) rotate(720deg); opacity: 0; display: none;}
}
@-o-keyframes hit { 0% {-o-transform: scale(1); opacity: 1;} 10% {-o-transform: scale(0.9) rotate(72deg); opacity: 1;} 20% {-o-transform: scale(0.8) rotate(144deg); opacity: 1;} 30% {-o-transform: scale(0.7) rotate(216deg); opacity: 1;} 40% {-o-transform: scale(0.6) rotate(288deg); opacity: 1;} 50% {-o-transform: scale(0.5) rotate(360deg); opacity: 1;} 60% {-o-transform: scale(0.4) rotate(432deg); opacity: 1;} 70% {-o-transform: scale(0.3) rotate(504deg); opacity: 0.75;} 80% {-o-transform: scale(0.2) rotate(576deg); opacity: 0.5;} 90% {-o-transform: scale(0.1) rotate(648deg); opacity: 0.25;} 100% {-o-transform: scale(0) rotate(720deg); opacity: 0; display: none;}
}
Pure CSS shooting gallery (WIP) - Script Codes
Pure CSS shooting gallery (WIP) - Script Codes
Home Page Home
Developer Eli Fitch
Username elifitch
Uploaded October 28, 2022
Rating 3
Size 2,588 Kb
Views 22,264
Do you need developer help for Pure CSS shooting gallery (WIP)?

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!

Eli Fitch (elifitch) Script Codes
Create amazing web content with AI!

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!