From c1cadd1fd502c244dd9f535650e56a7e3fce2173 Mon Sep 17 00:00:00 2001 From: Ota Prokopec Date: Sun, 8 Jan 2023 18:35:33 +0100 Subject: [PATCH] appWrite --- .editorconfig | 7 +- .gitignore | 4 +- README.md | 282 +------------ composer.json | 9 + composer.lock | 146 +++++++ index.html | 34 +- jsconfig.json | 7 +- postcss.config.cjs | 8 +- src/App.svelte | 3 + src/__routes.svelte | 38 +- src/fonts.scss | 10 + src/lib/components/Buttons/Button.svelte | 53 +++ src/lib/components/Buttons/Sharebutton.svelte | 55 +++ src/lib/components/Common/Bubble.svelte | 42 ++ src/lib/components/Common/Carousel.svelte | 266 ++++++++++++ src/lib/components/Common/FullWidthRow.svelte | 14 + src/lib/components/Common/Image.svelte | 17 + src/lib/components/Common/ImageSlider.svelte | 35 ++ src/lib/components/Common/Line.svelte | 12 + src/lib/components/Common/NavBar_Item.svelte | 42 ++ src/lib/components/Common/Redirect.svelte | 9 + src/lib/components/Common/Section.svelte | 36 ++ src/lib/components/Common/SettingRow.svelte | 8 + .../components/Cookies/CookiesPopUp.svelte | 61 +++ src/lib/components/Inputs/Checkbox.svelte | 39 ++ src/lib/components/Inputs/Hidden_Input.svelte | 65 +++ src/lib/components/Inputs/Input.svelte | 31 ++ src/lib/components/Inputs/InputPicture.svelte | 7 + src/lib/components/Inputs/Radio.svelte | 52 +++ src/lib/components/Inputs/Range.svelte | 33 ++ src/lib/components/Layouts/LayoutImg.svelte | 72 ++++ .../Layouts/NavigationBarLayout.svelte | 86 ++++ src/lib/components/Map/Erantmap.svelte | 88 ++++ src/lib/components/Map/Map.svelte | 56 +++ src/lib/components/Map/Marker.svelte | 48 +++ src/lib/stores/game.js | 3 + src/lib/svg/Earth.svelte | 8 + src/lib/svg/Eye.svelte | 14 + src/lib/svg/GoogleLogo.svelte | 16 + src/lib/svg/Help.svelte | 8 + src/lib/svg/InputPicture.svelte | 27 ++ src/lib/svg/Logout.svelte | 26 ++ src/lib/svg/Point.svelte | 8 + src/lib/svg/PointSmall.svelte | 19 + src/lib/svg/Profile.svelte | 8 + src/lib/svg/Search.svelte | 22 + src/lib/svg/Setting.svelte | 20 + src/lib/svg/Setting2.svelte | 8 + src/lib/svg/Share.svelte | 26 ++ src/lib/svg/Star.svelte | 6 + src/lib/svg/Times.svelte | 20 + src/lib/svg/Top-Image.svelte | 44 ++ src/lib/svg/Wallet.svelte | 8 + src/lib/svg/Warning.svelte | 8 + src/lib/utils/IdGenerator.js | 3 + src/lib/utils/api.js | 55 +++ src/lib/utils/parseQuestion.js | 15 + src/lib/utils/stores.js | 83 ++++ src/lib/utils/supabase.js | 0 src/main.js | 2 +- src/main.scss | 42 +- src/normalize.scss | 379 ++++++++++++++++++ src/routes/error.svelte | 17 + src/routes/explore/Components/Filter.svelte | 32 ++ src/routes/explore/Components/Result.svelte | 163 ++++++++ src/routes/explore/Components/Search.svelte | 74 ++++ src/routes/explore/Components/Top.svelte | 88 ++++ src/routes/explore/explore.svelte | 50 +++ src/routes/game/Components/Layout.svelte | 69 ++++ src/routes/game/Forms/Finish.svelte | 12 + src/routes/game/Forms/IntervalForm.svelte | 33 ++ src/routes/game/Forms/MultiChoiceForm.svelte | 46 +++ src/routes/game/Forms/NumberForm.svelte | 36 ++ src/routes/game/Forms/QrCode.svelte | 0 src/routes/game/Forms/Renderer.svelte | 108 +++++ src/routes/game/Forms/SingleChoiceForm.svelte | 41 ++ src/routes/game/Forms/TextForm.svelte | 37 ++ src/routes/game/game.svelte | 107 +++++ .../homepage/Components/Animation.svelte | 0 .../homepage/Components/Categories.svelte | 45 +++ .../homepage/Components/Category.svelte | 66 +++ .../homepage/Components/Comparment.svelte | 57 +++ .../Components/Compartment_Item.svelte | 189 +++++++++ .../homepage/Components/Discover.svelte | 80 ++++ .../homepage/Components/Headline.svelte | 33 ++ src/routes/homepage/Components/Top.svelte | 97 +++++ src/routes/homepage/homepage.svelte | 77 ++++ src/routes/index.svelte | 41 -- src/routes/log_in.svelte | 244 +++++++++++ src/routes/map.svelte | 15 + src/routes/profile/profile.svelte | 64 +++ .../qrscanner/Components/InfoBar.svelte | 16 + .../qrscanner/Components/QRinput.svelte | 15 + .../qrscanner/Components/QRscanner.svelte | 48 +++ .../qrscanner/Components/ScanFrame.svelte | 17 + .../qrscanner/Components/SwitchBar.svelte | 21 + src/routes/qrscanner/qrscanner.svelte | 36 ++ src/routes/test.svelte | 5 + tailwind.config.cjs | 13 +- 99 files changed, 4397 insertions(+), 348 deletions(-) create mode 100644 composer.json create mode 100644 composer.lock create mode 100644 src/fonts.scss create mode 100644 src/lib/components/Buttons/Button.svelte create mode 100644 src/lib/components/Buttons/Sharebutton.svelte create mode 100644 src/lib/components/Common/Bubble.svelte create mode 100644 src/lib/components/Common/Carousel.svelte create mode 100644 src/lib/components/Common/FullWidthRow.svelte create mode 100644 src/lib/components/Common/Image.svelte create mode 100644 src/lib/components/Common/ImageSlider.svelte create mode 100644 src/lib/components/Common/Line.svelte create mode 100644 src/lib/components/Common/NavBar_Item.svelte create mode 100644 src/lib/components/Common/Redirect.svelte create mode 100644 src/lib/components/Common/Section.svelte create mode 100644 src/lib/components/Common/SettingRow.svelte create mode 100644 src/lib/components/Cookies/CookiesPopUp.svelte create mode 100644 src/lib/components/Inputs/Checkbox.svelte create mode 100644 src/lib/components/Inputs/Hidden_Input.svelte create mode 100644 src/lib/components/Inputs/Input.svelte create mode 100644 src/lib/components/Inputs/InputPicture.svelte create mode 100644 src/lib/components/Inputs/Radio.svelte create mode 100644 src/lib/components/Inputs/Range.svelte create mode 100644 src/lib/components/Layouts/LayoutImg.svelte create mode 100644 src/lib/components/Layouts/NavigationBarLayout.svelte create mode 100644 src/lib/components/Map/Erantmap.svelte create mode 100644 src/lib/components/Map/Map.svelte create mode 100644 src/lib/components/Map/Marker.svelte create mode 100644 src/lib/stores/game.js create mode 100644 src/lib/svg/Earth.svelte create mode 100644 src/lib/svg/Eye.svelte create mode 100644 src/lib/svg/GoogleLogo.svelte create mode 100644 src/lib/svg/Help.svelte create mode 100644 src/lib/svg/InputPicture.svelte create mode 100644 src/lib/svg/Logout.svelte create mode 100644 src/lib/svg/Point.svelte create mode 100644 src/lib/svg/PointSmall.svelte create mode 100644 src/lib/svg/Profile.svelte create mode 100644 src/lib/svg/Search.svelte create mode 100644 src/lib/svg/Setting.svelte create mode 100644 src/lib/svg/Setting2.svelte create mode 100644 src/lib/svg/Share.svelte create mode 100644 src/lib/svg/Star.svelte create mode 100644 src/lib/svg/Times.svelte create mode 100644 src/lib/svg/Top-Image.svelte create mode 100644 src/lib/svg/Wallet.svelte create mode 100644 src/lib/svg/Warning.svelte create mode 100644 src/lib/utils/IdGenerator.js create mode 100644 src/lib/utils/api.js create mode 100644 src/lib/utils/parseQuestion.js create mode 100644 src/lib/utils/stores.js create mode 100644 src/lib/utils/supabase.js create mode 100644 src/normalize.scss create mode 100644 src/routes/error.svelte create mode 100644 src/routes/explore/Components/Filter.svelte create mode 100644 src/routes/explore/Components/Result.svelte create mode 100644 src/routes/explore/Components/Search.svelte create mode 100644 src/routes/explore/Components/Top.svelte create mode 100644 src/routes/explore/explore.svelte create mode 100644 src/routes/game/Components/Layout.svelte create mode 100644 src/routes/game/Forms/Finish.svelte create mode 100644 src/routes/game/Forms/IntervalForm.svelte create mode 100644 src/routes/game/Forms/MultiChoiceForm.svelte create mode 100644 src/routes/game/Forms/NumberForm.svelte create mode 100644 src/routes/game/Forms/QrCode.svelte create mode 100644 src/routes/game/Forms/Renderer.svelte create mode 100644 src/routes/game/Forms/SingleChoiceForm.svelte create mode 100644 src/routes/game/Forms/TextForm.svelte create mode 100644 src/routes/game/game.svelte create mode 100644 src/routes/homepage/Components/Animation.svelte create mode 100644 src/routes/homepage/Components/Categories.svelte create mode 100644 src/routes/homepage/Components/Category.svelte create mode 100644 src/routes/homepage/Components/Comparment.svelte create mode 100644 src/routes/homepage/Components/Compartment_Item.svelte create mode 100644 src/routes/homepage/Components/Discover.svelte create mode 100644 src/routes/homepage/Components/Headline.svelte create mode 100644 src/routes/homepage/Components/Top.svelte create mode 100644 src/routes/homepage/homepage.svelte delete mode 100644 src/routes/index.svelte create mode 100644 src/routes/log_in.svelte create mode 100644 src/routes/map.svelte create mode 100644 src/routes/profile/profile.svelte create mode 100644 src/routes/qrscanner/Components/InfoBar.svelte create mode 100644 src/routes/qrscanner/Components/QRinput.svelte create mode 100644 src/routes/qrscanner/Components/QRscanner.svelte create mode 100644 src/routes/qrscanner/Components/ScanFrame.svelte create mode 100644 src/routes/qrscanner/Components/SwitchBar.svelte create mode 100644 src/routes/qrscanner/qrscanner.svelte create mode 100644 src/routes/test.svelte diff --git a/.editorconfig b/.editorconfig index 4892518..f985a36 100644 --- a/.editorconfig +++ b/.editorconfig @@ -9,6 +9,11 @@ charset = utf-8 trim_trailing_whitespace = false quote_type = single -[*.{yml, md}] +[*.yml] +end_of_line = lf +insert_final_newline = true indent_style = space indent_size = 2 +charset = utf-8 +trim_trailing_whitespace = false +quote_type = single diff --git a/.gitignore b/.gitignore index 4f9d5ac..5cee774 100644 --- a/.gitignore +++ b/.gitignore @@ -23,5 +23,5 @@ dist-ssr *.sln *.sw? -# appwrite -appwrite +# php +public/api/vendor diff --git a/README.md b/README.md index 2f01f3e..d92f2da 100644 --- a/README.md +++ b/README.md @@ -1,278 +1,10 @@ -# Svelte + Appwrite = 🚀 +# Geohry -## Appwrite svelte template +Vzdělávejte se mimo lavice. Nechte se provést atraktivními lokacemi, vyřešte mnoho výzev a objevte nejednu geografickou zajímavost s bezplatnou mobilní aplikací. -Blazing fast development with done backend and fully-prepared frontend. +1. Hrací režim +2. QR kódy +3. Nacházení blízkých her do x km a jejich seznam +4. Přihlašování/registrace -CMS ready! - -## Appwrite installation - -[Appwrite installation](https://appwrite.io/docs/installation) - -## Start - -### Appwrite cli - -```bash -npm install -g appwrite-cli -``` - -### Appwrite new project - -```bash -appwrite init project -``` - -### Appwrite new collection - -```bash -appwrite init collection -``` - -### Appwrite new function - -```bash -appwrite init function -``` - -[Appwrite cli documentation](https://appwrite.io/docs/command-line) - -## env - -Edit `.env` file for config project id. - -## Frontend included - -* tailwind -* scss -* css reset -* typescript -* routing -* ready routes -* oauth -* files upload, download -* folder structure -* common components -* service worker -* path aliases -* database realtime subscribers -* database paginate, infinity scroll -* i18n -* cms -* cms forms components -* vite -* prettier -* editorconfig -* icons: [Feather icons](https://feathericons.com/) - -## Database subscribers - -```svelte - - -
- {#if $loading} -

Loading data from database...

- {:else} - {#each [...$subscriber, ...$insertSubscriber] as item} -

{item.name}

- {/each} - {/if} -
- - -
- {#each $scrollData as item} -

{item.name}

- {/each} -
console.log(e) /* on every fetch from scroll dispatcher do some action */} /> -
-``` - -## Files subscribers - -```svelte - - -
- - -
-``` - -## Routing - -Routes can be added in `__routes.svelte` file. Every route is fetched lazyly. - -```svelte - - - import('$routes/index.svelte'), - }, - { - path: '/oauth', - component: () => import('$routes/oauth/index.svelte'), - }, - { - path: '/oauth/failure', - component: () => import('$routes/oauth/failure.svelte'), - }, - { - path: '/oauth/success', - component: () => import('$routes/oauth/success.svelte'), - }, - ]} -/> -``` - -### Routes structure - -`__layout.svelte` the default layout for every page - -`__error.svelte` the error page (404 error) - -`__loading.svelte` the default loading component - -`__routes.svelte` the file includes all routes in application - -## auth/user - -```svelte - - -
- {#if $user} - user: {$user.name} - - {:else} - - {/if} -
-``` - -## i18n - -Locale file `src/locales/en.json` - -```json -{ - "page": { - "home": { - "title": "Appwrite svelte rocket start 🚀" - } - } -} -``` - -```svelte - - -
-

{$_('page.home.title')}

- -
-

Change language:

- - -
-
-``` - -## path aliases - -`$lib` = `src/lib` - -`$root` = `/` - -`$src` = `src` - -`$routes` = `src/routes` - -## commands - -```bash -npm run dev -``` - -```bash -npm run build -``` - -```bash -npm run preview -``` - -```bash -npm run appwrite -``` +https://www.figma.com/file/mEaF6SbE8aP1WCo95f8dlV/Erant diff --git a/composer.json b/composer.json new file mode 100644 index 0000000..a6b2c39 --- /dev/null +++ b/composer.json @@ -0,0 +1,9 @@ +{ + "config": { + "vendor-dir": "public/api/vendor" + }, + "require": { + "bramus/router": "1.5", + "catfan/medoo": "^2.1" + } +} diff --git a/composer.lock b/composer.lock new file mode 100644 index 0000000..d4800f5 --- /dev/null +++ b/composer.lock @@ -0,0 +1,146 @@ +{ + "_readme": [ + "This file locks the dependencies of your project to a known state", + "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", + "This file is @generated automatically" + ], + "content-hash": "df49ce8601cf8f4f5d004e144d8ecaa5", + "packages": [ + { + "name": "bramus/router", + "version": "1.5", + "source": { + "type": "git", + "url": "https://github.com/bramus/router.git", + "reference": "6adc0182dc6b0ebc22fd10543f65a36de10d8c05" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/bramus/router/zipball/6adc0182dc6b0ebc22fd10543f65a36de10d8c05", + "reference": "6adc0182dc6b0ebc22fd10543f65a36de10d8c05", + "shasum": "" + }, + "require": { + "php": ">=5.3.0" + }, + "require-dev": { + "friendsofphp/php-cs-fixer": "~2.14", + "phpunit/php-code-coverage": "~2.0", + "phpunit/phpunit": "~4.0" + }, + "type": "library", + "autoload": { + "psr-0": { + "Bramus": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Bram(us) Van Damme", + "email": "bramus@bram.us", + "homepage": "http://www.bram.us" + } + ], + "description": "A lightweight and simple object oriented PHP Router", + "homepage": "https://github.com/bramus/router", + "keywords": [ + "router", + "routing" + ], + "support": { + "issues": "https://github.com/bramus/router/issues", + "source": "https://github.com/bramus/router/tree/1.5" + }, + "time": "2020-10-26T09:50:48+00:00" + }, + { + "name": "catfan/medoo", + "version": "v2.1.7", + "source": { + "type": "git", + "url": "https://github.com/catfan/Medoo.git", + "reference": "74be58f80d330d1075ef3bfd0fb3d057349597ae" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/catfan/Medoo/zipball/74be58f80d330d1075ef3bfd0fb3d057349597ae", + "reference": "74be58f80d330d1075ef3bfd0fb3d057349597ae", + "shasum": "" + }, + "require": { + "ext-pdo": "*", + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.0" + }, + "suggest": { + "ext-pdo_dblib": "For MSSQL or Sybase database on Linux/UNIX platform", + "ext-pdo_mysql": "For MySQL or MariaDB database", + "ext-pdo_oci": "For Oracle database", + "ext-pdo_pqsql": "For PostgreSQL database", + "ext-pdo_sqlite": "For SQLite database", + "ext-pdo_sqlsrv": "For MSSQL database on both Window/Liunx platform" + }, + "type": "framework", + "autoload": { + "psr-4": { + "Medoo\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Angel Lai", + "email": "angel@medoo.in" + } + ], + "description": "The lightweight PHP database framework to accelerate development", + "homepage": "https://medoo.in", + "keywords": [ + "database", + "database library", + "lightweight", + "mariadb", + "mssql", + "mysql", + "oracle", + "php framework", + "postgresql", + "sql", + "sqlite" + ], + "support": { + "issues": "https://github.com/catfan/Medoo/issues", + "source": "https://github.com/catfan/Medoo" + }, + "funding": [ + { + "url": "https://paypal.me/AngelaonLai", + "type": "custom" + }, + { + "url": "https://opencollective.com/medoo", + "type": "open_collective" + } + ], + "time": "2022-07-02T04:27:50+00:00" + } + ], + "packages-dev": [], + "aliases": [], + "minimum-stability": "stable", + "stability-flags": [], + "prefer-stable": false, + "prefer-lowest": false, + "platform": [], + "platform-dev": [], + "plugin-api-version": "2.1.0" +} diff --git a/index.html b/index.html index 4624225..8fdd548 100644 --- a/index.html +++ b/index.html @@ -3,12 +3,42 @@ - + + - Svelte + Appwrite + Erant + + + + + + + + + +
diff --git a/jsconfig.json b/jsconfig.json index e596c58..4258594 100644 --- a/jsconfig.json +++ b/jsconfig.json @@ -1,8 +1,8 @@ { "compilerOptions": { - "moduleResolution": "Node", - "target": "ESNext", - "module": "ESNext", + "moduleResolution": "node", + "target": "esnext", + "module": "esnext", /** * svelte-preprocess cannot figure out whether you have * a value or a type, so tell TypeScript to enforce using @@ -19,6 +19,7 @@ "esModuleInterop": true, "skipLibCheck": true, "forceConsistentCasingInFileNames": true, + "baseUrl": ".", /** * Typecheck JS in `.svelte` and `.js` files by default. * Disable this if you'd like to use dynamic types. diff --git a/postcss.config.cjs b/postcss.config.cjs index 1b69d43..bafe175 100644 --- a/postcss.config.cjs +++ b/postcss.config.cjs @@ -1,6 +1,6 @@ +const autoprefixer = require('autoprefixer') +const tailwind = require('tailwindcss') + module.exports = { - plugins: { - tailwindcss: {}, - autoprefixer: {}, - }, + plugins: [tailwind(), autoprefixer()], } diff --git a/src/App.svelte b/src/App.svelte index 1663854..6ab2dba 100644 --- a/src/App.svelte +++ b/src/App.svelte @@ -5,6 +5,7 @@ import { onMount } from 'svelte' import Routes from './__routes.svelte' + import CookiesPopUp from '$lib/components/Cookies/CookiesPopUp.svelte' let isMounted = false $: isReady = $localeLoading === false && $authLoading === false && isMounted @@ -25,6 +26,8 @@
+ + {#if isReady} diff --git a/src/__routes.svelte b/src/__routes.svelte index 2fcb76b..e30d533 100644 --- a/src/__routes.svelte +++ b/src/__routes.svelte @@ -13,7 +13,43 @@ routes={[ { path: '/', - component: () => import('$routes/index.svelte'), + component: () => import('$routes/homepage/homepage.svelte'), + }, + { + path: '/error', + component: () => import('$routes/error.svelte'), + }, + { + path: '/scanner', + component: () => import('$routes/qrscanner/qrscanner.svelte'), + }, + { + path: '/test', + component: () => import('$routes/test.svelte'), + }, + { + path: '/map', + component: () => import('$routes/map.svelte'), + }, + { + path: '/explore', + component: () => import('$routes/explore/explore.svelte'), + }, + { + path: '/profile', + component: () => import('$routes/profile/profile.svelte'), + }, + { + path: '/login', + component: () => import('$routes/log_in.svelte'), + }, + { + path: '/register', + component: () => import('$routes/log_in.svelte'), + }, + { + path: '/:gameurl', + component: () => import('$routes/game/game.svelte'), }, ]} /> diff --git a/src/fonts.scss b/src/fonts.scss new file mode 100644 index 0000000..19172a5 --- /dev/null +++ b/src/fonts.scss @@ -0,0 +1,10 @@ +@font-face { + font-family: "Source Sans Pro"; + src: url("/assets/fonts/SourceSansPro-Regular.ttf") format("ttf"); +} + +@font-face { + font-family: "Source Sans Pro"; + font-style: italic; + src: url("/assets/fonts/SourceSansPro-Italic.ttf") format("ttf"); +} diff --git a/src/lib/components/Buttons/Button.svelte b/src/lib/components/Buttons/Button.svelte new file mode 100644 index 0000000..25aff56 --- /dev/null +++ b/src/lib/components/Buttons/Button.svelte @@ -0,0 +1,53 @@ + + + + + diff --git a/src/lib/components/Buttons/Sharebutton.svelte b/src/lib/components/Buttons/Sharebutton.svelte new file mode 100644 index 0000000..96f7f6b --- /dev/null +++ b/src/lib/components/Buttons/Sharebutton.svelte @@ -0,0 +1,55 @@ + + + + + diff --git a/src/lib/components/Common/Bubble.svelte b/src/lib/components/Common/Bubble.svelte new file mode 100644 index 0000000..385819f --- /dev/null +++ b/src/lib/components/Common/Bubble.svelte @@ -0,0 +1,42 @@ + + +
+ + +
+ + diff --git a/src/lib/components/Common/Carousel.svelte b/src/lib/components/Common/Carousel.svelte new file mode 100644 index 0000000..5d570ae --- /dev/null +++ b/src/lib/components/Common/Carousel.svelte @@ -0,0 +1,266 @@ + +
+ + +
+ {#each Array(images.length) as _, index (index)} + {#if Math.round(scrollProgress) == index} + + {:else} + + {/if} + {/each} +
+
+ + \ No newline at end of file diff --git a/src/lib/components/Common/FullWidthRow.svelte b/src/lib/components/Common/FullWidthRow.svelte new file mode 100644 index 0000000..485c6c3 --- /dev/null +++ b/src/lib/components/Common/FullWidthRow.svelte @@ -0,0 +1,14 @@ +
+ +
+ + diff --git a/src/lib/components/Common/Image.svelte b/src/lib/components/Common/Image.svelte new file mode 100644 index 0000000..5254fb7 --- /dev/null +++ b/src/lib/components/Common/Image.svelte @@ -0,0 +1,17 @@ + + +
+ + diff --git a/src/lib/components/Common/ImageSlider.svelte b/src/lib/components/Common/ImageSlider.svelte new file mode 100644 index 0000000..7ce50b7 --- /dev/null +++ b/src/lib/components/Common/ImageSlider.svelte @@ -0,0 +1,35 @@ + + +
+ {#each images as image, i} + +
+ + +
+ + {/each} +
+ + diff --git a/src/lib/components/Common/Line.svelte b/src/lib/components/Common/Line.svelte new file mode 100644 index 0000000..60c295b --- /dev/null +++ b/src/lib/components/Common/Line.svelte @@ -0,0 +1,12 @@ + + +
+ + diff --git a/src/lib/components/Common/NavBar_Item.svelte b/src/lib/components/Common/NavBar_Item.svelte new file mode 100644 index 0000000..122e877 --- /dev/null +++ b/src/lib/components/Common/NavBar_Item.svelte @@ -0,0 +1,42 @@ + + + + + diff --git a/src/lib/components/Common/Redirect.svelte b/src/lib/components/Common/Redirect.svelte new file mode 100644 index 0000000..d3a8108 --- /dev/null +++ b/src/lib/components/Common/Redirect.svelte @@ -0,0 +1,9 @@ + diff --git a/src/lib/components/Common/Section.svelte b/src/lib/components/Common/Section.svelte new file mode 100644 index 0000000..7d114e6 --- /dev/null +++ b/src/lib/components/Common/Section.svelte @@ -0,0 +1,36 @@ + + +
+

{title}

+
+
+ + diff --git a/src/lib/components/Common/SettingRow.svelte b/src/lib/components/Common/SettingRow.svelte new file mode 100644 index 0000000..688673c --- /dev/null +++ b/src/lib/components/Common/SettingRow.svelte @@ -0,0 +1,8 @@ + + +
+ +
diff --git a/src/lib/components/Cookies/CookiesPopUp.svelte b/src/lib/components/Cookies/CookiesPopUp.svelte new file mode 100644 index 0000000..dc8cf48 --- /dev/null +++ b/src/lib/components/Cookies/CookiesPopUp.svelte @@ -0,0 +1,61 @@ + + +{#if showCookiePopUp && !animation} +
+
+
+ +
+
Cookies settings
+
Our website uses cookies to operate, by continuing you agree to our cookie policy.
+
+ +
+
+ +
+
+
+{/if} + + diff --git a/src/lib/components/Inputs/Checkbox.svelte b/src/lib/components/Inputs/Checkbox.svelte new file mode 100644 index 0000000..186ddb3 --- /dev/null +++ b/src/lib/components/Inputs/Checkbox.svelte @@ -0,0 +1,39 @@ + + +
+
+ +
+ +
+ + diff --git a/src/lib/components/Inputs/Hidden_Input.svelte b/src/lib/components/Inputs/Hidden_Input.svelte new file mode 100644 index 0000000..aa30b65 --- /dev/null +++ b/src/lib/components/Inputs/Hidden_Input.svelte @@ -0,0 +1,65 @@ + + +
+ + +
+ + diff --git a/src/lib/components/Inputs/Input.svelte b/src/lib/components/Inputs/Input.svelte new file mode 100644 index 0000000..bb288dc --- /dev/null +++ b/src/lib/components/Inputs/Input.svelte @@ -0,0 +1,31 @@ + + + + + diff --git a/src/lib/components/Inputs/InputPicture.svelte b/src/lib/components/Inputs/InputPicture.svelte new file mode 100644 index 0000000..61f6e87 --- /dev/null +++ b/src/lib/components/Inputs/InputPicture.svelte @@ -0,0 +1,7 @@ + + +
+ +
diff --git a/src/lib/components/Inputs/Radio.svelte b/src/lib/components/Inputs/Radio.svelte new file mode 100644 index 0000000..2c09d93 --- /dev/null +++ b/src/lib/components/Inputs/Radio.svelte @@ -0,0 +1,52 @@ + + +
+
+ +
+ +
+ + diff --git a/src/lib/components/Inputs/Range.svelte b/src/lib/components/Inputs/Range.svelte new file mode 100644 index 0000000..63eaa85 --- /dev/null +++ b/src/lib/components/Inputs/Range.svelte @@ -0,0 +1,33 @@ + + +
+
+ +
+ +
+ + diff --git a/src/lib/components/Layouts/LayoutImg.svelte b/src/lib/components/Layouts/LayoutImg.svelte new file mode 100644 index 0000000..b712800 --- /dev/null +++ b/src/lib/components/Layouts/LayoutImg.svelte @@ -0,0 +1,72 @@ + + +
+
+ {#if img} + + {/if} + {#if shareData !== null && shareData !== false} + + {/if} +
+ +
+
+
+ + diff --git a/src/lib/components/Layouts/NavigationBarLayout.svelte b/src/lib/components/Layouts/NavigationBarLayout.svelte new file mode 100644 index 0000000..cb3b08c --- /dev/null +++ b/src/lib/components/Layouts/NavigationBarLayout.svelte @@ -0,0 +1,86 @@ + + +
+
+ +
+ + diff --git a/src/lib/components/Map/Erantmap.svelte b/src/lib/components/Map/Erantmap.svelte new file mode 100644 index 0000000..30446ef --- /dev/null +++ b/src/lib/components/Map/Erantmap.svelte @@ -0,0 +1,88 @@ + + + + + { + const { latitude, longitude } = e.detail.coords + user = { lat: latitude, lng: longitude } + //console.log(user) + }} + /> + + +
+ + +
+ + diff --git a/src/lib/components/Map/Map.svelte b/src/lib/components/Map/Map.svelte new file mode 100644 index 0000000..29b24e8 --- /dev/null +++ b/src/lib/components/Map/Map.svelte @@ -0,0 +1,56 @@ + + +
+ { + mapComponent.resize() + mapComponent.setCenter([center.lng, center.lat], 14) + }} + zoom={14} + > + + +
+ + diff --git a/src/lib/components/Map/Marker.svelte b/src/lib/components/Map/Marker.svelte new file mode 100644 index 0000000..63aa589 --- /dev/null +++ b/src/lib/components/Map/Marker.svelte @@ -0,0 +1,48 @@ + + + + + + + + + + + + + + + + + + + diff --git a/src/lib/stores/game.js b/src/lib/stores/game.js new file mode 100644 index 0000000..545b5d1 --- /dev/null +++ b/src/lib/stores/game.js @@ -0,0 +1,3 @@ +import { writable } from 'svelte/store' + +export const data = writable(null) diff --git a/src/lib/svg/Earth.svelte b/src/lib/svg/Earth.svelte new file mode 100644 index 0000000..77432b9 --- /dev/null +++ b/src/lib/svg/Earth.svelte @@ -0,0 +1,8 @@ + + + diff --git a/src/lib/svg/Eye.svelte b/src/lib/svg/Eye.svelte new file mode 100644 index 0000000..b419800 --- /dev/null +++ b/src/lib/svg/Eye.svelte @@ -0,0 +1,14 @@ + + +{#if active} + + + +{:else} + + + +{/if} + \ No newline at end of file diff --git a/src/lib/svg/GoogleLogo.svelte b/src/lib/svg/GoogleLogo.svelte new file mode 100644 index 0000000..ed80b48 --- /dev/null +++ b/src/lib/svg/GoogleLogo.svelte @@ -0,0 +1,16 @@ + + + + + + + + + \ No newline at end of file diff --git a/src/lib/svg/Help.svelte b/src/lib/svg/Help.svelte new file mode 100644 index 0000000..f1272af --- /dev/null +++ b/src/lib/svg/Help.svelte @@ -0,0 +1,8 @@ + + + diff --git a/src/lib/svg/InputPicture.svelte b/src/lib/svg/InputPicture.svelte new file mode 100644 index 0000000..bb220c6 --- /dev/null +++ b/src/lib/svg/InputPicture.svelte @@ -0,0 +1,27 @@ + + + + + + + + + + + + diff --git a/src/lib/svg/Logout.svelte b/src/lib/svg/Logout.svelte new file mode 100644 index 0000000..4216c04 --- /dev/null +++ b/src/lib/svg/Logout.svelte @@ -0,0 +1,26 @@ + + + + + + + + + + + + + + + + + + + + + diff --git a/src/lib/svg/Point.svelte b/src/lib/svg/Point.svelte new file mode 100644 index 0000000..91a8490 --- /dev/null +++ b/src/lib/svg/Point.svelte @@ -0,0 +1,8 @@ + + + diff --git a/src/lib/svg/PointSmall.svelte b/src/lib/svg/PointSmall.svelte new file mode 100644 index 0000000..8526886 --- /dev/null +++ b/src/lib/svg/PointSmall.svelte @@ -0,0 +1,19 @@ + + + + + + + + + diff --git a/src/lib/svg/Profile.svelte b/src/lib/svg/Profile.svelte new file mode 100644 index 0000000..806fa00 --- /dev/null +++ b/src/lib/svg/Profile.svelte @@ -0,0 +1,8 @@ + + + diff --git a/src/lib/svg/Search.svelte b/src/lib/svg/Search.svelte new file mode 100644 index 0000000..18c9a16 --- /dev/null +++ b/src/lib/svg/Search.svelte @@ -0,0 +1,22 @@ + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/lib/svg/Setting.svelte b/src/lib/svg/Setting.svelte new file mode 100644 index 0000000..093912b --- /dev/null +++ b/src/lib/svg/Setting.svelte @@ -0,0 +1,20 @@ + + + + + + + + + + diff --git a/src/lib/svg/Setting2.svelte b/src/lib/svg/Setting2.svelte new file mode 100644 index 0000000..df15098 --- /dev/null +++ b/src/lib/svg/Setting2.svelte @@ -0,0 +1,8 @@ + + + diff --git a/src/lib/svg/Share.svelte b/src/lib/svg/Share.svelte new file mode 100644 index 0000000..ce8515e --- /dev/null +++ b/src/lib/svg/Share.svelte @@ -0,0 +1,26 @@ + + + + + + + + + + + + + + + + + + + + + diff --git a/src/lib/svg/Star.svelte b/src/lib/svg/Star.svelte new file mode 100644 index 0000000..5c3531a --- /dev/null +++ b/src/lib/svg/Star.svelte @@ -0,0 +1,6 @@ + + + diff --git a/src/lib/svg/Times.svelte b/src/lib/svg/Times.svelte new file mode 100644 index 0000000..cfd87b5 --- /dev/null +++ b/src/lib/svg/Times.svelte @@ -0,0 +1,20 @@ + + + + + diff --git a/src/lib/svg/Top-Image.svelte b/src/lib/svg/Top-Image.svelte new file mode 100644 index 0000000..da675aa --- /dev/null +++ b/src/lib/svg/Top-Image.svelte @@ -0,0 +1,44 @@ + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/lib/svg/Wallet.svelte b/src/lib/svg/Wallet.svelte new file mode 100644 index 0000000..69b4e8c --- /dev/null +++ b/src/lib/svg/Wallet.svelte @@ -0,0 +1,8 @@ + + + diff --git a/src/lib/svg/Warning.svelte b/src/lib/svg/Warning.svelte new file mode 100644 index 0000000..e9ec653 --- /dev/null +++ b/src/lib/svg/Warning.svelte @@ -0,0 +1,8 @@ + + + diff --git a/src/lib/utils/IdGenerator.js b/src/lib/utils/IdGenerator.js new file mode 100644 index 0000000..3619eec --- /dev/null +++ b/src/lib/utils/IdGenerator.js @@ -0,0 +1,3 @@ +export const idGenerator = () => { + return JSON.stringify(Date.now() * Math.floor(Math.random() * 100000)) +} diff --git a/src/lib/utils/api.js b/src/lib/utils/api.js new file mode 100644 index 0000000..f8e0019 --- /dev/null +++ b/src/lib/utils/api.js @@ -0,0 +1,55 @@ +async function send({ method, path, body, token, headers }) { + const opts = { method, headers: new Headers(), mode: 'cors' } + opts.headers.append('Content-Type', 'application/json') + opts.headers.append('Access-Control-Allow-Origin', '*') + + if (body) { + opts.body = JSON.stringify(body) + } + + if (headers) { + for (const [k, v] of Object.entries(headers)) { + opts.headers.append(k, v) + } + } + + if (token) { + opts.headers['Authorization'] = `Bearer ${token}` + } + + const res = fetch(path, opts) + .then(async (r) => { + if (r.status >= 200 && r.status < 400) { + return await r.text() + } else { + return await r.text() + } + }) + .then((str) => { + try { + return JSON.parse(str) + } catch (err) { + return str + } + }) + + return res +} + +export function get(path, token = null) { + return send({ method: 'GET', path, body: null, token }) +} + +export function del(path, token = null) { + return send({ method: 'DELETE', path, body: null, token }) +} + +export function post(path, body, token = null) { + return send({ method: 'POST', path, body, token }) +} + +export function put(path, body, token = null, headers = []) { + return send({ method: 'PUT', path, body, token, headers }) +} + +export const hostName = 'https://erant.cz/api' diff --git a/src/lib/utils/parseQuestion.js b/src/lib/utils/parseQuestion.js new file mode 100644 index 0000000..c6e0a00 --- /dev/null +++ b/src/lib/utils/parseQuestion.js @@ -0,0 +1,15 @@ +export default (question, questionType) => { + switch (questionType.toLowerCase()) { + case 'text': + return question + case 'number': + return Number.parseFloat(question) + case 'choice': + return question.split(/;\s*/).map((item) => ({ + label: item.startsWith('*') ? item.substring(1) : item, + value: item.startsWith('*') ? true : false, + })) + default: + return null + } +} diff --git a/src/lib/utils/stores.js b/src/lib/utils/stores.js new file mode 100644 index 0000000..8765b2e --- /dev/null +++ b/src/lib/utils/stores.js @@ -0,0 +1,83 @@ +import { writable } from 'svelte/store' +import * as api from './api' + +class FetchArray extends Array { + constructor(items, caller = () => null) { + super() + this.push(...items) + this.caller = caller + } + + setFetch(caller) { + this.caller = caller + return this + } + + fetch(fetchBody = {}, then = () => null) { + return this.caller(fetchBody, then) + } +} + +export function fetchable(path, initBody = {}) { + const { subscribe, set } = writable(null) + + return { + subscribe, + fetch(fetchBody = {}, then = () => null) { + const body = Object.assign(initBody, fetchBody) + + api.post(path, body).then((result) => { + set(result) + then(result) + }) + + return this + } + } +} + +export function loadable(path, initBody = {}) { + const fetcher = fetchable(path, initBody) + const fetchCaller = fetcher.fetch + + const isFetching = writable(false) + + fetcher.fetch = (fetchBody = {}, then = () => null) => { + isFetching.set(true) + + fetchCaller(fetchBody, (result) => { + isFetching.set(false) + then(result) + }) + + return new FetchArray([fetcher, isFetching], fetcher.fetch) + } + + return new FetchArray([fetcher, isFetching], fetcher.fetch) +} + +export function mutable(path, callback = () => null) { + const isFetching = writable(false) + const { subscribe, set } = writable(null) + + const mutateCall = async (fetchBody = {}) => { + isFetching.set(true) + + const result = await api.post(path, fetchBody) + set(result) + isFetching.set(false) + + return result + } + + return [ + { + subscribe, + mutate(fetchBody = {}) { + callback(mutateCall, fetchBody) + return this + } + }, + isFetching + ] +} diff --git a/src/lib/utils/supabase.js b/src/lib/utils/supabase.js new file mode 100644 index 0000000..e69de29 diff --git a/src/main.js b/src/main.js index 45e5e2d..91f9d88 100644 --- a/src/main.js +++ b/src/main.js @@ -2,7 +2,7 @@ import './app.css' import App from './App.svelte' const app = new App({ - target: document.getElementById('app') + target: document.getElementById('app'), }) export default app diff --git a/src/main.scss b/src/main.scss index 24a1c19..9d0db9d 100644 --- a/src/main.scss +++ b/src/main.scss @@ -1,16 +1,42 @@ *, -*::before, -*::after { +*:before, +*:after { box-sizing: border-box; } +@import url("normalize.scss"); +@import url("fonts.scss"); + +@import url('https://fonts.googleapis.com/css2?family=Source+Sans+Pro:wght@600&display=swap'); +@import url('https://fonts.googleapis.com/css2?family=Work+Sans:wght@500&display=swap'); + html, body { - height: 100%; width: 100%; - - tab-size: 4; - -webkit-font-smoothing: antialiased; - -moz-osx-font-smoothing: grayscale; - -webkit-text-size-adjust: 100%; + height: 100%; + padding: 0; + margin: 0; + font-family: 'Source Sans Pro', sans-serif; +} + +#app { + width: 100%; + height: 100%; + justify-content: center; + display: flex; +} + +.mapboxgl-ctrl-logo, +.mapboxgl-ctrl-bottom-right { + display: none !important; +} + +:root { + --quizHeader: 300px; + --fontSize: 40px; + --blue: #96ddff; + --border-radius: 25px; + --grey: rgba(0, 0, 0, 0.4); + + --max-viewport-width: 500px; } diff --git a/src/normalize.scss b/src/normalize.scss new file mode 100644 index 0000000..4b154ac --- /dev/null +++ b/src/normalize.scss @@ -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; +} diff --git a/src/routes/error.svelte b/src/routes/error.svelte new file mode 100644 index 0000000..99d5667 --- /dev/null +++ b/src/routes/error.svelte @@ -0,0 +1,17 @@ + + + +
+ Erant +
+ +
+

Je nám líto ale tento zážitek nebyl nalezen.

+
+ + +
diff --git a/src/routes/explore/Components/Filter.svelte b/src/routes/explore/Components/Filter.svelte new file mode 100644 index 0000000..d2dc87e --- /dev/null +++ b/src/routes/explore/Components/Filter.svelte @@ -0,0 +1,32 @@ + + + + + \ No newline at end of file diff --git a/src/routes/explore/Components/Result.svelte b/src/routes/explore/Components/Result.svelte new file mode 100644 index 0000000..b71cfe9 --- /dev/null +++ b/src/routes/explore/Components/Result.svelte @@ -0,0 +1,163 @@ + + + + + \ No newline at end of file diff --git a/src/routes/explore/Components/Search.svelte b/src/routes/explore/Components/Search.svelte new file mode 100644 index 0000000..eabf720 --- /dev/null +++ b/src/routes/explore/Components/Search.svelte @@ -0,0 +1,74 @@ + + + + + \ No newline at end of file diff --git a/src/routes/explore/Components/Top.svelte b/src/routes/explore/Components/Top.svelte new file mode 100644 index 0000000..e110de3 --- /dev/null +++ b/src/routes/explore/Components/Top.svelte @@ -0,0 +1,88 @@ + + +
+
+ + + +
+
+ + +
+
+ + \ No newline at end of file diff --git a/src/routes/explore/explore.svelte b/src/routes/explore/explore.svelte new file mode 100644 index 0000000..2cc4603 --- /dev/null +++ b/src/routes/explore/explore.svelte @@ -0,0 +1,50 @@ + + + +
+ + +
+ {#each search(Search) as result} + + {/each} + +
+
+
+ + + diff --git a/src/routes/game/Components/Layout.svelte b/src/routes/game/Components/Layout.svelte new file mode 100644 index 0000000..ce5050f --- /dev/null +++ b/src/routes/game/Components/Layout.svelte @@ -0,0 +1,69 @@ + + +
+
+
+
+ + +
+
+
+
+
+ Popis úkolu: + +
+
+ + {#if control !== null} + + {:else} + + {/if} +
+
+
+ {#if control} + správně + {:else if control !== null} + špatně + {/if} +
+
+
+
+ + diff --git a/src/routes/game/Forms/Finish.svelte b/src/routes/game/Forms/Finish.svelte new file mode 100644 index 0000000..b7df27d --- /dev/null +++ b/src/routes/game/Forms/Finish.svelte @@ -0,0 +1,12 @@ + + + +
+
+ +
+
diff --git a/src/routes/game/Forms/IntervalForm.svelte b/src/routes/game/Forms/IntervalForm.svelte new file mode 100644 index 0000000..93617a0 --- /dev/null +++ b/src/routes/game/Forms/IntervalForm.svelte @@ -0,0 +1,33 @@ + + + { + nextQuestion() + myAnswer = '' + }} + on:submit={() => (control = myAnswer !== '' ? between(myAnswer, params.correct[0], params.correct[1]) : null)} +> + {title} + {params.quesion} +
+ + + +
+
diff --git a/src/routes/game/Forms/MultiChoiceForm.svelte b/src/routes/game/Forms/MultiChoiceForm.svelte new file mode 100644 index 0000000..251af60 --- /dev/null +++ b/src/routes/game/Forms/MultiChoiceForm.svelte @@ -0,0 +1,46 @@ + + + { + nextQuestion() + myAnswers = new Array(answers.length).fill(false) + }} + {control} + on:submit={controlMultiForm} +> + {gameData.name} + {@html gameData.question.question} +
+ {#each answers as { label }, i} + + {label} + + {/each} +
+
diff --git a/src/routes/game/Forms/NumberForm.svelte b/src/routes/game/Forms/NumberForm.svelte new file mode 100644 index 0000000..879b5e4 --- /dev/null +++ b/src/routes/game/Forms/NumberForm.svelte @@ -0,0 +1,36 @@ + + + { + nextQuestion() + myAnswer = '' + }} + {control} + on:submit={() => (control = myAnswer !== '' ? myAnswer == answer : null)} +> + {gameData.name} + {@html gameData.question.question} +
+ + + +
+
+ + diff --git a/src/routes/game/Forms/QrCode.svelte b/src/routes/game/Forms/QrCode.svelte new file mode 100644 index 0000000..e69de29 diff --git a/src/routes/game/Forms/Renderer.svelte b/src/routes/game/Forms/Renderer.svelte new file mode 100644 index 0000000..302af1e --- /dev/null +++ b/src/routes/game/Forms/Renderer.svelte @@ -0,0 +1,108 @@ + + +{#if page && startQuestion} + + (startQuestion = true)} {lat} {lng} {user} /> + +{/if} + +{#if !startQuestion} + {#if clientAnswers.pos !== clientAnswers.end} + + {:else} + + Získali jste {clientAnswers.points} / {clientAnswers.end * 2} bodů + + {/if} +{/if} diff --git a/src/routes/game/Forms/SingleChoiceForm.svelte b/src/routes/game/Forms/SingleChoiceForm.svelte new file mode 100644 index 0000000..518812c --- /dev/null +++ b/src/routes/game/Forms/SingleChoiceForm.svelte @@ -0,0 +1,41 @@ + + + { + nextQuestion() + myAnswer = '' + }} + on:submit={() => (control = typeof myAnswer === 'string' && myAnswer !== '' ? myAnswer === rightAnswer() : null)} +> + {gameData.name} + {@html gameData.question.question} +
+ {#each answers as { label }} + + {label} + + {/each} +
+
+ + diff --git a/src/routes/game/Forms/TextForm.svelte b/src/routes/game/Forms/TextForm.svelte new file mode 100644 index 0000000..46b3648 --- /dev/null +++ b/src/routes/game/Forms/TextForm.svelte @@ -0,0 +1,37 @@ + + + { + nextQuestion() + myAnswer = '' + }} + on:submit={() => (control = myAnswer !== '' ? compare(myAnswer, answer) : null)} +> + {gameData.name} + {@html gameData.question.question} +
+ + + +
+
+ + diff --git a/src/routes/game/game.svelte b/src/routes/game/game.svelte new file mode 100644 index 0000000..354b053 --- /dev/null +++ b/src/routes/game/game.svelte @@ -0,0 +1,107 @@ + + +{#if view === 'game-loading'} + {#if $loading} +

+ Hra se načítá... + +

+ {:else if $gameData?.success === true} + +
+ {$gameData.data.name} +
+ + + {'5.0'} + + + + {$gameData.data.district} + +
+
+ +
+ + {@html $gameData.data.start} + +
+ +
+
+
+ +
+
+
+ +
+
+ + {#each $gameData.data.questions as { lat, lng }} + + {/each} + { + const { latitude, longitude } = e.detail.coords + const user = { lat: latitude, lng: longitude } + console.log(user) + }} + /> + +
+
+ + +
+ {:else} + + {/if} +{:else if view === 'game-play'} + +{/if} + + diff --git a/src/routes/homepage/Components/Animation.svelte b/src/routes/homepage/Components/Animation.svelte new file mode 100644 index 0000000..e69de29 diff --git a/src/routes/homepage/Components/Categories.svelte b/src/routes/homepage/Components/Categories.svelte new file mode 100644 index 0000000..b539042 --- /dev/null +++ b/src/routes/homepage/Components/Categories.svelte @@ -0,0 +1,45 @@ + + +
+ +
+ +
+
+ + diff --git a/src/routes/homepage/Components/Category.svelte b/src/routes/homepage/Components/Category.svelte new file mode 100644 index 0000000..d48eeb9 --- /dev/null +++ b/src/routes/homepage/Components/Category.svelte @@ -0,0 +1,66 @@ + + + + \ No newline at end of file diff --git a/src/routes/homepage/Components/Comparment.svelte b/src/routes/homepage/Components/Comparment.svelte new file mode 100644 index 0000000..4cb417c --- /dev/null +++ b/src/routes/homepage/Components/Comparment.svelte @@ -0,0 +1,57 @@ + + +
+ + +
+ {#each items as item } + + {/each} +
+
+ + \ No newline at end of file diff --git a/src/routes/homepage/Components/Compartment_Item.svelte b/src/routes/homepage/Components/Compartment_Item.svelte new file mode 100644 index 0000000..8f7d1c8 --- /dev/null +++ b/src/routes/homepage/Components/Compartment_Item.svelte @@ -0,0 +1,189 @@ + + + + + diff --git a/src/routes/homepage/Components/Discover.svelte b/src/routes/homepage/Components/Discover.svelte new file mode 100644 index 0000000..7ac4f97 --- /dev/null +++ b/src/routes/homepage/Components/Discover.svelte @@ -0,0 +1,80 @@ + + +
+

+ Dicoveries around +

+ + +
+ + \ No newline at end of file diff --git a/src/routes/homepage/Components/Headline.svelte b/src/routes/homepage/Components/Headline.svelte new file mode 100644 index 0000000..d166803 --- /dev/null +++ b/src/routes/homepage/Components/Headline.svelte @@ -0,0 +1,33 @@ + + +

+ {content} +

+ + \ No newline at end of file diff --git a/src/routes/homepage/Components/Top.svelte b/src/routes/homepage/Components/Top.svelte new file mode 100644 index 0000000..e3bdfad --- /dev/null +++ b/src/routes/homepage/Components/Top.svelte @@ -0,0 +1,97 @@ + + +
+ +
+

+ {headline} +

+
+ +
+ + diff --git a/src/routes/homepage/homepage.svelte b/src/routes/homepage/homepage.svelte new file mode 100644 index 0000000..c1a45cf --- /dev/null +++ b/src/routes/homepage/homepage.svelte @@ -0,0 +1,77 @@ + + +{#if !fitstTime} + + + + + +
+ + + + + +{:else} +
+ +
+{/if} + + diff --git a/src/routes/index.svelte b/src/routes/index.svelte deleted file mode 100644 index 3c513f2..0000000 --- a/src/routes/index.svelte +++ /dev/null @@ -1,41 +0,0 @@ - - -
-

- {$_('page.home.title')} -

- -

-

- -

-

- -
- {#if $user} -
-

- -

- -

- user: - {$user.email} -

-
- {:else} -
-

- -

-

- -

-
- {/if} -
-
diff --git a/src/routes/log_in.svelte b/src/routes/log_in.svelte new file mode 100644 index 0000000..4ebb9ee --- /dev/null +++ b/src/routes/log_in.svelte @@ -0,0 +1,244 @@ + + +
+ +
+ +
+ + +

+ {#if purpose === 'login'} + Welcome Back + {:else} + Register + {/if} +

+ + +
+ {#if purpose === 'login'} +
+ + + + + {:else} +
+ + + + + + + {/if} +
+ +
+ + + +
+ +
+ + {#if purpose === 'login'} +

Don’t have an account? Sign-up

+ {:else} +

Already have an account? Log In

+ {/if} +
+
+ + diff --git a/src/routes/map.svelte b/src/routes/map.svelte new file mode 100644 index 0000000..73da237 --- /dev/null +++ b/src/routes/map.svelte @@ -0,0 +1,15 @@ + + + + + diff --git a/src/routes/profile/profile.svelte b/src/routes/profile/profile.svelte new file mode 100644 index 0000000..8c0d926 --- /dev/null +++ b/src/routes/profile/profile.svelte @@ -0,0 +1,64 @@ + + + +
+ + User name + + + Prague, Czechia + +
+ + +
+ {#each items as { title, itms }} +
{title}
+ {#each itms as { icon, text }} + + + {text} + + + {/each} + {/each} +
+
diff --git a/src/routes/qrscanner/Components/InfoBar.svelte b/src/routes/qrscanner/Components/InfoBar.svelte new file mode 100644 index 0000000..60a687e --- /dev/null +++ b/src/routes/qrscanner/Components/InfoBar.svelte @@ -0,0 +1,16 @@ + + +
+ + + + +
diff --git a/src/routes/qrscanner/Components/QRinput.svelte b/src/routes/qrscanner/Components/QRinput.svelte new file mode 100644 index 0000000..c8d3d5a --- /dev/null +++ b/src/routes/qrscanner/Components/QRinput.svelte @@ -0,0 +1,15 @@ + + +
+
+ +
+ + +
diff --git a/src/routes/qrscanner/Components/QRscanner.svelte b/src/routes/qrscanner/Components/QRscanner.svelte new file mode 100644 index 0000000..f15660e --- /dev/null +++ b/src/routes/qrscanner/Components/QRscanner.svelte @@ -0,0 +1,48 @@ + + +
+
+
+ +
+
+ + diff --git a/src/routes/qrscanner/Components/ScanFrame.svelte b/src/routes/qrscanner/Components/ScanFrame.svelte new file mode 100644 index 0000000..eb52860 --- /dev/null +++ b/src/routes/qrscanner/Components/ScanFrame.svelte @@ -0,0 +1,17 @@ + + +
+ + + + + + + + + + + + +
diff --git a/src/routes/qrscanner/Components/SwitchBar.svelte b/src/routes/qrscanner/Components/SwitchBar.svelte new file mode 100644 index 0000000..a01d876 --- /dev/null +++ b/src/routes/qrscanner/Components/SwitchBar.svelte @@ -0,0 +1,21 @@ + + +{#if switched === 'scan'} +
+ + +
+{:else if switched === 'input'} +
+ + +
+{/if} diff --git a/src/routes/qrscanner/qrscanner.svelte b/src/routes/qrscanner/qrscanner.svelte new file mode 100644 index 0000000..997f664 --- /dev/null +++ b/src/routes/qrscanner/qrscanner.svelte @@ -0,0 +1,36 @@ + + +
+ {#if switched === 'scan'} +
+ window.history.back()}>Scan our QR code or type in code to load the experience + (location.href = e.detail)}> +
+ +
+
+ (switched = e.detail)} class="mb-[40px] bottom-0 max-w-[95%] absolute z-10" /> +
+ {:else if switched === 'input'} +
+ window.history.back()}>Type code or type in code to load the experience + navigate(e.detail)} /> + (switched = e.detail)} class="mb-[40px] mt-auto bottom-0 max-w-[95%] relative z-10" /> +
+ {/if} +
+ + diff --git a/src/routes/test.svelte b/src/routes/test.svelte new file mode 100644 index 0000000..3d86c2d --- /dev/null +++ b/src/routes/test.svelte @@ -0,0 +1,5 @@ + + + diff --git a/tailwind.config.cjs b/tailwind.config.cjs index b653681..c20cfa0 100644 --- a/tailwind.config.cjs +++ b/tailwind.config.cjs @@ -1,15 +1,8 @@ /** @type {import('tailwindcss').Config} */ module.exports = { - content: [ - './src/**/*.{html,js,svelte,ts}', - './cms/**/*.{html,js,svelte,ts}', - './node_modules/flowbite-svelte/**/*.{html,js,svelte,ts}', - ], + content: ['./index.html', './src/**/*.{html,svelte,js,ts}'], theme: { - extend: {} + extend: {}, }, - plugins: [ - require('flowbite/plugin') - ], - darkMode: 'class' + plugins: [], }