Advertisement
Patrikrizek

lesson-9-card-in-animation

Dec 1st, 2022
1,119
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 1.92 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4.     <meta charset="UTF-8">
  5.     <meta http-equiv="X-UA-Compatible" content="IE=edge">
  6.     <meta name="viewport" content="width=device-width, initial-scale=1.0">
  7.     <title>Multi-layer shadow animation</title>
  8.     <style>
  9.         body {
  10.             height: 100vh;
  11.             margin: 0;
  12.             padding: 0;
  13.             display: flex;
  14.             justify-content: center;
  15.             align-items: center;
  16.             background-color: rgb(38, 38, 38);
  17.         }
  18.  
  19.         .card {
  20.             width: 150px;
  21.             height: 200px;
  22.             background-color: #4b4b53;
  23.             border-radius: 4px;
  24.             display: flex;
  25.             justify-content: center;
  26.             align-items: center;
  27.             cursor: default;
  28.             transition:
  29.                 box-shadow .5s,
  30.                 transform .25s;
  31.         }
  32.  
  33.         .card:hover {
  34.             cursor: default;
  35.                 box-shadow:
  36.                     5px 3px rgba(255, 255, 255, .05),
  37.                     10px 6px rgba(255,255,255, .04),
  38.                     15px 9px rgba(255, 255, 255, .03);
  39.                 transform:
  40.                     rotate(20deg)
  41.                     skew(-10deg, -5deg);
  42.                 transition:
  43.                     box-shadow .75s,
  44.                     transform .375s;    
  45.         }
  46.        
  47.         p, span {
  48.             color: white;
  49.             font-family: Arial, Helvetica, sans-serif;
  50.             font-weight: bold;
  51.             font-size: 20px;
  52.             text-align: center;
  53.         }
  54.  
  55.         .unselectable {
  56.         -webkit-touch-callout: none;
  57.         -webkit-user-select: none;
  58.         -khtml-user-select: none;
  59.         -moz-user-select: none;
  60.         -ms-user-select: none;
  61.         user-select: none;
  62.         }
  63.     </style>
  64. </head>
  65. <body>
  66.     <div class="card unselectable">
  67.         <p>&#x1f911;<br>Hover me</p>
  68.     </div>
  69. </body>
  70. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement