Quick and easy CSS3 rolling-number/slot machine?
dabblet.css
Our new slot machine twitch alert has just hit the store, and I wanted to take a bit of time and explain how it was made and how to use it for your stream. This alert is only for Muxy, OBS Studio, and XSplit Broadcaster at the moment, but it we are planning to make versions for other software and services if we can. Find GIFs with the latest and newest hashtags! Search, discover and share your favorite Slot Machine GIFs. The best GIFs are on GIPHY. And that’s what this post is about, creating a simple CSS spinning loader animation similar to Twitter’s. Although Twitter’s is made from an SVG, it can also be created out of pure CSS using a simple CSS keyframe animation, with nothing but a single HTML element. Run a slot machine animation in an input field. Slot items are chosen randomly from a large list stored outside the DOM. Slot animation based on Matthew Lein's jQuery jSlots with a few modifications (shown in revisions). Built for MarketWatch's cost-of-living calculator. Alignment of the slot animation over the input will depend on the project.
/** |
* Quick and easy CSS3 rolling-number/slot machine? |
*/ |
body { |
font-size: 700%; /* with this setup you get 1:1 em , so 1em is actually number 1 */ |
} |
#counter { |
height: 1em; |
overflow: hidden; |
} |
.digits { |
float:left; |
list-style-type: none; |
font-size: 1em; |
line-height: 1em; |
} |
.digits-first { |
margin-top: -4em; /* number 4! */ |
} |
.digits-second { |
margin-top: 0em; /* number 0! */ |
} |
.digits-third { |
margin-top: -4em; /* number 4! */ |
} |
.digits { |
animation-duration: 2s; |
animation-timing-function: ease; |
animation-delay: 2.2s; |
animation-fill-mode: forwards; |
} |
.luckie { |
animation-name: luckie; |
} |
/* Animations */ |
@keyframes luckie { |
100% { |
margin-top: -7em; |
} |
} |
Slot Machine Text Animation Css
dabblet.html
<!-- content to be placed inside <body>…</body> --> |
<divid='counter' class='animated'> |
<ulclass='digits digits-first luckie'><li> 0 <li> 1 <li> 2 <li> 3 <li> 4 <li> 5 <li> 6 <li> 7 <li> 8 <li> 9 </ul> |
<ulclass='digits digits-second luckie'><li> 0 <li> 1 <li> 2 <li> 3 <li> 4 <li> 5 <li> 6 <li> 7 <li> 8 <li> 9 </ul> |
<ulclass='digits digits-third luckie'><li> 0 <li> 1 <li> 2 <li> 3 <li> 4 <li> 5 <li> 6 <li> 7 <li> 8 <li> 9 </ul> |
</div> |
Slot Machine Animation Css Tutorial
dabblet.js
settings.json
Slot Machine Animation Css W3schools
Slot Machine Animation Css Editor
{'view':'split','fontsize':'100','seethrough':'','prefixfree':'1','page':'all'} |
Slot Machine Animation Css
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment