Advertisement
elroseria

disable

Jan 2nd, 2024 (edited)
834
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 2.76 KB | None | 0 0
  1. <!doctype html>
  2. <html>
  3.   <head>
  4.     <meta charset="utf-8">
  5.     <title>Action Menu Button</title>
  6.     <link rel="stylesheet" href="style.css">
  7.   </head>
  8.   <body>
  9.     <div class="action">
  10.       <div class="profile" onclick="menuToggle();">
  11.         <h4>Menu</h4>
  12.       </div>
  13.       <div class="menu">
  14.         <h3>Navigation<br></h3>
  15.         <ul>
  16.           <li><i class="fa-solid fa-house"></i><a href="#">Home</a></li>
  17.           <li><i class="fa-solid fa-circle-user"></i><a href="#">My Profile</a></li>
  18.           <li><i class="fa-solid fa-list-ul"></i><a href="#">Guidelines</a></li>
  19.           <li><i class="fa-regular fa-heart"></i><a href="#">Interests</a></li>
  20.       </div>
  21.     </div>
  22.   </body>
  23. </html>
  24.  
  25. <style>
  26. @import url('https://fonts.googleapis.com/css2?family=Comfortaa&family=Inter&family=Nunito&display=swap');
  27. *
  28. {
  29.   margin: 0;
  30.   padding: 0;
  31.   font-family: 'Nunito', sans-serif;
  32. }
  33.  
  34. body {
  35.   background: #ffefe8;
  36. }
  37.  
  38. .action {
  39.   position: fixed;
  40.   top: 20px;
  41.   left: 30px;
  42. }
  43.  
  44. .action .profile {
  45.   position: relative;
  46.   width: 70px;
  47.   height: 20px;
  48.   border-radius: 0.25em;
  49.   overflow: hidden;
  50.   cursor: pointer;
  51.   padding: 5px;
  52.   background: #FFE3E3;
  53.   text-align: center;
  54. }
  55.  
  56. .action .profile img {
  57.   position: absolute;
  58.   top: 0;
  59.   left: 0;
  60. }
  61.  
  62. .action .menu {
  63.   position: absolute;
  64.   top: 50px;
  65.   left: -1px;
  66.   padding: 7px 14px;
  67.   background: #ffffff;
  68.   width: 100px;
  69.   box-sizing: 0 5px 25px rgba (0,0,0,0.1);
  70.   border-radius: 8px;
  71.   transition: 0.5s;
  72.   visibility: hidden;
  73.   opacity: 0;
  74. }
  75.  
  76. .action .menu.active {
  77.   visibility: visible;
  78.   opacity: 1;
  79. }
  80.  
  81. .action .menu:before {
  82.   content: '';
  83.   position: absolute;
  84.   top: -5px;
  85.   left: 26px;
  86.   width: 20px;
  87.   height: 20px;
  88.   background: #fff;
  89.   transform: rotate(45deg);
  90. }
  91.  
  92. .action .menu h3 {
  93.   width: 100%;
  94.   text-align: center;
  95.   font-size: 14px;
  96.   padding: 7px 0;
  97.   font-weight: 600;
  98.   color: #212121;
  99.   line-height: 1.2em;
  100. }
  101.  
  102. .action .menu ul li {
  103.   list-style: none;
  104.   padding: 5px 0;
  105.   border-top: 1px solid rgba(0,0,0,0.05);
  106.   display: flex;
  107.   align-items: center;
  108. }
  109.  
  110. i {
  111.   width: 10px;
  112.   margin-right: 15px;
  113.   opacity: 1;
  114.   transition: 0.5s;
  115. }
  116.  
  117. .action .menu ul li:first-of-type {
  118. border-top: 0.5px solid #fff;
  119. }
  120.  
  121.  
  122. .action .menu ul li:hover i {
  123.   opacity: 0.5;
  124. }
  125.  
  126. .action .menu ul li a {
  127.   display: inline-block;
  128.   font-size: 12px;
  129.   text-decoration: none;
  130.   color: #000;
  131.   font-weight: 500;
  132.   transition: 0.5s;
  133. }
  134.  
  135. .action .menu ul li:hover a {
  136.   color: #999;
  137. }
  138.  
  139.  
  140. </style>
  141.  
  142. <script src="https://kit.fontawesome.com/ba309bcaa3.js" crossorigin="anonymous"></script>
  143.  
  144. <script>
  145. function menuToggle(){
  146.   const toggleMenu = document.querySelector ('.menu');
  147.   toggleMenu.classList.toggle('active')
  148. }
  149. </script>
  150.  
  151.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement