webring-static/style.scss

388 lines
9.1 KiB
SCSS
Raw Normal View History

2023-07-18 03:29:32 +00:00
// dialogue font (the taller one)
@font-face {
font-family: "SOADialogue";
2023-07-18 03:54:15 +00:00
src: url("font/SOADialogue.ttf") format(truetype);
}
@font-face {
font-family: "SOAUI";
src: url("font/SOAUI.ttf") format(truetype);
2023-07-18 03:29:32 +00:00
}
:root {
// rendering scale
--pixel-scale: 2;
// 1rem = 1 source pixel at the current render scale
font-size: calc(var(--pixel-scale) * 1px);
// some other bullshit
--gradient-horiz-stripes: repeating-linear-gradient(to bottom,
#1d6c5a,
#1d6c5a 2rem,
#025a49 2rem,
#025a49 4rem
);
}
2023-07-19 21:15:44 +00:00
// helper for applying consistent text style
%text {
color: var(--text-color);
text-shadow:
1rem 0 var(--text-shadow),
1rem 1rem var(--text-shadow),
0 1rem var(--text-shadow);
}
2023-07-18 03:29:32 +00:00
// i don't need eyes anyway (transparency spotting)
body {
background: var(--gradient-horiz-stripes);
min-height: 100vh;
margin: 0;
padding-block: 9rem;
2023-07-18 03:29:32 +00:00
// more or less reasonable default probably
2023-07-18 03:54:15 +00:00
font-family: 'SOAUI';
font-size: 10rem;
color:white;
// ideally the background stays pixel aligned with the text for
// perfectionism reasons, however it doesn't look great and kind of flashes
// a lot, which might cause people who use reduced motion settings to have a
// bad time. prevent the background from scrolling with the page for them
@media (prefers-reduced-motion) {
background-attachment: fixed;
}
2023-07-18 03:54:15 +00:00
}
main {
max-width: 250rem;
padding-inline: 3rem;
2023-07-18 03:54:15 +00:00
margin: 0 auto;
2023-07-18 03:29:32 +00:00
}
// aren't text boxes fun
.textbox {
// i cannot believe there is no better way to do this than
// - inline-block, or
// - shove it in a flex container (which i won't do because we have enough
// containers)
display: inline-block;
2023-07-19 21:15:44 +00:00
--text-color: #424231;
--text-shadow: #C6C6B5;
2023-07-18 03:29:32 +00:00
// Most of the text box styles in the game are just recolors of the same
// thing
&--simple {
// Variables for all the different colors
--textbox-bg: #FFFFFF;
--textbox-bg-fade: #F7F7EF;
// make room for the handles which are `position:absolute`'d outside
// this box
margin: 0 9rem;
// set up basic frame of inner section
border: 1rem solid var(--textbox-border-outer);
background: var(--textbox-border-inner);
// who's ready for position shenanigans
position: relative;
// box handles
&::before,
&::after {
content: "";
display: block;
background: var(--textbox-handle-bg);
position: absolute;
top: 0;
bottom: 0;
// styles for left and right curves are present on both handles, but
// they're layered behind the main box
z-index: -1;
// width cannot be lower than this because we need to be able to
// shrink the box shadow of the element at least two stages without
// it disappearing entirely in order to make the rounded corners
// work
width: 7rem;
// hell world
box-shadow:
// background extensions
3rem 0 0 -1rem var(--textbox-handle-bg),
-3rem 0 0 -1rem var(--textbox-handle-bg),
6rem 0 0 -3rem var(--textbox-handle-bg),
-6rem 0 0 -3rem var(--textbox-handle-bg),
// horizontal border segments (very top and bottom)
0 1rem 0 0 var(--textbox-handle-border),
0 -1rem 0 0 var(--textbox-handle-border),
// vertical border segments
2rem 0 0 0rem var(--textbox-handle-border),
-2rem 0 0 0rem var(--textbox-handle-border),
4rem 0 0 -1rem var(--textbox-handle-border),
-4rem 0 0 -1rem var(--textbox-handle-border),
7rem 0 0 -3rem var(--textbox-handle-border),
-7rem 0 0 -3rem var(--textbox-handle-border);
}
&::before {
left: 1rem;
transform: translateX(-100%);
border-right: 0;
}
&::after {
right: 1rem;
transform: translateX(100%);
border-left: 0;
}
// if this is a selection button, the handles are annoyingly 1 source
// pixel wider, and the text region is tiny and empty
&.textbox--theme-button {
margin: 0 10rem;
&::before {
left: 0;
}
&::after {
right: 0;
}
.textbox__text {
width: 14rem;
height: 10rem;
}
}
}
// #region .textbox--simple color variants
&--yellow {
--textbox-border-outer: #7B6321;
--textbox-border-inner: #A58429;
--textbox-handle-bg: #FFB539;
--textbox-handle-border: #AD8400;
}
&--red {
--textbox-border-outer: #632921;
--textbox-border-inner: #7B3129;
--textbox-handle-bg: #C63908;
--textbox-handle-border: #9C3108;
}
&--green {
--textbox-border-outer: #215A18;
--textbox-border-inner: #216318;
--textbox-handle-bg: #42AD31;
--textbox-handle-border: #297321;
}
&--blue {
--textbox-border-outer: #084263;
--textbox-border-inner: #085284;
--textbox-handle-bg: #1084C6;
--textbox-handle-border: #005A94;
}
&--gray {
--textbox-border-outer: #4A4242;
--textbox-border-inner: #5A5A52;
--textbox-handle-bg: #7B7B73;
--textbox-handle-border: #5E5E55;
}
&--pink {
--textbox-border-outer: #CE394A;
--textbox-border-inner: #E76B6B;
--textbox-handle-bg: #F79CA5;
--textbox-handle-border: #EF6B7B;
}
// #endregion
2023-07-19 21:15:44 +00:00
// TODO: implement the other styles of box frames
2023-07-18 03:29:32 +00:00
// Text inside the text box
&__text {
// offset by a bit to leave room for the rounded corners we do via box
// shadow
margin: 2rem;
// in game this region is 228x38, but again, part of that is done via
// box shadows because pixelated round corners are hard, so we subtract
// that margin
width: 224rem;
2023-07-18 03:54:15 +00:00
min-height: 34rem;
2023-07-19 22:11:07 +00:00
// this accounts for a bunch of things including the width of the
// handles and the padding of <main>
max-width: calc(100vw - 32rem);
2023-07-19 22:19:32 +00:00
// do not overflow outside the box
overflow-wrap: break-word;
2023-07-18 03:29:32 +00:00
// get the slightly off-white region around the text
box-shadow:
0 2rem 0 -1rem var(--textbox-bg-fade),
0 -2rem 0 -1rem var(--textbox-bg-fade),
2rem 0 0 -1rem var(--textbox-bg-fade),
-2rem 0 0 -1rem var(--textbox-bg-fade),
inset 0 0 0 1rem var(--textbox-bg-fade);
// the innermost part with the text is just white
background: var(--textbox-bg);
// text still needs to be offset a bit from left/right
padding: 0 1rem;
// font setup
font-family: "SOADialogue";
// font exported with 10px ascenders, 2px descenders
2023-07-18 03:54:15 +00:00
font-size: 12rem;
2023-07-18 03:29:32 +00:00
// trying our goddamn best to make the browser render the pixel font
// correctly, except i dont think this actually helps lol
// text-rendering: geometricPrecision;
2023-07-19 21:15:44 +00:00
// apply text styles (--text-color and --text-shadow are inherited
@extend %text;
2023-07-18 03:29:32 +00:00
}
&__advance {
--background: #FFF;
--border: #000;
--shadow: #42424A;
position: absolute;
bottom: 8rem;
right: -6rem;
width: 2rem;
height: 2rem;
background: var(--background);
box-shadow:
// background
// top and middle
-1rem 0 var(--background),
-2rem -2rem var(--background),
-1rem -2rem var(--background),
1rem -2rem var(--background),
// tip of triangle
-0.5rem 1.5rem 0 -0.5rem var(--background),
-0.5rem 2.5rem 0 -0.5rem var(--background),
// borders
// top segments
-2.5rem -2.5rem 0 0.5rem var(--border),
1.5rem -2.5rem 0 0.5rem var(--border),
0 -3rem 0 0 var(--border),
// middle segments
-2rem 0 var(--border),
1rem 0 var(--border),
-1rem 2rem var(--border),
0 2rem var(--border),
// tip
-0.5rem 3.5rem 0 -0.5rem var(--border),
// shadow
// top segments
-1.5rem -1.5rem 0 0.5rem var(--shadow),
2.5rem -1.5rem 0 0.5rem var(--shadow),
1rem -2rem 0 0 var(--shadow),
// middle segments
-1rem 1rem var(--shadow),
2rem 1rem var(--shadow),
0 3rem var(--shadow),
1rem 3rem var(--shadow),
// tip
0.5rem 4.5rem 0 -0.5rem var(--shadow);
@keyframes bounce {
from {
transform: translateY(0);
}
25% {
transform: translateY(-1rem);
}
50% {
transform: translateY(-2rem);
}
75% {
transform: translateY(-1rem);
}
to {
transform: translateY(0);
}
}
@media not (prefers-reduced-motion) {
animation: calc(2 / 3 * 1s) steps(1) bounce infinite;
}
}
2023-07-18 03:29:32 +00:00
}
// custom text colors in text boxes
2023-07-19 21:15:44 +00:00
.color {
@extend %text;
2023-07-18 03:29:32 +00:00
&--red {
2023-07-19 21:15:44 +00:00
--text-color: #C54700;
--text-shadow: #EFC6A5;
2023-07-18 03:29:32 +00:00
}
&--blue {
2023-07-19 21:15:44 +00:00
--text-color: #6352FF;
--text-shadow: #CEC6F7;
2023-07-18 03:29:32 +00:00
}
}
2023-07-19 21:15:44 +00:00
// links do a thing
a {
color: inherit;
text-decoration-thickness: 1rem;
text-underline-offset: 1rem;
text-decoration-skip-ink: none;
}
code {
font: inherit;
background: #7B7B7BBB;
}
2023-07-19 22:19:32 +00:00
ul, ol {
padding-inline-start: 1em;
}
2023-07-19 21:15:44 +00:00
ul {
2023-07-19 22:19:32 +00:00
list-style-type: "· ";
2023-07-19 21:15:44 +00:00
}
2023-07-19 21:50:45 +00:00
.silly-little-images {
2023-07-18 03:29:32 +00:00
display: flex;
2023-07-19 21:50:45 +00:00
justify-content: center;
align-items: flex-end;
margin-bottom: 1em;
img {
image-rendering: crisp-edges;
// transform: scale(calc(100% * var(--pixel-scale)));
// transform-origin: bottom;
}
2023-07-19 22:22:21 +00:00
:first-child {
margin-inline-end: -6rem;
margin-bottom: -5rem;
}
2023-07-18 03:29:32 +00:00
}
2024-09-06 11:07:41 +00:00
.eightyeightbythirtyones {
display: flex;
flex-wrap: wrap;
align-items: center;
justify-content: center;
padding: calc(2px * var(--pixel-scale));
gap: calc(2px * var(--pixel-scale));
img {
display: block;
box-shadow: 0 0 0 calc(1px * var(--pixel-scale)) rgb(255 255 255 / 0.5)
}
}