Advertisement
Guest User

Untitled

a guest
Dec 12th, 2019
114
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.23 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="UTF-8">
  5. <title>Sprawdzian</title>
  6. <link rel="stylesheet" href="style.css" type="text/css">
  7. <style>
  8. *,body{
  9. margin:0;
  10. padding:0;
  11. border:0;
  12. text-align:center;
  13. box-sizing:border-box;
  14. transition:all 0.3s;
  15. }
  16. body {
  17. background-color:#afafaf;
  18. color:#FFF;
  19. }
  20. #wrapper{
  21. width:1000px;
  22. margin:10vh auto;
  23. height:80vh;
  24. }
  25.  
  26. button{
  27. background-color:yellow;
  28. padding:5px;
  29. }
  30. </style>
  31. </head>
  32. <body onload="awakeStyles(); return false;">
  33. <div id="wrapper">
  34. <div id="form_wrapper">
  35. <form>
  36. Fromularz 1: <input type="number" id="form1">
  37. <br>
  38. Formularz 2: <input type="number" id="form2">
  39. <br> <br>
  40. <input type="checkbox" id="in_checkbox">
  41. <input type="checkbox" id="in_checkbox_2">
  42. <br> <br>
  43. <button id="formButton1" onclick="funkcja(1); return false;">przycisk 1</button>
  44. <button id="formButton2" onclick="funkcja(2); return false;">przycisk 2</button>
  45. <button id="formButton3" onclick="funkcja(3); return false;">przycisk 3</button>
  46. <br>
  47. </form>
  48. </div>
  49. </div>
  50. <script>
  51. var INPUT1=document.getElementById("form1");
  52. var INPUT2=document.getElementById("form2");
  53. var IN_CHECKBOX=document.getElementById('in_checkbox');
  54. var IN_CHECKBOX_2=document.getElementById('in_checkbox_2');
  55.  
  56.  
  57. INPUT1.addEventListener("mouseover",function(){
  58. INPUT1.style.width="15vw";
  59. });
  60. INPUT1.addEventListener("mouseout",function(){
  61. INPUT1.style.width="10vw";
  62. });
  63. INPUT2.addEventListener("mouseover",function(){
  64. INPUT2.style.backgroundColor="green";
  65. });
  66. INPUT2.addEventListener("mouseout",function(){
  67. INPUT2.style.backgroundColor="#FFF";;
  68. });
  69. IN_CHECKBOX.addEventListener("mouseover",function(){
  70. IN_CHECKBOX.style.transform = 'translate(-200px) scale(2)';
  71. });
  72. IN_CHECKBOX_2.addEventListener("mouseover",function(){
  73. IN_CHECKBOX_2.style.transform = 'translate(200px) scale(2)';
  74. });
  75.  
  76. document.getElementById("formButton1").addEventListener("click", function(){
  77. document.getElementById("formButton1").style.borderRadius="30% / 60%";
  78. });
  79. document.getElementById("formButton2").addEventListener("click", function(){
  80. document.getElementById("formButton2").style.borderRadius="70% / 60%";
  81. });
  82. document.getElementById("formButton3").addEventListener("click", function(){
  83. document.getElementById("formButton3").style.borderRadius="40% / 40%";
  84. });
  85.  
  86. function awakeStyles(){
  87. INPUT1.style.width="10vw";
  88. INPUT2.style.width=INPUT1.style.width;
  89. }
  90. function funkcja(x){
  91. var form1=parseInt(INPUT1.value);
  92. var form2=parseInt(INPUT2.value);
  93.  
  94. switch(x){
  95. case 1:
  96. break;
  97.  
  98. case 2:
  99. break;
  100.  
  101. case 3:
  102. break;
  103. }
  104. }
  105. </script>
  106. </body>
  107. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement