Spin button
How do I make an spin button?
Circular button with spinning border for hover indication. What is a spin button? How do you make a spin button? This script and codes were developed by Ross B on 23 November 2022, Wednesday.
Spin button - Script Codes HTML Codes
<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>Spin button</title> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/normalize/5.0.0/normalize.min.css"> <style> /* NOTE: The styles were added inline because Prefixfree needs access to your styles and they must be inlined if they are on local disk! */ *, *:after, *:before { box-sizing: border-box;
}
body { display: -webkit-box; display: -moz-box; display: box; display: -webkit-flex; display: -moz-flex; display: -ms-flexbox; display: flex; -webkit-align-content: center; -moz-align-content: center; align-content: center; -ms-flex-line-pack: center; color: #353535; min-height: 100vh; font-family: 'Open Sans', sans-serif; font-size: 14px; text-align: center; background-color: lightgreen;
}
.container { padding: 60px 80px; background-color: white; box-shadow: 0 0 4px 1px #BBB; margin: auto; text-align: center;
}
.wrap { position: relative; width: 80px; height: 80px; margin: 20px auto 30px auto;
}
.wrap:last-child { margin-bottom: 0;
}
.clicker { background-color: white; outline: none; font-weight: 600; position: absolute; cursor: pointer; padding: 0; border: none; height: 64px; width: 64px; left: 8px; top: 8px; border-radius: 100px; z-index: 2;
}
.clicker:active { transform: translate(0, 1px); height: 63px; box-shadow: 0px 1px 0 0 #bebebe inset;
}
.circle { position: relative; border-radius: 40px; width: 80px; height: 80px; z-index: 1;
}
.circle.third { border-radius: 0;
}
.clicker.faster:hover + .circle, .clicker.faster:active + .circle { animation: rotator linear .4s infinite;
}
.clicker.fast:hover + .circle, .clicker.fast:active + .circle { animation: rotator linear .5s infinite;
}
.clicker:hover + .circle, .clicker:active + .circle { animation: rotator linear .8s infinite;
}
@keyframes rotator { from { transform: rotate(0deg); } to { transform: rotate(360deg); }
}
.angled { background-image: linear-gradient(45deg, white 0%, white 30%, #14beeb 30%, #14beeb 70%, white 70%, white 100%);
}
.angled.second { background-image: linear-gradient(white 0%, white 30%, #faa078 30%, #faa078 70%, white 70%, white 100%);
}
.angled.third { background-image: linear-gradient(45deg, white 0%, white 30%, #82e687 30%, #82e687 70%, white 70%, white 100%);
} </style> <script src="https://cdnjs.cloudflare.com/ajax/libs/prefixfree/1.0.7/prefixfree.min.js"></script>
</head>
<body> <link href='https://fonts.googleapis.com/css?family=Open+Sans:600,700' rel='stylesheet' type='text/css'> <div class="container">
Medium, border-radius, 45deg background
<div class="wrap"> <button class="clicker">press</button> <div class="circle angled"></div> </div>
Fast, border-radius, vertical background <div class="wrap"> <button class="clicker fast">press</button> <div class="circle angled second"></div> </div>
Faster, no border-radius, 45 deg background
<div class="wrap"> <button class="clicker faster">press</button> <div class="circle angled third"></div> </div>
</div>
</body>
</html>
Spin button - Script Codes CSS Codes
*, *:after, *:before { box-sizing: border-box;
}
body { display: -webkit-box; display: -moz-box; display: box; display: -webkit-flex; display: -moz-flex; display: -ms-flexbox; display: flex; -webkit-align-content: center; -moz-align-content: center; align-content: center; -ms-flex-line-pack: center; color: #353535; min-height: 100vh; font-family: 'Open Sans', sans-serif; font-size: 14px; text-align: center; background-color: lightgreen;
}
.container { padding: 60px 80px; background-color: white; box-shadow: 0 0 4px 1px #BBB; margin: auto; text-align: center;
}
.wrap { position: relative; width: 80px; height: 80px; margin: 20px auto 30px auto;
}
.wrap:last-child { margin-bottom: 0;
}
.clicker { background-color: white; outline: none; font-weight: 600; position: absolute; cursor: pointer; padding: 0; border: none; height: 64px; width: 64px; left: 8px; top: 8px; border-radius: 100px; z-index: 2;
}
.clicker:active { transform: translate(0, 1px); height: 63px; box-shadow: 0px 1px 0 0 #bebebe inset;
}
.circle { position: relative; border-radius: 40px; width: 80px; height: 80px; z-index: 1;
}
.circle.third { border-radius: 0;
}
.clicker.faster:hover + .circle, .clicker.faster:active + .circle { animation: rotator linear .4s infinite;
}
.clicker.fast:hover + .circle, .clicker.fast:active + .circle { animation: rotator linear .5s infinite;
}
.clicker:hover + .circle, .clicker:active + .circle { animation: rotator linear .8s infinite;
}
@keyframes rotator { from { transform: rotate(0deg); } to { transform: rotate(360deg); }
}
.angled { background-image: linear-gradient(45deg, white 0%, white 30%, #14beeb 30%, #14beeb 70%, white 70%, white 100%);
}
.angled.second { background-image: linear-gradient(white 0%, white 30%, #faa078 30%, #faa078 70%, white 70%, white 100%);
}
.angled.third { background-image: linear-gradient(45deg, white 0%, white 30%, #82e687 30%, #82e687 70%, white 70%, white 100%);
}
Developer | Ross B |
Username | rocbear |
Uploaded | November 23, 2022 |
Rating | 4.5 |
Size | 3,935 Kb |
Views | 18,216 |
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 |
Responsive grid based FLIP.js demo | 3,883 Kb |
Loading animation - freedom purchase | 2,567 Kb |
UFO | 2,608 Kb |
Torus light track | 4,909 Kb |
Spear checkboxes | 3,682 Kb |
Hovergram | 2,505 Kb |
Plane vertex manipulation experiment | 4,363 Kb |
Context menu experiment | 5,059 Kb |
Unfolding circular menu | 7,466 Kb |
Full page scroll-over with ScrollMagic | 2,752 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 |
Promodoro | Bencarp | 1,712 Kb |
Email Marketing Mock | Kristenzirkler | 8,224 Kb |
Hoi hoi | JohnTheCat | 7,248 Kb |
Modal Dialog | Gigaleet | 2,251 Kb |
Automatic scroll | Skeurentjes | 4,042 Kb |
Cant get enough icecream in pure css3 | Melawire | 4,322 Kb |
Image grid with captions | Mchernin34 | 2,222 Kb |
Pure CSS Torch Light | Juliendargelos | 2,727 Kb |
Drill-down Map | Good886 | 8,484 Kb |
Collapsing Widget | Er40 | 4,279 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!