Compare commits
2 Commits
d39a98a42f
...
ee949aa76f
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ee949aa76f | ||
|
|
07d2c8628f |
@@ -2,7 +2,7 @@
|
|||||||
import { getLastAlbums } from "@/content/photos/albums";
|
import { getLastAlbums } from "@/content/photos/albums";
|
||||||
import { getSettings } from "@/content/settings/settings";
|
import { getSettings } from "@/content/settings/settings";
|
||||||
import CalendarIcon from "@/icons/CalendarIcon.astro";
|
import CalendarIcon from "@/icons/CalendarIcon.astro";
|
||||||
import { getImageUrl } from "@/lib/images";
|
import { getImageSize, getImageUrl } from "@/lib/images";
|
||||||
import { getAlbumRoute } from "@/lib/routing";
|
import { getAlbumRoute } from "@/lib/routing";
|
||||||
import { Image } from "astro:assets";
|
import { Image } from "astro:assets";
|
||||||
|
|
||||||
@@ -44,42 +44,51 @@ const size = calculateSizeClasses(albums.amount, lastAlbums.length);
|
|||||||
|
|
||||||
{ lastAlbums.length >= 4 ? (
|
{ lastAlbums.length >= 4 ? (
|
||||||
<div class="grid lg:grid-cols-2 lg:grid-rows-2 grid-cols-1 grid-rows-4 gap-x-10 gap-y-8">
|
<div class="grid lg:grid-cols-2 lg:grid-rows-2 grid-cols-1 grid-rows-4 gap-x-10 gap-y-8">
|
||||||
{ lastAlbums.map((album) => (
|
{ lastAlbums.map((album) => {
|
||||||
<a href={getAlbumRoute(settings.photo, album)} class={`w-full flex flex-col gap-2`}>
|
const imageSize = getImageSize(album.thumbnail.width, album.thumbnail.height, 0.5);
|
||||||
<Image
|
|
||||||
src={getImageUrl(album.thumbnail.url)}
|
return (
|
||||||
alt={album.title}
|
<a href={getAlbumRoute(settings.photo, album)} class={`w-full flex flex-col gap-2`}>
|
||||||
class="flex rounded-2xl shadow-md w-full"
|
<Image
|
||||||
width={600}
|
src={getImageUrl(album.thumbnail.url)}
|
||||||
height={315}
|
alt={album.title}
|
||||||
/>
|
class="flex rounded-2xl shadow-md w-full"
|
||||||
<h4 class="font-semibold text-[28px]">{album.title}</h4>
|
width={imageSize.width}
|
||||||
<div class="flex flex-row items-center gap-1.5 text-neutral-900 text-sm">
|
height={imageSize.height}
|
||||||
<CalendarIcon width={20} height={20} />
|
/>
|
||||||
<div>{album.startDate}</div>
|
<h4 class="font-semibold text-[28px]">{album.title}</h4>
|
||||||
</div>
|
<div class="flex flex-row items-center gap-1.5 text-neutral-900 text-sm">
|
||||||
</a>
|
<CalendarIcon width={20} height={20} />
|
||||||
)) }
|
<div>{album.startDate}</div>
|
||||||
|
</div>
|
||||||
|
</a>
|
||||||
|
)
|
||||||
|
}) }
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
) : (
|
) : (
|
||||||
<div class="flex flex-col lg:flex-row lg:justify-between gap-y-6">
|
<div class="flex flex-col lg:flex-row lg:justify-between gap-y-6">
|
||||||
{ lastAlbums.map((album) => (
|
{ lastAlbums.map((album) => {
|
||||||
<a href={getAlbumRoute(settings.photo, album)} class={`${size} flex flex-col gap-2`}>
|
const imageSize = getImageSize(album.thumbnail.width, album.thumbnail.height, 0.5);
|
||||||
<Image
|
|
||||||
src={getImageUrl(album.thumbnail.url)}
|
return (
|
||||||
alt={album.title}
|
<a href={getAlbumRoute(settings.photo, album)} class={`${size} flex flex-col gap-2`}>
|
||||||
class="flex rounded-2xl shadow-md w-full"
|
<Image
|
||||||
width={600}
|
src={getImageUrl(album.thumbnail.url)}
|
||||||
height={315}
|
alt={album.title}
|
||||||
/>
|
class="flex rounded-2xl shadow-md w-full"
|
||||||
<h4 class="font-semibold text-[28px]">{album.title}</h4>
|
width={imageSize.width}
|
||||||
<div class="flex flex-row items-center gap-1.5 text-neutral-900 text-sm">
|
height={imageSize.height}
|
||||||
<CalendarIcon width={20} height={20} />
|
/>
|
||||||
<div>{album.startDate}</div>
|
<h4 class="font-semibold text-[28px]">{album.title}</h4>
|
||||||
</div>
|
<div class="flex flex-row items-center gap-1.5 text-neutral-900 text-sm">
|
||||||
</a>
|
<CalendarIcon width={20} height={20} />
|
||||||
)) }
|
<div>{album.startDate}</div>
|
||||||
|
</div>
|
||||||
|
</a>
|
||||||
|
)
|
||||||
|
|
||||||
|
}) }
|
||||||
</div>
|
</div>
|
||||||
) }
|
) }
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
import { getLastProjects } from '@/content/projects/projects';
|
import { getLastProjects } from '@/content/projects/projects';
|
||||||
import { getSettings } from '@/content/settings/settings';
|
import { getSettings } from '@/content/settings/settings';
|
||||||
import CalendarIcon from '@/icons/CalendarIcon.astro';
|
import CalendarIcon from '@/icons/CalendarIcon.astro';
|
||||||
import { getImageUrl } from '@/lib/images';
|
import { getImageSize, getImageUrl } from '@/lib/images';
|
||||||
import { getProjectRoute } from '@/lib/routing';
|
import { getProjectRoute } from '@/lib/routing';
|
||||||
import { Image } from 'astro:assets';
|
import { Image } from 'astro:assets';
|
||||||
|
|
||||||
@@ -43,14 +43,16 @@ const size = calculateSizeClasses(projects.amount, lastProjects.length);
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="flex flex-col lg:flex-row lg:justify-between gap-y-6">
|
<div class="flex flex-col lg:flex-row lg:justify-between gap-y-6">
|
||||||
{ lastProjects.map((project) => (
|
{ lastProjects.map((project) => {
|
||||||
|
const imageSize = getImageSize(project.searchEngine.thumbnail.width, project.searchEngine.thumbnail.height, 0.5);
|
||||||
|
|
||||||
<a href={getProjectRoute(settings.project, project)} class={`${size} flex flex-col gap-2`}>
|
<a href={getProjectRoute(settings.project, project)} class={`${size} flex flex-col gap-2`}>
|
||||||
<Image
|
<Image
|
||||||
src={getImageUrl(project.searchEngine.thumbnail.url)}
|
src={getImageUrl(project.searchEngine.thumbnail.url)}
|
||||||
alt={project.title}
|
alt={project.title}
|
||||||
class="flex rounded-2xl shadow-md w-full"
|
class="flex rounded-2xl shadow-md w-full"
|
||||||
width={600}
|
width={imageSize.width}
|
||||||
height={315}
|
height={imageSize.height}
|
||||||
/>
|
/>
|
||||||
<h4 class="font-semibold text-[28px]">{project.title}</h4>
|
<h4 class="font-semibold text-[28px]">{project.title}</h4>
|
||||||
<div class="flex flex-row items-center gap-1.5 text-neutral-900 text-sm">
|
<div class="flex flex-row items-center gap-1.5 text-neutral-900 text-sm">
|
||||||
@@ -58,7 +60,7 @@ const size = calculateSizeClasses(projects.amount, lastProjects.length);
|
|||||||
<div>{project.date}</div>
|
<div>{project.date}</div>
|
||||||
</div>
|
</div>
|
||||||
</a>
|
</a>
|
||||||
)) }
|
}) }
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
) }
|
) }
|
||||||
|
|||||||
Reference in New Issue
Block a user