fix: changed back table style to side scrolling on mobile

pull/1/head
Antonio De Lucreziis 2 years ago
parent 42e9a05818
commit dda2e2c36f

@ -123,6 +123,7 @@ export const AdminPage = ({}) => {
<>
<hr />
<div class="subtitle">Controlli speciali solo per Admin</div>
<div class="scrollable">
<div class="users-table" style={{ '--cols': 4 }}>
<div class="cell header">Username Ateneo</div>
<div class="cell header">Nome Utente</div>
@ -141,6 +142,7 @@ export const AdminPage = ({}) => {
</>
))}
</div>
</div>
<div class="form">
<div class="fill subtitle mono">su $USER</div>
<p class="fill">Gli admin per fare prove possono immedesimarsi come un altro utente</p>

@ -24,6 +24,8 @@ body {
font-weight: 300;
font-size: 18px;
color: #222;
line-height: 1;
}
@ -385,13 +387,6 @@ main.page-problem {
}
main.page-scores {
.scrollable {
display: flex;
overflow: auto;
max-width: 100%;
padding: 1rem;
.table {
grid-template-columns: repeat(3, auto);
@ -419,101 +414,15 @@ main.page-scores {
text-align: center;
justify-content: space-between;
}
}
}
// .table {
// display: grid;
// grid-template-columns: auto auto auto;
// box-shadow: -2px 4px 6px 1px #00000018, 0 0 4px 0px #00000010;
// // border: 1px solid #ddd;
// border-radius: 0.5rem;
// background: #ffffff;
// user-select: none;
// position: relative;
// .cell {
// padding: 1rem 2rem;
// gap: 0.5rem;
// border-left: 1px solid #ddd;
// border-top: 1px solid #ddd;
// &:nth-child(3n + 3) {
// border-right: 1px solid #ddd;
// }
// &:nth-last-child(1),
// &:nth-last-child(2),
// &:nth-last-child(3) {
// border-bottom: 1px solid #ddd;
// }
// &:first-child {
// border-top-left-radius: 0.5rem;
// }
// &:nth-child(3) {
// border-top-right-radius: 0.5rem;
// }
// &:nth-last-child(3) {
// border-bottom-left-radius: 0.5rem;
// }
// &:last-child {
// border-bottom-right-radius: 0.5rem;
// }
// &:not(.header) {
// user-select: text;
// &:nth-child(3n + 1) {
// text-align: left;
// }
// &:nth-child(3n + 2),
// &:nth-child(3n + 3) {
// text-align: center;
// }
// &:nth-child(3n + 3) {
// &::after {
// content: '';
// position: absolute;
// left: 0;
// right: 0;
// height: 3rem;
// transform: translate(0, -1rem);
// pointer-events: none;
// background: transparent;
// }
// &:hover::after {
// background: #00000006;
// }
// }
// &:hover {
// &:nth-child(3n + 1) + .cell + .cell::after {
// background: #00000006;
// }
&:nth-child(3) {
border-top-right-radius: 0.5rem;
}
// &:nth-child(3n + 2) + .cell::after {
// background: #00000006;
// }
// }
// }
// }
// }
&:nth-last-child(3) {
border-bottom-left-radius: 0.5rem;
}
}
}
}
@ -521,6 +430,14 @@ main.page-scores {
// Components
//
.scrollable {
display: flex;
overflow: auto;
max-width: 100%;
padding: 1rem;
}
.table {
display: grid;
@ -533,11 +450,11 @@ main.page-scores {
user-select: none;
overflow: hidden;
.cell {
padding: 0.75rem;
white-space: nowrap;
border-right: 1px solid #ddd;
border-bottom: 1px solid #ddd;
@ -547,6 +464,12 @@ main.page-scores {
align-items: center;
justify-content: start;
&:first-child {
border-top-left-radius: 0.5rem;
}
&:last-child {
border-top-left-radius: 0.5rem;
}
&.last-col {
border-right: none;
}
@ -574,27 +497,12 @@ main.page-scores {
}
@media screen and (max-width: $device-s-width), (pointer: coarse) {
display: flex;
flex-direction: column;
width: 100%;
.cell {
padding: 0.5rem 0.75rem;
border-bottom: 1px dashed #ddd;
border-right: none;
&.last-row {
border-bottom: 1px dashed #ddd;
}
&.last-col {
border-bottom: 1px solid #bbb;
}
padding: 0.5rem;
gap: 0.5rem;
&.last-row.last-col {
border-bottom: none;
&.header {
padding: 0.75rem 0.5rem;
}
}
}
@ -907,8 +815,14 @@ main.page-admin {
grid-template-columns: auto 1fr auto auto;
width: 100%;
max-width: 80ch;
.cell {
&:nth-child(4) {
border-top-right-radius: 0.5rem;
}
&:nth-last-child(4) {
border-bottom-left-radius: 0.5rem;
}
}
}
}

Loading…
Cancel
Save