NoNameCracksInc

Gay-o-meter

Oct 28th, 2014
507
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.94 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <html>
  3.  
  4. <body onLoad='' background='http://img2.findthebest.com/sites/default/files/2307/media/images/t2/Light_Sky_Blue_429603_i0.png'>
  5.  
  6. <div id='meter_container'>
  7.  
  8. <div id='stick'></div>
  9. <div id='onoff'>OFF</div>
  10.  
  11. <div id='scale' style=''>
  12.  
  13. <div id='one' class='scalee' style='left:0;background-color:#FFCCCC'></div>
  14.  
  15. <div id='two' class='scalee' style='left:100px;background-color:#FF9999'></div>
  16.  
  17. <div id='three' class='scalee' style='left:200px;background-color:#FF6666'></div>
  18.  
  19. <div id='four' class='scalee' style='left:300px;background-color:#FF3333'></div>
  20.  
  21. <div id='five' class='scalee' style='left:400px;background-color:#FF0000'></div>
  22.  
  23. </div>
  24.  
  25. <input type='text' id='name'>
  26.  
  27. </div>
  28.  
  29.  
  30. <img src='http://image.spreadshirt.com/image-server/v1/designs/10494533,width=178,height=178/I-Love-Gays.png' id='head' style=''>
  31.  
  32. <canvas id='graph' style='border:1px solid;background-color:yellow' width='400' height='180'></canvas>
  33.  
  34.  
  35. <style>
  36.  
  37. #meter_container
  38. {
  39. width:500px;
  40. height:210px;
  41. position:absolute;
  42. top:0;left:0;bottom:0;right:0;
  43. border:1px solid;
  44. margin:auto;
  45. transition:opacity 0.4s;
  46. }
  47.  
  48. #stick
  49. {
  50. width:1px;
  51. height:200px;
  52. position:absolute;
  53. left:50%;
  54. border:2px solid;
  55. background-color:black;
  56. -webkit-transform-origin: bottom left;
  57. transition:0.2s;
  58. border-radius:50% 50% 0 0;
  59. }
  60.  
  61. #scale
  62. {
  63. width:500px;
  64. height:10px;
  65. position:relative;
  66. left:0;
  67. z-index:-1;
  68. }
  69.  
  70. .scalee
  71. {
  72. width:100px;
  73. height:10px;
  74. position:absolute;
  75. text-align:center;
  76. font-size:85%;
  77. font-family: Century Gothic, sans-serif;
  78. transition:height 0.4s;
  79. }
  80.  
  81. #name
  82. {
  83. width:500px;
  84. height:20px;
  85. position:absolute;
  86. border:1px solid;
  87. left:0;
  88. top:-30px;
  89. text-align:center;
  90. font-family: Century Gothic, sans-serif;
  91. }
  92.  
  93. #head
  94. {
  95. width:200px;
  96. height:200px;
  97. position:absolute;
  98. right:0;left:0;margin:auto;
  99. }
  100.  
  101. #state
  102. {
  103. width:100px;
  104. height:50px;
  105. position:absolute;
  106. right:0;left:0;margin:auto;
  107. top:-100px;
  108. font-size:120%;
  109. font-family: Century Gothic, sans-serif;
  110. }
  111.  
  112. #onoff
  113. {
  114. width:80px;
  115. height:20px;
  116. background-color:red;
  117. box-shadow:1px 1px 5px #888888;
  118. text-align:center;
  119. font-size:105%;
  120. font-color:white;
  121. font-family: Tahoma, Geneva, sans-serif;
  122. color:white;
  123. border-color:black;
  124. padding:5px;
  125. cursor:pointer;
  126. border-radius:20px;
  127. vertical-align:middle;
  128. transition:background-color 2s;
  129. position:absolute;
  130. top:-80px;
  131. left:210px;
  132. }
  133.  
  134. #onoff:active
  135. {
  136. background-color:#FF66FF;
  137. }
  138.  
  139. </style>
  140.  
  141.  
  142. <script>
  143.  
  144. var started = false;
  145. var go = false;
  146. var index = 0;
  147. var obj;
  148. var objt;
  149. var objtt;
  150. var amt;
  151. var c = 0;
  152.  
  153.  
  154. function start()
  155. {
  156.  
  157. var n = document.getElementById('name').value;
  158.  
  159. var amount = Math.floor(Math.random() * (90 - (-90) + 1)) + (-90);
  160. var stick = document.getElementById('stick');
  161.  
  162. if(n == 'Janci' || n == 'janci' || n == 'Janči' || n == 'janči')
  163. amount = 90;
  164.  
  165. if(n == 'Drew')
  166. amount = -90;
  167. amt = amount;
  168.  
  169. setupg(10,10);
  170.  
  171. stick.style.webkitTransform = 'rotate('+amount+'deg)';
  172.  
  173. obj=setInterval(function dynamic()
  174. {
  175.  
  176. var slightmove = Math.floor(Math.random() * (1 - (10) + 1)) + (10);
  177.  
  178. stick.style.webkitTransform = 'rotate('+(amount+slightmove)+'deg)';
  179.  
  180. setTimeout(function back()
  181. {
  182.  
  183. stick.style.webkitTransform = 'rotate('+(amount-slightmove)+'deg)';
  184. },200);
  185. },400);
  186. }
  187.  
  188.  
  189.  
  190. function randomize(min,max)
  191. {
  192. return Math.floor(Math.random() * (max - (min) + 1)) + (min);
  193. }
  194.  
  195.  
  196. document.getElementById('onoff').onmousedown = function(e)
  197. {
  198.  
  199. objt = setTimeout(function enough(){
  200.  
  201. if(!started)
  202. {
  203.  
  204. start();
  205. started = true;
  206. document.getElementById('one').style.height = 210+'px';
  207. setTimeout(function go(){document.getElementById('two').style.height = 210+'px'},100);;
  208. setTimeout(function go(){document.getElementById('three').style.height = 210+'px'},200);;
  209. setTimeout(function go(){document.getElementById('four').style.height = 210+'px'},300);;
  210. setTimeout(function go(){document.getElementById('five').style.height = 210+'px'},400);;
  211.  
  212. document.getElementById('one').innerHTML = 'Hetero';
  213. document.getElementById('two').innerHTML = 'Sometimes thinks about men';
  214. document.getElementById('three').innerHTML = 'Touches men too usually';
  215. document.getElementById('four').innerHTML = 'Kisses men';
  216. document.getElementById('five').innerHTML = "Gay'o fella";
  217.  
  218. document.getElementById('onoff').innerHTML = 'ON';
  219. document.getElementById('onoff').style.backgroundColor = '#FF66FF';
  220.  
  221. return;
  222. }
  223. },2000);
  224. }
  225.  
  226.  
  227. document.getElementById('onoff').onmouseup = function(e)
  228. {
  229.  
  230. clearInterval(objt);
  231. }
  232.  
  233. function setupg(bot,gap)
  234. {
  235.  
  236. var g = document.getElementById('graph');
  237. var ctx = g.getContext('2d');
  238.  
  239. var boat = g.height - bot;
  240. var up = (90 - amt) - bot;
  241.  
  242. ctx.strokeStyle = '#ff0000';
  243. ctx.lineWidth = 2;
  244. ctx.fillText('Graph beta',20,20);
  245. ctx.fillRect(g.width-5,up-5,5,5);
  246. ctx.beginPath();
  247.  
  248. ctx.moveTo(0,boat);
  249. ctx.lineTo(gap/2,up);
  250. ctx.lineTo(gap,boat);
  251. ctx.lineTo(g.width,boat);
  252.  
  253. ctx.stroke();
  254.  
  255. objtt = setInterval(function move()
  256. {
  257.  
  258. c = c + 10;
  259.  
  260. g.width = g.width;
  261.  
  262. ctx.strokeStyle = '#ff0000';
  263. ctx.fillText('Graph beta',20,20);
  264. ctx.fillRect(g.width-5,up-5,5,5);
  265. ctx.lineWidth = 2;
  266.  
  267. ctx.moveTo(0,boat);
  268. ctx.lineTo(c,boat);
  269. ctx.lineTo(gap/2+c,up);
  270. ctx.lineTo((gap)+c,boat);
  271. ctx.lineTo(g.width,boat);
  272.  
  273. ctx.stroke();
  274.  
  275. if(c >= g.width+1)
  276. {
  277.  
  278. clearInterval(objtt);
  279. c=0;
  280. setupg(10,10);
  281. }
  282.  
  283. },100);
  284. }
  285.  
  286.  
  287. </script>
  288.  
  289. </body>
  290.  
  291. </html>
Advertisement
Add Comment
Please, Sign In to add comment