CSS3 transform timer. animated
https://dribbble.com/shots/1890182-numeral-morph
Refresh Output <- onload
.warp
.warp
span.num(style="animation-play-state:paused;-webkit-animation-play-state:paused", data-num="5") 5
@import url(http://fonts.googleapis.com/css?family=Oswald:400,700,300)
@import url(http://fonts.googleapis.com/css?family=Oswald:400,700,300)
body
html
height 100%
width 100%
overflow hidden
background #5A37BC
.warp
display flex
height 100%
transform-style preserve-3d
perspective 500px
.num
margin auto
font bold 20em 'Oswald', sans-serif
text-align center
color white
position relative
z-index 3
animation rotate 1s ease-in-out infinite
&:after,
&:before
content: attr(data-num);
position absolute
left 0
top 0
animation ABrotate 1s ease-in-out .7s infinite
&:after
color #fff700
z-index -2
&:before
color #d601ee
z-index -1
animation-delay .6s
text-shadow -10px -3px #4C31A5
@keyframes ABrotate
0%
transform rotate(0)
50%
transform rotate(30deg)
100%
transform rotate(0)
@keyframes rotate
100%
transform rotate3d(0, -1, -1, 360deg)
counter = 6;
counter = 6;
cached = document.querySelector '.num'
setTimeout ->
cached.style.animationPlayState = "running"
cached.style.WebkitAnimationPlayState = "running"
,500
setInterval ->
cached.innerHTML = counter
cached.dataset.num = counter
counter+=1
,1000