0
0
mirror of https://github.com/naturalcrit/homebrewery.git synced 2026-01-14 08:32:44 +00:00

i love grid template area

This commit is contained in:
Víctor Losada Hernández
2024-01-23 22:55:36 +01:00
parent 0dc1b46466
commit c50042c1e7

View File

@@ -1,121 +1,243 @@
.archivePage { body {
height:100%; height: 100vh;
background-color: #2C3E50;
.content { .content {
display:grid; height: 100%;
}
}
.archivePage {
overflow-y: hidden;
height: 100%;
background-color: #2C3E50;
.content {
display: grid;
grid-template-rows: 20vh 1fr; grid-template-rows: 20vh 1fr;
.welcome { .welcome {
display:grid; display: grid;
place-items: center; place-items: center;
background: url('https://i.imgur.com/MJ4YHu7.jpg'); background: url('https://i.imgur.com/MJ4YHu7.jpg');
background-size:100%; background-size: 100%;
background-position:center; background-position: center;
height:20vh; height: 20vh;
border-bottom:5px solid #333; border-bottom: 5px solid #333;
h1 { h1 {
font-size:40px; font-size: 40px;
font-weight:900; font-weight: 900;
color:white; color: white;
filter: drop-shadow(0 0 5px black); filter: drop-shadow(0 0 5px black);
} }
} }
.flexGroup { .flexGroup {
height:100%; height: 100%;
display:grid; display: grid;
grid-template-columns:1fr 2fr; grid-template-columns: 1fr 2fr;
.dataGroup { .dataGroup {
width:100%; width: 100%;
height:100%; height: 100%;
background:white; background: white;
&.form .brewLookup { &.form .brewLookup {
padding:50px; padding: 50px;
h2 { h2 {
font-size:30px; font-size: 30px;
font-weight: 900; font-weight: 900;
border-bottom:2px solid; border-bottom: 2px solid;
margin-block: 20px; margin-block: 20px;
} }
label { label {
margin-right:10px; margin-right: 10px;
} }
input+button { input+button {
margin-left:20px; margin-left: 20px;
} }
} }
&.resultsContainer { &.resultsContainer {
display:flex; display: flex;
flex-direction: column; flex-direction: column;
border-left:2px solid; border-left: 2px solid;
height:76.8vh; height: 100%;
.title { .title {
height:100px; height: 100px;
background-color: #333; background-color: #333;
display:grid; display: grid;
place-items: center; place-items: center;
h2 { h2 {
font-size:30px; font-size: 30px;
color:white; color: white;
font-weight:900; font-weight: 900;
} }
} }
.foundBrews { .foundBrews {
background-color: #2C3E50; background-color: #2C3E50;
display:flex; display: flex;
flex-direction:column; flex-direction: column;
width:100%; width: 100%;
min-height:500px; min-height: 500px;
height:max-content; height: 100%;
padding:50px; padding: 50px;
padding-bottom:unset; padding-bottom: unset;
.brewItem { .brewItem {
height:50px; height: 50px;
min-height:unset; min-height: unset;
width:100%; width: 100%;
display:flex; display: flex;
color:white; color: white;
background:#707070; background: #707070;
overflow: visible;
.text { .text {
min-height:unset; min-height: unset;
width:20vw; width: 20vw;
text-overflow: ellipsis; padding-inline:10px;
overflow:hidden;
white-space: nowrap; display: grid;
display:grid; align-content: center;
align-content:center;
h2 { h2 {
text-overflow: ellipsis;
overflow: hidden;
white-space: nowrap;
font-size: 20px; font-size: 20px;
font-weight:900; font-weight: 900;
} }
} }
hr { hr {
display:none; display: none;
} }
.info { .info {
width:100%; width: 100%;
display:grid; display: grid;
grid-template-columns: 3fr 1fr 70px 70px 150px 50px; grid-template-areas: "tags authors views pages update storage";
align-items:center; justify-content: end;
align-content: space-around;
grid-template-columns: 3fr 150px 70px 70px 200px 50px;
br { br {
display:none; display: none;
} }
&:not(:has(.brewTags)) { .brewTags{
grid-template-columns:3fr 70px 70px 150px 50px; display:inline-block;
grid-area: tags;
}
[title*="Authors:"] {
display:inline-block;
grid-area: authors;
}
[title*="Last"] {
display:inline-block;
grid-area: views;
}
[title*="Page"] {
display:inline-block;
grid-area: pages;
}
[title*="Created"] {
display:inline-block;
grid-area: update;
} }
[title*="Storage"] {
display:inline-block;
grid-area: storage;
filter:drop-shadow(0 0 10px white);
}
.brewTags {
padding-left: 10px;
}
.brewTags:has(span:nth-of-type(4)) {
position: relative;
overflow: hidden;
display: flex;
flex-wrap: wrap;
span:nth-of-type(n+2) {
display: none;
}
&:hover {
overflow: visible;
position: absolute;
top: 0;
background:#707070;
height: max-content;
z-index: 100;
width:min-content;
span:nth-of-type(n+4) {
display: block;
}
&:after {
position: absolute;
top: 48px;
right: 0;
left:0;
bottom:0;
content: '';
display: block;
height: calc(100% - 48px);
background: #707070;
border-inline: 1px solid gold;
border-bottom: 1px solid gold;
border-bottom-left-radius: 5px;
border-bottom-right-radius: 5px;
z-index: -1;
}
}
}
}
.links {
opacity: 1;
background: none;
position: relative;
display: grid;
grid-template-columns: 1fr 1fr;
height: 100%;
width: 100px;
.editLink,
.deleteLink {
display: none;
}
>a {
opacity: .8;
&:hover {
opacity: 1;
}
}
.shareLink {
color: deepskyblue;
}
.downloadLink {
color: coral;
}
} }
} }
} }
@@ -124,11 +246,3 @@
} }
} }
} }