Skip to content

Commit

Permalink
image and code optimizations
Browse files Browse the repository at this point in the history
  • Loading branch information
markokroselj committed Apr 28, 2024
1 parent b7c29ed commit 80f7be5
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 12 deletions.
26 changes: 16 additions & 10 deletions src/components/DailyMenu.astro
Original file line number Diff line number Diff line change
@@ -1,20 +1,23 @@
---
import type { MenuData } from "../types/data.ts";
import { Image } from "astro:assets";
import sadge from "../images/sadge.png";
import lekohungy from "../images/lekohungy.webp";
import { getFormattedDate, getWeekNumber, getDay } from "../js/utlis.ts";
const { todaysMenu, date } = Astro.props;
---
{
(date == getFormattedDate()) ? <h1 class="text-2xl flex items-end gap-1">Današnji meni
<Image src={lekohungy} alt=":lekohungry:" width={35} height={35} />
</h1>
: <h1 class="text-2xl flex items-end gap-1">{getDay(date)}
<Image src={lekohungy} alt=":lekohungry:" width={35} height={35} />
</h1>}


<h1 class="text-2xl flex items-end gap-1">
{date == getFormattedDate() ? "Današnji meni" : getDay(date)}
<Image
src={lekohungy}
loading="eager"
alt=":lekohungry:"
width={35}
height={35}
/>
</h1>

{
todaysMenu ? (
<ul class="list-disc w-fit shadow-lg p-2 list-inside rounded-md">
Expand All @@ -23,6 +26,9 @@ const { todaysMenu, date } = Astro.props;
))}
</ul>
) : (
<p class="flex items-end gap-1">Danes ni nč <Image src={sadge} alt=":sadge:" width={35} height={35} /></p>
<p class="flex items-end gap-1">
Danes ni nč
<Image src={sadge} loading="eager" alt=":sadge:" width={35} height={35} />
</p>
)
}
4 changes: 2 additions & 2 deletions src/components/Footer.astro
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
import { Image } from 'astro:assets';
---

<footer class="bg-gray-800 text-white p-3 flex place-content-between gap-4 pwa:select-none">
Expand All @@ -8,7 +8,7 @@
Made with ♥ by <a href="https://github.com/markokroselj" class="hover:underline" target="_blank"
>Marko Krošelj</a
> <span class="pwa:hidden"> using Astro.js 🚀 <a href="https://astro.build"
><img
><Image
src="https://astro.badg.es/v2/built-with-astro/tiny.svg"
alt="Built with Astro"
width="120"
Expand Down

0 comments on commit 80f7be5

Please sign in to comment.