úprava game.svelte/try.svelte=volá komponentu

This commit is contained in:
ota-prokopec 2022-07-31 20:47:05 +02:00
parent 047941a041
commit da894e7dda
16 changed files with 291 additions and 19 deletions

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

View File

@ -3,12 +3,13 @@
import './main.scss'
import Game from './routes/game.svelte'
import Try from './routes/try.svelte'
</script>
<main>
<Router>
<Route path="/">
<Game />
<Try />
</Route>
</Router>
</main>
@ -16,6 +17,8 @@
<style lang="scss">
main {
height: 100%;
display: flex;
justify-content: center;
width: 100%;
}
</style>

View File

@ -13,5 +13,6 @@
background-size: cover;
height: 94px;
width: 94px;
min-width: 94px;
}
</style>

42
src/lib/Ota/Bubble.svelte Normal file
View File

@ -0,0 +1,42 @@
<script>
const col = {
blue: '#4263EB',
white: 'white',
txt_blue: 'white',
txt_white: '#999999',
}
export let background
</script>
<bubble style={`background: ${col[background]}; color: ${col[`txt_${background}`]}`}>
<slot name="icon" />
<span class="text"><slot /></span>
</bubble>
<style>
bubble {
border-radius: 20px;
width: fit-content;
height: 38px;
display: flex;
align-items: center;
flex-direction: row;
align-items: center;
justify-content: space-between;
padding: 6px 10px;
gap: 10px;
border: 1px solid #4263eb;
font-size: 17px;
color: white;
}
.text {
font-family: 'Source Sans Pro';
font-style: normal;
font-weight: 700;
font-size: 20px;
line-height: 25px;
display: flex;
align-items: center;
text-align: center;
}
</style>

View File

@ -0,0 +1,25 @@
<script>
</script>
<div>
<h1>
<slot />
</h1>
<slot name="bubbles" />
</div>
<style lang="scss">
div {
display: flex;
flex-wrap: wrap;
gap: 10px;
}
h1 {
font-style: normal;
font-weight: 600;
font-size: 36px;
line-height: 45px;
color: #110042;
}
</style>

View File

@ -0,0 +1,8 @@
<svg width="20" height="26" viewBox="0 0 20 26" fill="none" xmlns="http://www.w3.org/2000/svg">
<path
fill-rule="evenodd"
clip-rule="evenodd"
d="M0.479126 9.35335C0.479126 4.19335 4.65246 0.0200195 9.8125 0.0200195C14.9725 0.0200195 19.1458 4.19335 19.1458 9.35335C19.1458 14.9133 13.2525 22.58 10.8391 25.5C10.3058 26.14 9.33246 26.14 8.79913 25.5C6.37246 22.58 0.479126 14.9133 0.479126 9.35335ZM6.47913 9.35335C6.47913 11.1933 7.97246 12.6867 9.8125 12.6867C11.6525 12.6867 13.1458 11.1933 13.1458 9.35335C13.1458 7.51335 11.6525 6.02002 9.8125 6.02002C7.97246 6.02002 6.47913 7.51335 6.47913 9.35335Z"
fill="#4263EB"
/>
</svg>

After

Width:  |  Height:  |  Size: 641 B

View File

