Files
comp126/assignments/a2/css/index.css
2024-10-10 13:21:51 -04:00

176 lines
2.8 KiB
CSS

@import './clean.css';
@import url('https://fonts.googleapis.com/css2?family=Protest+Strike&display=swap');
header {
color: white;
background-color: #0d2b43;
& > nav {
display: flex;
justify-content: end;
align-items: center;
gap: 1rem;
padding: 1rem;
& > a:hover {
color: lightgray;
}
}
& > div:has(img) {
width: 100%;
display: flex;
justify-content: end;
padding: 1rem 0;
& > div {
height: 9rem;
width: 50%;
overflow: hidden;
position: relative;
& > img {
width: 100%;
height: 100%;
object-fit: cover;
object-position: left top;
}
& > div {
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
display: flex;
justify-content: space-between;
& > div {
/* background-color: #0d2b43; */
border-right: 1rem solid #0d2b43;
flex-grow: 1;
&:nth-child(4) {
flex-grow: 1.5;
}
&:nth-child(5) {
flex-grow: 2;
}
&:last-child {
flex-grow: 4;
border-right: 0;
}
}
}
}
}
& > div:has(h1) {
display: flex;
flex-direction: column;
gap: 0.5rem;
padding: 1rem;
& > h1 {
font-size: 3rem;
font-family: 'Protest Strike', sans-serif;
}
& > h2 {
font-size: 1.5rem;
}
& > p {
font-size: 1rem;
margin-top: 0.5rem;
}
}
}
main {
width: 100%;
& > section:has(> div > img) {
max-width: 100%;
display: flex;
gap: 1rem;
padding: 1rem;
flex-wrap: wrap;
@media (min-width: 768px) {
flex-wrap: nowrap;
max-height: 80vh;
}
img {
object-fit: cover;
object-position: center 25%;
border-radius: 1rem;
}
& > :first-child:nth-last-child(n + 2) {
flex-grow: 1;
display: flex;
flex-direction: column;
gap: 1rem;
& > img {
height: 50%;
width: 100%;
}
}
& > :nth-child(2) {
flex-grow: 3;
& > img {
height: 100%;
width: 100%;
}
}
}
& > section:has(> div > h3) {
display: flex;
flex-direction: column;
gap: 1rem;
padding: 0 2rem 2rem 2rem;
& > div {
display: flex;
flex-direction: column;
gap: 0.5rem;
padding: 1rem;
& > h3 {
font-size: 3rem;
font-family: 'Protest Strike', sans-serif;
}
& > h4 {
font-size: 1.5rem;
}
& > p {
font-size: 1rem;
margin-top: 0.5rem;
line-height: 1.5rem;
}
}
}
}
footer {
background-color: #c5f36c;
display: flex;
justify-content: center;
align-items: center;
padding: 2rem;
}