Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <html lang="en">
- <head>
- <meta charset="UTF-8">
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
- <title>pH Strip Animation</title>
- <style>
- body {
- display: flex;
- justify-content: center;
- align-items: center;
- height: 100vh;
- background-color: #eef;
- }
- .container {
- position: relative;
- width: 100px;
- height: 250px;
- }
- .test-tube {
- position: absolute;
- bottom: 0;
- width: 60px;
- height: 150px;
- background: linear-gradient(to bottom, transparent 10%, #99d 30%, #339 100%);
- border: 3px solid #555;
- border-radius: 20px;
- display: flex;
- justify-content: center;
- align-items: flex-end;
- overflow: hidden;
- }
- .liquid {
- width: 100%;
- height: 70%;
- background: #339;
- border-radius: 0 0 20px 20px;
- transition: background-color 1s ease-in-out;
- }
- .ph-strip {
- position: absolute;
- top: -50px;
- left: 50%;
- width: 20px;
- height: 80px;
- background: #f5e663;
- border: 2px solid #ccc;
- transform: translateX(-50%);
- animation: dipAnimation 4s infinite ease-in-out;
- }
- @keyframes dipAnimation {
- 0%, 100% {
- top: -50px;
- background: #f5e663;
- }
- 50% {
- top: 80px;
- background: #ff5733;
- }
- }
- </style>
- </head>
- <body>
- <div class="container">
- <div class="ph-strip"></div>
- <div class="test-tube">
- <div class="liquid"></div>
- </div>
- </div>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement