Pr/kuba #16

Merged
Sch3nky merged 4 commits from pr/kuba into deploy/prod 2022-11-21 18:48:11 +00:00
11 changed files with 358 additions and 9 deletions
Showing only changes of commit 5466420cda - Show all commits

View File

@ -5,6 +5,7 @@
import Error from './routes/error.svelte' import Error from './routes/error.svelte'
import Game from './routes/game.svelte' import Game from './routes/game.svelte'
import Index from './routes/index.svelte' import Index from './routes/index.svelte'
import Test from './routes/test.svelte'
if ('serviceWorker' in window.navigator) { if ('serviceWorker' in window.navigator) {
window.navigator.serviceWorker.register('/serviceworker.js', { window.navigator.serviceWorker.register('/serviceworker.js', {
@ -17,6 +18,7 @@
<Router> <Router>
<Route path="/" component={Index} /> <Route path="/" component={Index} />
<Route path="/error" component={Error} /> <Route path="/error" component={Error} />
<Route path="/test" component={Test} />
<Route path="/:gameurl" let:params> <Route path="/:gameurl" let:params>
<Game gameurl={params.gameurl} /> <Game gameurl={params.gameurl} />

View File

@ -23,6 +23,11 @@
position: relative; position: relative;
} }
@media screen and (max-width: 370px){
.categories {
width: calc(100% - 12px);
}
}
.categories > .options{ .categories > .options{
display: flex; display: flex;

View File

@ -26,8 +26,6 @@
opacity: 70%; opacity: 70%;
} }
button > h3{ button > h3{
font-family: 'Source Sans Pro'; font-family: 'Source Sans Pro';
font-style: normal; font-style: normal;
@ -55,5 +53,14 @@
background-repeat: no-repeat; background-repeat: no-repeat;
background-position: center; background-position: center;
} }
@media screen and (max-width: 370px){
button {
gap: 2.5vw;
}
button > div {
width: 18vw;
height: 18vw;
}
}
</style> </style>

View File

@ -26,6 +26,11 @@
position: relative; position: relative;
} }
@media screen and (max-width: 370px){
.section {
width: calc(100% - 12px);
}
}
.section > .options{ .section > .options{
display: flex; display: flex;

View File

@ -90,6 +90,19 @@
overflow: hidden; overflow: hidden;
} }
@media screen and (max-width: 390px){
button > .image{
width: 61.5vw;
height: 39vw;
}
}
@media screen and (max-width: 330px){
button > .image{
border-radius: 18px;
}
}
button > .image > .bookmark{ button > .image > .bookmark{
position: absolute; position: absolute;
width: 28px; width: 28px;
@ -122,6 +135,25 @@
line-height: 20px; line-height: 20px;
} }
@media screen and (max-width: 370px){
button > .image > .bookmark{
width: 8vw;
height: 8vw;
right: 3vw;
top: 3vw;
border-radius: 2vw;
}
button > .image > .price{
padding: 1.2vw 2vw 1.2vw 2vw;
height: 8vw;
left: 3vw;
bottom: 3vw;
border-radius: 2vw;
font-size: 13px;
line-height: 18px;
}
}
button > .info{ button > .info{
text-align: left; text-align: left;
width: 100%; width: 100%;

View File

@ -59,4 +59,22 @@
opacity: 80%; opacity: 80%;
cursor: pointer; cursor: pointer;
} }
@media screen and (max-width: 370px){
.discover {
width: calc(100% - 24px);
height: 33.5vw;
border-radius: 8vw;
}
.discover > button{
font-size: 4.3vw;
line-height: 5.4vw;
padding: 2.2vw 14.8vw 2.2vw 14.8vw;
border-radius: 15px;
}
.discover > h2{
font-size: 6.4vw;
line-height: 8.6vw;
}
}
</style> </style>

View File

@ -52,10 +52,18 @@
border-top: 1px solid #EFEFF0; border-top: 1px solid #EFEFF0;
display: flex; display: flex;
gap: 16px;
flex-direction: row; flex-direction: row;
align-items: center; align-items: center;
justify-content: space-evenly; justify-content: space-around;
padding: 15px 10px 25px 10px; padding: 15px 10px 25px 10px;
} }
@media screen and (max-width: 320px){
.footer {
gap: 0px;
justify-content: space-around;
padding: 10px 0 15px 0;
}
}
</style> </style>

