leaky-ships/leaky-ships/styles/App.scss
2023-06-07 11:51:33 +02:00

416 lines
6.8 KiB
SCSS

@use "./mixins/display" as *;
@use "./mixins/effects" as *;
@import "./mixins/variables";
html,
body,
#__next {
height: 100%;
}
body {
margin: 0;
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen",
"Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue",
sans-serif;
}
* {
padding: 0;
margin: 0;
box-sizing: border-box;
}
.App {
text-align: center;
}
.App-logo {
height: 40vmin;
pointer-events: none;
}
.App-header {
background-color: $theme;
min-height: 100vh;
font-size: calc(10px + 2vmin);
color: white;
}
.App-link {
color: #61dafb;
}
@keyframes App-logo-spin {
from {
transform: rotate(0deg);
}
to {
transform: rotate(360deg);
}
}
#gamefield {
@include flex-col;
align-items: center;
justify-content: space-evenly;
height: 100vh;
}
#game-frame {
// $height: 864px;
$height: 648px;
$width: $height;
height: $height;
width: $width;
max-height: 100vw;
max-width: 100vw;
display: grid;
align-items: center;
justify-items: center;
grid-template-rows: 0.75fr repeat(12, 1fr) 0.75fr;
grid-template-columns: 0.75fr repeat(12, 1fr) 0.75fr;
overflow: hidden;
> .label {
grid-column: var(--x);
grid-row: var(--y);
}
> .border-tile {
box-sizing: border-box;
border: 1px solid blue;
height: 100%;
width: 100%;
grid-column: var(--x);
grid-row: var(--y);
&.edge {
border: 1px solid gray;
}
@include gradient-edge;
}
> :not(.border) {
box-sizing: border-box;
}
> span {
vertical-align: center;
user-select: none;
}
.ship {
height: 100%;
width: 100%;
position: relative;
@include flex-col;
align-items: center;
grid-row: var(--x);
pointer-events: none;
img {
@include pixelart;
position: absolute;
// height: 90%;
width: 90%;
// object-fit: cover;
}
&.s2 {
grid-column: 3 / 5;
}
&.s3 {
grid-column: 3 / 6;
}
&.s4 {
grid-column: 3 / 7;
}
}
.hit-svg {
// border: 2px solid blue;
// height: 50px;
// width: 50px;
height: 100%;
width: 100%;
position: relative;
@include flex;
// align-items: center;
// align-self: center;
// justify-self: center;
grid-column: var(--x);
grid-row: var(--y);
pointer-events: none;
svg {
position: absolute;
height: 100%;
width: 100%;
box-sizing: border-box;
padding: 25%;
&.fa-burst {
color: red;
}
}
&.target {
--color: red;
color: var(--color);
opacity: 0;
&.preview {
--color: orange;
}
}
&.preview {
opacity: 0;
@include transition(0.5s);
}
&.radar {
--color: limegreen;
svg {
opacity: 0;
}
&:not(.left):not(.right):not(.top):not(.bottom) {
// border: 5px solid var(--color);
grid-area: var(--y1) / var(--x1) / var(--y2) / var(--x2);
svg {
opacity: 1;
padding: 12.5%;
}
}
&.imply {
box-shadow: 0 0 6px 6px #fff4;
}
&.preview {
--color: forestgreen;
background-color: #0001;
// border: 5px dashed var(--color);
}
}
&.show {
opacity: 1;
}
&.imply > svg {
opacity: 0;
}
&.left {
border-left: 2px solid var(--color);
}
&.right {
border-right: 2px solid var(--color);
}
&.top {
border-top: 2px solid var(--color);
}
&.bottom {
border-bottom: 2px solid var(--color);
}
&.imply {
&.left {
border-left: 2px dashed white;
}
&.right {
border-right: 2px dashed white;
}
&.top {
border-top: 2px dashed white;
}
&.bottom {
border-bottom: 2px dashed white;
}
}
&.left.top {
border-top-left-radius: 8px;
}
&.right.top {
border-top-right-radius: 8px;
}
&.left.bottom {
border-bottom-left-radius: 8px;
}
&.right.bottom {
border-bottom-right-radius: 8px;
}
}
.r2 {
border: 2px solid green;
}
.r3 {
border: 2px solid yellowgreen;
}
.fog {
width: inherit;
pointer-events: none;
&:not(.middle) {
grid-area: 1 / 1 / -1 / -1;
transform-origin: 324px 0;
align-self: flex-start;
margin-top: 324px;
opacity: 1;
}
&.left {
transform: rotate(90deg);
animation: floatInl 3s ease-out;
@keyframes floatInl {
from {
transform: scale(2) rotate(90deg);
margin-left: -324px;
opacity: 0;
}
}
}
&.right {
transform: rotate(270deg);
animation: floatInr 3s ease-out;
@keyframes floatInr {
from {
transform: scale(2) rotate(270deg);
margin-left: 324px;
opacity: 0;
}
}
}
&.top {
animation: floatInt 3s ease-out;
@keyframes floatInt {
from {
transform: scale(2);
margin-top: 648px;
opacity: 0;
}
}
}
&.bottom {
transform: rotate(180deg);
animation: floatInb 3s ease-out;
@keyframes floatInb {
from {
transform: scale(2) rotate(180deg);
margin-top: 0;
opacity: 0;
}
}
}
&.middle {
grid-area: 4 / 4 / -4 / -4;
}
}
canvas {
grid-area: 1 / 1 / -1 / -1;
border: 1px solid #000;
border-radius: 0.5rem;
z-index: 1;
}
}
.event-bar {
@include flex-row;
padding: 1rem 3rem;
background-color: #fff9;
border-radius: 1rem;
.item {
@include flex-col;
align-items: center;
gap: 0.5rem;
width: 128px;
position: relative;
.react-colorful-wrapper {
pointer-events: none;
opacity: 0;
transition: 0.2s;
position: absolute;
top: -225px;
left: 50%;
transform: translateX(-50%);
z-index: 1;
box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
&.active {
pointer-events: auto;
opacity: 1;
}
}
.container {
width: initial;
position: relative;
padding: 8px;
background-color: white;
border-radius: 1rem;
&.disabled {
box-shadow: inset 0 0 1rem 1rem #888;
}
&.amount::after {
content: var(--amount);
position: absolute;
top: -8px;
right: -16px;
color: black;
background-color: white;
border: 1px solid black;
border-radius: 8px;
font-size: 16px;
padding: 2px 8px;
}
img {
width: 64px;
@include pixelart;
}
svg {
margin: 8px;
height: 48px;
display: inherit;
}
}
span {
color: black;
font-size: 0.75em;
font-weight: bold;
}
}
}