-
-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
5ff5326
commit dc01efe
Showing
13 changed files
with
125 additions
and
55 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
120 changes: 102 additions & 18 deletions
120
src/lib/components/kurosearch/cookie-message/CookieMessage.svelte
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,34 +1,118 @@ | ||
<script> | ||
<script lang="ts"> | ||
import TextButton from '$lib/components/pure/text-button/TextButton.svelte'; | ||
import cookiesAccepted from '$lib/store/cookies-accepted-store'; | ||
import { fly } from 'svelte/transition'; | ||
import LynxMain from '../../../../routes/LynxMain.svelte'; | ||
const accept = () => { | ||
$cookiesAccepted = true; | ||
document.documentElement.dataset.cookies = 'true'; | ||
}; | ||
const leave = () => { | ||
history.back(); | ||
}; | ||
</script> | ||
|
||
<section out:fly={{ y: 200, duration: 200 }}> | ||
<div> | ||
<span>This website uses cookies.</span> | ||
<TextButton title="Accept cookies" on:click={() => cookiesAccepted.set(true)}>Ok</TextButton> | ||
</div> | ||
</section> | ||
<svelte:head> | ||
<script lang="ts"> | ||
const cookies = localStorage.getItem('kurosearch:cookies-accepted') ?? 'false'; | ||
document.documentElement.dataset.cookies = cookies; | ||
</script> | ||
</svelte:head> | ||
|
||
<div id="cookie-dialog" class="backdrop"> | ||
<section> | ||
<LynxMain /> | ||
<h1>kurosearch</h1> | ||
<h2>Terms of Use</h2> | ||
<span /> | ||
<h3>Mature Content</h3> | ||
<p> | ||
This website contains mature content. By using this website you confirm that you are at | ||
legally allowed to view such content. | ||
</p> | ||
<span /> | ||
<h3>Use of Cookies</h3> | ||
<p>Additinally, this website uses cookies to provide functionality.</p> | ||
<div class="row"> | ||
<TextButton title="Accept terms of use" on:click={accept}>Accept</TextButton> | ||
<TextButton title="Leave website" type="secondary" on:click={leave}>Leave</TextButton> | ||
</div> | ||
</section> | ||
</div> | ||
|
||
<style> | ||
section { | ||
position: fixed; | ||
bottom: 0; | ||
left: 0; | ||
width: 100vw; | ||
display: flex; | ||
flex-direction: column; | ||
background-color: var(--background-0); | ||
gap: var(--grid-gap); | ||
padding: var(--grid-gap); | ||
max-width: 500px; | ||
border-radius: var(--border-radius-large); | ||
} | ||
h1 { | ||
font-family: 'Zen Kaku Gothic New', sans-serif; | ||
font-size: 72px; | ||
color: var(--accent); | ||
margin-block: -0.25em; | ||
} | ||
@media (max-width: 600px) { | ||
h1 { | ||
font-size: 12vw; | ||
} | ||
} | ||
span { | ||
background-color: var(--background-1); | ||
z-index: var(--z-dialog); | ||
height: 2px; | ||
} | ||
div { | ||
max-width: var(--body-width); | ||
margin: auto; | ||
h1, | ||
h2, | ||
h3, | ||
p { | ||
text-align: center; | ||
} | ||
:global(:root[data-cookies='false'] .backdrop) { | ||
display: flex; | ||
} | ||
.backdrop { | ||
z-index: var(--z-dialog); | ||
position: fixed; | ||
display: none; | ||
justify-content: center; | ||
align-items: center; | ||
justify-content: space-between; | ||
width: 100vw; | ||
height: 100vh; | ||
backdrop-filter: blur(10px); | ||
overflow: hidden; | ||
} | ||
@media not (min-width: 600px) { | ||
.backdrop { | ||
background-color: var(--background-0); | ||
} | ||
} | ||
@media (min-width: 600px) { | ||
section { | ||
border: solid 2px crimson; | ||
box-shadow: 0 0 100px 100px black; | ||
} | ||
} | ||
.row { | ||
align-self: center; | ||
display: flex; | ||
gap: var(--grid-gap); | ||
padding: var(--grid-gap); | ||
} | ||
:global(:root[data-cookies='false'] body) { | ||
overflow: hidden; | ||
} | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,4 @@ | ||
import { boolParser, boolSerializer, persistentWritable } from './persistent-store'; | ||
import { createBoolStore } from './generic/bool-store'; | ||
import { StoreKey } from './store-keys'; | ||
|
||
const createCookiesAcceptedStore = () => { | ||
const initial = false; | ||
const { subscribe, set } = persistentWritable( | ||
StoreKey.CookiesAccepted, | ||
initial, | ||
boolSerializer, | ||
boolParser | ||
); | ||
return { subscribe, set, reset: () => set(initial) }; | ||
}; | ||
|
||
export default createCookiesAcceptedStore(); | ||
export default createBoolStore(StoreKey.CookiesAccepted, false); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters