animation
This commit is contained in:
parent
97c8f22bbb
commit
3285348787
129 changed files with 732 additions and 693 deletions
|
@ -0,0 +1,16 @@
|
|||
<!doctype html>
|
||||
<html>
|
||||
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<link rel="stylesheet" href="style.css">
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
Click below to animate:
|
||||
<div id="digit"><div id="stripe">0123456789</div></div>
|
||||
|
||||
<script src="script.js"></script>
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,5 @@
|
|||
stripe.onclick = function() {
|
||||
let sec = new Date().getSeconds() % 10;
|
||||
stripe.style.transitionDelay = '-' + sec + 's';
|
||||
stripe.classList.add('animate');
|
||||
};
|
|
@ -0,0 +1,17 @@
|
|||
#digit {
|
||||
width: .5em;
|
||||
overflow: hidden;
|
||||
font: 32px monospace;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
#stripe {
|
||||
display: inline-block
|
||||
}
|
||||
|
||||
#stripe.animate {
|
||||
transform: translate(-90%);
|
||||
transition-property: transform;
|
||||
transition-duration: 9s;
|
||||
transition-timing-function: linear;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue