-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathsample.css
More file actions
58 lines (48 loc) · 1.47 KB
/
sample.css
File metadata and controls
58 lines (48 loc) · 1.47 KB
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
<style type="text/css">
body { text-align: center;
}
p.pet-me {
background-color: black;
}
.pet-me {
color: white;
text-align: center;
font-family: 'Press Start 2P', cursive;
}
.annoying-dog {
width: 200px;
position: absolute;
top: 50%;
right: 50%;
margin: -65px -100px 0px 0px;
}
.annoying-dog:hover {
-webkit-animation-name: vibrate;
-webkit-animation-duration: 0.7s;
-webkit-animation-iteration-count: infinite;
-webkit-animation-timing-function: linear;
}
@keyframes vibrate {
0% { -webkit-transform: translate(2px, 1px) rotate(0deg); }
10% { -webkit-transform: translate(-1px, -2px) rotate(-1deg); }
20% { -webkit-transform: translate(-3px, 0px) rotate(1deg); }
30% { -webkit-transform: translate(0px, 2px) rotate(0deg); }
40% { -webkit-transform: translate(1px, -1px) rotate(1deg); }
50% { -webkit-transform: translate(-1px, 2px) rotate(-1deg); }
60% { -webkit-transform: translate(-3px, 1px) rotate(0deg); }
70% { -webkit-transform: translate(2px, 1px) rotate(-1deg); }
80% { -webkit-transform: translate(-1px, -1px) rotate(1deg); }
90% { -webkit-transform: translate(2px, 2px) rotate(0deg); }
100% { -webkit-transform: translate(1px, -2px) }
}
</style>
<script type="text/javascript">
var annoyingDog = $('.annoying-dog');
var annoyingDogAudio = $('body').find('audio')[0];
annoyingDog.hover(function(){
annoyingDogAudio.play();
$('.pet-me').hide();}, function(){
annoyingDogAudio.pause();
$('.pet-me').show();
});
</script>