-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathindex.html
39 lines (39 loc) · 1.63 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
<!DOCTYPE html>
<html lang="en">
<head>
<title>Beating Heart</title>
<link rel="icon" href="favicon.ico">
<link rel="stylesheet" href="style.css">
<script src="script.js"></script>
</head>
<body>
<svg id="ecg" viewbox="0 0 100 60">
<path id="path" d="M 0,30 H 100" stroke="lightgreen" stroke-width=.5 stroke-dasharray="80,20">
<animate attributeName="stroke-dashoffset" values="180;80" dur=5 repeatCount="indefinite" />
</path>
<circle r="2" fill="lime" filter="url(#glow)">
<animateMotion dur=5 repeatCount="indefinite">
<mpath href="#path" />
</animateMotion>
</circle>
</svg>
<figure>
<svg id="heart" viewbox="0 0 30 30">
<filter id="glow">
<feGaussianBlur in="SourceGraphic" stdDeviation=.5 />
</filter>
<path id="heartsvg">
<animate attributeName="d" values="
M 6,12 A 1,1 0,0,1 15,9 1,1 0,0,1 24,12 C 23,16 18,18 15,23 12,18 7,16 6,12 z;
M 5,12 A 1,1 0,0,1 15,9 1,1 0,0,1 25,12 C 23,16 20,18 15,23 10,18 6,16 5,12 z;
M 6,12 A 1,1 0,0,1 15,9 1,1 0,0,1 24,12 C 23,16 18,18 15,23 12,18 7,16 6,12 z"
dur=0.75 repeatCount="indefinite" calcMode="spline" keyTimes="0; .7; 1" keySplines="0 0 0 .4;0 0 0 .4" />
<animate attributeName="fill" values="firebrick;crimson;firebrick" dur=0.75 repeatCount="indefinite" calcMode="spline" keyTimes="0; .7; 1" keySplines="0 0 0 .4;0 0 0 .4" />
<animate attributeName="stroke" values="darkred;firebrick;darkred" dur=0.75 repeatCount="indefinite" calcMode="spline" keyTimes="0; .7; 1" keySplines="0 0 0 .4;0 0 0 .4" />
</path>
</svg>
<input id="slider" type="range" min="50" max="110" />
<figcaption id="bpm">80</figcaption>
</figure>
</body>
</html>