forked from jtmkrueger/pulse
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
95 lines (87 loc) · 2.86 KB
/
index.html
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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Pulse</title>
<link rel="stylesheet" type="text/css" href="/css/reset.css" />
<link rel="stylesheet" type="text/css" href="pulse.css" />
<link rel="stylesheet" type="text/css" href="jquery.snippet.min.css" />
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"></script>
<script type="text/javascript" src="jquery.snippet.min.js"></script>
<script type="text/javascript">
$(document).ready(function(){
$("pre.html").snippet("html",{style:"bipolar", showNum:false, transparent:true});
$("pre.css").snippet("css",{style:"bipolar",showNum:false, transparent:true});
$("a#target").click(function() {
alert('Target acquired.')
});
});
</script>
</head>
<body>
<header>
<h1>Pulse</h1>
<div id="share">
<a href="https://twitter.com/share" class="twitter-share-button" data-text="Pulse — A simple pulsating indicator. #css" data-count="horizontal" data-via="mmhd">Tweet</a><script type="text/javascript" src="//platform.twitter.com/widgets.js"></script>
<a href="https://twitter.com/mmhd" class="twitter-follow-button" data-width="110px" data-show-count="false">Follow @mmhd</a>
<script src="//platform.twitter.com/widgets.js" type="text/javascript"></script>
</div>
</header>
<div id="content">
<a href="#" id="target" title="Target">
<img src="spot.png" alt="" class="indicator" />
<span id="pulse"></span>
</a>
</div>
<section class="snippet">
<h2>Notes</h2>
<ul>
<li>This is just a CSS experiment. I'm sure smart people like you can create fallbacks and make it cross-browser compliant.</li>
<li>You can replace the one image being used with CSS, but I chose an image just because it was easy to swap out and a little less markup.</li>
<li>It only works in -webkit- browsers at the moment.</li>
</ul>
</section>
<section class="snippet">
<h2>The HTML</h2>
<pre class="html">
<a href="#" id="target" title="Target">
<img src="spot.png" alt="" class="indicator" />
<span id="pulse"></span>
</a></pre>
</section>
<section class="snippet">
<h2>The CSS</h2>
<pre class="css">
a#target {
width: 30px;
height: 30px;
display: block;
margin: 0 auto;
position: relative;
}
a#target #pulse {
width: 30px;
height: 30px;
display: block;
position: absolute;
top: -2px;
left: -2px;
border: 2px solid #30a3ec;
border-radius: 50px;
box-shadow: 0 0 5px #a0eaff;
/* Animate */.
-webkit-animation-name: pulse;
-webkit-animation-duration: 1s;
-webkit-animation-iteration-count: infinite;
-webkit-animation-timing-function: ease-out;
}
/* The animation */
@-webkit-keyframes pulse {
0% { -webkit-transform: scale(0.3); opacity: 0.5; }
80% { -webkit-transform: scale(1.5); opacity: 0; }
100% { -webkit-transform: scale(2.5); opacity: 0; }
}
</section>
</body>
</html>