Skip to content

Commit 3c79db6

Browse files
committed
separate css into four files
1 parent 6731dcb commit 3c79db6

17 files changed

Lines changed: 230 additions & 203 deletions

!template.html

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,9 @@
55
<meta name="viewport" content="width=device-width, initial-scale=1.0">
66
<title>The Nerd Herd</title>
77
<link rel="stylesheet" type="text/css" href="../css/base.css">
8+
<link rel="stylesheet" type="text/css" href="../css/header.css">
89
<link rel="stylesheet" type="text/css" href="../css/main.css">
10+
<link rel="stylesheet" type="text/css" href="../css/footer.css">
911
<script src="../js/header.js" defer></script>
1012
<link rel="icon" href="../images/nerd.svg">
1113
<meta property="og:title" content="NerdHerd"/>

css/footer.css

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
/* footer */
2+
footer {
3+
background-color: var(--nerd-herd-blue);
4+
display: flex;
5+
flex-direction: row;
6+
justify-content: space-between;
7+
padding: 20px;
8+
width: min(var(--min-width),calc(100% - 40px));
9+
overflow-x: auto;
10+
}
11+
12+
footer img {
13+
height: 100px;
14+
}
15+
16+
footer a, footer p {
17+
margin: 0;
18+
color: white
19+
}
20+
21+
footer > div:not(:last-child) {
22+
margin-right: 40px;
23+
}
24+
25+
footer > div > p {
26+
font-size: 15px;
27+
font-weight: bold;
28+
}
29+
30+
footer > div > div {
31+
display: flex;
32+
flex-direction: row;
33+
column-gap: 10px;
34+
}
35+
36+
footer > div > div > div {
37+
display: flex;
38+
flex-direction: column;
39+
}
40+
41+
footer > div > div > div a {
42+
font-size: 10px;
43+
}
44+
45+
@media screen and (width < 760px){
46+
footer{
47+
flex-direction: column;
48+
}
49+
}

css/header.css

Lines changed: 150 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,150 @@
1+
header {
2+
width: 100%;
3+
margin: 0;
4+
padding: 0;
5+
display: flex;
6+
justify-content: center;
7+
flex-direction: column;
8+
}
9+
10+
.logo {
11+
background-color: var(--nerd-herd-blue);
12+
width: 100%;
13+
height: 250px;
14+
margin: 0;
15+
padding: 0;
16+
display: flex;
17+
justify-content: space-evenly;
18+
}
19+
20+
.logo img {
21+
width: min(200px,40%);
22+
}
23+
24+
.logo div {
25+
display: flex;
26+
flex-direction: column;
27+
justify-content: space-evenly;
28+
}
29+
30+
.logo h1{
31+
color: white;
32+
text-align: right;
33+
font-size: min(40px,5vw);
34+
}
35+
36+
/* subtabs */
37+
38+
.nav {
39+
display: flex;
40+
flex-direction: row;
41+
justify-content: space-around;
42+
width: 100%;
43+
background-color: var(--nerd-herd-blue);
44+
height: 60px;
45+
z-index: 2;
46+
padding-top: 20px;
47+
}
48+
49+
.nav a {
50+
font-size: 25px;
51+
/* display: block; */
52+
/* transform: translateY(10px); */
53+
}
54+
55+
.nav > a{
56+
transform: translateY(10px);
57+
}
58+
59+
.nav a img {
60+
/* height: 300%; */
61+
transform: translateY(-10px);
62+
}
63+
64+
.subtabs {
65+
position: relative;
66+
}
67+
68+
.subtabs a{
69+
color: white;
70+
text-decoration: none;
71+
height: 20px;
72+
}
73+
74+
.subtabs .subtabs-content {
75+
display:none;
76+
position: absolute;
77+
left: 0;
78+
background-color: var(--nerd-herd-blue);
79+
border: 2px solid white;
80+
z-index: 1;
81+
flex-direction: column;
82+
width: 100%;
83+
overflow-x: hidden;
84+
}
85+
86+
.subtabs:hover .subtabs-content {
87+
display: flex;
88+
}
89+
90+
.subtabs .subtabs-content a {
91+
font-size: 10px;
92+
color: white;
93+
text-decoration: none;
94+
}
95+
96+
.smallnav {
97+
display: none;
98+
}
99+
100+
hr{
101+
color: black;
102+
width: 100%;
103+
margin: 0;
104+
}
105+
106+
107+
@media screen and (width < 930px){
108+
.nav {
109+
flex-direction: column;
110+
position: fixed;
111+
top: 0;
112+
width: fit-content;
113+
padding-right: 10px;
114+
height: 100%;
115+
justify-content: start;
116+
left: -100%;
117+
transition: left 100ms;
118+
border-right: 3px solid white;
119+
}
120+
.nav.show {
121+
left: 0;
122+
}
123+
124+
.nav a img {
125+
width: 100px;
126+
}
127+
128+
.smallnav {
129+
display: flex;
130+
background-color: var(--nerd-herd-blue);
131+
justify-content: end;
132+
}
133+
134+
.subtabs .subtabs-content {
135+
position:relative;
136+
display: flex;
137+
height: 0;
138+
overflow-y: hidden;
139+
transition: height 150ms;
140+
justify-content: space-evenly;
141+
}
142+
143+
.subtabs:not(:hover) .subtabs-content {
144+
border-width: 0;
145+
}
146+
147+
.subtabs:hover .subtabs-content {
148+
height: 120px;
149+
}
150+
}

0 commit comments

Comments
 (0)