diff --git a/src/lib/ArticlePreview.svelte b/src/lib/ArticlePreview.svelte index d577b7e..f293fb0 100644 --- a/src/lib/ArticlePreview.svelte +++ b/src/lib/ArticlePreview.svelte @@ -1,28 +1,23 @@
- {preview.image.alt} + {#if preview.postImage} + {preview.postImage.alt} + {:else} + + {/if}

{preview.title}

{preview.description}

-
+
@@ -42,6 +37,10 @@ width: 100%; } + .preview-image.logo { + object-fit: contain; + } + .content { display: flex; padding: 1rem; diff --git a/src/lib/BigArticlePreview.svelte b/src/lib/BigArticlePreview.svelte index 502d73f..80fd71b 100644 --- a/src/lib/BigArticlePreview.svelte +++ b/src/lib/BigArticlePreview.svelte @@ -1,19 +1,25 @@
- {preview.image.alt} + {#if preview.postImage} + {preview.postImage.alt} + {:else} + + {/if}
- {preview.date.toLocaleDateString("bg-BG", { year: 'numeric', month: 'long', day: 'numeric' })} + {new Date(preview.publishDate) + .toLocaleDateString("bg-BG", { year: 'numeric', month: 'long', day: 'numeric' })}

{preview.title}

-
+
@@ -36,6 +42,10 @@ filter: brightness(0.5);; } + .preview-image.logo { + object-fit: contain; + } + .content { position: relative; display: flex; diff --git a/src/lib/Project.svelte b/src/lib/Project.svelte index b8d2b0c..683dafe 100644 --- a/src/lib/Project.svelte +++ b/src/lib/Project.svelte @@ -6,8 +6,10 @@
- {project.image.alt} -
+ {#if project.image} + {project.image.alt} + {/if} +

{project.name}

@@ -46,6 +48,13 @@ padding-right: 1rem; } + .content.no-image { + width: 100%; + padding: 1rem; + justify-content: center; + align-items: center; + } + .content p { font-family: 'Roboto', serif; font-style: normal; diff --git a/src/lib/SecondaryButton.svelte b/src/lib/SecondaryButton.svelte index cb2935c..8af29b1 100644 --- a/src/lib/SecondaryButton.svelte +++ b/src/lib/SecondaryButton.svelte @@ -25,7 +25,7 @@ font-size: 19px; line-height: 22px; color: var(--color); - font-family: 'Roboto Flex', serif; + font-family: 'Roboto Flex Variable', serif; font-variation-settings: 'GRAD' -150; } diff --git a/src/lib/SecondarySubmit.svelte b/src/lib/SecondarySubmit.svelte index 75a7c2d..b0b507a 100644 --- a/src/lib/SecondarySubmit.svelte +++ b/src/lib/SecondarySubmit.svelte @@ -14,7 +14,7 @@ padding: 0.5rem 3rem; color: #FFFFFF; text-transform: uppercase; - font-family: 'Roboto Flex', serif; + font-family: 'Roboto Flex Variable', serif; font-style: normal; text-align: center; cursor: pointer; diff --git a/src/lib/logo.ts b/src/lib/logo.ts new file mode 100644 index 0000000..b0063c0 --- /dev/null +++ b/src/lib/logo.ts @@ -0,0 +1,5 @@ +import { writable } from "svelte/store"; + +const logo = writable({}); + +export { logo }; diff --git a/src/lib/mapArticles.ts b/src/lib/mapArticles.ts deleted file mode 100644 index 27a987c..0000000 --- a/src/lib/mapArticles.ts +++ /dev/null @@ -1,18 +0,0 @@ -import { env } from "$env/dynamic/public"; - -const mapArticles = (docs) => { - return docs.map((article) => { - return { - title: article.title, - description: article.description, - image: { - url: env.PUBLIC_SERVER_URL + article.postImage.url, - alt: article.postImage.alt, - }, - href: "/news/" + article.id, - date: new Date(article.publishDate), - }; - }); -}; - -export { mapArticles }; diff --git a/src/routes/+layout.svelte b/src/routes/+layout.svelte index ac7f79e..e2b069e 100644 --- a/src/routes/+layout.svelte +++ b/src/routes/+layout.svelte @@ -7,24 +7,12 @@ import { env } from "$env/dynamic/public"; import { seoInfo } from "../lib/seoInfo"; import { page } from "$app/stores"; + import { logo } from "$lib/logo"; setContext('layout', layout); setLayout(mainLayout) - onMount(() => { - layout.subscribe((layoutProps) => { - window.document.body.style.backgroundColor = layoutProps.navbar.backgroundColor - }) - }) - - const client = new Client({ - url: env.PUBLIC_SERVER_URL + "/api/graphql", - exchanges: [cacheExchange, fetchExchange], - }); - - setContextClient(client); - export let data; onMount(() => { @@ -36,12 +24,25 @@ import('@fontsource/roboto/300-italic.css'); import('@fontsource/roboto/400-italic.css'); import('@fontsource/roboto/500-italic.css'); - import('@fontsource-variable/roboto-flex/opsz.css'); + import('@fontsource-variable/roboto-flex/full.css'); import('@fontsource/alegreya/400.css'); import('@fontsource/alegreya/500.css'); import('@fontsource/alegreya/700.css'); + + logo.set(data.MainInfo.logo) + + layout.subscribe((layoutProps) => { + window.document.body.style.backgroundColor = layoutProps.navbar.backgroundColor + }) }) + const client = new Client({ + url: env.PUBLIC_SERVER_URL + "/api/graphql", + exchanges: [cacheExchange, fetchExchange], + }); + + setContextClient(client); + seoInfo.set({ title: data.MainInfo.name, description: undefined, diff --git a/src/routes/+page.svelte b/src/routes/+page.svelte index f723994..864d541 100644 --- a/src/routes/+page.svelte +++ b/src/routes/+page.svelte @@ -6,7 +6,6 @@ import Carousel from "$lib/Carousel.svelte"; import Button from "$lib/Button.svelte"; import { mainLayout, setLayout } from "../lib/setLayout" - import { mapArticles } from "../lib/mapArticles"; import { env } from "$env/dynamic/public"; import { onMount } from "svelte"; @@ -39,7 +38,7 @@ } }) - let articleProps = mapArticles(data.allNews.docs).map((article) => { + let articleProps = data.allNews.docs.map((article) => { return { preview: article } diff --git a/src/routes/achievements/+page.svelte b/src/routes/achievements/+page.svelte index 4f32be3..76b5e2e 100644 --- a/src/routes/achievements/+page.svelte +++ b/src/routes/achievements/+page.svelte @@ -1,7 +1,6 @@
@@ -53,7 +52,6 @@ align-items: center; margin-top: 2rem; margin-bottom: 3rem; - gap: 3rem; } .header-container { diff --git a/src/routes/news/+page.svelte b/src/routes/news/+page.svelte index a4456e6..f1f2de9 100644 --- a/src/routes/news/+page.svelte +++ b/src/routes/news/+page.svelte @@ -5,14 +5,13 @@ import { fly } from "svelte/transition"; import { secondaryLayout, setLayout } from "../../lib/setLayout"; import { getContextClient } from "@urql/svelte"; - import { mapArticles } from "../../lib/mapArticles"; import RSSFeedIcon from "$lib/RSSFeedIcon.svelte"; setLayout(secondaryLayout) export let data; - let articles = mapArticles(data.allNews.docs) + let articles = data.allNews.docs let remainArticles = data.allNews.hasNextPage; let page = 1; @@ -37,7 +36,7 @@ } } `, { page }).then(result => { - articles = articles.concat(mapArticles(result.data.allNews.docs)) + articles = articles.concat(result.data.allNews.docs) remainArticles = result.data.allNews.hasNextPage }) } diff --git a/src/routes/news/[id]/+page.svelte b/src/routes/news/[id]/+page.svelte index 983c652..a4c3fb9 100644 --- a/src/routes/news/[id]/+page.svelte +++ b/src/routes/news/[id]/+page.svelte @@ -17,7 +17,6 @@ seoInfo.title = data.News.title seoInfo.description = data.News.description seoInfo.type = "article" - seoInfo.imageUrl = data.News.postImage.url seoInfo.publishDate = data.News.publishDate return seoInfo @@ -82,7 +81,9 @@

{data.News.description}

- {data.News.postImage.alt} + {#if data.News.postImage} + {data.News.postImage.alt} + {/if}