1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63
| <!doctype html>
<html lang="fr">
<head>
<meta charset="UTF-8" />
<title>Flip horizontal/vertical</title>
<meta name="Author" content="NoSmoking">
<style>
html, body{
margin:0;
padding:0;
font-size:100%;
font: 1em/1.5 Verdana, sans-serif;
}
h1, h2, h3 {
color:#069;
}
main {
max-width:60em;
margin: auto;
display:block;
}
.slidecaption {
width:13em;
padding:1em;
margin:auto 2em;;
text-align:center;
animation-name: spinner;
animation-timing-function: linear;
animation-iteration-count: infinite;
animation-fill-mode: forwards;
animation-duration: 8s;
transform-style: preserve-3d;
cursor:pointer;
box-shadow: 0 0 2px #888;
background:#fafafa;
}
.slidecaption:hover {
animation-play-state: paused;
}
@keyframes spinner {
0% { transform: perspective(400px) rotateY(0deg) rotateX(0deg);} /* position de départ */
25% { transform: perspective(400px) rotateY(-180deg) rotateX(0deg);} /* flip horizontal */
50% { transform: perspective(400px) rotateY(-180deg) rotateX(-180deg);} /* flip vertical */
75% { transform: perspective(400px) rotateY(0deg) rotateX(-180deg);} /* re-flip horizontal */
100% { transform: perspective(400px) rotateY(0deg) rotateX(0deg);} /* re-flip horizontal */
}
</style>
</head>
<body>
<main>
<h1>Flip horizontal/vertical</h1>
<h2>Démo</h2>
<div class="slidecaption">
<img src="http://pouemes.free.fr/poemes-amour/abe.gif">
</div>
<h2>Ressources</h2>
<ul>
<li><a href="http://www.w3.org/TR/css-transforms-1/">CSS Transforms Module Level 1</a></li>
<li><a href="http://www.w3.org/TR/css3-animations/">CSS Animations</a></li>
</ul>
</main>
</body>
</html> |
Partager