Advertisement
Guest User

Untitled

a guest
Apr 2nd, 2020
124
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 1.63 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4.     <title></title>
  5. </head>
  6. <body>
  7. <div onclick="f()" id="block"></div>
  8. <div id="menu"><button class="b">Mneu</button><button class="b">Mneu</button><button class="b">Mneu</button><button class="b">Mneu</button><button class="b">Mneu</button><button class="b">Mneu</button><button class="b">Mneu</button></div>
  9. <style type="text/css">
  10.     .b{width: 80px; height: 50px;margin: 10px;opacity: 0.7;background-color: rgb(140,0,160);color:white;border:0;}
  11.     #block{
  12.         width: 100px;
  13.         height: 100px;
  14.         background-color: black;
  15.         animation:2s block1 infinite ;
  16.     }
  17.     #menu{
  18.         width: 100px;
  19.         height: 80%;
  20.         background-color: teal;
  21.         opacity: 0.8;
  22.         position: fixed;
  23.         right: 0px;
  24.         top: 10%;
  25.     }
  26.     @keyframes fadein{
  27.         from{opacity: 0;right: -100px;}
  28.         to{opacity: 0.8;right: 0px;}
  29.     }
  30.     @keyframes fadeout{
  31.         from{opacity: 0.8;right: 0px;}
  32.         to{opacity: 0;right: -100px;}
  33.     }
  34.     @keyframes block1{
  35.         0%{transform: rotate(0deg);border-radius: 0%;background-color: black}
  36.         50%{transform: rotate(360deg);border-radius: 60%;background-color: red}
  37.         100%{transform: rotate(720deg);border-radius: 0%;background-color: black}
  38.     }
  39. </style>
  40. <script type="text/javascript">
  41.     var k =  1;
  42.     function f(){
  43.         if(k>0){
  44.         document.getElementById('menu').style.animation = "1s fadeout 1";
  45.         document.getElementById('menu').style.right = "-100px";
  46.         document.getElementById('menu').style.opacity = "0";
  47.     }
  48.         else{
  49.         document.getElementById('menu').style.animation = "1s fadein 1"
  50.         document.getElementById('menu').style.right = "0px";
  51.         document.getElementById('menu').style.opacity = "0.8";
  52. }
  53.         k=-k;
  54.     }
  55. </script>
  56. </body>
  57. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement