nedfire

SVG patternlock

Apr 17th, 2019
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.95 KB | None | 0 0
  1. <!doctype html>
  2. <html>
  3. <head>
  4. <meta charset="utf-8">
  5. <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  6. <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
  7. <title>SVG Based Pattern Lock Example</title>
  8. <link href="https://www.jqueryscript.net/css/jquerysctipttop.css" rel="stylesheet" type="text/css">
  9. <style media="screen">
  10. * {
  11. box-sizing: border-box;
  12. }
  13.  
  14. html,
  15. body {
  16. padding: 0;
  17. margin: 0;
  18. height: 100vh;
  19. max-height: 100vh;
  20. overflow: hidden;
  21. }
  22.  
  23. body {
  24. font-family: 'Varela Round', sans-serif;
  25. background-color: #fafafa;
  26. }
  27.  
  28. .container {
  29. margin: 150px auto;
  30. height: 100%;
  31. }
  32.  
  33. h1 {
  34. text-align: center;
  35. margin: 0;
  36. height: 15vh;
  37. line-height: 15vh;
  38. text-align: center;
  39. font-size: 6vh;
  40.  
  41. }
  42.  
  43. #lock {
  44. width: 100%;
  45. height: calc(100% - 15vh);
  46. padding-bottom: 12vh;
  47. min-height: 120px;
  48. }
  49.  
  50. .stars {
  51. margin: auto;
  52. display: block;
  53. }
  54. </style>
  55.  
  56. <link rel="stylesheet" href="styles.css">
  57.  
  58. <link href="https://fonts.googleapis.com/css?family=Varela+Round" rel="stylesheet">
  59. </head>
  60.  
  61. <body>
  62. <div id="jquery-script-menu">
  63. <div class="jquery-script-center">
  64. <ul>
  65. <!-- <li><a href="https://www.jqueryscript.net/other/SVG-Pattern-Lock.html">Download This Plugin</a></li> -->
  66. <!--<li><a href="https://www.jqueryscript.net/">Back To jQueryScript.Net</a></li>-->
  67. </ul>
  68. <div class="jquery-script-ads"><script type="text/javascript"><!--
  69. google_ad_client = "ca-pub-2783044520727903";
  70. /* jQuery_demo */
  71. google_ad_slot = "2780937993";
  72. google_ad_width = 728;
  73. google_ad_height = 90;
  74. //-->
  75. </script>
  76. <script type="text/javascript"
  77. src="https://pagead2.googlesyndication.com/pagead/show_ads.js">
  78. </script></div>
  79. <div class="jquery-script-clear"></div>
  80. </div>
  81. </div>
  82.  
  83. <div class="container">
  84. <h1>SVG Based Pattern Lock Example</h1>
  85. <svg class="patternlock" id="lock" viewBox="0 0 100 100" xmlns="http://www.w3.org/2000/svg">
  86. <g class="lock-actives"></g>
  87. <g class="lock-lines"></g>
  88. <g class="lock-dots">
  89. <circle cx="20" cy="20" r="2"/>
  90. <circle cx="50" cy="20" r="2"/>
  91. <circle cx="80" cy="20" r="2"/>
  92.  
  93. <circle cx="20" cy="50" r="2"/>
  94. <circle cx="50" cy="50" r="2"/>
  95. <circle cx="80" cy="50" r="2"/>
  96.  
  97. <circle cx="20" cy="80" r="2"/>
  98. <circle cx="50" cy="80" r="2"/>
  99. <circle cx="80" cy="80" r="2"/>
  100. </g>
  101. <svg>
  102.  
  103. </div>
  104.  
  105. <script src="https://code.jquery.com/jquery-3.3.1.slim.min.js" integrity="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo" crossorigin="anonymous"></script>
  106.  
  107. <script src="patternlock.js"></script>
  108.  
  109. <script type="text/javascript">
  110. var e = document.getElementById('lock')
  111. var number=document.getElementById('lock').value;
  112.  
  113. var p = new PatternLock(e, {
  114. onPattern: function() {
  115. this.success()
  116. alert(number);
  117. }
  118. }
  119. )
  120.  
  121.  
  122.  
  123. </script>
  124. </body>
  125. <script type="text/javascript">
  126.  
  127. var _gaq = _gaq || [];
  128. _gaq.push(['_setAccount', 'UA-36251023-1']);
  129. _gaq.push(['_setDomainName', 'jqueryscript.net']);
  130. _gaq.push(['_trackPageview']);
  131.  
  132. (function() {
  133. var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
  134. ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
  135. var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
  136. })();
  137.  
  138. </script>
  139.  
  140. </html>
Add Comment
Please, Sign In to add comment