View File

@ -14,5 +14,20 @@
font-size: 24px; font-size: 24px;
line-height: 30px; line-height: 30px;
text-align: left; text-align: left;
margin-top: 0;
}
@media screen and (max-width: 370px)
{
h1 {
font-size: 6.4vw;
line-height: 8.6vw;
}
}
@media screen and (max-width: 300px)
{
h1 {
font-size: 19px;
line-height: 25px;
}
} }
</style> </style>

View File

@ -1,17 +1,19 @@
<script>
export let headline = "Paris, Les Invalides"
</script>
<div class="top"> <div class="top">
<button> <button>
<svg width="52" height="52" viewBox="0 0 52 52" fill="none" xmlns="http://www.w3.org/2000/svg"> <svg viewBox="0 0 52 52" fill="none" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" clip-rule="evenodd" d="M5.77778 8.66765C5.77778 7.07876 7.07778 5.77876 8.66667 5.77876H14.4445C16.0333 5.77876 17.3333 4.47876 17.3333 2.88987C17.3333 1.30098 16.0333 0.000976562 14.4445 0.000976562H5.77778C2.6 0.000976562 0 2.60098 0 5.77876V14.4454C0 16.0343 1.3 17.3343 2.88889 17.3343C4.47778 17.3343 5.77778 16.0343 5.77778 14.4454V8.66765ZM2.88889 34.666C1.3 34.666 0 35.966 0 37.5549V46.2216C0 49.3994 2.6 51.9994 5.77778 51.9994H14.4445C16.0333 51.9994 17.3333 50.6994 17.3333 49.1105C17.3333 47.5216 16.0333 46.2216 14.4445 46.2216H8.66667C7.07778 46.2216 5.77778 44.9216 5.77778 43.3327V37.5549C5.77778 35.966 4.47778 34.666 2.88889 34.666ZM37.5553 0.000976562H46.222C49.3998 0.000976562 51.9998 2.60098 51.9998 5.77876V14.4454C51.9998 16.0343 50.6998 17.3343 49.1109 17.3343C47.522 17.3343 46.222 16.0343 46.222 14.4454V8.66765C46.222 7.07876 44.922 5.77876 43.3331 5.77876H37.5553C35.9664 5.77876 34.6664 4.47876 34.6664 2.88987C34.6664 1.30098 35.9664 0.000976562 37.5553 0.000976562ZM46.2221 43.3327C46.2221 44.9216 44.9221 46.2216 43.3332 46.2216H37.5554C35.9665 46.2216 34.6665 47.5216 34.6665 49.1105C34.6665 50.6994 35.9665 51.9994 37.5554 51.9994H46.2221C49.3998 51.9994 51.9998 49.3994 51.9998 46.2216V37.5549C51.9998 35.966 50.6998 34.666 49.111 34.666C47.5221 34.666 46.2221 35.966 46.2221 37.5549V43.3327ZM28.8881 23.1085H23.1104V28.8838H17.3345V34.6616H23.1123V28.8862H28.8881V23.1085ZM23.1123 28.8862V28.8838H23.1104V28.8862H23.1123ZM28.8912 28.8838H34.6689V34.6616H28.8912V28.8838ZM34.669 17.3302H28.8913V23.108H34.669V17.3302ZM17.3345 17.3301H23.1123V23.1079H17.3345V17.3301Z" fill="#4263EB"/> <path fill-rule="evenodd" clip-rule="evenodd" d="M5.77778 8.66765C5.77778 7.07876 7.07778 5.77876 8.66667 5.77876H14.4445C16.0333 5.77876 17.3333 4.47876 17.3333 2.88987C17.3333 1.30098 16.0333 0.000976562 14.4445 0.000976562H5.77778C2.6 0.000976562 0 2.60098 0 5.77876V14.4454C0 16.0343 1.3 17.3343 2.88889 17.3343C4.47778 17.3343 5.77778 16.0343 5.77778 14.4454V8.66765ZM2.88889 34.666C1.3 34.666 0 35.966 0 37.5549V46.2216C0 49.3994 2.6 51.9994 5.77778 51.9994H14.4445C16.0333 51.9994 17.3333 50.6994 17.3333 49.1105C17.3333 47.5216 16.0333 46.2216 14.4445 46.2216H8.66667C7.07778 46.2216 5.77778 44.9216 5.77778 43.3327V37.5549C5.77778 35.966 4.47778 34.666 2.88889 34.666ZM37.5553 0.000976562H46.222C49.3998 0.000976562 51.9998 2.60098 51.9998 5.77876V14.4454C51.9998 16.0343 50.6998 17.3343 49.1109 17.3343C47.522 17.3343 46.222 16.0343 46.222 14.4454V8.66765C46.222 7.07876 44.922 5.77876 43.3331 5.77876H37.5553C35.9664 5.77876 34.6664 4.47876 34.6664 2.88987C34.6664 1.30098 35.9664 0.000976562 37.5553 0.000976562ZM46.2221 43.3327C46.2221 44.9216 44.9221 46.2216 43.3332 46.2216H37.5554C35.9665 46.2216 34.6665 47.5216 34.6665 49.1105C34.6665 50.6994 35.9665 51.9994 37.5554 51.9994H46.2221C49.3998 51.9994 51.9998 49.3994 51.9998 46.2216V37.5549C51.9998 35.966 50.6998 34.666 49.111 34.666C47.5221 34.666 46.2221 35.966 46.2221 37.5549V43.3327ZM28.8881 23.1085H23.1104V28.8838H17.3345V34.6616H23.1123V28.8862H28.8881V23.1085ZM23.1123 28.8862V28.8838H23.1104V28.8862H23.1123ZM28.8912 28.8838H34.6689V34.6616H28.8912V28.8838ZM34.669 17.3302H28.8913V23.108H34.669V17.3302ZM17.3345 17.3301H23.1123V23.1079H17.3345V17.3301Z" fill="#4263EB"/>
</svg> </svg>
</button> </button>
<div> <div>
<h1> <h1>
Paris, Les Invalides {headline}
</h1> </h1>
</div> </div>
<button> <button>
<svg width="62" height="62" viewBox="0 0 62 62" fill="none" xmlns="http://www.w3.org/2000/svg"> <svg viewBox="0 0 62 62" fill="none" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" clip-rule="evenodd" d="M39.2319 37.3851H41.2728L52.2261 48.3901C53.2853 49.4492 53.2853 51.1801 52.2261 52.2392C51.1669 53.2984 49.4361 53.2984 48.3769 52.2392L37.3978 41.2601V39.2192L36.7003 38.4959C33.0836 41.5959 28.1494 43.1976 22.9053 42.3192C15.7236 41.1051 9.98861 35.1117 9.11027 27.8784C7.76694 16.9509 16.9636 7.75425 27.8911 9.09758C35.1244 9.97591 41.1178 15.7109 42.3319 22.8926C43.2103 28.1367 41.6086 33.0709 38.5086 36.6876L39.2319 37.3851ZM14.1478 25.7601C14.1478 32.1926 19.3403 37.3851 25.7728 37.3851C32.2053 37.3851 37.3978 32.1926 37.3978 25.7601C37.3978 19.3276 32.2053 14.1351 25.7728 14.1351C19.3403 14.1351 14.1478 19.3276 14.1478 25.7601Z" fill="#4263EB"/> <path fill-rule="evenodd" clip-rule="evenodd" d="M39.2319 37.3851H41.2728L52.2261 48.3901C53.2853 49.4492 53.2853 51.1801 52.2261 52.2392C51.1669 53.2984 49.4361 53.2984 48.3769 52.2392L37.3978 41.2601V39.2192L36.7003 38.4959C33.0836 41.5959 28.1494 43.1976 22.9053 42.3192C15.7236 41.1051 9.98861 35.1117 9.11027 27.8784C7.76694 16.9509 16.9636 7.75425 27.8911 9.09758C35.1244 9.97591 41.1178 15.7109 42.3319 22.8926C43.2103 28.1367 41.6086 33.0709 38.5086 36.6876L39.2319 37.3851ZM14.1478 25.7601C14.1478 32.1926 19.3403 37.3851 25.7728 37.3851C32.2053 37.3851 37.3978 32.1926 37.3978 25.7601C37.3978 19.3276 32.2053 14.1351 25.7728 14.1351C19.3403 14.1351 14.1478 19.3276 14.1478 25.7601Z" fill="#4263EB"/>
</svg> </svg>
</button> </button>
@ -33,6 +35,8 @@
flex-direction: row; flex-direction: row;
align-items: center; align-items: center;
justify-content: space-between; justify-content: space-between;
position: relative;
} }
.top h1{ .top h1{
@ -42,4 +46,40 @@
font-size: 24px; font-size: 24px;
line-height: 30px; line-height: 30px;
} }
.top > button{
height: 100%;
position: relative;
}
.top > button > svg{
height: 90%;
width: auto;
}
@media screen and (max-width: 370px){
.top {
width: calc(100% - 24px);
}
}
@media screen and (max-width: 440px){
.top{
height: 14vw;
}
.top h1{
font-size: 5.5vw;
line-height: 6.8vw;
}
}
@media screen and (max-width: 310px){
.top{
height: 14vw;
}
.top h1{
font-size: 18px;
line-height: 21px;
}
}
</style> </style>

