react-touch
Version:
React wrapper components that make touch events easy
70 lines (68 loc) • 2.15 kB
HTML
<html lang="en">
<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no">
<meta charset="UTF-8">
<title>Smartphone Dashboard</title>
<script async defer src="./build.js"></script>
<style type="text/css">
body { margin: 0; }
.dashboard {
border: 10px solid black;
border-radius: 30px;
position: relative;
overflow: hidden;
box-sizing: border-box;
-webkit-user-select: none;
}
.instructions {
position: absolute;
font-family: Helvetica, sans-serif;
font-size: 18px;
bottom: 0;
right: 10px;
z-index: -1;
}
.page-wrapper {
position: absolute;
width: 100%;
height: 100%;
}
.page {
width: 100%;
height: 100%;
}
.icon {
width: 90px;
height: 90px;
border-radius: 5px;
position: absolute;
}
.icon.shake {
animation-name: shake;
animation-duration: 0.8s;
animation-iteration-count: infinite;
animation-timing-function: linear;
}
.icon.shake:nth-of-type(n) { animation-delay: -0.25s }
.icon.shake:nth-of-type(2n) { animation-delay: -0.5s }
.icon.shake:nth-of-type(3n) { animation-delay: -0.75s }
@keyframes shake {
0% { transform: translate(2px, 1px) rotate(0deg); }
10% { transform: translate(-1px, -2px) rotate(-2deg); }
20% { transform: translate(-3px, 0px) rotate(2deg); }
30% { transform: translate(0px, 2px) rotate(0deg); }
40% { transform: translate(1px, -1px) rotate(2deg); }
50% { transform: translate(-1px, 2px) rotate(-2deg); }
60% { transform: translate(-3px, 1px) rotate(0deg); }
70% { transform: translate(2px, 1px) rotate(-2deg); }
80% { transform: translate(-1px, 1px) rotate(2deg); }
90% { transform: translate(2px, 2px) rotate(0deg); }
100% { transform: translate(1px, -2px) rotate(-2deg); }
}
</style>
</head>
<body>
<div id="content"></div>
</body>
</html>