Skip to content

Commit 780c90f

Browse files
water droplets using css
1 parent 0356faa commit 780c90f

2 files changed

Lines changed: 81 additions & 0 deletions

File tree

waterDrops/index.html

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
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>Water Droplets | CSS Drawing</title>
8+
<link rel="stylesheet" href="./style.css" />
9+
</head>
10+
<body>
11+
<div class="drops">
12+
<div class="drop"></div>
13+
<div class="drop"></div>
14+
<div class="drop"></div>
15+
<div class="drop"></div>
16+
</div>
17+
</body>
18+
</html>

waterDrops/style.css

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
* {
2+
margin: 0;
3+
padding: 0;
4+
box-sizing: border-box;
5+
}
6+
7+
body {
8+
display: flex;
9+
justify-content: center;
10+
align-items: center;
11+
min-height: 100vh;
12+
background: #edeeed;
13+
}
14+
15+
.drops {
16+
position: relative;
17+
display: flex;
18+
justify-content: center;
19+
align-items: center;
20+
}
21+
.drop {
22+
position: absolute;
23+
width: 150px;
24+
height: 150px;
25+
background: transparent;
26+
border-radius: 57% 43% 37% 63% / 45% 52% 48% 55%;
27+
box-shadow: inset 10px 10px 10px rgba(0, 0, 0, 0.05),
28+
15px 25px 10px rgba(0, 0, 0, 0.1), 15px 20px 20px rgba(0, 0, 0, 0.05),
29+
inset -10px -10px 15px rgba(255, 255, 255, 0.5);
30+
}
31+
32+
.drop::before {
33+
content: "";
34+
position: absolute;
35+
top: 35px;
36+
left: 25px;
37+
background: #fff;
38+
width: 20px;
39+
height: 20px;
40+
border-radius: 42% 58% 37% 63% / 40% 43% 57% 60%;
41+
}
42+
.drop::after {
43+
content: "";
44+
position: absolute;
45+
top: 25px;
46+
left: 65px;
47+
background: #fff;
48+
width: 10px;
49+
height: 10px;
50+
border-radius: 57% 43% 37% 63% / 48% 37% 63% 52%;
51+
}
52+
.drop:nth-child(2) {
53+
transform: scale(0.5) translate(-200px, 180px);
54+
border-radius: 64% 36% 42% 58% / 42% 37% 63% 58%;
55+
}
56+
.drop:nth-child(3) {
57+
transform: scale(0.5) translate(280px, 10px);
58+
border-radius: 49% 51% 42% 58% / 56% 47% 53% 44%;
59+
}
60+
.drop:nth-child(4) {
61+
transform: scale(0.35) translate(120px, -350px);
62+
border-radius: 39% 1% 63% 37% / 56% 47% 53% 44%;
63+
}

0 commit comments

Comments
 (0)