index.html 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <title>Hard Drive Unlocking</title>
  5. <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
  6. <style>
  7. body {
  8. text-align: center;
  9. font-family: sans;
  10. background-color: #d5a6d9;
  11. padding-top: 15px;
  12. }
  13. fieldset {
  14. margin: 10px auto 30px;
  15. padding: 30px;
  16. width: 50%;
  17. background-color: #fff;
  18. border: 0;
  19. border-radius: 15px;
  20. }
  21. legend {
  22. background-color: #fff;
  23. padding: 5px 17px;
  24. font-weight: bold;
  25. border-radius: 5px;
  26. text-shadow: 1px 1px rgba(0,0,0,.3);
  27. font-variant: small-caps;
  28. }
  29. input {
  30. border: 1px solid #6f1465;
  31. padding: 5px;
  32. font-size: 1em;
  33. color: #c70fb3;
  34. text-align: center;
  35. background-color: #fcf2fb;
  36. border-radius: 5px;
  37. }
  38. input[type=submit] {
  39. padding: 10px 20px;
  40. font-weight: bold;
  41. background-color: #fff;
  42. border-width: 0;
  43. font-size: 20px;
  44. }
  45. input[type=submit]:hover {
  46. background-color: #6f1465;
  47. color: #fff;
  48. cursor: pointer;
  49. }
  50. #error {
  51. display: none;
  52. /* TPL:ERROR
  53. display: block;
  54. TPL:ERROR */
  55. color: #ca0000;
  56. font-weight: bold;
  57. }
  58. label span {
  59. cursor: pointer;
  60. }
  61. #loader {
  62. display: none;
  63. width: 400px;
  64. height: 20px;
  65. background-color: #9f7ca2;
  66. border-radius: 5px;
  67. margin: 0 auto;
  68. }
  69. #loader div {
  70. height: 20px;
  71. background-color: #9f7ca2;
  72. animation: bgdisco .5s ease infinite;
  73. border-radius: 5px;
  74. }
  75. #main {
  76. /* TPL:UNLOCKED
  77. display: none;
  78. TPL:UNLOCKED */
  79. }
  80. #unlocked {
  81. display: none; /* TPL:UNLOCKED */
  82. font-size: 6em;
  83. font-weight: bold;
  84. }
  85. #unlocked img {
  86. display: block;
  87. margin: .6em auto;
  88. }
  89. .no-js {
  90. display: none;
  91. }
  92. .beautiful {
  93. animation: disco .5s ease infinite;
  94. }
  95. @keyframes disco {
  96. 6% {
  97. color: #f00000;
  98. }
  99. 22% {
  100. color: #ff9b00;
  101. }
  102. 38% {
  103. color: #f4ff4d;
  104. }
  105. 54% {
  106. color: #62ff9b;
  107. }
  108. 86% {
  109. color: #2efff2;
  110. }
  111. 90% {
  112. color: #1b50e4;
  113. }
  114. }
  115. @keyframes bgdisco {
  116. 6% {
  117. background-color: #f00000;
  118. }
  119. 22% {
  120. background-color: #ff9b00;
  121. }
  122. 38% {
  123. background-color: #f4ff4d;
  124. }
  125. 54% {
  126. background-color: #62ff9b;
  127. }
  128. 86% {
  129. background-color: #2efff2;
  130. }
  131. 90% {
  132. background-color: #1b50e4;
  133. }
  134. }
  135. #maintop {
  136. display: none;
  137. }
  138. </style>
  139. <script>
  140. function showPassword(chk) {
  141. var pwd = document.getElementById('passphrase');
  142. pwd.type = chk.checked ? 'text' : 'password';
  143. }
  144. function focusText() {
  145. var pwd = document.getElementById('passphrase');
  146. pwd.focus();
  147. }
  148. function progressLoader() {
  149. var pc = parseInt(document.getElementById('progress').style.width.replace('%', '')) + 5;
  150. document.getElementById('progress').style.width = pc + "%";
  151. if(pc < 100) {
  152. setTimeout(progressLoader, 1000);
  153. }
  154. }
  155. function showLoader() {
  156. document.getElementById('itsgone').play();
  157. document.getElementById('unlock').style.display = 'none';
  158. document.getElementById('loader').style.display = 'block';
  159. setTimeout(progressLoader, 1000);
  160. }
  161. function hideLoader() {
  162. document.getElementById('unlock').style.display = 'inline';
  163. document.getElementById('loader').style.display = 'none';
  164. }
  165. function unlocked() {
  166. document.getElementById('itworks').play();
  167. document.getElementById('main').style.display = 'none';
  168. document.getElementById('unlocked').style.display = 'block';
  169. }
  170. function failed() {
  171. document.getElementById('doesnwork').play();
  172. document.getElementById('error').style.display = 'block';
  173. document.getElementById('mainimg').src = document.getElementById('mainimg').src.replace('caticorn', 'caticorn_failed');
  174. }
  175. function submitForm() {
  176. showLoader();
  177. var xmlHttp = new XMLHttpRequest();
  178. xmlHttp.open('POST', document.getElementById('form').action, true);
  179. xmlHttp.onreadystatechange = function() {
  180. if(xmlHttp.readyState == 4) {
  181. if(xmlHttp.responseText.match(/TPL:UNLOCKED/)) {
  182. hideLoader();
  183. failed();
  184. } else {
  185. unlocked();
  186. }
  187. }
  188. }
  189. xmlHttp.send('passphrase=' + document.getElementById('passphrase').value);
  190. return false;
  191. }
  192. function onLoadHandler() {
  193. focusText();
  194. var nojs = document.getElementsByClassName('no-js');
  195. for(var i = 0; i < nojs.length; i++) {
  196. nojs[i].className = nojs[i].className.replace('no-js', '');
  197. }
  198. }
  199. </script>
  200. </head>
  201. <body onload="onLoadHandler()">
  202. <div id="main">
  203. <img src="/img/caticorn.png" id="mainimg" alt="Beautiful Unicorn" />
  204. <form method="post" id="form" action="/cgi-bin/post.sh" onsubmit="return submitForm()">
  205. <fieldset>
  206. <legend>Hard Drive Locked</legend>
  207. <p id="error">
  208. Wrong passphrase. Try again?
  209. </p>
  210. <p>
  211. <label for="passphrase">
  212. Enter your passphrase to unlock the hard drive:
  213. </label>
  214. </p>
  215. <input type="password" name="passphrase" id="passphrase" />
  216. <p class="no-js">
  217. <label>
  218. <input type="checkbox" onclick="showPassword(this)" />
  219. <span>Show passphrase</span>
  220. </label>
  221. </p>
  222. </fieldset>
  223. <input type="submit" id="unlock" value="Unlock" />
  224. <div id="loader">
  225. <div id="progress" style="width: 0%"> </div>
  226. </div>
  227. </form>
  228. </div>
  229. <div id="unlocked" class="beautiful">
  230. <img src="/img/caticorn_success.png" alt="Unlocked" />
  231. Unlocked!
  232. </div>
  233. <audio id="itsgone" preload><source src="img/itsgone.ogg" type="audio/ogg"></audio>
  234. <audio id="itworks" preload><source src="img/itworks.ogg" type="audio/ogg"></audio>
  235. <audio id="doesnwork" preload><source src="img/doesntwork.ogg" type="audio/ogg"></audio>
  236. </body>
  237. </html>