Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <head>
- <title>Analog Clock</title>
- <script type="text/javascript" src="script.js"></script>
- <link type="text/css" rel="stylesheet" href="style.css">
- </head>
- <svg width="140" height="140">
- <circle id="clock-face" cx="70" cy="70" r="65" />
- <line id="h-hand" x1="70" y1="70" x2="70" y2="38" />
- <line id="m-hand" x1="70" y1="70" x2="70" y2="20" />
- <line id="s-hand" x1="70" y1="70" x2="70" y2="12" />
- <line id="s-tail" x1="70" y1="70" x2="70" y2="56" />
- <text x="62" y="18">12</text>
- <text x="126" y="76">3</text>
- <text x="66" y="130">6</text>
- <text x="7" y="76">9</text>
- </svg>
- function setAttr(id, value) {
- var v = 'rotate(' + val + ',200,200);';
- document.getElementById(id).setAttribute('transform', v);
- };
- setAttr('s-hand', 30);
- <script src="clockwork.js"></script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement