Compare commits
1 Commits
feature/ma
...
04a0e1a912
| Author | SHA1 | Date | |
|---|---|---|---|
| 04a0e1a912 |
@@ -1,244 +1,117 @@
|
|||||||
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@100..900&display=swap');
|
|
||||||
|
|
||||||
* {
|
* {
|
||||||
--clr-light-a0: #ffffff;
|
margin: 0;
|
||||||
--clr-light-a10: #f4f4f4;
|
padding: 0;
|
||||||
--clr-light-a20: #e0e0e0;
|
|
||||||
--clr-light-a30: #c2c2c2;
|
|
||||||
--clr-light-a40: #a3a3a3;
|
|
||||||
--clr-light-a50: #858585;
|
|
||||||
--clr-dark: #000000;
|
|
||||||
|
|
||||||
--clr-surface-a0: #FFF6E5;
|
|
||||||
--clr-surface-a10: #f7f7f7;
|
|
||||||
--clr-surface-a20: #DADEEF;
|
|
||||||
--clr-surface-a30: #e0e0e0;
|
|
||||||
--clr-surface-a40: #d1d1d1;
|
|
||||||
--clr-surface-a50: #c2c2c2;
|
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
}
|
}
|
||||||
|
|
||||||
html {
|
html, body {
|
||||||
font-size: 100%;
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
overflow: hidden;
|
||||||
}
|
}
|
||||||
|
|
||||||
body {
|
body {
|
||||||
background-color: var(--clr-surface-a0);
|
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
|
||||||
font-family: 'Inter', sans-serif;
|
|
||||||
margin: 0;
|
|
||||||
padding: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.hero {
|
|
||||||
position: relative;
|
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: row;
|
|
||||||
justify-content: center;
|
|
||||||
align-items: center;
|
align-items: center;
|
||||||
min-height: 100vh;
|
justify-content: center;
|
||||||
gap: 3rem;
|
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
|
||||||
padding: 2rem clamp(1rem, 4vw, 3rem);
|
|
||||||
box-sizing: border-box;
|
|
||||||
background: var(--clr-surface-a10);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.adsbanner {
|
main {
|
||||||
position: absolute;
|
display: flex;
|
||||||
top: 50%;
|
align-items: center;
|
||||||
left: clamp(0.75rem, 3vw, 2.5rem);
|
justify-content: center;
|
||||||
transform: translateY(-50%);
|
padding: 20px;
|
||||||
z-index: 5;
|
border-radius: 15px;
|
||||||
width: clamp(160px, 22vw, 300px);
|
background: rgba(255, 255, 255, 0.1);
|
||||||
aspect-ratio: 9 / 16;
|
backdrop-filter: blur(4px);
|
||||||
box-shadow: 0 18px 40px rgba(0,0,0,0.18);
|
min-width: fit-content;
|
||||||
|
flex-shrink: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.adsbanner.is-hidden {
|
.map {
|
||||||
display: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
.leftadsbanner {
|
|
||||||
position: absolute;
|
|
||||||
top: 50%;
|
|
||||||
right: clamp(0.75rem, 3vw, 2.5rem);
|
|
||||||
transform: translateY(-50%);
|
|
||||||
z-index: 5;
|
|
||||||
width: clamp(160px, 22vw, 300px);
|
|
||||||
aspect-ratio: 9 / 16;
|
|
||||||
}
|
|
||||||
|
|
||||||
.hero-content {
|
|
||||||
max-width: 90vw;
|
|
||||||
text-align: left;
|
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
align-items: center;
|
gap: 2px;
|
||||||
background: var(--clr-surface-a20);
|
padding: 15px;
|
||||||
border-radius: 1.5rem;
|
background: rgba(0, 0, 0, 0.2);
|
||||||
padding: 2rem clamp(2rem, 8vw, 10rem);
|
border-radius: 10px;
|
||||||
box-shadow: 0px 0px 27px 14px rgba(0,0,0,0.2);
|
width: fit-content;
|
||||||
|
height: fit-content;
|
||||||
}
|
}
|
||||||
|
|
||||||
.hero-content-text {
|
.lign {
|
||||||
|
display: flex;
|
||||||
|
margin: 2px 2px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.cell {
|
||||||
|
border: 2px solid rgba(255, 255, 255, 0.3);
|
||||||
|
border-radius: 5px;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
transition: all 0.2s ease;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
margin: 2px 2px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.hero h1 {
|
.empty {
|
||||||
color: var(--clr-dark);
|
background-color: rgba(200, 200, 200, 0.3);
|
||||||
font-size: clamp(2.5rem, 7vw, 4rem);
|
|
||||||
margin: 0 0 1rem 0;
|
|
||||||
line-height: 1.1;
|
|
||||||
word-break: break-word;
|
|
||||||
text-shadow: none;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.hero-content button {
|
.empty:hover {
|
||||||
margin-top: 2rem;
|
background-color: rgba(200, 200, 200, 0.5);
|
||||||
align-self: center;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.hero img {
|
.laser {
|
||||||
max-width: 400px;
|
background-color: #FFD700;
|
||||||
width: 35vw;
|
border-color: #FFA500;
|
||||||
min-width: 180px;
|
|
||||||
height: auto;
|
|
||||||
border-radius: 1.5rem;
|
|
||||||
box-shadow: 0 6px 32px rgba(0,0,0,.10);
|
|
||||||
flex-shrink: 1;
|
|
||||||
background: var(--clr-surface-a0);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* --- RESPONSIVE HERO-PLAY-BUTTON FIXES --- */
|
.colored-laser {
|
||||||
|
background: linear-gradient(45deg, #FF1493, #00CED1);
|
||||||
@media (max-width: 900px) {
|
box-shadow: inset 0 0 10px rgba(255, 20, 147, 0.6);
|
||||||
.hero {
|
border-color: #FF1493;
|
||||||
flex-direction: column;
|
|
||||||
text-align: center;
|
|
||||||
gap: 2rem;
|
|
||||||
padding: 1.5rem;
|
|
||||||
}
|
|
||||||
.hero-content {
|
|
||||||
max-width: 100vw;
|
|
||||||
text-align: center;
|
|
||||||
padding: 2rem;
|
|
||||||
}
|
|
||||||
.hero-content {
|
|
||||||
align-items: center;
|
|
||||||
}
|
|
||||||
.adsbanner {
|
|
||||||
left: 1rem;
|
|
||||||
width: clamp(130px, 24vw, 220px);
|
|
||||||
}
|
|
||||||
.leftadsbanner {
|
|
||||||
right: 1rem;
|
|
||||||
width: clamp(130px, 24vw, 220px);
|
|
||||||
}
|
|
||||||
.hero img {
|
|
||||||
max-width: 70vw;
|
|
||||||
min-width: 0;
|
|
||||||
}
|
|
||||||
.hero-play-button {
|
|
||||||
padding: 1rem 4vw;
|
|
||||||
font-size: 1.1rem;
|
|
||||||
min-width: min(220px, 70vw);
|
|
||||||
max-width: 90vw;
|
|
||||||
}
|
|
||||||
.hero-play-button svg {
|
|
||||||
width: 2em;
|
|
||||||
height: 1em;
|
|
||||||
min-width: 1.25em;
|
|
||||||
min-height: 1em;
|
|
||||||
margin-right: 0.5em;
|
|
||||||
flex-shrink: 0;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@media (max-width: 600px) {
|
.mirror {
|
||||||
.hero {
|
background: linear-gradient(45deg, #C0C0C0 25%, transparent 25%, transparent 75%, #C0C0C0 75%) / 10px 10px;
|
||||||
min-height: 70vh;
|
background-color: #E8E8E8;
|
||||||
padding: 0.5rem;
|
border-color: #A9A9A9;
|
||||||
}
|
|
||||||
.hero-content {
|
|
||||||
padding: 1.5rem;
|
|
||||||
}
|
|
||||||
.hero h1 {
|
|
||||||
font-size: clamp(2rem, 9vw, 2.5rem);
|
|
||||||
}
|
|
||||||
.hero p {
|
|
||||||
font-size: clamp(1rem, 5vw, 1.15rem);
|
|
||||||
}
|
|
||||||
.adsbanner {
|
|
||||||
top: 1rem;
|
|
||||||
left: 0.75rem;
|
|
||||||
transform: none;
|
|
||||||
width: clamp(110px, 30vw, 170px);
|
|
||||||
border-radius: 1rem;
|
|
||||||
}
|
|
||||||
.leftadsbanner {
|
|
||||||
right: 0.75rem;
|
|
||||||
width: clamp(110px, 30vw, 170px);
|
|
||||||
border-radius: 1rem;
|
|
||||||
}
|
|
||||||
.hero img {
|
|
||||||
max-width: 100%;
|
|
||||||
border-radius: 1rem;
|
|
||||||
box-shadow: 0 2px 12px rgba(0,0,0,.07);
|
|
||||||
}
|
|
||||||
.hero-play-button {
|
|
||||||
padding: 0.85rem 3vw;
|
|
||||||
min-width: min(120px, 92vw);
|
|
||||||
max-width: 96vw;
|
|
||||||
font-size: 1rem;
|
|
||||||
}
|
|
||||||
.hero-play-button svg {
|
|
||||||
width: 1.3em;
|
|
||||||
height: 1em;
|
|
||||||
min-width: 1em;
|
|
||||||
min-height: 1em;
|
|
||||||
margin-right: 0.45em;
|
|
||||||
flex-shrink: 0;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.hero-play-button {
|
.door {
|
||||||
font-family: inherit;
|
background-color: #8B4513;
|
||||||
font-size: 20px;
|
border-color: #654321;
|
||||||
background: #8ea3fd;
|
position: relative;
|
||||||
color: white;
|
|
||||||
padding: 1rem 10rem;
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
justify-content: center; /* Ensure SVG/button content is horizontally centered */
|
|
||||||
border: none;
|
|
||||||
border-radius: 50px;
|
|
||||||
overflow: hidden;
|
|
||||||
transition: all 0.2s;
|
|
||||||
cursor: pointer;
|
|
||||||
box-shadow: 0 2px 8px rgba(30, 80, 255, 0.10);
|
|
||||||
/* Button grows/shrinks with container at low widths */
|
|
||||||
width: 100%;
|
|
||||||
max-width: 500px;
|
|
||||||
min-width: 180px;
|
|
||||||
box-sizing: border-box;
|
|
||||||
}
|
|
||||||
.hero-play-button:hover {
|
|
||||||
background: #7286e0;
|
|
||||||
transform: translateY(-2px);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.hero-play-button:active {
|
.door::after {
|
||||||
transform: scale(0.95);
|
content: '🚪';
|
||||||
|
font-size: 24px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.hero-play-button svg {
|
.button {
|
||||||
width: 2em;
|
background-color: #FF6347;
|
||||||
height: 1em;
|
border-color: #DC143C;
|
||||||
min-width: 1.2em;
|
border-radius: 50%;
|
||||||
min-height: 1em;
|
|
||||||
margin-right: 0.6em;
|
|
||||||
color: var(--clr-surface-a0);
|
|
||||||
flex-shrink: 0;
|
|
||||||
flex-grow: 0;
|
|
||||||
display: inline-block;
|
|
||||||
vertical-align: middle;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.wall {
|
||||||
|
background-color: #2F4F4F;
|
||||||
|
border-color: #000000;
|
||||||
|
box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.8);
|
||||||
|
}
|
||||||
|
|
||||||
|
.demi-wall {
|
||||||
|
background: linear-gradient(to right, #2F4F4F 50%, rgba(200, 200, 200, 0.3) 50%);
|
||||||
|
border-color: #444444;
|
||||||
|
}
|
||||||
|
|
||||||
|
.target {
|
||||||
|
background: radial-gradient(circle, #00FF00 30%, rgba(0, 255, 0, 0.3) 70%);
|
||||||
|
border-color: #00CC00;
|
||||||
|
}
|
||||||
@@ -0,0 +1,79 @@
|
|||||||
|
// Legend of grid case
|
||||||
|
|
||||||
|
const legend = {
|
||||||
|
empty: 0,
|
||||||
|
laser: 1,
|
||||||
|
coloredLaser: 2,
|
||||||
|
mirror: 3,
|
||||||
|
door:4,
|
||||||
|
button: 5,
|
||||||
|
wall: 6,
|
||||||
|
demiWall: 7,
|
||||||
|
target: 8,
|
||||||
|
}
|
||||||
|
|
||||||
|
// Grid test
|
||||||
|
|
||||||
|
let grid = [
|
||||||
|
[0, 0, 0, 0, 0, 0, 0, 0],
|
||||||
|
[0, 1, 0, 0, 0, 0, 0, 0],
|
||||||
|
[0, 0, 3, 0, 0, 0, 0, 0],
|
||||||
|
[0, 0, 0, 0, 0, 0, 0, 0],
|
||||||
|
[0, 0, 0, 0, 0, 0, 0, 0],
|
||||||
|
[0, 0, 0, 0, 0, 0, 0, 0],
|
||||||
|
[0, 0, 0, 0, 0, 0, 8, 0],
|
||||||
|
[0, 0, 0, 0, 0, 0, 0, 0],
|
||||||
|
]
|
||||||
|
|
||||||
|
// Function to print grid
|
||||||
|
|
||||||
|
function loadGrid () {
|
||||||
|
const mapDiv = document.getElementById("map"); // Div with map in DOM
|
||||||
|
mapDiv.innerHTML = "";
|
||||||
|
|
||||||
|
for (let y = 0; y < grid.length; y++) {
|
||||||
|
const lign = document.createElement("div");
|
||||||
|
lign.classList.add("lign");
|
||||||
|
|
||||||
|
for (let x = 0; x < grid[y].length; x++) {
|
||||||
|
const cell = document.createElement("div");
|
||||||
|
cell.classList.add("cell");
|
||||||
|
|
||||||
|
switch (grid[y][x]) {
|
||||||
|
case legend.empty:
|
||||||
|
cell.classList.add("empty");
|
||||||
|
break;
|
||||||
|
case legend.laser:
|
||||||
|
cell.classList.add("laser");
|
||||||
|
break;
|
||||||
|
case legend.coloredLaser:
|
||||||
|
cell.classList.add("colored-laser");
|
||||||
|
break;
|
||||||
|
case legend.mirror:
|
||||||
|
cell.classList.add("mirror");
|
||||||
|
break;
|
||||||
|
case legend.door:
|
||||||
|
cell.classList.add("door");
|
||||||
|
break;
|
||||||
|
case legend.button:
|
||||||
|
cell.classList.add("button");
|
||||||
|
break;
|
||||||
|
case legend.wall:
|
||||||
|
cell.classList.add("wall");
|
||||||
|
break;
|
||||||
|
case legend.demiWall:
|
||||||
|
cell.classList.add("demi-wall");
|
||||||
|
break;
|
||||||
|
case legend.target:
|
||||||
|
cell.classList.add("target");
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
lign.appendChild(cell);
|
||||||
|
}
|
||||||
|
|
||||||
|
mapDiv.appendChild(lign);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
loadGrid();
|
||||||
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user