@ -0,0 +1,26 @@
<svg width="42" height="42" viewBox="0 0 42 42" fill="none" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<g filter="url(#filter0_i_956_444)">
<rect width="42" height="42" fill="url(#share_svelteSvgPictureid)" />
</g>
<defs>
<filter id="filter0_i_956_444" x="0" y="0" width="42" height="42" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB">
<feFlood flood-opacity="0" result="BackgroundImageFix" />
<feBlend mode="normal" in="SourceGraphic" in2="BackgroundImageFix" result="shape" />
<feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha" />
<feOffset dx="436" dy="4" />
<feGaussianBlur stdDeviation="2" />
<feComposite in2="hardAlpha" operator="arithmetic" k2="-1" k3="1" />
<feColorMatrix type="matrix" values="0 0 0 0 0.258824 0 0 0 0 0.388235 0 0 0 0 0.921569 0 0 0 1 0" />
<feBlend mode="normal" in2="shape" result="effect1_innerShadow_956_444" />
</filter>
<pattern id="share_svelteSvgPictureid" patternContentUnits="objectBoundingBox" width="1" height="1">
<use xlink:href="#image0_956_444" transform="scale(0.00520833)" />
</pattern>
<image
id="image0_956_444"
width="192"
height="192"
xlink:href="data:image/png;base64,iVBORw0KG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FNlXKWa36TkGp64UGVHsQfppxRMhT5IU31Ss0C3tatMubA7XuQwuVD6v8rOQU0q+E/b0SFksxkqfQzf8S8A6Rh5E1QKsxwbIePP1YTMCiiTWig2CCdVtegmb/aJeiwhzETyW/NBFBrVh44O9DXFdA7k3BMj7WgN5RW7xF3yNsIvGxo63AIeduVOfFFifnYtvjnP7XVhjTGqgsq2Hd99F3OuvzXXknu/MfcqRWwTwl02MdeS+x5n7qiN3XfQIJLV45o7K/bxTugCK76Jz++mObWc4c3v3vSZdAMXX69zeM3DdO+j9rHP7mnQBFF+3c/vNNN4NutmZ27vvNekCKL6jzu07aOxD2EZgoTO3d99FWI3/i+xlrLyhXosJUwrxaENHLHKTSYQZWH8ZK2+oVQy3iXDFcBPcRy+CTUXobZDVOIzN7zmfwXLoBcAObN2yUHn2pXImpJS2Ea5hZhVbUjkTUkrtNNeIsV4yGhKpXqByOA/8OvZOJPBL/KvaiNxiMvaXNfZf91pxBo0Ek5TsIH4DrxVbUzt6Kb1WwvYIhY596LFcUjYD/xiBNKIHX+GdSN1WkK/pFa8Cy1I9YpEh1pCPqdf70Or2Eskq4ArxGr+WSJLolhPnnaAHPfZITszAFqfIqvHvQy+8kjPVRTjSvBv0YhP5jsromEQSmwS8iE1RHrLhP4/Km6WJtGFTlHfSWG9RH/aos4Ucz/Wf+2krJBcmYi+sS7BxALOxO8W4yr9fxB6djmPDGA8Ae8lgULuIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiJTP/wH5i5NW/xdfxAAAAABJRU5ErkJggg=="
/>
</defs>
</svg>

After

Width:  |  Height:  |  Size: 5.3 KiB

View File

@ -0,0 +1,6 @@
<svg width="27" height="26" viewBox="0 0 27 26" fill="none" xmlns="http://www.w3.org/2000/svg">
<path
d="M13.5 21.2792L19.725 25.0442C20.865 25.7342 22.26 24.7142 21.96 23.4242L20.31 16.3442L25.815 11.5742C26.82 10.7042 26.28 9.05416 24.96 8.94916L17.715 8.33416L14.88 1.64416C14.37 0.42916 12.63 0.42916 12.12 1.64416L9.28499 8.31916L2.03999 8.93416C0.719987 9.03916 0.179987 10.6892 1.18499 11.5592L6.68999 16.3292L5.03999 23.4092C4.73999 24.6992 6.13499 25.7192 7.27499 25.0292L13.5 21.2792Z"
fill="#FFBF00"
/>
</svg>

After

Width:  |  Height:  |  Size: 527 B

View File

@ -0,0 +1,48 @@
<script>
import Image from '../Image.svelte'
export let images
let windowsize
let overflow = 'hidden'
const nextImages = () => {
overflow = 'auto'
images = images
windowsize = Infinity
}
</script>
<div style={`overflow-y: ${overflow}`} bind:offsetWidth={windowsize} class="imageSlider">
{#each images as image, i}
{#if Math.floor(windowsize / (94 + 10)) >= i + 1}
<div>
<Image src={image} />
{#if Math.floor(windowsize / (94 + 10)) === i + 1 && images.length !== i + 1}
<span on:click={nextImages} class="imageCounter">{`+${images.length - Math.floor(windowsize / (94 + 10))}`}</span>
{/if}
</div>
{/if}
{/each}
</div>
<style>
.imageSlider {
display: flex;
justify-content: space-between;
width: 100%;
gap: 10px;
position: relative;
}
.imageCounter {
display: flex;
align-items: center;
justify-content: center;
font-size: 125%;
color: white;
height: 94px;
width: 94px;
min-width: 94px;
position: absolute;
top: 0;
cursor: pointer;
}
</style>

12
src/lib/Ota/Map.svelte Normal file

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,32 @@
<script>
import IconShare from './Icons/Share.svelte'
export let shareData
const share = async () => {
if (navigator.canShare(shareData)) {
await navigator.share(shareData)
} else {
navigator.clipboard.writeText(shareData.url)
}
}
</script>
<div on:click={share}>
<span>
<IconShare />
</span>
</div>
<style>
div {
height: 62px;
width: 62px;
cursor: pointer;
background: #e8e8e8;
border-radius: 16px;
z-index: 6;
display: flex;
align-items: center;
justify-content: center;
}
</style>

22
src/lib/Ota/Tab.svelte Normal file
View File

@ -0,0 +1,22 @@
<script>
import Sharebutton from './Sharebutton.svelte'
export let shareData
</script>
<div>
<Sharebutton {shareData} />
</div>
<style>
div {
width: 100%;
height: calc(100% - 75%);
display: flex;
justify-content: flex-end;
align-items: center;
position: absolute;
top: 0;
padding: 50px;
background: none;
}
</style>

View File

@ -1,10 +1,13 @@
<script>
export let img
export let shareData
export let alt = 'background image'
import Tab from './Ota/Tab.svelte'
</script>
<section class="container">
<img src={img} {alt} />
<Tab {shareData} />
<section class="overlay">
<slot />
</section>
@ -15,16 +18,18 @@
position: relative;
height: 100%;
width: 100%;
max-width: 768px;
.overlay {
height: 75%;
height: max-content;
width: 100%;
position: absolute;
bottom: 0;
top: 25%;
border-radius: 70px 70px 0 0;
padding-left: 52px;
/*padding-left: 52px;
padding-right: 52px;
padding-top: 52px;
padding-top: 52px;*/
padding: 52px; /*provedena změna-OtaProkopec*/
display: flex;
flex-direction: column;
row-gap: 35px;

View File

@ -1,24 +1,50 @@
<script>
import Image from '../lib/Image.svelte'
import Heading from '../lib/Heading.svelte'
import Heading from '../lib/Ota/Heading.svelte'
import Overlay from '../lib/Overlay.svelte'
import Section from '../lib/Section.svelte'
import Button from '../lib/Button.svelte'
import Bubble from '../lib/Ota/Bubble.svelte'
import IconStar from '../lib/Ota/Icons/Star.svelte'
import IconPoint from '../lib/Ota/Icons/Point.svelte'
import Map from '../lib/Ota/Map.svelte'
import ImageSlider from '../lib/Ota/ImageSlider.svelte'
let assets = Array.from(Array(4).keys()).map((_, i) => `/assets/temp/kar${i + 1}.png`)
export let assets
export let shareData
</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}
<Overlay {shareData} img="/assets/temp/kar1.png">
<Heading>
<slot name="title" />
<div class="bubbles" slot="bubbles">
<Bubble background="blue">
<span slot="icon"><IconStar /></span>
<span><slot name="stars" /></span>
</Bubble>
<Bubble background="white">
<span slot="icon"><IconPoint /></span>
<span><slot name="point" /></span>
</Bubble>
</div>
</Section>
</Heading>
<Button primary>Play</Button>
<Section title="Popis"><slot name="description" /></Section>
<Section title="Fotky">
<ImageSlider images={assets} />
</Section>
<Map />
<Button primary>Hrát</Button>
</Overlay>
<!---->
<style>
.bubbles {
display: flex;
height: fit-content;
width: 100%;
align-items: center;
justify-content: flex-start;
gap: 15px;
}
</style>

16
src/routes/try.svelte Normal file
View File

@ -0,0 +1,16 @@
<script>
import Overlay from './game.svelte'
let assets = Array.from(Array(6).keys()).map((_, i) => `/assets/temp/kar${i + 1}.png`)
const shareData = {
title: 'Geohry',
text: 'Naše geohry',
url: location.origin,
}
</script>
<Overlay {shareData} {assets}>
<span slot="title">Tůra po Karláku</span>
<span slot="description">Vydejte se na napínavou pouť po zajímavostech největšího náměstí v Česku.</span>
<span slot="stars">4.5</span>
<span slot="point">Praha</span>
</Overlay>