run.html 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. <html>
  2. <head>
  3. <title>DWatch</title>
  4. <style type="text/css">
  5. body {
  6. background-color: #000;
  7. color: #fff;
  8. }
  9. #canvas{
  10. /* center on page */
  11. position: absolute;
  12. top:0; left:0; bottom:0; right:0;
  13. margin: auto;
  14. }
  15. @font-face{
  16. font-family: 'digital-font';
  17. src: url('font.ttf');
  18. }
  19. #displayText{
  20. font: 28px digital-font;
  21. }
  22. /* disable text selection */
  23. svg text {
  24. cursor: default;
  25. -webkit-user-select: none;
  26. -moz-user-select: none;
  27. -ms-user-select: none;
  28. user-select: none;
  29. }
  30. </style>
  31. </head>
  32. <body>
  33. <svg version="1.1"
  34. baseProfile="full"
  35. width="222" height="236"
  36. xmlns="http://www.w3.org/2000/svg"
  37. id="canvas">
  38. <image width="222" height="236" xlink:href="watch.gif"/>
  39. <rect id="display" x="51" y="95" width="120" height="55" rx="2" fill="#DCDCDC">
  40. </rect>
  41. <text id="displayText" x="111" y="126" dominant-baseline="middle" text-anchor="middle">12:00:00</text>
  42. <rect id="topLeft" x="3" y="62", width="10", height="10" fill="#fff" fill-opacity="0.2" />
  43. <rect id="topRight" x="209" y="60", width="10", height="10" fill="#fff" fill-opacity="0.2" />
  44. <rect id="bottomLeft" x="2" y="161", width="10", height="10" fill="#fff" fill-opacity="0.2" />
  45. <rect id="bottomRight" x="211" y="161", width="10", height="10" fill="#fff" fill-opacity="0.2" />
  46. <image id="note" x="54" y="96" xlink:href="noteSmall.gif"/>
  47. </svg>
  48. <p id="log">
  49. </p>
  50. <script type="text/javascript">
  51. function log(msg) {
  52. // document.getElementById("log").innerText += msg + '\n';
  53. }
  54. ["topLeft", "topRight", "bottomLeft", "bottomRight"].forEach(button => {
  55. document.getElementById(button).onmousedown = () => log(button + " pressed");
  56. document.getElementById(button).onmouseup = () => log(button + " released");
  57. })
  58. </script>
  59. </body>
  60. </html>