Skip to content

Commit 56ff733

Browse files
committed
Safari Logo In CSS
1 parent 674b4be commit 56ff733

2 files changed

Lines changed: 143 additions & 0 deletions

File tree

19. Safari Logo/index.html

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
<html lang="en">
2+
<head>
3+
<meta charset="UTF-8" />
4+
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
5+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
6+
<title>Safari Logo</title>
7+
<link rel="stylesheet" href="style.css" />
8+
</head>
9+
<body>
10+
<div class="safari">
11+
<div class="circle-lines">
12+
<span style="--i: 1"></span>
13+
<span style="--i: 2"></span>
14+
<span style="--i: 3"></span>
15+
<span style="--i: 4"></span>
16+
<span style="--i: 5"></span>
17+
<span style="--i: 6"></span>
18+
<span style="--i: 7"></span>
19+
<span style="--i: 8"></span>
20+
<span style="--i: 9"></span>
21+
<span style="--i: 10"></span>
22+
<span style="--i: 11"></span>
23+
<span style="--i: 12"></span>
24+
<span style="--i: 13"></span>
25+
<span style="--i: 14"></span>
26+
<span style="--i: 15"></span>
27+
<span style="--i: 16"></span>
28+
<span style="--i: 17"></span>
29+
<span style="--i: 18"></span>
30+
<span style="--i: 19"></span>
31+
<span style="--i: 20"></span>
32+
<span style="--i: 21"></span>
33+
<span style="--i: 22"></span>
34+
<span style="--i: 23"></span>
35+
<span style="--i: 24"></span>
36+
<span style="--i: 25"></span>
37+
<span style="--i: 26"></span>
38+
<span style="--i: 27"></span>
39+
<span style="--i: 28"></span>
40+
<span style="--i: 29"></span>
41+
<span style="--i: 30"></span>
42+
<span style="--i: 31"></span>
43+
<span style="--i: 32"></span>
44+
<span style="--i: 33"></span>
45+
<span style="--i: 34"></span>
46+
<span style="--i: 35"></span>
47+
<span style="--i: 36"></span>
48+
<span style="--i: 37"></span>
49+
<span style="--i: 38"></span>
50+
</div>
51+
<div class="niddle"></div>
52+
</div>
53+
</body>
54+
</html>

19. Safari Logo/style.css

Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
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+
height: 100vh;
12+
background: #f8f8f8;
13+
}
14+
15+
.safari {
16+
position: relative;
17+
width: 400px;
18+
height: 400px;
19+
background: #f2f2f2;
20+
border-radius: 50px;
21+
box-shadow: 0 30px 20px #ccc, 0 30px 30px rgba(0, 0, 0, 0.25),
22+
0 28px 0 rgba(0, 0, 0, 0.5), 0 50px 60px rgba(0, 0, 0, 0.1);
23+
}
24+
25+
.circle-lines {
26+
position: absolute;
27+
display: flex;
28+
justify-content: center;
29+
align-items: center;
30+
inset: 35px;
31+
background: linear-gradient(#1ec9ff, #2971e7);
32+
border-radius: 50%;
33+
box-shadow: 0 -5px 0 5px rgba(0, 0, 0, 0.15) inset 0 10px 0 rgba(0, 0, 0, 0.1);
34+
}
35+
36+
.circle-lines span {
37+
position: absolute;
38+
width: 2px;
39+
height: 24px;
40+
transform: translateY(-137.55px) rotate(calc(10deg * var(--i)));
41+
transform-origin: 1px 150px;
42+
background: #fff;
43+
filter: drop-shadow(2px 2px 1px rgba(0, 0, 0, 0.15));
44+
}
45+
46+
.circle-lines span::before {
47+
content: "";
48+
position: absolute;
49+
width: 2px;
50+
height: 12px;
51+
background: #fff;
52+
transform-origin: 0 150px;
53+
transform: rotate(5deg);
54+
}
55+
56+
.niddle {
57+
display: flex;
58+
justify-content: center;
59+
align-items: center;
60+
position: absolute;
61+
width: 36px;
62+
inset: 50px;
63+
transform: translateX(130px) rotate(45deg);
64+
filter: drop-shadow(0 0 4px rgba(0, 0, 0, 0.25));
65+
transition: 2s cubic-bezier(1, -0.39, 0.5, 1);
66+
}
67+
68+
.safari:hover .niddle {
69+
transform: translateX(130px) rotate(405deg);
70+
}
71+
72+
.niddle::before {
73+
content: "";
74+
position: absolute;
75+
top: -150px;
76+
height: 150px;
77+
border-left: 18px solid transparent;
78+
border-right: 18px solid transparent;
79+
border-bottom: 150px solid rgb(231, 51, 51);
80+
}
81+
82+
.niddle::after {
83+
content: "";
84+
position: absolute;
85+
top: 150px;
86+
border-left: 18px solid transparent;
87+
border-right: 18px solid transparent;
88+
border-bottom: 150px solid white;
89+
}

0 commit comments

Comments
 (0)