game home page

This commit is contained in:
Ludvík Prokopec 2022-07-25 12:44:41 +02:00
parent 6d91fe6962
commit b9b44fe27b
17 changed files with 2935 additions and 2350 deletions

View File

@ -6,3 +6,5 @@ Vzdělávejte se mimo lavice. Nechte se provést atraktivními lokacemi, vyřeš
2. QR kódy 2. QR kódy
3. Nacházení blízkých her do x km a jejich seznam 3. Nacházení blízkých her do x km a jejich seznam
4. Přihlašování/registrace 4. Přihlašování/registrace
https://www.figma.com/file/mEaF6SbE8aP1WCo95f8dlV/Erant

68
package-lock.json generated
View File

@ -11,14 +11,14 @@
"svelte-routing": "^1.6.0" "svelte-routing": "^1.6.0"
}, },
"devDependencies": { "devDependencies": {
"@sveltejs/vite-plugin-svelte": "^1.0.0-next.30", "@sveltejs/vite-plugin-svelte": "^1.0.1",
"autoprefixer": "^10.4.7", "autoprefixer": "^10.4.7",
"postcss": "^8.4.14", "postcss": "^8.4.14",
"postcss-load-config": "^4.0.1", "postcss-load-config": "^4.0.1",
"sass": "^1.53.0", "sass": "^1.53.0",
"svelte": "^3.44.0", "svelte": "^3.49.0",
"svelte-preprocess": "^4.10.7", "svelte-preprocess": "^4.10.7",
"vite": "^2.9.9" "vite": "^3.0.0"
} }
}, },
"node_modules/@rollup/pluginutils": { "node_modules/@rollup/pluginutils": {
@ -1231,7 +1231,6 @@
"version": "3.49.0", "version": "3.49.0",
"resolved": "https://registry.npmjs.org/svelte/-/svelte-3.49.0.tgz", "resolved": "https://registry.npmjs.org/svelte/-/svelte-3.49.0.tgz",
"integrity": "sha512-+lmjic1pApJWDfPCpUUTc1m8azDqYCG1JN9YEngrx/hUyIcFJo6VZhj0A1Ai0wqoHcEIuQy+e9tk+4uDgdtsFA==", "integrity": "sha512-+lmjic1pApJWDfPCpUUTc1m8azDqYCG1JN9YEngrx/hUyIcFJo6VZhj0A1Ai0wqoHcEIuQy+e9tk+4uDgdtsFA==",
"dev": true,
"engines": { "engines": {
"node": ">= 8" "node": ">= 8"
} }
@ -1364,6 +1363,19 @@
"resolved": "https://registry.npmjs.org/tslib/-/tslib-2.4.0.tgz", "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.4.0.tgz",
"integrity": "sha512-d6xOpEDfsi2CZVlPQzGeux8XMwLT9hssAsaPYExaQMuYskwb+x1x7J371tWlbBdWHroy99KnVB6qIkUbs5X3UQ==" "integrity": "sha512-d6xOpEDfsi2CZVlPQzGeux8XMwLT9hssAsaPYExaQMuYskwb+x1x7J371tWlbBdWHroy99KnVB6qIkUbs5X3UQ=="
}, },
"node_modules/typescript": {
"version": "4.7.4",
"resolved": "https://registry.npmjs.org/typescript/-/typescript-4.7.4.tgz",
"integrity": "sha512-C0WQT0gezHuw6AdY1M2jxUO83Rjf0HP7Sk1DtXj6j1EwkQNZrHAg2XPWlq62oqEhYvONq5pkC2Y9oPljWToLmQ==",
"peer": true,
"bin": {
"tsc": "bin/tsc",
"tsserver": "bin/tsserver"
},
"engines": {
"node": ">=4.2.0"
}
},
"node_modules/update-browserslist-db": { "node_modules/update-browserslist-db": {
"version": "1.0.4", "version": "1.0.4",
"resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.0.4.tgz", "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.0.4.tgz",
@ -1391,21 +1403,21 @@
} }
}, },
"node_modules/vite": { "node_modules/vite": {
"version": "2.9.14", "version": "3.0.3",
"resolved": "https://registry.npmjs.org/vite/-/vite-2.9.14.tgz", "resolved": "https://registry.npmjs.org/vite/-/vite-3.0.3.tgz",
"integrity": "sha512-P/UCjSpSMcE54r4mPak55hWAZPlyfS369svib/gpmz8/01L822lMPOJ/RYW6tLCe1RPvMvOsJ17erf55bKp4Hw==", "integrity": "sha512-sDIpIcl3mv1NUaSzZwiXGEy1ZoWwwC2vkxUHY6yiDacR6zf//ZFuBJrozO62gedpE43pmxnLATNR5IYUdAEkMQ==",
"dev": true, "dev": true,
"dependencies": { "dependencies": {
"esbuild": "^0.14.27", "esbuild": "^0.14.47",
"postcss": "^8.4.13", "postcss": "^8.4.14",
"resolve": "^1.22.0", "resolve": "^1.22.1",
"rollup": "^2.59.0" "rollup": "^2.75.6"
}, },
"bin": { "bin": {
"vite": "bin/vite.js" "vite": "bin/vite.js"
}, },
"engines": { "engines": {
"node": ">=12.2.0" "node": "^14.18.0 || >=16.0.0"
}, },
"optionalDependencies": { "optionalDependencies": {
"fsevents": "~2.3.2" "fsevents": "~2.3.2"
@ -1413,7 +1425,8 @@
"peerDependencies": { "peerDependencies": {
"less": "*", "less": "*",
"sass": "*", "sass": "*",
"stylus": "*" "stylus": "*",
"terser": "^5.4.0"
}, },
"peerDependenciesMeta": { "peerDependenciesMeta": {
"less": { "less": {
@ -1424,6 +1437,9 @@
}, },
"stylus": { "stylus": {
"optional": true "optional": true
},
"terser": {
"optional": true
} }
} }
}, },
@ -2211,14 +2227,14 @@
"svelte": { "svelte": {
"version": "3.49.0", "version": "3.49.0",
"resolved": "https://registry.npmjs.org/svelte/-/svelte-3.49.0.tgz", "resolved": "https://registry.npmjs.org/svelte/-/svelte-3.49.0.tgz",
"integrity": "sha512-+lmjic1pApJWDfPCpUUTc1m8azDqYCG1JN9YEngrx/hUyIcFJo6VZhj0A1Ai0wqoHcEIuQy+e9tk+4uDgdtsFA==", "integrity": "sha512-+lmjic1pApJWDfPCpUUTc1m8azDqYCG1JN9YEngrx/hUyIcFJo6VZhj0A1Ai0wqoHcEIuQy+e9tk+4uDgdtsFA=="
"dev": true
}, },
"svelte-hmr": { "svelte-hmr": {
"version": "0.14.12", "version": "0.14.12",
"resolved": "https://registry.npmjs.org/svelte-hmr/-/svelte-hmr-0.14.12.tgz", "resolved": "https://registry.npmjs.org/svelte-hmr/-/svelte-hmr-0.14.12.tgz",
"integrity": "sha512-4QSW/VvXuqVcFZ+RhxiR8/newmwOCTlbYIezvkeN6302YFRE8cXy0naamHcjz8Y9Ce3ITTZtrHrIL0AGfyo61w==", "integrity": "sha512-4QSW/VvXuqVcFZ+RhxiR8/newmwOCTlbYIezvkeN6302YFRE8cXy0naamHcjz8Y9Ce3ITTZtrHrIL0AGfyo61w==",
"dev": true "dev": true,
"requires": {}
}, },
"svelte-preprocess": { "svelte-preprocess": {
"version": "4.10.7", "version": "4.10.7",
@ -2276,6 +2292,12 @@
"resolved": "https://registry.npmjs.org/tslib/-/tslib-2.4.0.tgz", "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.4.0.tgz",
"integrity": "sha512-d6xOpEDfsi2CZVlPQzGeux8XMwLT9hssAsaPYExaQMuYskwb+x1x7J371tWlbBdWHroy99KnVB6qIkUbs5X3UQ==" "integrity": "sha512-d6xOpEDfsi2CZVlPQzGeux8XMwLT9hssAsaPYExaQMuYskwb+x1x7J371tWlbBdWHroy99KnVB6qIkUbs5X3UQ=="
}, },
"typescript": {
"version": "4.7.4",
"resolved": "https://registry.npmjs.org/typescript/-/typescript-4.7.4.tgz",
"integrity": "sha512-C0WQT0gezHuw6AdY1M2jxUO83Rjf0HP7Sk1DtXj6j1EwkQNZrHAg2XPWlq62oqEhYvONq5pkC2Y9oPljWToLmQ==",
"peer": true
},
"update-browserslist-db": { "update-browserslist-db": {
"version": "1.0.4", "version": "1.0.4",
"resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.0.4.tgz", "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.0.4.tgz",
@ -2287,16 +2309,16 @@
} }
}, },
"vite": { "vite": {
"version": "2.9.14", "version": "3.0.3",
"resolved": "https://registry.npmjs.org/vite/-/vite-2.9.14.tgz", "resolved": "https://registry.npmjs.org/vite/-/vite-3.0.3.tgz",
"integrity": "sha512-P/UCjSpSMcE54r4mPak55hWAZPlyfS369svib/gpmz8/01L822lMPOJ/RYW6tLCe1RPvMvOsJ17erf55bKp4Hw==", "integrity": "sha512-sDIpIcl3mv1NUaSzZwiXGEy1ZoWwwC2vkxUHY6yiDacR6zf//ZFuBJrozO62gedpE43pmxnLATNR5IYUdAEkMQ==",
"dev": true, "dev": true,
"requires": { "requires": {
"esbuild": "^0.14.27", "esbuild": "^0.14.47",
"fsevents": "~2.3.2", "fsevents": "~2.3.2",
"postcss": "^8.4.13", "postcss": "^8.4.14",
"resolve": "^1.22.0", "resolve": "^1.22.1",
"rollup": "^2.59.0" "rollup": "^2.75.6"
} }
}, },
"wrappy": { "wrappy": {

View File

@ -9,14 +9,14 @@
"preview": "vite preview" "preview": "vite preview"
}, },
"devDependencies": { "devDependencies": {
"@sveltejs/vite-plugin-svelte": "^1.0.0-next.30", "@sveltejs/vite-plugin-svelte": "^1.0.1",
"autoprefixer": "^10.4.7", "autoprefixer": "^10.4.7",
"postcss": "^8.4.14", "postcss": "^8.4.14",
"postcss-load-config": "^4.0.1", "postcss-load-config": "^4.0.1",
"sass": "^1.53.0", "sass": "^1.53.0",
"svelte": "^3.44.0", "svelte": "^3.49.0",
"svelte-preprocess": "^4.10.7", "svelte-preprocess": "^4.10.7",
"vite": "^2.9.9" "vite": "^3.0.0"
}, },
"dependencies": { "dependencies": {
"svelte-routing": "^1.6.0" "svelte-routing": "^1.6.0"

BIN
public/assets/temp/kar1.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 603 KiB

BIN
public/assets/temp/kar2.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

BIN
public/assets/temp/kar3.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

BIN
public/assets/temp/kar4.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

View File

@ -1,14 +1,21 @@
<script> <script>
import { Router, link, Route } from 'svelte-routing' import { Router, link, Route } from 'svelte-routing'
import './main.scss'
import Game from './routes/game.svelte'
</script> </script>
<main> <main>
<nav>
<a href="/" use:link>Home</a>
<a href="/play" use:link>Play</a>
</nav>
<Router> <Router>
<Route path="/">home</Route> <Route path="/">
<Route path="/play">play</Route> <Game />
</Route>
</Router> </Router>
</main> </main>
<style lang="scss">
main {
height: 100%;
width: 100%;
}
</style>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.1 KiB

View File

@ -1,11 +1,14 @@
<button on:click><slot /></button> <script>
export let primary = false
</script>
<style> <button on:click class:primary>
<slot />
</button>
<style lang="scss">
button { button {
background-color: rgba(150, 221, 255); border-radius: 25px;
min-width: 460px;
border-radius: 6px;
color: #fff;
cursor: pointer; cursor: pointer;
display: inline-block; display: inline-block;
font-size: 30px; font-size: 30px;
@ -17,9 +20,21 @@
box-shadow: none; box-shadow: none;
border: none; border: none;
transition: background-color 0.3s; transition: background-color 0.3s;
}
button:hover { background-color: rgb(232, 232, 232);
color: #4263eb;
&.primary {
color: #110042;
background-color: rgba(150, 221, 255);
&:hover {
background-color: rgba(150, 221, 255, 0.8); background-color: rgba(150, 221, 255, 0.8);
} }
}
&:hover {
background-color: rgb(232, 232, 232, 0.8);
}
}
</style> </style>

13
src/lib/Heading.svelte Normal file
View File

@ -0,0 +1,13 @@
<h1>
<slot />
</h1>
<style lang="scss">
h1 {
font-style: normal;
font-weight: 600;
font-size: 36px;
line-height: 45px;
color: #110042;
}
</style>

17
src/lib/Image.svelte Normal file
View File

@ -0,0 +1,17 @@
<script>
export let src
</script>
<section style="--bg: url({src});" />
<style lang="scss">
section {
border-radius: 26px;
background-image: var(--bg);
background-position: center center;
background-repeat: no-repeat;
background-size: cover;
height: 94px;
width: 94px;
}
</style>

43
src/lib/Overlay.svelte Normal file
View File

@ -0,0 +1,43 @@
<script>
export let img
export let alt = 'background image'
</script>
<section class="container">
<img src={img} {alt} />
<section class="overlay">
<slot />
</section>
</section>
<style lang="scss">
.container {
position: relative;
height: 100%;
width: 100%;
.overlay {
height: 75%;
width: 100%;
position: absolute;
bottom: 0;
border-radius: 70px 70px 0 0;
padding-left: 52px;
padding-right: 52px;
padding-top: 52px;
display: flex;
flex-direction: column;
row-gap: 35px;
z-index: 5;
background-color: white;
}
img {
z-index: 4;
width: 100%;
height: auto;
min-height: 25%;
max-height: 100%;
}
}
</style>

32
src/lib/Section.svelte Normal file
View File

@ -0,0 +1,32 @@
<script>
export let title
</script>
<section>
<h2>{title}</h2>
<div><slot /></div>
</section>
<style lang="scss">
section {
display: flex;
flex-direction: column;
row-gap: 20px;
h2 {
font-style: normal;
font-weight: 600;
font-size: 24px;
line-height: 30px;
color: #110042;
}
div {
color: rgba(0, 0, 0, 0.4);
font-style: normal;
font-weight: 400;
font-size: 20px;
line-height: 25px;
}
}
</style>

31
src/main.scss Normal file
View File

@ -0,0 +1,31 @@
*,
*:before,
*:after {
box-sizing: border-box;
}
html,
body {
width: 100%;
height: 100%;
padding: 0;
margin: 0;
font-family: 'Source Sans Pro';
}
#app {
width: 100%;
height: 100%;
}
h1,
h2,
h3,
h4,
h5,
h6,
p {
margin: 0;
}
@import url("normalize.scss")

379
src/normalize.scss vendored Normal file
View File

@ -0,0 +1,379 @@
/*! normalize.css v8.0.1 | MIT License | github.com/necolas/normalize.css */
/* Document
========================================================================== */
/**
* 1. Correct the line height in all browsers.
* 2. Prevent adjustments of font size after orientation changes in iOS.
*/
html {
line-height: 1.15;
/* 1 */
-webkit-text-size-adjust: 100%;
/* 2 */
}
/* Sections
========================================================================== */
/**
* Remove the margin in all browsers.
*/
body {
margin: 0;
}
/**
* Render the `main` element consistently in IE.
*/
main {
display: block;
}
/**
* Correct the font size and margin on `h1` elements within `section` and
* `article` contexts in Chrome, Firefox, and Safari.
*/
h1 {
font-size: 2em;
margin: 0.67em 0;
}
/* Grouping content
========================================================================== */
/**
* 1. Add the correct box sizing in Firefox.
* 2. Show the overflow in Edge and IE.
*/
hr {
box-sizing: content-box;
/* 1 */
height: 0;
/* 1 */
overflow: visible;
/* 2 */
}
/**
* 1. Correct the inheritance and scaling of font size in all browsers.
* 2. Correct the odd `em` font sizing in all browsers.
*/
pre {
font-family: monospace, monospace;
/* 1 */
font-size: 1em;
/* 2 */
}
/* Text-level semantics
========================================================================== */
/**
* Remove the gray background on active links in IE 10.
*/
a {
background-color: transparent;
}
/**
* 1. Remove the bottom border in Chrome 57-
* 2. Add the correct text decoration in Chrome, Edge, IE, Opera, and Safari.
*/
abbr[title] {
border-bottom: none;
/* 1 */
text-decoration: underline;
/* 2 */
text-decoration: underline dotted;
/* 2 */
}
/**
* Add the correct font weight in Chrome, Edge, and Safari.
*/
b,
strong {
font-weight: bolder;
}
/**
* 1. Correct the inheritance and scaling of font size in all browsers.
* 2. Correct the odd `em` font sizing in all browsers.
*/
code,
kbd,
samp {
font-family: monospace, monospace;
/* 1 */
font-size: 1em;
/* 2 */
}
/**
* Add the correct font size in all browsers.
*/
small {
font-size: 80%;
}
/**
* Prevent `sub` and `sup` elements from affecting the line height in
* all browsers.
*/
sub,
sup {
font-size: 75%;
line-height: 0;
position: relative;
vertical-align: baseline;
}
sub {
bottom: -0.25em;
}
sup {
top: -0.5em;
}
/* Embedded content
========================================================================== */
/**
* Remove the border on images inside links in IE 10.
*/
img {
border-style: none;
}
/* Forms
========================================================================== */
/**
* 1. Change the font styles in all browsers.
* 2. Remove the margin in Firefox and Safari.
*/
button,
input,
optgroup,
select,
textarea {
font-family: inherit;
/* 1 */
font-size: 100%;
/* 1 */
line-height: 1.15;
/* 1 */
margin: 0;
/* 2 */
}
/**
* Show the overflow in IE.
* 1. Show the overflow in Edge.
*/
button,
input {
/* 1 */
overflow: visible;
}
/**
* Remove the inheritance of text transform in Edge, Firefox, and IE.
* 1. Remove the inheritance of text transform in Firefox.
*/
button,
select {
/* 1 */
text-transform: none;
}
/**
* Correct the inability to style clickable types in iOS and Safari.
*/
button,
[type="button"],
[type="reset"],
[type="submit"] {
-webkit-appearance: button;
}
/**
* Remove the inner border and padding in Firefox.
*/
button::-moz-focus-inner,
[type="button"]::-moz-focus-inner,
[type="reset"]::-moz-focus-inner,
[type="submit"]::-moz-focus-inner {
border-style: none;
padding: 0;
}
/**
* Restore the focus styles unset by the previous rule.
*/
button:-moz-focusring,
[type="button"]:-moz-focusring,
[type="reset"]:-moz-focusring,
[type="submit"]:-moz-focusring {
outline: 1px dotted ButtonText;
}
/**
* Correct the padding in Firefox.
*/
fieldset {
padding: 0.35em 0.75em 0.625em;
}
/**
* 1. Correct the text wrapping in Edge and IE.
* 2. Correct the color inheritance from `fieldset` elements in IE.
* 3. Remove the padding so developers are not caught out when they zero out
* `fieldset` elements in all browsers.
*/
legend {
box-sizing: border-box;
/* 1 */
color: inherit;
/* 2 */
display: table;
/* 1 */
max-width: 100%;
/* 1 */
padding: 0;
/* 3 */
white-space: normal;
/* 1 */
}
/**
* Add the correct vertical alignment in Chrome, Firefox, and Opera.
*/
progress {
vertical-align: baseline;
}
/**
* Remove the default vertical scrollbar in IE 10+.
*/
textarea {
overflow: auto;
}
/**
* 1. Add the correct box sizing in IE 10.
* 2. Remove the padding in IE 10.
*/
[type="checkbox"],
[type="radio"] {
box-sizing: border-box;
/* 1 */
padding: 0;
/* 2 */
}
/**
* Correct the cursor style of increment and decrement buttons in Chrome.
*/
[type="number"]::-webkit-inner-spin-button,
[type="number"]::-webkit-outer-spin-button {
height: auto;
}
/**
* 1. Correct the odd appearance in Chrome and Safari.
* 2. Correct the outline style in Safari.
*/
[type="search"] {
-webkit-appearance: textfield;
/* 1 */
outline-offset: -2px;
/* 2 */
}
/**
* Remove the inner padding in Chrome and Safari on macOS.
*/
[type="search"]::-webkit-search-decoration {
-webkit-appearance: none;
}
/**
* 1. Correct the inability to style clickable types in iOS and Safari.
* 2. Change font properties to `inherit` in Safari.
*/
::-webkit-file-upload-button {
-webkit-appearance: button;
/* 1 */
font: inherit;
/* 2 */
}
/* Interactive
========================================================================== */
/*
* Add the correct display in Edge, IE 10+, and Firefox.
*/
details {
display: block;
}
/*
* Add the correct display in all browsers.
*/
summary {
display: list-item;
}
/* Misc
========================================================================== */
/**
* Add the correct display in IE 10+.
*/
template {
display: none;
}
/**
* Add the correct display in IE 10.
*/
[hidden] {
display: none;
}

24
src/routes/game.svelte Normal file
View File

@ -0,0 +1,24 @@
<script>
import Image from '../lib/Image.svelte'
import Heading from '../lib/Heading.svelte'
import Overlay from '../lib/Overlay.svelte'
import Section from '../lib/Section.svelte'
import Button from '../lib/Button.svelte'
let assets = Array.from(Array(4).keys()).map((_, i) => `/assets/temp/kar${i + 1}.png`)
</script>
<Overlay img="/assets/temp/kar1.png">
<Heading>Tůra po Karláku</Heading>
<Section title="Popis">Vydejte se na napínavou pouť po zajímavostech největšího náměstí v Česku.</Section>
<Section title="Fotky">
<div style="display: flex; justify-content: space-between; width: 100%;">
{#each assets as asset}
<Image src={asset} />
{/each}
</div>
</Section>
<Button primary>Hrát</Button>
</Overlay>