Advertisement
Guest User

Untitled

a guest
Apr 21st, 2018
56
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.38 KB | None | 0 0
  1. <!DOCTYPE html>
  2.  
  3. <head>
  4. <link href='https://fonts.googleapis.com/css?family=Poller+One' rel='stylesheet' type='text/css'>
  5.  
  6. <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
  7.  
  8. <style>
  9.  
  10. .robot {
  11. position: relative;
  12. left: 200px;
  13. }
  14.  
  15. .beep {
  16. width: 5px;
  17. height: 0;
  18. border: 5px solid transparent;
  19. border-top: 10px solid #777;
  20. border-bottom: 80px solid #888;
  21. position: relative;
  22. left: 140px;
  23. }
  24.  
  25. @keyframes blink {
  26. 50% {
  27. background: radial-gradient(circle, red 15%, transparent 40%), #cc5;
  28. }
  29. }
  30. @-webkit-keyframes blink {
  31. 50% {
  32. background: -webkit-radial-gradient(circle, red 15%, transparent 40%), #cc5;
  33. }
  34. }
  35. @-moz-keyframes blink {
  36. 50% {
  37. background: -moz-radial-gradient(circle, red 15%, transparent 40%), #cc5;
  38. }
  39. }
  40. .laser {
  41. animation: blink .5s infinite;
  42. -webkit-animation: blink .5s infinite;
  43. -moz-animation: blink .5s infinite;
  44. }
  45. .brain {
  46. background: radial-gradient(circle, white 15%, transparent 40%), #cc5;
  47. background: -moz-radial-gradient(circle, white 15%, transparent 40%), #cc5;
  48. background: -webkit-radial-gradient(circle, white 15%, transparent 40%), #cc5;
  49. background-size: 75px 150px;
  50. height: 150px;
  51. width: 150px;
  52. border-radius: 60px 60px 10px 10px;
  53. border-bottom: 40px solid #666;
  54. position: relative;
  55. left: 70px;
  56. }
  57. .torso {
  58. height: 0;
  59. width: 140px;
  60. border-top: 300px solid #bc6;
  61. border-left: 75px solid transparent;
  62. border-right: 75px solid transparent;
  63. border-radius: 20px 20px 100px 100px;
  64. }
  65. .left {
  66. font-family: 'Poller One', verdana, arial, sans-serif;
  67. font-weight: bold;
  68. font-size: 250px;
  69. color: #666;
  70. transform: rotate(200deg);
  71. -webkit-transform: rotate(200deg);
  72. -moz-transform: rotate(200deg);
  73. position: relative;
  74. top: -320px;
  75. left: -190px;
  76. z-index: -1;
  77. }
  78. .right {
  79. font-family: 'Poller One', verdana, arial, sans-serif;
  80. font-weight: bold;
  81. font-size: 250px;
  82. color: #666;
  83. transform: scaleY(-1) rotate(20deg);
  84. -webkit-transform: scaleY(-1) rotate(20deg);
  85. -moz-transform: scaleY(-1) rotate(20deg);
  86. position: relative;
  87. top: -620px;
  88. left: 190px;
  89. z-index: -1;
  90. }
  91. .foot {
  92. height: 40px;
  93. width: 40px;
  94. background: #ccc;
  95. border-radius: 40px;
  96. border: 15px solid #999;
  97. position: relative;
  98. left: 110px;
  99. top: -10px;
  100. z-index: -1;
  101. }
  102. </style>
  103. </head>
  104.  
  105. <body>
  106.  
  107. <div class="robot">
  108. <div class="beep"></div>
  109. <div class="brain"></div>
  110. <div class="torso">
  111. <div class="left">j</div>
  112. <div class="right">j</div>
  113. </div>
  114. <div class="foot"></div>
  115. </div>
  116.  
  117. <button class="flash">laser eyes on/off</button>
  118. <button class="color">change color!</button>
  119.  
  120.  
  121. <script>
  122. // When eyes button is clicked, toggle laser class on brain
  123. $(".flash").click(function() {
  124. $(".brain").toggleClass('laser');
  125. });
  126.  
  127. // When color button is clicked...
  128. $(".color").click(function() {
  129. // assign each named color a random number 0-255
  130. var red = Math.floor(Math.random() * 255);
  131. var green = Math.floor(Math.random() * 255);
  132. var blue = Math.floor(Math.random() * 255);
  133.  
  134. // Generate an RGBA value from red, green and blue
  135. var randomRGBA = 'rgba('+red+','+green+','+blue+',1);';
  136.  
  137. // Dsiplay the RGBA value in an alert window
  138. alert(randomRGBA);
  139.  
  140. //Display the three values in an alert window
  141. alert(red + "," + green + "," + blue);
  142. });
  143. </script>
  144. </body>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement