Compare commits
14 Commits
65efc3a8df
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
| 59db1227fe | |||
| 12b673de9f | |||
| ff20858b97 | |||
| 7fd35b0f36 | |||
| 2e90924ce2 | |||
| 84af125a86 | |||
| 082a0942a3 | |||
| 46183798ee | |||
| ed76674db3 | |||
| 733975c7c4 | |||
| 7f3986f098 | |||
| 2fecb6de3d | |||
| 6ccd33a35f | |||
| e14d5db9da |
1
.gitignore
vendored
Normal file
@@ -0,0 +1 @@
|
|||||||
|
.DS_Store
|
||||||
34
colors/colors.css
Normal file
@@ -0,0 +1,34 @@
|
|||||||
|
* {
|
||||||
|
margin: 0;
|
||||||
|
padding: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
body {
|
||||||
|
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
|
||||||
|
}
|
||||||
|
|
||||||
|
#content {
|
||||||
|
top: 50%;
|
||||||
|
left: 50%;
|
||||||
|
width: 100%;
|
||||||
|
max-width: 500px;
|
||||||
|
position: absolute;
|
||||||
|
transform: translate(-50%, -50%);
|
||||||
|
}
|
||||||
|
|
||||||
|
.color-palette {
|
||||||
|
width: 100%;
|
||||||
|
max-width: 500px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.single-color {
|
||||||
|
width: 20%;
|
||||||
|
float: left;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.single-color div {
|
||||||
|
padding-top: 50%;
|
||||||
|
margin-top: 50px;
|
||||||
|
margin-bottom: 2px;
|
||||||
|
}
|
||||||
@@ -1,104 +1,64 @@
|
|||||||
<?php include "../html-head.php"; ?>
|
<?php include "../html-head.php"; ?>
|
||||||
|
|
||||||
|
<link rel="stylesheet" href="colors.css">
|
||||||
<link rel="stylesheet" href="https://static.eliasfink.de/fonts/montserrat/montserrat.css">
|
<link rel="stylesheet" href="https://static.eliasfink.de/fonts/montserrat/montserrat.css">
|
||||||
|
|
||||||
<style>
|
<title>Colors – Elias Fink</title>
|
||||||
|
|
||||||
* {
|
|
||||||
margin: 0;
|
|
||||||
padding: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
body {
|
|
||||||
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
|
|
||||||
}
|
|
||||||
|
|
||||||
#content {
|
|
||||||
top: 50%;
|
|
||||||
left: 50%;
|
|
||||||
width: 100%;
|
|
||||||
max-width: 500px;
|
|
||||||
position: absolute;
|
|
||||||
transform: translate(-50%, -50%);
|
|
||||||
}
|
|
||||||
|
|
||||||
.color-palette {
|
|
||||||
width: 100%;
|
|
||||||
max-width: 500px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.single-color {
|
|
||||||
width: 20%;
|
|
||||||
float: left;
|
|
||||||
text-align: center;
|
|
||||||
display: inline-block;
|
|
||||||
}
|
|
||||||
|
|
||||||
.single-color div {
|
|
||||||
padding-top: 50%;
|
|
||||||
margin-top: 50px;
|
|
||||||
margin-bottom: 2px;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</style>
|
|
||||||
|
|
||||||
<title>Colors – eliasfink.de</title>
|
|
||||||
|
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
|
|
||||||
<body>
|
<body>
|
||||||
|
|
||||||
<div id="content">
|
<main id="content">
|
||||||
|
|
||||||
<div id="blue" class="color-palette">
|
<div id="blue" class="color-palette">
|
||||||
<div class="single-color">
|
<div class="single-color">
|
||||||
<div style="background-color: var(--blue-1);"></div>
|
<div style="background-color: var(--blue-darkest);"></div>
|
||||||
<span>#001A33</span>
|
<span>#001A33</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="single-color">
|
<div class="single-color">
|
||||||
<div style="background-color: var(--blue-2);"></div>
|
<div style="background-color: var(--blue-darker);"></div>
|
||||||
<span>#004D99</span>
|
<span>#004D99</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="single-color">
|
<div class="single-color">
|
||||||
<div style="background-color: var(--blue-3);"></div>
|
<div style="background-color: var(--blue-medium);"></div>
|
||||||
<span>#0080FF</span>
|
<span>#0080FF</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="single-color">
|
<div class="single-color">
|
||||||
<div style="background-color: var(--blue-4);"></div>
|
<div style="background-color: var(--blue-lighter);"></div>
|
||||||
<span>#66B3FF</span>
|
<span>#66B3FF</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="single-color">
|
<div class="single-color">
|
||||||
<div style="background-color: var(--blue-5);"></div>
|
<div style="background-color: var(--blue-lightest);"></div>
|
||||||
<span>#CCE6FF</span>
|
<span>#CCE6FF</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div id="grey" class="color-palette">
|
<div id="grey" class="color-palette">
|
||||||
<div class="single-color">
|
<div class="single-color">
|
||||||
<div style="background-color: var(--grey-1);"></div>
|
<div style="background-color: var(--grey-darkest);"></div>
|
||||||
<span>#161A1D</span>
|
<span>#161A1D</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="single-color">
|
<div class="single-color">
|
||||||
<div style="background-color: var(--grey-2);"></div>
|
<div style="background-color: var(--grey-darker);"></div>
|
||||||
<span>#434D56</span>
|
<span>#434D56</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="single-color">
|
<div class="single-color">
|
||||||
<div style="background-color: var(--grey-3);"></div>
|
<div style="background-color: var(--grey-medium);"></div>
|
||||||
<span>#708090</span>
|
<span>#708090</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="single-color">
|
<div class="single-color">
|
||||||
<div style="background-color: var(--grey-4);"></div>
|
<div style="background-color: var(--grey-lighter);"></div>
|
||||||
<span>#A9B3BC</span>
|
<span>#A9B3BC</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="single-color">
|
<div class="single-color">
|
||||||
<div style="background-color: var(--grey-5);"></div>
|
<div style="background-color: var(--grey-lightest);"></div>
|
||||||
<span>#E2E6E9</span>
|
<span>#E2E6E9</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</main>
|
||||||
|
|
||||||
</body>
|
</body>
|
||||||
|
|
||||||
|
|||||||
@@ -10,16 +10,16 @@
|
|||||||
|
|
||||||
<div id="container">
|
<div id="container">
|
||||||
|
|
||||||
<svg id="ef-logo" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1000 1000">
|
<svg id="ef-logo" viewBox="0 0 1000 1000" xmlns="http://www.w3.org/2000/svg">
|
||||||
<circle cx="500" cy="500" r="500" fill="#0080FF"/>
|
<circle cx="500" cy="500" r="500" fill="#0080FF"/>
|
||||||
<g fill="#FFFFFF">
|
<g fill="#FFFFFF">
|
||||||
<rect x="430" y="240" width="50" height="520"/>
|
<rect x="425" y="250" width="50" height="500"/>
|
||||||
<rect x="190" y="240" width="265" height="50" />
|
<rect x="525" y="250" width="50" height="500"/>
|
||||||
<rect x="190" y="475" width="265" height="50" />
|
<rect x="200" y="250" width="250" height="50" />
|
||||||
<rect x="190" y="710" width="265" height="50" />
|
<rect x="200" y="475" width="250" height="50" />
|
||||||
<rect x="520" y="240" width="50" height="520"/>
|
<rect x="200" y="700" width="250" height="50" />
|
||||||
<rect x="545" y="240" width="265" height="50" />
|
<rect x="550" y="250" width="250" height="50" />
|
||||||
<rect x="545" y="475" width="265" height="50" />
|
<rect x="550" y="475" width="250" height="50" />
|
||||||
</g>
|
</g>
|
||||||
</svg>
|
</svg>
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
|
|
||||||
<html lang="de" dir="ltr">
|
<html lang="de">
|
||||||
|
|
||||||
<head>
|
<head>
|
||||||
|
|
||||||
@@ -10,7 +10,6 @@
|
|||||||
<meta name="robots" content="noindex, nofollow">
|
<meta name="robots" content="noindex, nofollow">
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||||
|
|
||||||
|
|
||||||
<link rel="icon" type="image/png" sizes="96x96" href="https://static.eliasfink.de/img/favicon/favicon-96x96.png"/>
|
<link rel="icon" type="image/png" sizes="96x96" href="https://static.eliasfink.de/img/favicon/favicon-96x96.png"/>
|
||||||
<link rel="icon" type="image/svg+xml" href="https://static.eliasfink.de/img/favicon/favicon.svg"/>
|
<link rel="icon" type="image/svg+xml" href="https://static.eliasfink.de/img/favicon/favicon.svg"/>
|
||||||
<link rel="shortcut icon" href="https://static.eliasfink.de/img/favicon/favicon.ico"/>
|
<link rel="shortcut icon" href="https://static.eliasfink.de/img/favicon/favicon.ico"/>
|
||||||
|
|||||||
@@ -1,13 +1,5 @@
|
|||||||
Header set Access-Control-Allow-Origin "*"
|
Header set Access-Control-Allow-Origin "*"
|
||||||
|
|
||||||
<Files ~ "^\.(htaccess|htpasswd)$">
|
|
||||||
deny from all
|
|
||||||
</Files>
|
|
||||||
ErrorDocument 403 /index.php
|
|
||||||
ErrorDocument 404 /index.php
|
|
||||||
DirectoryIndex index.php
|
|
||||||
order deny,allow
|
|
||||||
|
|
||||||
<IfModule mod_expires.c>
|
<IfModule mod_expires.c>
|
||||||
ExpiresActive On
|
ExpiresActive On
|
||||||
ExpiresDefault A2592000
|
ExpiresDefault A2592000
|
||||||
|
|||||||
BIN
static/fonts/.DS_Store
vendored
BIN
static/img/.DS_Store
vendored
|
Before Width: | Height: | Size: 9.5 KiB |
|
Before Width: | Height: | Size: 2.7 KiB |
|
Before Width: | Height: | Size: 4.8 KiB |
@@ -1,12 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8" ?>
|
|
||||||
<svg id="lettering" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1086.2 142.063">
|
|
||||||
<title>Schriftzug dunkel</title>
|
|
||||||
<defs>
|
|
||||||
<linearGradient id="logo-gradient" x1="0%" y1="0%" x2="100%" y2="100%">
|
|
||||||
<stop offset="0%" stop-color="rgb(22,232,255)"/>
|
|
||||||
<stop offset="100%" stop-color="rgb(22,52,255)"/>
|
|
||||||
</linearGradient>
|
|
||||||
</defs>
|
|
||||||
<path fill="#000" d="M10.2 131.833h86.4v9.2H0v-140h93.6v9.2H10.2v55.2h74.6v9H10.2v57.4zm123.6 9.2v-140H144v130.8h80.6v9.2h-90.8zm117 0v-140H261v140h-10.2zm163.6 0l-18-39.4h-81.2l-17.8 39.4h-11l64.4-140H361l64.4 140h-11zm-95.2-48h73.4l-36.8-80.8-36.6 80.8zm117.4 30l4.6-7.6q7.4 7.8 19.9 12.7 12.5 4.9 26.3 4.9 20 0 30.2-7.6 10.2-7.6 10.2-19.8 0-9.4-5.4-15-5.4-5.6-13.4-8.6-8-3-21.6-6.2-15.4-3.8-24.7-7.4-9.3-3.6-15.8-11.1-6.5-7.5-6.5-20.1 0-10.2 5.4-18.7 5.4-8.5 16.5-13.5 11.1-5 27.7-5 11.6 0 22.8 3.4 11.2 3.4 19.4 9.2l-3.8 8.2q-8.4-5.8-18.5-8.8-10.1-3-19.9-3-19.4 0-29.4 7.8-10 7.8-10 20.2 0 9.4 5.4 15 5.4 5.6 13.4 8.6 8 3 21.8 6.4 15.4 3.8 24.6 7.4 9.2 3.6 15.7 10.9 6.5 7.3 6.5 19.7 0 10.2-5.5 18.6-5.5 8.4-16.9 13.4-11.4 5-28 5-15.4 0-29.3-5.3-13.9-5.3-21.7-13.7z"/>
|
|
||||||
<path fill="url(#logo-gradient)" d="M717.6 10.233h-83.4v59.8h74.6v9.2h-74.6v61.8H624v-140h93.6v9.2zm32.6 130.8v-140h10.2v140h-10.2zm162.8-140h10.2v140h-8.4l-95.4-121.6v121.6h-10.2v-140h8.6l95.2 121.6V1.033zm160.8 140l-60.2-69-31.4 32.2v36.8H972v-140h10.2v90l87.4-90h12.4l-61.6 63.6 65.8 76.4h-12.4z"/>
|
|
||||||
</svg>
|
|
||||||
|
Before Width: | Height: | Size: 1.5 KiB |
|
Before Width: | Height: | Size: 9.3 KiB |
|
Before Width: | Height: | Size: 2.8 KiB |
|
Before Width: | Height: | Size: 4.7 KiB |
@@ -1,12 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8" ?>
|
|
||||||
<svg id="lettering" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1086.2 142.063">
|
|
||||||
<title>Schriftzug hell</title>
|
|
||||||
<defs>
|
|
||||||
<linearGradient id="logo-gradient" x1="0%" y1="0%" x2="100%" y2="100%">
|
|
||||||
<stop offset="0%" stop-color="rgb(22,232,255)"/>
|
|
||||||
<stop offset="100%" stop-color="rgb(22,52,255)"/>
|
|
||||||
</linearGradient>
|
|
||||||
</defs>
|
|
||||||
<path fill="#fff" d="M10.2 131.833h86.4v9.2H0v-140h93.6v9.2H10.2v55.2h74.6v9H10.2v57.4zm123.6 9.2v-140H144v130.8h80.6v9.2h-90.8zm117 0v-140H261v140h-10.2zm163.6 0l-18-39.4h-81.2l-17.8 39.4h-11l64.4-140H361l64.4 140h-11zm-95.2-48h73.4l-36.8-80.8-36.6 80.8zm117.4 30l4.6-7.6q7.4 7.8 19.9 12.7 12.5 4.9 26.3 4.9 20 0 30.2-7.6 10.2-7.6 10.2-19.8 0-9.4-5.4-15-5.4-5.6-13.4-8.6-8-3-21.6-6.2-15.4-3.8-24.7-7.4-9.3-3.6-15.8-11.1-6.5-7.5-6.5-20.1 0-10.2 5.4-18.7 5.4-8.5 16.5-13.5 11.1-5 27.7-5 11.6 0 22.8 3.4 11.2 3.4 19.4 9.2l-3.8 8.2q-8.4-5.8-18.5-8.8-10.1-3-19.9-3-19.4 0-29.4 7.8-10 7.8-10 20.2 0 9.4 5.4 15 5.4 5.6 13.4 8.6 8 3 21.8 6.4 15.4 3.8 24.6 7.4 9.2 3.6 15.7 10.9 6.5 7.3 6.5 19.7 0 10.2-5.5 18.6-5.5 8.4-16.9 13.4-11.4 5-28 5-15.4 0-29.3-5.3-13.9-5.3-21.7-13.7z"/>
|
|
||||||
<path fill="url(#logo-gradient)" d="M717.6 10.233h-83.4v59.8h74.6v9.2h-74.6v61.8H624v-140h93.6v9.2zm32.6 130.8v-140h10.2v140h-10.2zm162.8-140h10.2v140h-8.4l-95.4-121.6v121.6h-10.2v-140h8.6l95.2 121.6V1.033zm160.8 140l-60.2-69-31.4 32.2v36.8H972v-140h10.2v90l87.4-90h12.4l-61.6 63.6 65.8 76.4h-12.4z"/>
|
|
||||||
</svg>
|
|
||||||
|
Before Width: | Height: | Size: 1.5 KiB |
|
Before Width: | Height: | Size: 25 KiB |
|
Before Width: | Height: | Size: 17 KiB |
|
Before Width: | Height: | Size: 2.1 KiB |
BIN
static/img/logo/logo-1024px.png
Normal file
|
After Width: | Height: | Size: 24 KiB |
BIN
static/img/logo/logo-128px.png
Normal file
|
After Width: | Height: | Size: 2.7 KiB |
|
Before Width: | Height: | Size: 4.3 KiB |
BIN
static/img/logo/logo-256px.png
Normal file
|
After Width: | Height: | Size: 5.4 KiB |
|
Before Width: | Height: | Size: 7.7 KiB |
BIN
static/img/logo/logo-512px.png
Normal file
|
After Width: | Height: | Size: 11 KiB |
BIN
static/img/logo/logo-64px.png
Normal file
|
After Width: | Height: | Size: 1.4 KiB |
28
static/img/logo/logo.svg
Normal file → Executable file
@@ -1,20 +1,12 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8" ?>
|
<svg id="ef-logo" viewBox="0 0 1000 1000" xmlns="http://www.w3.org/2000/svg">
|
||||||
<svg id="logo" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1000 1000">
|
<circle cx="500" cy="500" r="500" fill="#0080FF"/>
|
||||||
<title>Logo</title>
|
<g fill="#FFFFFF">
|
||||||
<defs>
|
<rect x="425" y="250" width="50" height="500"/>
|
||||||
<linearGradient id="logo-gradient" x1="0%" y1="0%" x2="100%" y2="100%">
|
<rect x="525" y="250" width="50" height="500"/>
|
||||||
<stop offset="0%" stop-color="rgb(22,232,255)"/>
|
<rect x="200" y="250" width="250" height="50" />
|
||||||
<stop offset="100%" stop-color="rgb(22,52,255)"/>
|
<rect x="200" y="475" width="250" height="50" />
|
||||||
</linearGradient>
|
<rect x="200" y="700" width="250" height="50" />
|
||||||
</defs>
|
<rect x="550" y="250" width="250" height="50" />
|
||||||
<circle cx="500" cy="500" r="500" fill="url(#logo-gradient)"/>
|
<rect x="550" y="475" width="250" height="50" />
|
||||||
<g fill="#fff">
|
|
||||||
<rect x="430" y="240" width="50" height="520"/>
|
|
||||||
<rect x="190" y="240" width="265" height="50"/>
|
|
||||||
<rect x="190" y="475" width="265" height="50"/>
|
|
||||||
<rect x="190" y="710" width="265" height="50"/>
|
|
||||||
<rect x="520" y="240" width="50" height="520"/>
|
|
||||||
<rect x="545" y="240" width="265" height="50"/>
|
|
||||||
<rect x="545" y="475" width="265" height="50"/>
|
|
||||||
</g>
|
</g>
|
||||||
</svg>
|
</svg>
|
||||||
|
Before Width: | Height: | Size: 885 B After Width: | Height: | Size: 564 B |
|
Before Width: | Height: | Size: 10 KiB |
|
Before Width: | Height: | Size: 852 B |
|
Before Width: | Height: | Size: 2.1 KiB |
|
Before Width: | Height: | Size: 4.8 KiB |
@@ -1,14 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8" ?>
|
|
||||||
<svg id="logo" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1000 1000">
|
|
||||||
<title>Logo ohne Farbverlauf</title>
|
|
||||||
<circle cx="500" cy="500" r="500" fill="#168eff"/>
|
|
||||||
<g fill="#fff">
|
|
||||||
<rect x="430" y="240" width="50" height="520"/>
|
|
||||||
<rect x="190" y="240" width="265" height="50"/>
|
|
||||||
<rect x="190" y="475" width="265" height="50"/>
|
|
||||||
<rect x="190" y="710" width="265" height="50"/>
|
|
||||||
<rect x="520" y="240" width="50" height="520"/>
|
|
||||||
<rect x="545" y="240" width="265" height="50"/>
|
|
||||||
<rect x="545" y="475" width="265" height="50"/>
|
|
||||||
</g>
|
|
||||||
</svg>
|
|
||||||
|
Before Width: | Height: | Size: 638 B |
|
Before Width: | Height: | Size: 68 KiB |
|
Before Width: | Height: | Size: 125 KiB |
|
Before Width: | Height: | Size: 35 KiB |
|
Before Width: | Height: | Size: 66 KiB |
@@ -3,15 +3,18 @@
|
|||||||
<link rel="stylesheet" href="https://static.eliasfink.de/fonts/montserrat/montserrat.css">
|
<link rel="stylesheet" href="https://static.eliasfink.de/fonts/montserrat/montserrat.css">
|
||||||
|
|
||||||
<style>
|
<style>
|
||||||
body {
|
* {
|
||||||
margin: 0;
|
margin: 0;
|
||||||
background-color: var(--blue-1);
|
padding: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
body {
|
||||||
|
background-color: var(--blue-darkest);
|
||||||
}
|
}
|
||||||
|
|
||||||
h1 {
|
h1 {
|
||||||
top: 50%;
|
top: 50%;
|
||||||
left: 50%;
|
left: 50%;
|
||||||
margin: 0;
|
|
||||||
color: #FFFFFF;
|
color: #FFFFFF;
|
||||||
font-size: 48px;
|
font-size: 48px;
|
||||||
font-weight: 300;
|
font-weight: 300;
|
||||||
@@ -21,7 +24,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
span {
|
span {
|
||||||
color: var(--blue-3);
|
color: var(--blue-medium);
|
||||||
}
|
}
|
||||||
|
|
||||||
@media (max-width: 767px) {
|
@media (max-width: 767px) {
|
||||||
@@ -31,7 +34,7 @@
|
|||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
<title>Static – eliasfink.de</title>
|
<title>Static – Elias Fink</title>
|
||||||
|
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
|
|||||||
|
Before Width: | Height: | Size: 15 KiB |
|
Before Width: | Height: | Size: 15 KiB |
@@ -1,12 +0,0 @@
|
|||||||
<svg id="ef-logo" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1000 1000">
|
|
||||||
<circle cx="500" cy="500" r="500" fill="#FFFFFF"/>
|
|
||||||
<g fill="#0080FF">
|
|
||||||
<rect x="430" y="240" width="50" height="520"/>
|
|
||||||
<rect x="190" y="240" width="265" height="50" />
|
|
||||||
<rect x="190" y="475" width="265" height="50" />
|
|
||||||
<rect x="190" y="710" width="265" height="50" />
|
|
||||||
<rect x="520" y="240" width="50" height="520"/>
|
|
||||||
<rect x="545" y="240" width="265" height="50" />
|
|
||||||
<rect x="545" y="475" width="265" height="50" />
|
|
||||||
</g>
|
|
||||||
</svg>
|
|
||||||
|
Before Width: | Height: | Size: 570 B |
@@ -1,191 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
|
||||||
<!-- Created with Inkscape (http://www.inkscape.org/) -->
|
|
||||||
|
|
||||||
<svg
|
|
||||||
width="1000"
|
|
||||||
height="100"
|
|
||||||
viewBox="0 0 264.58333 26.458333"
|
|
||||||
version="1.1"
|
|
||||||
id="svg5"
|
|
||||||
inkscape:version="1.1.2 (0a00cf5339, 2022-02-04, custom)"
|
|
||||||
sodipodi:docname="symbols.svg"
|
|
||||||
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
|
||||||
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
|
||||||
xmlns:xlink="http://www.w3.org/1999/xlink"
|
|
||||||
xmlns="http://www.w3.org/2000/svg"
|
|
||||||
xmlns:svg="http://www.w3.org/2000/svg">
|
|
||||||
<sodipodi:namedview
|
|
||||||
id="namedview7"
|
|
||||||
pagecolor="#ffffff"
|
|
||||||
bordercolor="#666666"
|
|
||||||
borderopacity="1.0"
|
|
||||||
inkscape:pageshadow="2"
|
|
||||||
inkscape:pageopacity="0.0"
|
|
||||||
inkscape:pagecheckerboard="0"
|
|
||||||
inkscape:document-units="px"
|
|
||||||
showgrid="true"
|
|
||||||
units="px"
|
|
||||||
gridtolerance="10"
|
|
||||||
inkscape:zoom="4.6726229"
|
|
||||||
inkscape:cx="918.43492"
|
|
||||||
inkscape:cy="46.440726"
|
|
||||||
inkscape:window-width="1920"
|
|
||||||
inkscape:window-height="1057"
|
|
||||||
inkscape:window-x="1016"
|
|
||||||
inkscape:window-y="1"
|
|
||||||
inkscape:window-maximized="1"
|
|
||||||
inkscape:current-layer="layer1">
|
|
||||||
<inkscape:grid
|
|
||||||
type="xygrid"
|
|
||||||
id="grid824"
|
|
||||||
empspacing="100" />
|
|
||||||
</sodipodi:namedview>
|
|
||||||
<defs
|
|
||||||
id="defs2">
|
|
||||||
<linearGradient
|
|
||||||
inkscape:collect="always"
|
|
||||||
id="linearGradient17492">
|
|
||||||
<stop
|
|
||||||
style="stop-color:#fffaff;stop-opacity:1"
|
|
||||||
offset="0"
|
|
||||||
id="stop17488" />
|
|
||||||
<stop
|
|
||||||
style="stop-color:#000000;stop-opacity:1"
|
|
||||||
offset="1"
|
|
||||||
id="stop17490" />
|
|
||||||
</linearGradient>
|
|
||||||
<radialGradient
|
|
||||||
inkscape:collect="always"
|
|
||||||
xlink:href="#linearGradient17492"
|
|
||||||
id="radialGradient17534"
|
|
||||||
gradientUnits="userSpaceOnUse"
|
|
||||||
gradientTransform="matrix(0.01185507,-0.00474077,0.00509163,0.01253756,245.5889,24.86303)"
|
|
||||||
cx="684.98218"
|
|
||||||
cy="-755.83978"
|
|
||||||
fx="684.98218"
|
|
||||||
fy="-755.83978"
|
|
||||||
r="399.74589" />
|
|
||||||
</defs>
|
|
||||||
<g
|
|
||||||
inkscape:label="Ebene 1"
|
|
||||||
inkscape:groupmode="layer"
|
|
||||||
id="layer1">
|
|
||||||
<text
|
|
||||||
xml:space="preserve"
|
|
||||||
style="font-weight:bold;font-size:25.4px;line-height:15.875px;font-family:'DejaVu Sans Mono';-inkscape-font-specification:'DejaVu Sans Mono Bold';letter-spacing:0px;word-spacing:0px;stroke-width:0.264583"
|
|
||||||
x="5.4673328"
|
|
||||||
y="23.171078"
|
|
||||||
id="text2764"><tspan
|
|
||||||
sodipodi:role="line"
|
|
||||||
id="tspan2762"
|
|
||||||
style="font-size:25.4px;stroke-width:0.264583"
|
|
||||||
x="5.4673328"
|
|
||||||
y="23.171078">1</tspan></text>
|
|
||||||
<text
|
|
||||||
xml:space="preserve"
|
|
||||||
style="font-weight:bold;font-size:25.4px;line-height:15.875px;font-family:'DejaVu Sans Mono';-inkscape-font-specification:'DejaVu Sans Mono Bold';letter-spacing:0px;word-spacing:0px;stroke-width:0.264583"
|
|
||||||
x="31.925665"
|
|
||||||
y="23.171078"
|
|
||||||
id="text2764-6"><tspan
|
|
||||||
sodipodi:role="line"
|
|
||||||
id="tspan2762-7"
|
|
||||||
style="font-size:25.4px;stroke-width:0.264583"
|
|
||||||
x="31.925665"
|
|
||||||
y="23.171078">2</tspan></text>
|
|
||||||
<text
|
|
||||||
xml:space="preserve"
|
|
||||||
style="font-weight:bold;font-size:25.4px;line-height:15.875px;font-family:'DejaVu Sans Mono';-inkscape-font-specification:'DejaVu Sans Mono Bold';letter-spacing:0px;word-spacing:0px;stroke-width:0.264583"
|
|
||||||
x="58.383999"
|
|
||||||
y="23.171078"
|
|
||||||
id="text2764-4"><tspan
|
|
||||||
sodipodi:role="line"
|
|
||||||
id="tspan2762-6"
|
|
||||||
style="font-size:25.4px;stroke-width:0.264583"
|
|
||||||
x="58.383999"
|
|
||||||
y="23.171078">3</tspan></text>
|
|
||||||
<text
|
|
||||||
xml:space="preserve"
|
|
||||||
style="font-weight:bold;font-size:25.4px;line-height:15.875px;font-family:'DejaVu Sans Mono';-inkscape-font-specification:'DejaVu Sans Mono Bold';letter-spacing:0px;word-spacing:0px;stroke-width:0.264583"
|
|
||||||
x="84.581985"
|
|
||||||
y="23.171078"
|
|
||||||
id="text2764-67"><tspan
|
|
||||||
sodipodi:role="line"
|
|
||||||
id="tspan2762-3"
|
|
||||||
style="font-size:25.4px;stroke-width:0.264583"
|
|
||||||
x="84.581985"
|
|
||||||
y="23.171078">4</tspan></text>
|
|
||||||
<text
|
|
||||||
xml:space="preserve"
|
|
||||||
style="font-weight:bold;font-size:25.4px;line-height:15.875px;font-family:'DejaVu Sans Mono';-inkscape-font-specification:'DejaVu Sans Mono Bold';letter-spacing:0px;word-spacing:0px;stroke-width:0.264583"
|
|
||||||
x="137.75899"
|
|
||||||
y="23.171078"
|
|
||||||
id="text2764-9"><tspan
|
|
||||||
sodipodi:role="line"
|
|
||||||
id="tspan2762-2"
|
|
||||||
style="font-size:25.4px;stroke-width:0.264583"
|
|
||||||
x="137.75899"
|
|
||||||
y="23.171078">6</tspan></text>
|
|
||||||
<text
|
|
||||||
xml:space="preserve"
|
|
||||||
style="font-weight:bold;font-size:25.4px;line-height:15.875px;font-family:'DejaVu Sans Mono';-inkscape-font-specification:'DejaVu Sans Mono Bold';letter-spacing:0px;word-spacing:0px;stroke-width:0.264583"
|
|
||||||
x="112.24477"
|
|
||||||
y="23.171078"
|
|
||||||
id="text2764-5"><tspan
|
|
||||||
sodipodi:role="line"
|
|
||||||
id="tspan2762-0"
|
|
||||||
style="font-size:25.4px;stroke-width:0.264583"
|
|
||||||
x="112.24477"
|
|
||||||
y="23.171078">5</tspan></text>
|
|
||||||
<text
|
|
||||||
xml:space="preserve"
|
|
||||||
style="font-weight:bold;font-size:25.4px;line-height:15.875px;font-family:'DejaVu Sans Mono';-inkscape-font-specification:'DejaVu Sans Mono Bold';letter-spacing:0px;word-spacing:0px;stroke-width:0.264583"
|
|
||||||
x="164.21733"
|
|
||||||
y="23.171078"
|
|
||||||
id="text2764-8"><tspan
|
|
||||||
sodipodi:role="line"
|
|
||||||
id="tspan2762-37"
|
|
||||||
style="font-size:25.4px;stroke-width:0.264583"
|
|
||||||
x="164.21733"
|
|
||||||
y="23.171078">7</tspan></text>
|
|
||||||
<text
|
|
||||||
xml:space="preserve"
|
|
||||||
style="font-weight:bold;font-size:25.4px;line-height:15.875px;font-family:'DejaVu Sans Mono';-inkscape-font-specification:'DejaVu Sans Mono Bold';letter-spacing:0px;word-spacing:0px;stroke-width:0.264583"
|
|
||||||
x="190.67566"
|
|
||||||
y="23.171078"
|
|
||||||
id="text2764-56"><tspan
|
|
||||||
sodipodi:role="line"
|
|
||||||
id="tspan2762-78"
|
|
||||||
style="font-size:25.4px;stroke-width:0.264583"
|
|
||||||
x="190.67566"
|
|
||||||
y="23.171078">8</tspan></text>
|
|
||||||
<rect
|
|
||||||
style="opacity:0.94;fill:#000000;fill-opacity:1;stroke-width:0.159074;stroke-linejoin:round"
|
|
||||||
id="rect13458"
|
|
||||||
width="3.0269053"
|
|
||||||
height="23.409332"
|
|
||||||
x="216.61328"
|
|
||||||
y="1.4898645" />
|
|
||||||
<path
|
|
||||||
sodipodi:type="star"
|
|
||||||
style="opacity:0.94;fill:#c80000;fill-opacity:1;stroke-width:1.88976;stroke-linejoin:round"
|
|
||||||
id="path13598"
|
|
||||||
inkscape:flatsided="true"
|
|
||||||
sodipodi:sides="3"
|
|
||||||
sodipodi:cx="830.13611"
|
|
||||||
sodipodi:cy="17.592884"
|
|
||||||
sodipodi:r1="31.913498"
|
|
||||||
sodipodi:r2="15.956749"
|
|
||||||
sodipodi:arg1="0"
|
|
||||||
sodipodi:arg2="1.0471976"
|
|
||||||
inkscape:rounded="0"
|
|
||||||
inkscape:randomized="0"
|
|
||||||
d="m 862.04961,17.592884 -47.87025,27.6379 v -55.2758 z"
|
|
||||||
transform="matrix(0.26458333,0,0,0.26458333,4.4504611,4.7744104)"
|
|
||||||
inkscape:transform-center-x="-2.1109449" />
|
|
||||||
<path
|
|
||||||
id="path15198"
|
|
||||||
style="opacity:0.94;fill:url(#radialGradient17534);fill-opacity:1;stroke:none;stroke-width:0.0611019;stroke-linejoin:round"
|
|
||||||
d="m 255.02903,18.922636 -2.38443,0.980073 -1.29044,6.689887 -1.29044,-6.689887 -2.38442,-0.980073 -2.81674,0.984166 0.99178,-2.795106 -0.98766,-2.366105 -6.74168,-1.280528 6.74168,-1.280527 0.98766,-2.3661053 -0.99178,-2.7951042 2.81674,0.9841643 2.38442,-0.9800724 1.29044,-6.6898862 1.29044,6.6898862 2.38443,0.9800733 2.81675,-0.9841652 -0.99178,2.7951042 0.98766,2.3661063 6.74167,1.280526 -6.74167,1.280528 -0.98766,2.366105 0.99178,2.795106 z"
|
|
||||||
sodipodi:nodetypes="ccccccccccccccccccccccccc" />
|
|
||||||
</g>
|
|
||||||
</svg>
|
|
||||||
|
Before Width: | Height: | Size: 7.5 KiB |
@@ -1,25 +0,0 @@
|
|||||||
<!DOCTYPE html>
|
|
||||||
|
|
||||||
<html lang="de" dir="ltr">
|
|
||||||
|
|
||||||
<head>
|
|
||||||
|
|
||||||
<meta charset="utf-8">
|
|
||||||
<meta name="author" content="Elias Fink">
|
|
||||||
<meta name="copyright" content="Copyright © 2024 Elias Fink">
|
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
||||||
<meta name="robots" content="noindex, nofollow">
|
|
||||||
|
|
||||||
<link rel="icon" href="images/favicon.ico">
|
|
||||||
<link rel="stylesheet" href="styles.css">
|
|
||||||
<script src="script.js"></script>
|
|
||||||
|
|
||||||
<title>Minesweeper by Elias Fink</title>
|
|
||||||
|
|
||||||
</head>
|
|
||||||
|
|
||||||
<body>
|
|
||||||
|
|
||||||
</body>
|
|
||||||
|
|
||||||
</html>
|
|
||||||
@@ -1,306 +0,0 @@
|
|||||||
window.addEventListener('load', () => {
|
|
||||||
minesweeper.init();
|
|
||||||
});
|
|
||||||
|
|
||||||
const minesweeper = {
|
|
||||||
|
|
||||||
init() {
|
|
||||||
this.logic = remoteLogic;
|
|
||||||
this.generateBody();
|
|
||||||
this.newGame('small');
|
|
||||||
},
|
|
||||||
|
|
||||||
// ------------------------------------ //
|
|
||||||
// ----- Basic Body Structure ----- //
|
|
||||||
// ------------------------------------ //
|
|
||||||
|
|
||||||
generateBody() {
|
|
||||||
const body = document.body;
|
|
||||||
|
|
||||||
const container = document.createElement('div');
|
|
||||||
container.id = 'container';
|
|
||||||
body.appendChild(container);
|
|
||||||
|
|
||||||
container.append(this.getHeader(), this.getMain(), this.getButtons(), this.getFooter());
|
|
||||||
},
|
|
||||||
|
|
||||||
getHeader() {
|
|
||||||
const header = document.createElement('header');
|
|
||||||
|
|
||||||
const title = document.createElement('div');
|
|
||||||
title.id = 'title';
|
|
||||||
header.appendChild(title);
|
|
||||||
|
|
||||||
const heading = document.createElement('h1');
|
|
||||||
heading.innerText = 'Minesweeper';
|
|
||||||
|
|
||||||
const subheading = document.createElement('p');
|
|
||||||
subheading.innerText = 'by Elias Fink';
|
|
||||||
|
|
||||||
title.append(heading, subheading);
|
|
||||||
|
|
||||||
return header;
|
|
||||||
},
|
|
||||||
|
|
||||||
getMain() {
|
|
||||||
const main = document.createElement('main');
|
|
||||||
|
|
||||||
return main;
|
|
||||||
},
|
|
||||||
|
|
||||||
getButtons() {
|
|
||||||
const buttons = document.createElement('div');
|
|
||||||
buttons.id = 'buttons';
|
|
||||||
|
|
||||||
const smallButton = this.createButton('small');
|
|
||||||
const mediumButton = this.createButton('medium');
|
|
||||||
const largeButton = this.createButton('large');
|
|
||||||
|
|
||||||
buttons.append(smallButton, mediumButton, largeButton);
|
|
||||||
|
|
||||||
return buttons;
|
|
||||||
},
|
|
||||||
|
|
||||||
getFooter() {
|
|
||||||
const footer = document.createElement('footer');
|
|
||||||
|
|
||||||
const copyright = document.createElement('span');
|
|
||||||
copyright.innerHTML = 'Copyright © 2024 Elias Fink';
|
|
||||||
|
|
||||||
const webLink = document.createElement('span');
|
|
||||||
webLink.innerHTML = '<a href="https://studium.eliasfink.de/it-lab/" target="_blank" rel="noopener noreferrer">Web Version</a>';
|
|
||||||
|
|
||||||
const gitLink = document.createElement('span');
|
|
||||||
gitLink.innerHTML = '<a href="https://github.com/eliasfnk/it-lab.git" target="_blank" rel="noopener noreferrer">Git Repository</a>';
|
|
||||||
|
|
||||||
footer.append(copyright, webLink, gitLink);
|
|
||||||
|
|
||||||
return footer;
|
|
||||||
},
|
|
||||||
|
|
||||||
// ---------------------------------- //
|
|
||||||
// ----- Buttons and Fields ----- //
|
|
||||||
// ---------------------------------- //
|
|
||||||
|
|
||||||
createButton(type) {
|
|
||||||
const button = document.createElement('button');
|
|
||||||
button.id = type;
|
|
||||||
button.innerText = type;
|
|
||||||
|
|
||||||
button.addEventListener('click', () => {
|
|
||||||
this.newGame(type);
|
|
||||||
});
|
|
||||||
|
|
||||||
return button;
|
|
||||||
},
|
|
||||||
|
|
||||||
generatePlayfield(size) {
|
|
||||||
const playfield = document.querySelector('main');
|
|
||||||
playfield.innerText = '';
|
|
||||||
|
|
||||||
for (let row = 0; row < size; row++) {
|
|
||||||
for (let col = 0; col < size; col++) {
|
|
||||||
playfield.appendChild(this.createCell(row, col));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
createCell(row, col) {
|
|
||||||
const cell = document.createElement('div');
|
|
||||||
cell.classList.add('cell', 'covered');
|
|
||||||
|
|
||||||
cell.dataset.x = col;
|
|
||||||
cell.dataset.y = row;
|
|
||||||
|
|
||||||
cell.style.width = `calc(100% / ${this.size} - 2px)`;
|
|
||||||
cell.style.height = `calc(100% / ${this.size} - 2px)`;
|
|
||||||
|
|
||||||
this.cellEventListeners(cell);
|
|
||||||
|
|
||||||
return cell;
|
|
||||||
},
|
|
||||||
|
|
||||||
cellEventListeners(cell) {
|
|
||||||
cell.addEventListener('click', (event) => {
|
|
||||||
this.cellLeftClickHandler(event);
|
|
||||||
});
|
|
||||||
cell.addEventListener('contextmenu', (event) => {
|
|
||||||
this.cellRightClickHandler(event);
|
|
||||||
});
|
|
||||||
|
|
||||||
cell.addEventListener('touchstart', (event) => {
|
|
||||||
this.cellTouchStartHandler(event);
|
|
||||||
});
|
|
||||||
cell.addEventListener('touchend', (event) => {
|
|
||||||
this.cellTouchEndHandler(event);
|
|
||||||
});
|
|
||||||
},
|
|
||||||
|
|
||||||
// -------------------------- //
|
|
||||||
// ----- Game Start ----- //
|
|
||||||
// -------------------------- //
|
|
||||||
|
|
||||||
gameModes: [
|
|
||||||
{
|
|
||||||
name: 'small',
|
|
||||||
size: 9,
|
|
||||||
mines: 10
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'medium',
|
|
||||||
size: 16,
|
|
||||||
mines: 40
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'large',
|
|
||||||
size: 24,
|
|
||||||
mines: 150
|
|
||||||
},
|
|
||||||
],
|
|
||||||
|
|
||||||
async newGame(gameMode) {
|
|
||||||
for (const mode of this.gameModes) {
|
|
||||||
if (mode.name == gameMode) {
|
|
||||||
this.size = mode.size;
|
|
||||||
this.mines = mode.mines;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
this.generatePlayfield(this.size);
|
|
||||||
|
|
||||||
await this.logic.init(this.size, this.mines);
|
|
||||||
},
|
|
||||||
|
|
||||||
// ------------------------------------ //
|
|
||||||
// ----- Click/Touch Handling ----- //
|
|
||||||
// ------------------------------------ //
|
|
||||||
|
|
||||||
async cellLeftClickHandler(event) {
|
|
||||||
event.preventDefault();
|
|
||||||
|
|
||||||
const x = event.target.dataset.x;
|
|
||||||
const y = event.target.dataset.y;
|
|
||||||
|
|
||||||
const result = await this.logic.sweep(x, y);
|
|
||||||
|
|
||||||
if (result.minehit) {
|
|
||||||
this.logic.gameLost(event, result.mines);
|
|
||||||
} else {
|
|
||||||
this.logic.uncoverCell(x, y, result.minesAround);
|
|
||||||
for (const cell of result.emptyCells) {
|
|
||||||
this.logic.uncoverCell(cell.x, cell.y, cell.minesAround);
|
|
||||||
}
|
|
||||||
if (result.userwins) {
|
|
||||||
this.logic.gameWon();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
cellRightClickHandler(event) {
|
|
||||||
event.preventDefault();
|
|
||||||
|
|
||||||
event.target.classList.toggle('symbol-f');
|
|
||||||
},
|
|
||||||
|
|
||||||
cellTouchStartHandler(event) {
|
|
||||||
event.preventDefault();
|
|
||||||
|
|
||||||
this.touchStartTime = new Date().getTime();
|
|
||||||
},
|
|
||||||
|
|
||||||
cellTouchEndHandler(event) {
|
|
||||||
event.preventDefault();
|
|
||||||
|
|
||||||
const touchDuration = new Date().getTime() - this.touchStartTime;
|
|
||||||
if (touchDuration < 500) {
|
|
||||||
this.cellLeftClickHandler(event);
|
|
||||||
} else {
|
|
||||||
this.cellRightClickHandler(event);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// -------------------------------------------------- //
|
|
||||||
// -------------------------------------------------- //
|
|
||||||
// -------------------------------------------------- //
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
const remoteLogic = {
|
|
||||||
|
|
||||||
// ----------------------------- //
|
|
||||||
// ----- Field Filling ----- //
|
|
||||||
// ----------------------------- //
|
|
||||||
|
|
||||||
async init(size, mines) {
|
|
||||||
this.serverUrl = 'https://www2.hs-esslingen.de/~melcher/it/minesweeper/?';
|
|
||||||
const request = `request=init&size=${size}&mines=${mines}&userid=elfiit00`;
|
|
||||||
const response = await this.fetchAndDecode(request);
|
|
||||||
this.token = response.token;
|
|
||||||
},
|
|
||||||
|
|
||||||
async fetchAndDecode(request) {
|
|
||||||
return fetch(this.serverUrl + request).then(response => response.json());
|
|
||||||
},
|
|
||||||
|
|
||||||
// ------------------------------- //
|
|
||||||
// ----- Move Processing ----- //
|
|
||||||
// ------------------------------- //
|
|
||||||
|
|
||||||
async sweep(x, y) {
|
|
||||||
const request = `request=sweep&token=${this.token}&x=${x}&y=${y}`;
|
|
||||||
return this.fetchAndDecode(request);
|
|
||||||
},
|
|
||||||
|
|
||||||
// ------------------------------- //
|
|
||||||
// ----- Cell Uncovering ----- //
|
|
||||||
// ------------------------------- //
|
|
||||||
|
|
||||||
getCell(x, y) {
|
|
||||||
return document.querySelector(`[data-x="${x}"][data-y="${y}"]`);
|
|
||||||
},
|
|
||||||
|
|
||||||
uncoverCell(x, y, symbol) {
|
|
||||||
this.getCell(x, y).classList.remove('covered');
|
|
||||||
|
|
||||||
if (symbol) {
|
|
||||||
this.getCell(x, y).classList.add(`symbol-${symbol}`);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
// ------------------------ //
|
|
||||||
// ----- Game End ----- //
|
|
||||||
// ------------------------ //
|
|
||||||
|
|
||||||
gameLost(event, mines) {
|
|
||||||
event.target.id = 'mine-hit';
|
|
||||||
for (const m of mines) {
|
|
||||||
this.uncoverCell(m.x, m.y, 'm');
|
|
||||||
}
|
|
||||||
this.displayOverlay('Game Over');
|
|
||||||
},
|
|
||||||
|
|
||||||
gameWon() {
|
|
||||||
this.displayOverlay('Victory');
|
|
||||||
},
|
|
||||||
|
|
||||||
displayOverlay(text) {
|
|
||||||
const overlay = document.createElement('div');
|
|
||||||
overlay.id = 'overlay';
|
|
||||||
|
|
||||||
const div = document.createElement('div');
|
|
||||||
div.innerText = text;
|
|
||||||
overlay.appendChild(div);
|
|
||||||
|
|
||||||
const main = document.querySelector('main');
|
|
||||||
main.appendChild(overlay);
|
|
||||||
}
|
|
||||||
|
|
||||||
};
|
|
||||||
@@ -1,231 +0,0 @@
|
|||||||
/* ------------------------- */
|
|
||||||
/* General */
|
|
||||||
/* ------------------------- */
|
|
||||||
|
|
||||||
:root {
|
|
||||||
--blue-1: #001A33;
|
|
||||||
--blue-2: #004D99;
|
|
||||||
--blue-3: #0080FF;
|
|
||||||
--blue-4: #66B3FF;
|
|
||||||
--blue-5: #CCE6FF;
|
|
||||||
--grey-1: #161A1D;
|
|
||||||
--grey-2: #434D56;
|
|
||||||
--grey-3: #708090;
|
|
||||||
--grey-4: #A9B3BC;
|
|
||||||
--grey-5: #E2E6E9;
|
|
||||||
--peach-fuzz: #ffbe98;
|
|
||||||
}
|
|
||||||
|
|
||||||
* {
|
|
||||||
margin: 0;
|
|
||||||
padding: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
html, body {
|
|
||||||
height: 100%;
|
|
||||||
font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
|
|
||||||
}
|
|
||||||
|
|
||||||
#container {
|
|
||||||
width: min(100vw, 55.555vh);
|
|
||||||
height: min(100vh, 180vw);
|
|
||||||
margin: 0 auto;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/* ------------------------ */
|
|
||||||
/* Header */
|
|
||||||
/* ------------------------ */
|
|
||||||
|
|
||||||
|
|
||||||
header {
|
|
||||||
height: calc(4 * 100% / 18);
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
justify-content: space-between;
|
|
||||||
padding: 0 20px;
|
|
||||||
background-color: var(--blue-3);
|
|
||||||
color: #fff;
|
|
||||||
}
|
|
||||||
|
|
||||||
#title h1 {
|
|
||||||
font-size: 40px;
|
|
||||||
margin-bottom: 5px;
|
|
||||||
}
|
|
||||||
|
|
||||||
#title p {
|
|
||||||
font-size: 20px;
|
|
||||||
}
|
|
||||||
|
|
||||||
@media (min-width: 420px) {
|
|
||||||
|
|
||||||
header {
|
|
||||||
background-image: url(images/logo.svg);
|
|
||||||
background-size: 100px;
|
|
||||||
background-position: right 20px center;
|
|
||||||
background-repeat: no-repeat;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/* ------------------------------- */
|
|
||||||
/* Playing Field */
|
|
||||||
/* ------------------------------- */
|
|
||||||
|
|
||||||
main {
|
|
||||||
position: relative;
|
|
||||||
height: calc(10 * 100% / 18);
|
|
||||||
display: flex;
|
|
||||||
flex-wrap: wrap;
|
|
||||||
align-content: space-between;
|
|
||||||
justify-content: space-between;
|
|
||||||
border: 1px solid var(--grey-3);
|
|
||||||
}
|
|
||||||
|
|
||||||
.cell {
|
|
||||||
flex-shrink: 0;
|
|
||||||
background-color: var(--blue-5);
|
|
||||||
border: 1px solid var(--grey-3);
|
|
||||||
}
|
|
||||||
|
|
||||||
.covered {
|
|
||||||
background-color: var(--grey-4);
|
|
||||||
}
|
|
||||||
|
|
||||||
.symbol-1, .symbol-2, .symbol-3, .symbol-4, .symbol-5, .symbol-6, .symbol-7, .symbol-8, .symbol-f.covered, .symbol-m {
|
|
||||||
background-size: 1000%;
|
|
||||||
background-image: url(images/symbols.svg);
|
|
||||||
}
|
|
||||||
|
|
||||||
.symbol-1 {
|
|
||||||
background-position: calc(100% * 0 / 9);
|
|
||||||
}
|
|
||||||
|
|
||||||
.symbol-2 {
|
|
||||||
background-position: calc(100% * 1 / 9);
|
|
||||||
}
|
|
||||||
|
|
||||||
.symbol-3 {
|
|
||||||
background-position: calc(100% * 2 / 9);
|
|
||||||
}
|
|
||||||
|
|
||||||
.symbol-4 {
|
|
||||||
background-position: calc(100% * 3 / 9);
|
|
||||||
}
|
|
||||||
|
|
||||||
.symbol-5 {
|
|
||||||
background-position: calc(100% * 4 / 9);
|
|
||||||
}
|
|
||||||
|
|
||||||
.symbol-6 {
|
|
||||||
background-position: calc(100% * 5 / 9);
|
|
||||||
}
|
|
||||||
|
|
||||||
.symbol-7 {
|
|
||||||
background-position: calc(100% * 6 / 9);
|
|
||||||
}
|
|
||||||
|
|
||||||
.symbol-8 {
|
|
||||||
background-position: calc(100% * 7 / 9);
|
|
||||||
}
|
|
||||||
|
|
||||||
.symbol-f.covered {
|
|
||||||
background-position: calc(100% * 8 / 9);
|
|
||||||
}
|
|
||||||
|
|
||||||
.symbol-m {
|
|
||||||
background-position: calc(100% * 9 / 9);
|
|
||||||
}
|
|
||||||
|
|
||||||
#mine-hit {
|
|
||||||
background-color: var(--peach-fuzz);
|
|
||||||
}
|
|
||||||
|
|
||||||
#overlay {
|
|
||||||
position: absolute;
|
|
||||||
top: 0;
|
|
||||||
left: 0;
|
|
||||||
right: 0;
|
|
||||||
bottom: 0;
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
justify-content: center;
|
|
||||||
background-color: rgba(0, 0, 0, 0.4);
|
|
||||||
}
|
|
||||||
|
|
||||||
#overlay div {
|
|
||||||
padding: 16px 32px;
|
|
||||||
border-radius: 16px;
|
|
||||||
background-color: var(--blue-4);
|
|
||||||
font-size: 48px;
|
|
||||||
}
|
|
||||||
|
|
||||||
#overlay div:hover {
|
|
||||||
opacity: 0.2;
|
|
||||||
transition: 0.2s;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/* ------------------------- */
|
|
||||||
/* Buttons */
|
|
||||||
/* ------------------------- */
|
|
||||||
|
|
||||||
#buttons {
|
|
||||||
height: calc(3 * 100% / 18);
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
justify-content: space-around;
|
|
||||||
padding: 0 20px;
|
|
||||||
background-color: var(--grey-5);
|
|
||||||
}
|
|
||||||
|
|
||||||
button {
|
|
||||||
font-size: 16px;
|
|
||||||
text-transform: capitalize;
|
|
||||||
padding: 15px 30px;
|
|
||||||
margin: 0 2px;
|
|
||||||
color: #fff;
|
|
||||||
background-color: var(--blue-3);
|
|
||||||
border: 2px solid var(--blue-3);
|
|
||||||
cursor: pointer;
|
|
||||||
transition: 0.2s;
|
|
||||||
}
|
|
||||||
|
|
||||||
button:hover {
|
|
||||||
color: var(--blue-3);
|
|
||||||
background-color: transparent;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/* ------------------------ */
|
|
||||||
/* Footer */
|
|
||||||
/* ------------------------ */
|
|
||||||
|
|
||||||
footer {
|
|
||||||
height: calc(100% / 18);
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
justify-content: space-around;
|
|
||||||
padding: 0 20px;
|
|
||||||
background-color: var(--grey-2);
|
|
||||||
color: #fff;
|
|
||||||
}
|
|
||||||
|
|
||||||
footer a {
|
|
||||||
color: #fff;
|
|
||||||
text-decoration: none;
|
|
||||||
border-bottom: 1px solid #fff;
|
|
||||||
}
|
|
||||||
|
|
||||||
footer a:hover {
|
|
||||||
border-bottom: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
@media (max-width: 480px) {
|
|
||||||
|
|
||||||
footer span:not(:first-child) {
|
|
||||||
display: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -5,7 +5,7 @@
|
|||||||
<style>
|
<style>
|
||||||
body {
|
body {
|
||||||
margin: 0;
|
margin: 0;
|
||||||
background-color: var(--blue-1);
|
background-color: var(--blue-darkest);
|
||||||
}
|
}
|
||||||
|
|
||||||
h1 {
|
h1 {
|
||||||
@@ -21,7 +21,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
span {
|
span {
|
||||||
color: var(--blue-3);
|
color: var(--blue-medium);
|
||||||
}
|
}
|
||||||
|
|
||||||
@media (max-width: 767px) {
|
@media (max-width: 767px) {
|
||||||
|
|||||||