geochan/src/assets/css/style.css

412 lines
6.9 KiB
CSS
Raw Normal View History

2023-12-18 00:45:46 +01:00
/* TODO
* - nice color palette
* - nice fonts
* ... */
:root {
--bg: #e8eaf6;
--bg-nav: #feafd6;
--bg-nav-hover: color-mix(in srgb, var(--bg-nav), black 15%);
--heavy-text: black;
--text: #333333;
--light-text: #5a5a5a;
--quote: #FFB300;
--bg-post: #C5E1A5;
--border-post: #9dd162;
--bg-post-highlight: #9dd162;
--border-form: #FFB300;
--bg-form: #FCE4EC;
--bg-error-popup: red;
--border-error-popup: red;
--bg-id: DodgerBlue;
--bg-id-hover: red;
--bg-id-remote: gray;
--bg-id-remote-loading: #FCE4EC;
--bg-id-remote-not-found: black;
--bg-id-remote-ready: blue;
}
/* unset default */
ul {
list-style-type: none;
padding: 0;
margin-block: 0;
}
body {
margin: 0;
color: var(--light-text);
background-color: var(--bg);
font-size: 18px;
display: grid;
grid-template-rows: 3fr 97fr;
height: 100vh;
}
body * {
max-height: 100%;
}
nav {
background-color: var(--bg-nav);
display: flex;
justify-content: space-between;
}
nav div {
display: flex;
flex-direction: row;
}
.logout-btn {
all: unset;
outline: revert;
}
.logout-btn:hover {
cursor: pointer;
}
nav a, nav button,
.sub-nav a, .sub-nav button {
display: flex;
align-items: center;
text-decoration: none;
color: var(--heavy-text);
transition: all 0.3s ease;
padding-inline: 2vw;
}
nav a:hover, nav button:hover,
.sub-nav a:hover, .sub-nav button:hover {
background-color: var(--bg-nav-hover);
}
/* todo: use sub-grid? */
.home-page {
display: grid;
grid-template-columns: 60fr 40fr ;
width: 100%;
height: 100%;
}
.home-left, .home-right {
position: relative;
width: 100%;
height: 100%;
}
#map {
position: sticky !important;
height: 100vh;
width: 100%;
top: 0;
left: 0;
}
.home-left-navigation-div {
display: flex;
margin-bottom: 7vh;
justify-content: flex-end;
margin-right: 7vw;
}
.map-btn-div {
display: flex;
position: absolute;
bottom: 0;
margin-bottom: 7vh;
justify-content: flex-end;
right: 0;
margin-right: 7vw;
z-index: 999;
}
.new-thread-view {
margin-inline: 1vw;
margin-block: 3vw;
}
/* css trick to have a dropdown menu on click */
.dropdown {
position: relative;
display: grid;
grid-template-rows: 1fr;
grid-auto-rows: 0;
.dropdown-content, .dropdown-content-placeholder {
visibility: hidden;
display: flex;
flex-direction: column;
}
.dropdown-content {
transition: 0.2s ease-out;
z-index: 100000;
position: absolute;
top: 100%;
left: 0;
}
li {
background-color: var(--bg);
}
&:focus-within .dropdown-content {
visibility: visible;
}
.dropdown-arrow {
/* need to be block element to apply transform */
display: inline-block;
transition: 0.2s ease-out;
}
&:focus-within .dropdown-arrow {
transform: rotate(90deg);
}
.dropdown-open-btn, .dropdown-close-btn {
all: unset;
cursor: pointer;
user-select: none;
transition: 0.2s ease-out;
}
.dropdown-open-btn {
/* gap to add space between arrow and label */
display: flex;
gap: 3ch;
align-items: center;
}
.dropdown-open-btn:hover, .dropdown-open-btn:focus {
color: var(--bg-id-hover);
}
.dropdown-close-btn {
display: none;
position: absolute;
top: 0;
left: 0;
opacity: 0;
z-index: 99;
}
&:focus-within .dropdown-close-btn:not(:focus) {
display: inline-block;
min-width: 100%;
}
}
.thread-view {
display: flex;
flex-direction: column;
height: 100%;
}
.sub-nav {
display: flex;
flex-direction: row;
justify-content: space-between;
border-bottom: 1px solid black;
}
#bottom {
margin-top: auto;
}
.thread {
margin-inline: 1vw;
margin-block: 3vw;
}
.thread-subject {
color: var(--light-text);
font-size: 25px;
padding-left: 3vw;
padding-bottom: 1vh;
}
.thread-replies {
color: var(--light-text);
font-size: 20px;
display: flex;
flex-direction: column;
gap: 0.7vh;
}
.post {
background-color: var(--bg-post);
border: 1px solid var(--border-post);
border-top: none;
border-left: none;
padding: 5px;
padding-left: 10px;
width: fit-content;
max-width: 100%;
}
.post-info {
display: flex;
flex-direction: row;
gap: 0.2em;
align-items: center;
margin-bottom: 5px;
}
.post-info * {
text-align: center
}
.post-replies {
display: flex;
gap: 0.2em;
}
.post-id, .post-id-quote {
all: unset;
cursor: revert;
/* revert default focus ring */
outline: revert;
outline-offset: 3px;
background-color: var(--bg-id);
padding: 2px;
text-align: center;
transition: 0.2s ease-out;
display: inline-block;
height: calc(1lh - 2px);
border-radius: 6px;
}
.post-id-quote {
border-radius: 12px;
}
.post-id:hover, .post-id-quote:hover,
.post-id:focus, .post-id-quote:focus {
background-color: var(--bg-id-hover);
}
.post-id-quote.remote {
background-color: var(--bg-id-remote);
}
.post-id-quote.remote.loading {
background-color: var(--bg-id-remote-loading);
}
.post-id-quote.remote.not-found {
background-color: var(--bg-id-remote-not-found);
}
.post-id-quote.remote.ready {
background-color: var(--bg-id-remote-ready);
}
.post-author-nick, .post-link-to-self {
text-decoration: none;
color: unset;
font-style: italic;
transition: 0.2s ease-out;
}
.post-author-nick:hover, .post-link-to-self:hover,
.post-author-nick:focus, .post-link-to-self:focus {
color: var(--bg-id-hover);
}
.post-content {
display: flex;
gap: 10px;
}
/* TODO use image dim? better max-size? */
.post-image-div {
}
.post-image {
max-width: 90vw;
height: auto;
}
.post-image-small {
max-width: 30vw;
max-height: 30vh;
}
.post-comment {
color: var(--text);
padding-top: 10px;
overflow-wrap: break-word;
}
.line-quote {
color: var(--quote);
}
.selected, .highlighted {
background-color: var(--bg-post-highlight);
}
.open-reply-popup-btn {
/* TODO */
}
.reply-popup {
display: table;
position: fixed;
right: 1vw;
top: 40vh;
background-color: var(--bg-form);
border: 2px solid var(--border-form);
padding: 5px;
z-index: 999990;
}
.reply-popup-dragzone {
display: flex;
justify-content: end;
cursor: move;
}
.close-reply-popup-btn {
line-height: 0.5lh;
}
.reply-popup-content {
display: flex;
flex-direction: column;
gap: 1em;
label {
display: block;
}
textarea {
width: 40ch;
height: 15ch;
}
& > div:last-child {
display: flex;
justify-content: center;
margin-top: 1em;
}
}
.error-popup {
display: table;
position: fixed;
right: 1vw;
bottom: 1vh;
padding: 5px;
z-index: 999999;
background-color: var(--bg-error-popup);
border: 2px solid var(--border-error-popup);
border-radius: 12px;
}
.error-popup-dragzone {
display: flex;
justify-content: end;
cursor: move;
}
.close-error-popup-btn {
/* TODO
* - always have good contrast
* - better style
* same for reply-form */
line-height: 0.5lh;
}
.error-popup-content {
padding: 2vw;
font-size: 18px;
color: white;
}
.hidden {
visibility: hidden;
}
.off {
display: none;
}