breakout71/src/game.less

588 lines
8.9 KiB
Text
Raw Normal View History

2025-03-14 16:13:43 +01:00
* {
2025-04-07 14:08:48 +02:00
font-family:
Courier New,
Courier,
Lucida Sans Typewriter,
Lucida Typewriter,
monospace;
2025-03-14 16:13:43 +01:00
box-sizing: border-box;
}
2025-04-18 21:17:32 +02:00
@purple: #6262ea;
2025-03-14 16:13:43 +01:00
body {
margin: 0;
padding: 0;
overflow: hidden;
width: 100vw;
height: 100vh;
height: calc(var(--vh, 1vh) * 100);
color: white;
background-size: 120px 120px;
background-color: var(--background1);
--background1: #030c23;
--background2: #03112a;
}
#game {
2025-03-20 18:44:46 +01:00
position: fixed;
2025-03-14 16:13:43 +01:00
top: 0;
left: 0;
height: 100vh;
height: calc(var(--vh, 1vh) * 100);
width: 100vw;
}
canvas:not(#game) {
display: none;
}
2025-03-14 16:13:43 +01:00
#score,
#menu {
position: absolute;
top: 0;
z-index: 1;
padding: 10px;
appearance: none;
background: none;
border: none;
font: inherit;
color: white;
min-width: 40px;
min-height: 40px;
line-height: 20px;
max-width: calc(100vw - 80px);
overflow: hidden;
2025-04-02 10:41:35 +02:00
2025-03-14 16:13:43 +01:00
&:hover,
&:focus {
background: rgba(0, 0, 0, 0.3);
cursor: pointer;
}
2025-03-29 21:05:53 +01:00
text-shadow: 0 0 4px var(--level-background);
2025-03-14 16:13:43 +01:00
}
#score {
right: 0;
2025-03-16 18:24:48 +01:00
color: white;
2025-03-15 10:58:37 +01:00
transition: color 0.3s;
2025-03-29 21:05:53 +01:00
2025-04-01 18:33:58 +02:00
&.active .score {
2025-03-15 10:58:37 +01:00
color: gold;
transition: color 0.01s;
}
2025-04-14 13:39:30 +02:00
2025-04-15 16:47:04 +02:00
&.computer_controlled {
pointer-events: none;
2025-04-12 20:58:24 +02:00
}
2025-03-29 20:45:54 +01:00
2025-03-29 21:05:53 +01:00
span {
2025-03-31 20:08:17 +02:00
color: rgba(255, 255, 255, 0.8);
2025-03-29 20:45:54 +01:00
2025-03-29 21:05:53 +01:00
&.great {
color: lightgreen;
}
&.good {
color: white;
}
2025-03-29 21:05:53 +01:00
&.bad {
color: white;
}
2025-03-29 20:45:54 +01:00
}
2025-03-14 16:13:43 +01:00
}
#menu {
left: 0;
}
2025-03-20 18:44:46 +01:00
body.has-alert-open {
height: auto;
overflow: visible;
}
2025-03-29 21:05:53 +01:00
2025-03-20 18:44:46 +01:00
body:not(.has-alert-open) #popup {
display: none;
}
2025-03-29 21:05:53 +01:00
2025-03-20 18:44:46 +01:00
#popup {
&::before {
2025-04-20 12:56:50 +02:00
z-index: 4;
2025-03-20 18:44:46 +01:00
content: "";
display: block;
position: fixed;
inset: 0;
background: rgba(0, 0, 0, 0.9);
}
2025-03-14 16:13:43 +01:00
display: flex;
overflow: auto;
& > div {
2025-04-20 12:56:50 +02:00
z-index: 5;
2025-03-20 18:44:46 +01:00
position: relative;
2025-03-14 16:13:43 +01:00
margin: auto;
padding: 20px 10px;
transform-origin: center;
display: flex;
flex-direction: column;
align-items: stretch;
width: 100%;
2025-03-31 20:08:17 +02:00
max-width: 500px;
2025-03-14 16:13:43 +01:00
& > * {
padding: 0;
2025-03-27 10:52:31 +01:00
margin: 0 0 20px 0;
2025-03-14 16:13:43 +01:00
}
& > section {
display: flex;
flex-direction: column;
align-items: stretch;
button {
font: inherit;
background: rgba(0, 0, 0, 0.8);
color: white;
padding: 10px;
cursor: pointer;
border: 1px solid white;
text-align: left;
display: flex;
gap: 10px;
margin-top: -1px;
&:not([disabled]):hover,
&:not([disabled]):focus {
border-color: #f1d33b;
position: relative;
z-index: 1;
}
&[disabled] {
opacity: 0.5;
filter: saturate(0);
2025-04-06 15:38:30 +02:00
//pointer-events: none;
cursor: not-allowed;
2025-03-14 16:13:43 +01:00
}
& > div {
flex-grow: 1;
}
& > div > em {
display: block;
opacity: 0.8;
}
&.grey-out-unless-hovered {
&:not(:hover) {
opacity: 0.6;
img {
filter: saturate(0);
}
}
2025-04-02 10:41:35 +02:00
2025-04-01 13:35:33 +02:00
&[disabled] {
opacity: 0.2;
}
2025-03-14 16:13:43 +01:00
}
}
}
}
&.actionsAsGrid > div {
max-width: none;
2025-03-14 16:13:43 +01:00
2025-04-01 13:39:09 +02:00
& > div,
& > p,
& > h1,
& > h2 {
2025-04-01 13:35:33 +02:00
width: 100%;
max-width: 550px;
margin-left: auto;
margin-right: auto;
}
2025-04-02 10:41:35 +02:00
2025-03-14 16:13:43 +01:00
section {
display: grid;
grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
}
}
2025-03-20 18:44:46 +01:00
button#close-modale {
2025-03-14 16:13:43 +01:00
color: white;
2025-03-31 20:13:47 +02:00
position: fixed;
2025-03-14 16:13:43 +01:00
top: 0;
right: 0;
width: 60px;
height: 60px;
background: transparent;
border: none;
cursor: pointer;
overflow: hidden;
2025-04-20 12:56:50 +02:00
z-index: 6;
2025-03-14 16:13:43 +01:00
&:before {
content: "+";
position: absolute;
transform: translate(-50%, -50%) rotate(45deg);
font-size: 80px;
display: inline-block;
top: 34px;
left: 26px;
}
&:hover {
font-weight: bold;
background: black;
}
}
.textAfterButtons {
color: rgba(255, 255, 255, 0.58);
}
a[href] {
color: inherit;
&:hover,
&:focus {
color: white;
}
}
@media (min-width: 1400px) {
&.settings {
&:before {
opacity: 0;
}
& > div {
margin-right: 0;
2025-04-04 12:07:51 +02:00
max-width: 400px;
}
}
}
2025-03-14 16:13:43 +01:00
}
#level-recording-container {
max-width: 400px;
text-align: center;
margin: 40px;
video {
max-width: 100%;
height: auto;
}
a {
display: block;
video {
border-radius: 10px;
display: block;
outline: 1px solid white;
box-shadow: 2px 2px 5px black;
margin: 20px auto;
}
}
}
.histogram {
display: flex;
gap: 10px;
align-items: stretch;
margin: 10px 0 40px 0;
& > span {
/* Hover zone */
flex-grow: 1;
width: 10px;
position: relative;
display: flex;
flex-direction: column;
justify-content: flex-end;
&.active > span {
background: #4049ca;
}
& > span {
/*Visible bar*/
background: #1c1c2f;
width: 100%;
display: block;
border-radius: 5px;
min-height: 1px;
& > span {
/*label */
position: absolute;
bottom: -20px;
pointer-events: none;
white-space: nowrap;
transform-origin: bottom left;
font-size: 13px;
text-align: center;
display: block;
left: 50%;
transform: translate(-50%, 0);
}
}
}
2025-03-29 21:05:53 +01:00
& > span:not(:hover):not(.active) > span > span {
2025-03-14 16:13:43 +01:00
opacity: 0;
2025-03-14 19:43:19 +01:00
}
2025-03-14 16:13:43 +01:00
}
h2.histogram-title {
color: #3b3f75;
font-size: 18px;
}
h2.histogram-title strong {
color: #4049ca;
}
2025-03-27 10:52:31 +01:00
.red-icon {
background: red;
2025-03-29 21:05:53 +01:00
2025-03-27 10:52:31 +01:00
img {
filter: saturate(0);
mix-blend-mode: luminosity;
}
}
2025-03-29 20:45:54 +01:00
.upgrade {
display: flex;
gap: 2px;
margin: 0 0 10px 0;
img {
width: 32px;
height: 32px;
}
2025-04-02 10:41:35 +02:00
p {
flex-grow: 1;
color: rgba(255, 255, 255, 0.6);
margin: 0 20px;
}
2025-04-02 10:41:35 +02:00
&.used p strong {
color: white;
}
2025-04-02 10:41:35 +02:00
& > span {
flex-grow: 0;
flex-shrink: 0;
width: 5px;
display: inline-block;
height: 32px;
align-self: center;
&.used {
background: #fff;
}
&.free {
background: #fff;
2025-04-01 18:26:40 +02:00
opacity: 0.25;
}
&.banned {
background: red;
}
}
2025-04-02 10:41:35 +02:00
&.used {
opacity: 1;
}
&.free {
opacity: 0.8;
}
&.banned {
opacity: 0.8;
}
}
2025-04-01 13:35:33 +02:00
#tooltip {
display: block;
2025-04-01 13:39:09 +02:00
position: fixed;
2025-04-01 13:35:33 +02:00
left: 0;
2025-04-01 13:39:09 +02:00
top: 0;
background: black;
color: white;
padding: 10px;
2025-04-20 12:56:50 +02:00
z-index: 5;
2025-04-01 13:35:33 +02:00
border-radius: 2px;
pointer-events: none;
user-select: none;
opacity: 1;
border: 1px solid white;
max-width: 300px;
2025-04-01 13:39:09 +02:00
}
2025-04-07 08:24:17 +02:00
#popup.history > div {
max-width: none;
table {
2025-04-07 14:08:48 +02:00
th:hover {
2025-04-07 08:24:17 +02:00
cursor: pointer;
background: black;
}
2025-04-14 13:39:30 +02:00
2025-04-07 14:08:48 +02:00
td,
th {
2025-04-07 08:24:17 +02:00
padding: 0 5px;
line-height: 20px;
text-align: right;
}
2025-04-07 14:08:48 +02:00
th:first-child,
td:first-child {
text-align: left;
2025-04-07 08:24:17 +02:00
}
2025-04-14 13:39:30 +02:00
2025-04-07 14:08:48 +02:00
img {
2025-04-07 08:24:17 +02:00
width: 20px;
2025-04-07 14:08:48 +02:00
height: auto;
2025-04-07 08:24:17 +02:00
pointer-events: none;
}
2025-04-14 13:39:30 +02:00
2025-04-07 14:08:48 +02:00
tr:nth-child(2n) {
background: rgba(0, 0, 0, 0.58);
}
2025-04-07 08:24:17 +02:00
}
}
2025-04-07 14:08:48 +02:00
.progress-inline {
position: absolute;
display: block;
background: grey;
left: 62px;
right: 2px;
height: 7px;
bottom: 2px;
border-radius: 2px;
2025-04-14 13:39:30 +02:00
2025-04-07 14:08:48 +02:00
span {
position: absolute;
inset: 1px;
transform-origin: top left;
background: white;
}
}
2025-04-08 10:36:30 +02:00
.toast {
2025-04-08 14:03:38 +02:00
position: fixed;
left: 0;
top: 40px;
display: flex;
align-items: center;
gap: 10px;
opacity: 0.8;
background: black;
border: 1px solid white;
border-radius: 2px;
padding-right: 10px;
2025-04-08 10:36:30 +02:00
pointer-events: none;
2025-04-15 21:28:00 +02:00
transition:
opacity 200ms,
transform 200ms;
2025-04-20 12:56:50 +02:00
z-index: 7;
2025-04-15 21:28:00 +02:00
&.hidden {
2025-04-08 10:36:30 +02:00
opacity: 0;
2025-04-08 14:03:38 +02:00
transform: translate(-20px, -20px) scale(0.5);
2025-04-08 10:36:30 +02:00
}
2025-04-15 21:28:00 +02:00
&.visible {
2025-04-08 10:36:30 +02:00
opacity: 0.8;
transform: none;
}
2025-04-08 14:03:38 +02:00
}
2025-04-14 13:39:30 +02:00
.gridEdit > div > span,
.palette > span {
display: inline-flex;
align-items: center;
justify-content: center;
width: 40px;
height: 40px;
border: 1px solid;
cursor: pointer;
&:hover {
border-color: gold;
z-index: 1;
position: relative;
box-shadow: inset 2px 2px 4px rgba(0, 0, 0, 0.2);
}
}
.gridEdit {
& > div {
display: flex;
& > span {
width: calc(min(500px, 100vw, 100vh - 200px) / var(--grid-size));
height: calc(min(500px, 100vw, 100vh - 200px) / var(--grid-size));
}
}
}
.palette {
display: flex;
flex-wrap: wrap;
& > span {
&[data-selected="true"] {
border: 2px solid white;
}
}
}
2025-04-18 21:17:32 +02:00
#stats {
position: fixed;
left: 0;
top: 40px;
width: 100vw;
max-width: 400px;
color: white;
z-index: 3;
pointer-events: none;
opacity: 1;
& > div {
background: rgba(38, 38, 38, 0.5);
position: relative;
> div {
background: @purple;
position: absolute;
inset: 0;
transform-origin: top left;
}
> strong {
position: relative;
padding: 0 5px;
}
}
}
.highlight {
position: relative;
&:before {
content: "";
position: absolute;
inset: 0;
background: linear-gradient(-45deg, @purple, transparent);
mix-blend-mode: screen;
opacity: 0.3;
}
}