View File

@ -59,4 +59,11 @@
background-color: #EFEFF0; background-color: #EFEFF0;
margin: 20px auto 20px auto; margin: 20px auto 20px auto;
} }
@media screen and (max-width: 370px){
.line {
width: calc(100% - 24px);
margin: 5.4vw auto 5.4vw auto;
}
}
</style> </style>

210
src/routes/test.svelte Normal file
View File

@ -0,0 +1,210 @@
<script>
// 420 px
export var images = [{"color":"https://cdn.pixabay.com/photo/2015/04/23/22/00/tree-736885__480.jpg"}, {"color":"https://cdn.pixabay.com/photo/2015/04/23/22/00/tree-736885__480.jpg"}, {"color":"https://cdn.pixabay.com/photo/2015/04/23/22/00/tree-736885__480.jpg"}, {"color":"https://cdn.pixabay.com/photo/2015/04/23/22/00/tree-736885__480.jpg"}, {"color":"https://cdn.pixabay.com/photo/2015/04/23/22/00/tree-736885__480.jpg"}]
let default_index = 3
let scrollProgress = 0
let width = 320
let height = 160
let func = 0.1
let margin = 0
let mp = [-3, -2, -1]
let nav = []
for (let i = 0; i < images.length + 3; i++)
{
mp.push(mp.at(-1) + 1)
}
for (let i = 0; i < images.length ; i++)
{
if (i === 0){
nav.push({"status":"active"})
}
else{
nav.push({"status":"wait"})
}
}
let carousel
const scroll = (self) => {
scrollProgress = -(self.querySelector(".scroll-guide").getBoundingClientRect().x - self.querySelector(".sticky").getBoundingClientRect().width -self.getBoundingClientRect().x)/(width)
}
function getWidth(x){
var res = width - width*0.3*Math.abs(x)
if (res > 0){return res}
else{return 0}
}
function getMargin(x){
var m = 1000
if (x<=-1.75){
x = -(1.75+(x+1.75))
if (x>=0){
x=0
}
}
else if (x>=1.75){
x = 1.75-(x-1.75)
if (x<=0){
x=0
}
}
if (x > 0){
x = Math.abs(x)
return "margin-left: -"+ m*func*x +"px"
}
else if (x === 0){return "margin: 0px;"}
else{
x = Math.abs(x)
return "margin-right: -" + m*func*x +"px"
}
}
</script>
<div id=carousel bind:this={carousel} on:scroll={scroll(carousel)} style="min-height: {height+100}px;">
<div class="sticky" style="min-height: {height+100}px;">
{#each Array(default_index) as _, index (index)}
<div class="item fake" style="
display: {mp.at(index)-scrollProgress<=-3.5||mp.at(index)-scrollProgress>3.5 ? "none" : "block"};
min-width: {getWidth(mp.at(index)-scrollProgress)}px;
max-width: {getWidth(mp.at(index)-scrollProgress)}px;
min-height: {height + height*(-func*(mp.at(index)-scrollProgress)*(mp.at(index)-scrollProgress))}px;
z-index: {(mp.at(index)-scrollProgress<-0.5 && mp.at(index)-scrollProgress>=-1.5)||(mp.at(index)-scrollProgress>=0.5 && mp.at(index)-scrollProgress<=1.5)? 1:((mp.at(index)-scrollProgress>-0.5 && mp.at(index)-scrollProgress<=0.5)?2:0)};
{getMargin(mp.at(index)-scrollProgress)};">
</div>
{/each}
{#each images as image, index (index)}
<div class="item real" style="text-align:center;
display: {mp.at(index+default_index)-scrollProgress<=-3.5||mp.at(index+default_index)-scrollProgress>3.5 ? "none" : "block"};
min-width: {getWidth(mp.at(index+default_index)-scrollProgress)}px;
max-width: {getWidth(mp.at(index+default_index)-scrollProgress)}px;
min-height: {height + height*(-func*(mp.at(index+default_index)-scrollProgress)*(mp.at(index+default_index)-scrollProgress))}px;
z-index: {(mp.at(index+default_index)-scrollProgress<-0.5 && mp.at(index+default_index)-scrollProgress>-1.5)||(mp.at(index+default_index)-scrollProgress>=0.5 && mp.at(index+default_index)-scrollProgress<=1.5)? 1:((mp.at(index+default_index)-scrollProgress>-0.5 && mp.at(index+default_index)-scrollProgress<=0.5)?2:0)};
{getMargin(mp.at(index+default_index)-scrollProgress)}">
<img src={image.color}>
</div>
{/each}
{#each Array(3) as _, index (index)}
<div class="item fake" style="
display: {mp.at(-default_index+index)-scrollProgress<=-3.5||mp.at(-default_index+index)-scrollProgress>3.5 ? "none" : "block"};
min-width: {getWidth(mp.at(-default_index+index)-scrollProgress)}px;
max-width: {getWidth(mp.at(-default_index+index)-scrollProgress)}px;
min-height: {height + height*(-func*(mp.at(-default_index+index)-scrollProgress)*(mp.at(-default_index+index)-scrollProgress))}px;
z-index: {(mp.at(-default_index+index)-scrollProgress<-0.5 && mp.at(-default_index+index)-scrollProgress>=-1.5)||(mp.at(-default_index+index)-scrollProgress>=0.5 && mp.at(-default_index+index)-scrollProgress<=1.5)? 1:((mp.at(-default_index+index)-scrollProgress>-0.5 && mp.at(-default_index+index)-scrollProgress<=0.5)?2:0)};
{getMargin(mp.at(-default_index+index)-scrollProgress)}">
</div>
{/each}
<div class="overlay">
</div>
</div>
<div class="scroll-guide" style="min-width: {(width)*5-width}px; min-height: 10px;">
</div>
</div>
<div class="slide-navigation">
<span class="active"></span>
<span></span>
<span></span>
<span></span>
<span></span>
</div>
<style>
#carousel{
margin-top: 20px;
display: flex;
flex-direction: row;
align-items: center;
max-width: 100%;
overflow-y: scroll;
height: fit-content;
position: relative;
}
#carousel > .sticky{
display: flex;
flex-direction: row;
align-items: center;
justify-content: center;
position: sticky;
left: 0;
top: 0;
gap: 0px;
min-width: 100%;
max-width: 100%;
overflow: hidden;
}
#carousel > .sticky > .item{
border-radius: 10px;
min-width: 0;
color: white;
overflow: hidden;
}
#carousel > .sticky > .overlay{
position: absolute;
left: 0px;
top: 0;
width: 100%;
height: 100%;
/* Mask */
background: linear-gradient(270deg, rgba(255, 255, 255, 0.6) 0%, rgba(255, 255, 255, 0.1) 20%, rgba(255, 255, 255, 0) 40%, rgba(255, 255, 255, 0) 50.56%, rgba(255, 255, 255, 0) 60%, rgba(255, 255, 255, 0.1) 80%, rgba(255, 255, 255, 0.6) 100%);
transform: matrix(1, 0, 0, -1, 0, 0);
z-index: 10;
}
#carousel > .sticky > .real{
display: flex;
align-items: stretch;
justify-content: stretch;
position: relative;
}
#carousel > .sticky > .real > img{
flex-grow: 1;
}
#carousel > .sticky > .fake {
background-color: black;
}
.slide-navigation{
height: fit-content;
display: none;
flex-direction: row;
align-items: center;
justify-content: space-evenly;
gap: 5px;
}
.slide-navigation > span{
width: 4px;
height: 4px;
border-radius: 4px;
background-color: #999999;
}
.slide-navigation > .active{
background-color: #7B61FF;
}
</style>