Untitled

mail@pastecode.io avatar
unknown
plain_text
2 months ago
1.4 kB
1
Indexable
Never
<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Sliding Birthday Present</title>
  <style>
    body {
      font-family: 'Arial', sans-serif;
      display: flex;
      justify-content: center;
      align-items: center;
      height: 100vh;
      margin: 0;
      background-color: #f0f0f0;
    }

    .present-container {
      position: relative;
    }

    .base {
      width: 200px;
      height: 150px;
      background-color: #ffd700; /* Gold color for the base */
      position: relative;
      overflow: hidden;
    }

    .slider {
      width: 100px;
      height: 150px;
      background-color: #ff6347; /* Tomato color for the sliding part */
      position: absolute;
      top: 0;
      transition: transform 0.5s ease-in-out;
    }

    .message {
      position: absolute;
      top: 50%;
      left: 50%;
      transform: translate(-50%, -50%);
      color: #fff;
      text-align: center;
      font-size: 16px;
      display: none;
    }

    .base:hover .slider {
      transform: translateX(100%);
    }

    .base:hover .message {
      display: block;
    }
  </style>
</head>
<body>
  <div class="present-container">
    <div class="base">
      <div class="slider"></div>
      <div class="message">Happy Birthday!</div>
    </div>
  </div>
</body>
</html>
Leave a Comment