✨ New landing-page
This commit is contained in:
@@ -29,6 +29,7 @@
|
|||||||
"@types/yup": "^0.29.13",
|
"@types/yup": "^0.29.13",
|
||||||
"@typescript-eslint/eslint-plugin": "^5.10.1",
|
"@typescript-eslint/eslint-plugin": "^5.10.1",
|
||||||
"@typescript-eslint/parser": "^5.10.1",
|
"@typescript-eslint/parser": "^5.10.1",
|
||||||
|
"i18next-scanner": "^3.1.0",
|
||||||
"autoprefixer": "^10.4.2",
|
"autoprefixer": "^10.4.2",
|
||||||
"cookie": "^0.4.2",
|
"cookie": "^0.4.2",
|
||||||
"eslint": "^7.32.0",
|
"eslint": "^7.32.0",
|
||||||
@@ -37,7 +38,6 @@
|
|||||||
"felte": "^1.0.1",
|
"felte": "^1.0.1",
|
||||||
"highlight.js": "^11.4.0",
|
"highlight.js": "^11.4.0",
|
||||||
"i18next-browser-languagedetector": "^6.1.4",
|
"i18next-browser-languagedetector": "^6.1.4",
|
||||||
"i18next-scanner": "^3.1.0",
|
|
||||||
"ioredis": "^4.28.5",
|
"ioredis": "^4.28.5",
|
||||||
"js-cookie": "^3.0.1",
|
"js-cookie": "^3.0.1",
|
||||||
"luxon": "^2.3.1",
|
"luxon": "^2.3.1",
|
||||||
|
|||||||
@@ -0,0 +1,6 @@
|
|||||||
|
*.png
|
||||||
|
*.xcf
|
||||||
|
admin_overview.webp
|
||||||
|
results.webp
|
||||||
|
select.webp
|
||||||
|
solution.webp
|
||||||
Binary file not shown.
|
After Width: | Height: | Size: 44 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 56 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 23 KiB |
@@ -9,7 +9,7 @@ export const initLocalizationContext = () => {
|
|||||||
const i18n = new I18nService();
|
const i18n = new I18nService();
|
||||||
const tranlator = new I18NextTranslationService(i18n);
|
const tranlator = new I18NextTranslationService(i18n);
|
||||||
|
|
||||||
// Setting the Svelte context
|
// skipcq: JS-0357
|
||||||
setLocalization({
|
setLocalization({
|
||||||
t: tranlator.translate,
|
t: tranlator.translate,
|
||||||
currentLanguage: tranlator.locale
|
currentLanguage: tranlator.locale
|
||||||
|
|||||||
@@ -0,0 +1,29 @@
|
|||||||
|
<script lang="ts">
|
||||||
|
/* import AdminOverviewScreenshot from '$lib/assets/landing/admin_overview.png';
|
||||||
|
import SelectScreenshot from '$lib/assets/landing/select.webp';
|
||||||
|
import ResultsScreenshot from '$lib/assets/landing/results.webp';
|
||||||
|
import SolutionScreenshot from '$lib/assets/landing/solution.webp';*/
|
||||||
|
import SelectMockup from '$lib/assets/landing/select-mockup.webp';
|
||||||
|
import ResultsMockup from '$lib/assets/landing/results-mockup.webp';
|
||||||
|
import SolutionMockup from '$lib/assets/landing/solution-mockup.webp';
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<div class="grid grid-cols-3 grow pt-4">
|
||||||
|
<h1 class="text-center h-fit text-3xl marck-script">1: Answer</h1>
|
||||||
|
<h1 class="text-center h-fit text-3xl marck-script">2: See what was right or wrong</h1>
|
||||||
|
<h1 class="text-center h-fit text-3xl marck-script">3: See how many were right or wrong</h1>
|
||||||
|
|
||||||
|
<div class="flex justify-center">
|
||||||
|
<img src={SelectMockup} class="max-h-80" alt="Select answer" />
|
||||||
|
</div>
|
||||||
|
<div class="flex justify-center">
|
||||||
|
<img src={SolutionMockup} class="max-h-80" alt="See right and wrong solutions" />
|
||||||
|
</div>
|
||||||
|
<div class="flex justify-center">
|
||||||
|
<img
|
||||||
|
src={ResultsMockup}
|
||||||
|
class="max-h-80"
|
||||||
|
alt="See results in comparison with other players"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
@@ -1,5 +1,6 @@
|
|||||||
<script lang="ts" context="module">
|
<script lang="ts" context="module">
|
||||||
import { signedIn } from '$lib/stores';
|
import { signedIn } from '$lib/stores';
|
||||||
|
|
||||||
export async function load({ url, session }) {
|
export async function load({ url, session }) {
|
||||||
if (!session.authenticated) {
|
if (!session.authenticated) {
|
||||||
return {
|
return {
|
||||||
@@ -29,6 +30,7 @@
|
|||||||
import Editor from '$lib/editor.svelte';
|
import Editor from '$lib/editor.svelte';
|
||||||
import { getLocalization } from '$lib/i18n';
|
import { getLocalization } from '$lib/i18n';
|
||||||
import { navbarVisible } from '$lib/stores';
|
import { navbarVisible } from '$lib/stores';
|
||||||
|
import { onMount } from 'svelte';
|
||||||
|
|
||||||
navbarVisible.set(true);
|
navbarVisible.set(true);
|
||||||
|
|
||||||
@@ -60,6 +62,19 @@
|
|||||||
export let quiz_id: string;
|
export let quiz_id: string;
|
||||||
let data: Data;
|
let data: Data;
|
||||||
|
|
||||||
|
onMount(() => {
|
||||||
|
const from_localstorage = localStorage.getItem('edit_game');
|
||||||
|
if (from_localstorage === null) {
|
||||||
|
data = {
|
||||||
|
description: '',
|
||||||
|
public: false,
|
||||||
|
title: '',
|
||||||
|
questions: [{ question: '', time: '20', answers: [{ right: false, answer: '' }] }]
|
||||||
|
};
|
||||||
|
} else {
|
||||||
|
data = JSON.parse(from_localstorage);
|
||||||
|
}
|
||||||
|
});
|
||||||
const get_quiz = async (): Promise<void> => {
|
const get_quiz = async (): Promise<void> => {
|
||||||
const response = await fetch(`/api/v1/quiz/get/${quiz_id}`);
|
const response = await fetch(`/api/v1/quiz/get/${quiz_id}`);
|
||||||
if (response.status === 404) {
|
if (response.status === 404) {
|
||||||
@@ -78,7 +93,8 @@
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
if (res.status === 401) {
|
if (res.status === 401) {
|
||||||
throw new Error('Unauthorized');
|
localStorage.setItem('edit_game', JSON.stringify(data));
|
||||||
|
window.location.href = '/account/login';
|
||||||
} else if (res.status === 404) {
|
} else if (res.status === 404) {
|
||||||
throw new Error('Quiz not found');
|
throw new Error('Quiz not found');
|
||||||
} else if (res.status === 200) {
|
} else if (res.status === 200) {
|
||||||
|
|||||||
@@ -14,6 +14,7 @@
|
|||||||
import { getLocalization } from '$lib/i18n';
|
import { getLocalization } from '$lib/i18n';
|
||||||
import Footer from '$lib/footer.svelte';
|
import Footer from '$lib/footer.svelte';
|
||||||
|
|
||||||
|
import LandingPromo from '$lib/landing-promo.svelte';
|
||||||
const { t } = getLocalization();
|
const { t } = getLocalization();
|
||||||
|
|
||||||
navbarVisible.set(true);
|
navbarVisible.set(true);
|
||||||
@@ -54,6 +55,10 @@
|
|||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
|
<section>
|
||||||
|
<LandingPromo />
|
||||||
|
</section>
|
||||||
<section id="features">
|
<section id="features">
|
||||||
<div class="text-center pt-24 snap-y">
|
<div class="text-center pt-24 snap-y">
|
||||||
<h1 class="sm:text-6xl text-4xl">{$t('words.features')}</h1>
|
<h1 class="sm:text-6xl text-4xl">{$t('words.features')}</h1>
|
||||||
|
|||||||
Reference in New Issue
Block a user