Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

glass fill animation #5169

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions Animations-CSS/Glass fill animation/ReadMe.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Glass fill animation

This is an animation of a glass filling with water using CSS.
13 changes: 13 additions & 0 deletions Animations-CSS/Glass fill animation/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Glass fill animation</title>
<link rel="stylesheet" href="style.css">
</head>
<body>
<div class="glass"></div>
</body>
</html>
55 changes: 55 additions & 0 deletions Animations-CSS/Glass fill animation/style.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
* {
margin: 0px;
padding: 0px;
box-sizing: border-box;
}

body {
justify-content: center;
align-items: center;
min-height: 100vh;
display: flex;
background-color: black;
}

.glass {
position: absolute;
top: 50%;
left: 50%;
width: 150px;
height: 180px;
border: 5px solid black;
border-radius: 20px;
border-top: 2px solid transparent;
border-top-left-radius: 5px;
border-top-right-radius: 5px;
transform: translate(-50%,-50%);
background: url(waterWave.jpg);
color: #ffffff;
font-size: 130px;
background-repeat: repeat-x;
animation: filling 5s linear infinite;
box-shadow: 0 0 0 6px #ffffff;
}

@keyframes filling {
0%{
background-position: 0 100px;
}

10%{
background-position: 0 100px;
}

40%{
background-position: 1000px -70px;
}

80%{
background-position: 2000px -80px;
}

100%{
background-position: 2500px 100px;
}
}
Binary file added Animations-CSS/Glass fill animation/waterWave.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.