Skip to content

Commit 9f4574a

Browse files
committed
add transition and transform
1 parent 30696cd commit 9f4574a

File tree

1 file changed

+132
-0
lines changed

1 file changed

+132
-0
lines changed

RotatingNavigation/style.css

Lines changed: 132 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,132 @@
1+
* {
2+
box-sizing: border-box;
3+
}
4+
5+
body {
6+
font-family: Georgia, 'Times New Roman', Times, serif;
7+
margin: 0;
8+
overflow-x: hidden;
9+
height: 100vh;
10+
padding: 20px;
11+
background-color: #333;
12+
color: #222;
13+
}
14+
15+
.container.show-nav {
16+
transform: rotate(-20deg);
17+
}
18+
19+
.container {
20+
background-color: #fafafa;
21+
transform-origin: top left;
22+
transition: transform 0.5s linear;
23+
width: 100vw;
24+
min-height: 100vh;
25+
padding: 50px;
26+
}
27+
28+
.circle-container {
29+
position: fixed;
30+
top: -100px;
31+
left: -100px;
32+
}
33+
34+
.circle {
35+
background-color: #ff7979;
36+
height: 200px;
37+
width: 200px;
38+
border-radius: 50%;
39+
position: relative;
40+
transition: transform 0.5s linear;
41+
}
42+
43+
.container.show-nav .circle {
44+
transform: rotate(-70deg);
45+
}
46+
47+
.circle button {
48+
cursor: pointer;
49+
position: absolute;
50+
top: 50%;
51+
left: 50%;
52+
height: 100px;
53+
background-color: transparent;
54+
border: 0;
55+
font-size: 26px;
56+
color: #fff;
57+
}
58+
59+
.circle button:focus {
60+
outline: none;
61+
}
62+
63+
.circle button#open {
64+
left: 60%;
65+
}
66+
67+
.circle button#close {
68+
top: 60%;
69+
transform: rotate(90deg);
70+
transform-origin: top left;
71+
}
72+
73+
nav ul li {
74+
text-transform: uppercase;
75+
color: #fff;
76+
margin: 40px 0;
77+
transform: translateX(-100%);
78+
transition: transform 0.4s ease-in;
79+
cursor: pointer;
80+
font-size: 20px;
81+
margin-right: 10px;
82+
}
83+
84+
nav ul li + li {
85+
margin-left: 15px;
86+
transform: translateX(-150%);
87+
}
88+
89+
nav ul li + li + li {
90+
margin-left: 30px;
91+
transform: translateX(-200%);
92+
}
93+
94+
.container.show-nav + nav li {
95+
transform: translateX(0);
96+
transition-delay: 0.3s;
97+
}
98+
99+
img {
100+
max-width: 100%;
101+
}
102+
103+
nav {
104+
position: fixed;
105+
bottom: 40px;
106+
left: 0;
107+
z-index: 100;
108+
}
109+
110+
nav ul {
111+
list-style-type: none;
112+
padding-left: 30px;
113+
}
114+
115+
.content {
116+
max-width: 1000px;
117+
margin: 50px auto;
118+
}
119+
120+
.content h1 {
121+
margin: 0;
122+
}
123+
124+
.content small {
125+
color: #555;
126+
font-style: italic;
127+
}
128+
129+
.content p {
130+
color: #333;
131+
line-height: 1.5;
132+
}

0 commit comments

Comments
 (0)