Advertisement
1xptolevitico69

Play /Pause Button

Nov 20th, 2019
354
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 0.89 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <title></title>
  5. <meta charset="utf-8">
  6. <meta name="viewport" content="width=device-width">
  7. <style>
  8.  
  9. .bt {  
  10. width:125px;
  11. height:125px;
  12. border-radius:50%;
  13. outline:none;
  14. background-color:red;
  15. color:white;
  16. font-size:15px;
  17. font-family:arial;
  18. font-weight:900;
  19. border:20px solid;
  20. box-shadow:4px 4px 5px black;
  21. margin:100px;
  22. cursor:pointer;
  23. }
  24.  
  25. #bt_style {
  26. transform:skew(-15deg);
  27. display:inline-block;
  28. }
  29.  
  30. </style>
  31. </head>
  32. <body>
  33.  
  34.  
  35. <button id='bt' onmouseup='up()' onmousedown='down()' class='bt'>
  36. <span id='bt_style'>Play</span>
  37. </button>
  38.  
  39.  
  40.  
  41. <script>
  42. i=0;
  43.  
  44. function down(){
  45. bt.style.boxShadow="1px 1px 1px black";
  46. }
  47.  
  48. function up(){
  49. bt.style.boxShadow="4px 4px 5px black";
  50. }
  51.  
  52. bt.onclick=function(){
  53. if(i==0){i=1;
  54. bt_style.innerHTML='Pause';
  55. }else if(i==1){i=0;
  56. bt_style.innerHTML='Play';
  57. }
  58. }
  59.  
  60.  
  61. </script>
  62. </body>
  63. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement