Show sourcecode
The following files exists in this folder. Click to view.
public_html/gamla-kurser/webbutv2/projekt/snake/E/css/
snake.css
317 lines ASCII Windows (CRLF)
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317
:root {
--primary-bg: #121212;
--secondary-bg: #1e1e1e;
--text-primary: #ecf0f1;
--text-secondary: #bdc3c7;
--accent-color: #3498db;
--border-radius: 10px;
--border-color: #3498db;
}
* {
margin: 0;
padding: 0;
box-sizing: border-box;
font-family: 'Poppins', 'Segoe UI', sans-serif;
}
body {
background-color: #0f0f0f;
color: var(--text-primary);
min-height: 100vh;
display: flex;
justify-content: center;
align-items: center;
padding: 20px;
}
.game-container {
display: grid;
grid-template-columns: 250px 1fr 250px;
grid-template-areas:
"sidebar header options"
"sidebar board options"
"sidebar controls options";
gap: 20px;
max-width: 1200px;
width: 100%;
background-color: var(--primary-bg);
border-radius: var(--border-radius);
padding: 30px;
box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}
.game-container::before {
content: '';
position: absolute;
top: 0;
left: 0;
right: 0;
height: 3px;
background-color: var(--accent-color);
}
.left-column {
grid-area: sidebar;
background-color: var(--secondary-bg);
border-radius: var(--border-radius);
padding: 20px;
display: flex;
flex-direction: column;
gap: 20px;
border: 1px solid rgba(255, 255, 255, 0.05);
}
#scoreBoard {
background-color: rgba(0, 0, 0, 0.2);
padding: 20px;
border-radius: var(--border-radius);
border: 1px solid rgba(255, 255, 255, 0.05);
}
#scoreBoard p {
margin: 8px 0;
font-size: 1.1rem;
display: flex;
justify-content: space-between;
}
.header {
grid-area: header;
text-align: left;
padding-bottom: 0;
}
.header h2 {
font-size: 1.8rem;
font-weight: 700;
margin-bottom: 4px;
color: var(--accent-color);
letter-spacing: 1px;
}
#levelText {
font-size: 1rem;
color: var(--text-secondary);
letter-spacing: 1px;
text-transform: uppercase;
margin-bottom: 10px;
}
.board-container {
grid-area: board;
position: relative;
display: flex;
justify-content: center;
align-items: center;
}
#gameOverlay {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
background-color: rgba(0, 0, 0, 0.7);
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
border-radius: 8px;
z-index: 10;
}
#overlayMessage {
color: white;
font-size: 2rem;
font-weight: 700;
text-align: center;
margin-bottom: 0.5rem;
}
#overlaySubMessage {
color: var(--text-secondary);
font-size: 1.2rem;
text-align: center;
}
#board {
border-radius: 8px;
border: 2px solid var(--border-color);
max-width: 100%;
height: auto;
}
.right-column {
grid-area: options;
background-color: var(--secondary-bg);
border-radius: var(--border-radius);
padding: 20px;
display: flex;
flex-direction: column;
gap: 20px;
border: 1px solid rgba(255, 255, 255, 0.05);
}
.options-panel {
display: flex;
flex-direction: column;
gap: 20px;
}
.options-panel h3 {
font-size: 1.3rem;
margin-bottom: 5px;
border-bottom: 1px solid rgba(255, 255, 255, 0.1);
padding-bottom: 10px;
color: var(--accent-color);
}
.option-group {
display: flex;
flex-direction: column;
gap: 8px;
}
.option-group.toggle {
flex-direction: row;
justify-content: space-between;
align-items: center;
}
.option-group label {
font-size: 0.9rem;
color: var(--text-secondary);
}
.option-group select,
.option-group input[type="range"] {
background-color: rgba(0, 0, 0, 0.2);
border: 1px solid rgba(255, 255, 255, 0.1);
border-radius: 5px;
padding: 8px;
color: var(--text-primary);
width: 100%;
}
.range-labels {
display: flex;
justify-content: space-between;
font-size: 0.7rem;
color: var(--text-secondary);
}
/* Toggle switch styles */
.switch {
position: relative;
display: inline-block;
width: 48px;
height: 24px;
}
.switch input {
opacity: 0;
width: 0;
height: 0;
}
.slider {
position: absolute;
cursor: pointer;
top: 0;
left: 0;
right: 0;
bottom: 0;
background-color: rgba(0, 0, 0, 0.4);
transition: 0.4s;
border-radius: 24px;
}
.slider:before {
position: absolute;
content: "";
height: 18px;
width: 18px;
left: 3px;
bottom: 3px;
background-color: white;
transition: 0.4s;
border-radius: 50%;
}
input:checked + .slider {
background-color: var(--accent-color);
}
input:checked + .slider:before {
transform: translateX(24px);
}
/* Control info styles */
.controls-info {
background-color: rgba(0, 0, 0, 0.2);
padding: 15px;
border-radius: var(--border-radius);
margin-top: 15px;
border: 1px solid rgba(255, 255, 255, 0.05);
}
.controls-info h4 {
font-size: 0.9rem;
color: var(--text-secondary);
margin-bottom: 10px;
border-bottom: 1px solid rgba(255, 255, 255, 0.1);
padding-bottom: 5px;
}
.player-controls p {
font-size: 0.85rem;
margin: 5px 0;
display: flex;
justify-content: space-between;
}
.player-controls span {
color: var(--accent-color);
font-weight: 600;
}
.info-section {
margin-top: 15px;
}
.info-section ul {
font-size: 0.8rem;
color: var(--text-secondary);
padding-left: 20px;
line-height: 1.5;
}
.info-section li {
margin-bottom: 5px;
}
/* Responsive design */
@media (max-width: 900px) {
.game-container {
grid-template-columns: 1fr;
grid-template-areas:
"header"
"board"
"options"
"sidebar";
gap: 15px;
padding: 15px;
}
}
@media (max-width: 600px) {
.game-container {
padding: 10px;
}
#board {
width: 100%;
height: auto;
}
}