Add per-cell laserSegments tracking and use it to render correct laser orientation: introduce laserSegments global, reset it at trace start, populate entries when tracing, and consult it in loadGrid to choose horizontal vs vertical classes. Update UI styling from a dark to a lighter theme (body and main backgrounds, cell/empty/mirror/wall colors and laser gradients), remove some borders/fit-content sizing, and add a "map" class to the map container in the HTML. These changes fix laser orientation rendering and refresh the game's visual theme.
172 lines
2.9 KiB
CSS
172 lines
2.9 KiB
CSS
* {
|
|
margin: 0;
|
|
padding: 0;
|
|
box-sizing: border-box;
|
|
}
|
|
|
|
html,
|
|
body {
|
|
width: 100vw;
|
|
height: 100vh;
|
|
overflow: hidden;
|
|
}
|
|
|
|
body {
|
|
background: #f7f7f7;
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
font-family: 'Arial', sans-serif;
|
|
}
|
|
|
|
main {
|
|
display: flex;
|
|
flex-direction: column;
|
|
align-items: center;
|
|
justify-content: center;
|
|
padding: 20px;
|
|
border-radius: 10px;
|
|
min-width: fit-content;
|
|
flex-shrink: 0;
|
|
}
|
|
|
|
/* ================================
|
|
GRID
|
|
================================ */
|
|
|
|
.map {
|
|
display: flex;
|
|
flex-direction: column;
|
|
gap: 0px;
|
|
padding: 10px;
|
|
background: #DADEEF;
|
|
border-radius: 5px;
|
|
}
|
|
|
|
.lign {
|
|
display: flex;
|
|
gap: 0px;
|
|
margin: 0;
|
|
}
|
|
|
|
/* ================================
|
|
CELLS
|
|
================================ */
|
|
|
|
.cell {
|
|
width: clamp(28px, 5.5vmin, 60px);
|
|
height: clamp(28px, 5.5vmin, 60px);
|
|
transition: all 0.2s ease;
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
margin: 0;
|
|
position: relative;
|
|
background-color: #2a2a2a;
|
|
}
|
|
|
|
/* ================================
|
|
CASES TYPE
|
|
================================ */
|
|
|
|
.empty {
|
|
background-color: #DADEEF;
|
|
border-color: #DADEEF;
|
|
}
|
|
|
|
.empty:hover {
|
|
background-color: #333333;
|
|
}
|
|
|
|
.laser {
|
|
background-color: #FFD700;
|
|
}
|
|
|
|
.mirror {
|
|
background-color: #DADEEF;
|
|
border-color: #444444;
|
|
position: relative;
|
|
overflow: hidden;
|
|
}
|
|
|
|
.wall {
|
|
background-color: #DADEEF;
|
|
}
|
|
|
|
.target {
|
|
background: #00FF00;
|
|
}
|
|
|
|
/* ================================
|
|
CURSOR PLAYER
|
|
================================ */
|
|
|
|
.player-cursor {
|
|
outline: 2px solid #00e5ff;
|
|
outline-offset: -2px;
|
|
z-index: 10;
|
|
}
|
|
|
|
.player-cursor.mirror {
|
|
outline-color: #FFD700;
|
|
}
|
|
|
|
/* ================================
|
|
LIGHT LASER
|
|
================================ */
|
|
|
|
.light-laser {
|
|
position: relative;
|
|
}
|
|
|
|
.laser-horizontal {
|
|
background: linear-gradient(to bottom, transparent 0%, transparent 45%, red 45%, red 55%, transparent 55%, transparent 100%), #DADEEF
|
|
}
|
|
|
|
.laser-vertical {
|
|
background: linear-gradient(to right, transparent 0%, transparent 45%, red 45%, red 55%, transparent 55%, transparent 100%), #DADEEF;
|
|
}
|
|
|
|
/* ================================
|
|
MIRROR
|
|
================================ */
|
|
|
|
.btn-mirror {
|
|
background: none;
|
|
border: none;
|
|
cursor: pointer;
|
|
height: 100%;
|
|
position: relative;
|
|
}
|
|
|
|
.btn-mirror::after {
|
|
content: '';
|
|
position: absolute;
|
|
top: 50%;
|
|
left: 10%;
|
|
width: 80%;
|
|
height: 2px;
|
|
background-color: #aaaaaa;
|
|
transform-origin: center;
|
|
}
|
|
|
|
/* ================================
|
|
RESPONSIVE
|
|
================================ */
|
|
|
|
@media (max-width: 600px) {
|
|
.map {
|
|
padding: 5px;
|
|
border-radius: 3px;
|
|
}
|
|
|
|
main {
|
|
padding: 8px;
|
|
}
|
|
}
|
|
|
|
@media (max-height: 500px) {
|
|
.map {
|
|
padding: 4px;
|
|
}
|
|
} |