Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <html>
- <head>
- <title></title>
- </head>
- <body>
- <div onclick="f()" id="block"></div>
- <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>
- <style type="text/css">
- .b{width: 80px; height: 50px;margin: 10px;opacity: 0.7;background-color: rgb(140,0,160);color:white;border:0;}
- #block{
- width: 100px;
- height: 100px;
- background-color: black;
- animation:2s block1 infinite ;
- }
- #menu{
- width: 100px;
- height: 80%;
- background-color: teal;
- opacity: 0.8;
- position: fixed;
- right: 0px;
- top: 10%;
- }
- @keyframes fadein{
- from{opacity: 0;right: -100px;}
- to{opacity: 0.8;right: 0px;}
- }
- @keyframes fadeout{
- from{opacity: 0.8;right: 0px;}
- to{opacity: 0;right: -100px;}
- }
- @keyframes block1{
- 0%{transform: rotate(0deg);border-radius: 0%;background-color: black}
- 50%{transform: rotate(360deg);border-radius: 60%;background-color: red}
- 100%{transform: rotate(720deg);border-radius: 0%;background-color: black}
- }
- </style>
- <script type="text/javascript">
- var k = 1;
- function f(){
- if(k>0){
- document.getElementById('menu').style.animation = "1s fadeout 1";
- document.getElementById('menu').style.right = "-100px";
- document.getElementById('menu').style.opacity = "0";
- }
- else{
- document.getElementById('menu').style.animation = "1s fadein 1"
- document.getElementById('menu').style.right = "0px";
- document.getElementById('menu').style.opacity = "0.8";
- }
- k=-k;
- }
- </script>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement