heonian-webdic/main.css
2022-06-10 05:12:45 +02:00

265 lines
4.5 KiB
CSS

@font-face {
font-family: "heonian";
src: url("./font.otf");
}
@keyframes clearly-cheating {
0% {
opacity: 1;
transform: translateY(0);
}
50% {
opacity: 0;
transform: translateY(-20px);
}
100% {
opacity: 1;
transform: translateY(0);
}
}
@keyframes not-cheating {
0% {
opacity: 0;
transform: translateY(-20px);
}
100% {
opacity: 1;
transform: translateY(0);
}
}
:root {
--font: "Helvetica Neue", Helvetica, Arial, sans-serif;
--font-h: "heonian", "Helvatica Neue", Helvetica, Arial, sans-serif;
--fg: rgb(0,0,0);
--bg: rgb(255,255,255);
--grey: rgb(152, 152, 152);
--darkgrey: rgb(100, 100, 100);
--link: rgb(27 120 151);
}
@media (prefers-color-scheme: dark) {
:root {
--fg: rgb(255,255,255);
--bg: rgb(0,0,0);
--grey: rgb(226, 226, 226);
--darkgrey: rgb(215, 215, 215);
--link: rgb(27 120 151);
}
}
body {
margin: 0;
padding: 0;
font-family: var(--font);
color: var(--fg);
background-color: var(--bg);
}
a {
color: var(--link);
text-decoration: none;
}
a:hover {
text-decoration: underline;
cursor: pointer;
}
.heonian {
font-family: "heonian";
}
header {
display: flex;
justify-content: space-around;
align-items: center;
flex-flow: row wrap;
padding-bottom: 4px; padding-top: 4px;
border-bottom: 1px solid var(--grey);
max-width: 1000px;
margin: auto;
}
header * {
margin: 8px;
}
header #search {
flex-grow: 1;
white-space: nowrap;
overflow-x: hidden;
}
header #search button {
all: unset;
position: relative;
left: -64px;
top: -2px;
width: 48px;
text-align: center;
height: 2rem;
border-left: 1px solid var(--grey);
color: var(--grey);
transition: 0.3s color ease;
cursor: pointer;
}
header input {
height: 2rem;
font-size: 1.5rem;
font-family: var(--font-h);
padding: 4px;
padding-right: calc(4px + 48px); /* space for heonian ime button */
border: 1px solid var(--grey);
border-radius: 4px;
font-weight: 100;
transition: border-color 0.3s;
width: calc(100% - 52px - 24px);
background-color: var(--bg);
color: var(--fg);
}
header input:focus {
outline: none;
border: 1px solid var(--darkgrey);
}
header span.heonian {
font-size: 1.5rem;
cursor: pointer;
user-select: none;
-webkit-user-select: none;
}
header.fullscreen {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
flex-flow: column;
justify-content: center;
padding-bottom: 0px; padding-top: 0px;
border-bottom: none;
max-width: unset;
}
header.fullscreen span.heonian {
font-size: 8rem;
cursor: default;
}
header.fullscreen #search {
flex-grow: 0;
max-width: 500px;
}
.header-animation {
animation: clearly-cheating 1s ease-in-out;
}
.header-animation-reverse {
animation: clearly-cheating 1s ease-in-out reverse;
}
main {
opacity: 0;
max-width: 600px;
margin: auto;
margin-top: calc(1rem + 24px);
padding-left: 1rem;
padding-right: 1rem;
}
.main-animation {
animation: not-cheating 0.5s ease-in-out;
}
.main-animation-reverse {
animation: not-cheating 0.5s ease-in-out reverse;
}
.capitalize {
text-transform: capitalize;
}
.result {
padding-bottom: 8px;
padding-top: 24px;
border-bottom: 1px solid var(--darkgrey);
}
.result:first-child {
padding-top: 0;
}
.result:last-child {
border-bottom: none;
}
.result-meaning {
padding-bottom: 8px;
}
.result .result-meaning:last-child {
padding-bottom: 0px;
}
.result-header {
font-family: var(--font-h);
font-size: 2.5rem;
}
.result-number {
color: var(--darkgrey);
font-size: 1.25rem;
}
.result-big {
font-size: 1.25rem;
}
.result-number::after {
content: ". ";
}
.result-notes {
font-size: 0.85rem;
color: var(--darkgrey);
margin-top: 6px;
margin-bottom: 6px;
border-left: 3px solid var(--darkgrey);
padding-left: 4px;
}
.result-translation {
font-size: 0.9rem;
color: var(--darkgrey);
}
.result summary {
margin-top: 4px;
color: grey;
}
.result details p {
margin-top: 4px;
margin-bottom: 4px;
font-size: 1.25rem;
}
.result details.result-meta p {
font-size: 1rem;
}
.results-header-count::after {
content: ", ";
}
.results-header-count:last-child::after {
content: "";
}
/* todo. organize this file better. this is a fucking mess */