hyprland-website/src/routes/wall_of_fame/FamedRice.svelte

114 lines
2.8 KiB
Svelte
Raw Normal View History

2023-08-27 17:02:35 +02:00
<script>
2023-09-03 18:00:52 +02:00
import { getBlurredPath } from '$lib/Helper.mjs'
import { inview } from 'svelte-inview'
2023-08-27 17:02:35 +02:00
/** @type {string} */
export let name
/** @type {string} */
export let creator
/** @type {string} */
export let dotfilesLink
/** @type {string} */
export let creatorProfilePicture
/** @type {string} */
export let thumbnail
2023-08-31 19:57:26 +02:00
/**
* Specify the blurred background image to be used.
* Defaults to `"generated_<thumbnail>"`
* @type {string | undefined} */
export let blurredThumbnail = undefined
2023-08-27 17:02:35 +02:00
/** @type {string} */
export let pretitel
2023-08-31 19:57:26 +02:00
2023-09-03 18:00:52 +02:00
let background = blurredThumbnail ?? getBlurredPath(thumbnail)
2023-08-27 17:02:35 +02:00
</script>
2023-09-10 08:09:06 +02:00
<div class="flex flex-col items-center gap-12 px-4 {$$restProps.class}">
2023-09-03 18:00:52 +02:00
<div class="flex flex-col items-center justify-center">
<div class="mb-2 text-lg font-bold">{pretitel}</div>
2023-09-07 21:03:47 +02:00
<h3 class="mb-6 text-4xl font-bold hover:text-slate-200 sm:text-6xl">
2023-08-27 17:02:35 +02:00
<a href={dotfilesLink} target="_blank">{name}</a>
</h3>
2023-09-03 18:00:52 +02:00
<a class="group flex gap-3" href={dotfilesLink} target="_blank">
2023-08-27 17:02:35 +02:00
<img
src={creatorProfilePicture}
2023-09-03 18:00:52 +02:00
class="aspect-square h-6 rounded-full"
2023-08-27 17:02:35 +02:00
alt={creator + ' profile picture'}
2023-09-13 14:27:13 +02:00
loading="lazy"
2023-08-27 17:02:35 +02:00
/>
2023-09-03 18:00:52 +02:00
<div class="text-lg font-medium text-slate-300 transition-colors group-hover:text-white">
2023-08-27 17:02:35 +02:00
{creator}
</div>
</a>
</div>
2023-09-10 08:09:06 +02:00
<div class="image-wrapper">
2023-09-03 18:00:52 +02:00
<a class="rice" href={dotfilesLink} target="_blank">
2023-09-13 14:27:13 +02:00
<img src={thumbnail} alt={`${name} by ${creator} thumbnail`} class="" loading="lazy" />
2023-08-27 17:02:35 +02:00
</a>
2023-08-31 19:57:26 +02:00
<!-- blur background -->
2023-08-27 17:02:35 +02:00
<img
2023-08-31 19:57:26 +02:00
src={background}
2023-08-27 17:02:35 +02:00
aria-hidden="true"
2023-08-31 19:57:26 +02:00
class="background-blurred"
2023-08-27 17:02:35 +02:00
alt={`${name} by ${creator} thumbnail`}
2023-09-13 14:27:13 +02:00
loading="lazy"
2023-08-27 17:02:35 +02:00
/>
</div>
</div>
2023-08-31 19:57:26 +02:00
<style lang="postcss">
2023-09-10 08:09:06 +02:00
.image-wrapper {
@apply relative w-full max-w-[1100px] px-6 sm:px-8;
position: relative;
width: 100%;
}
2023-09-03 18:00:52 +02:00
.rice {
position: relative;
display: block;
2023-09-07 21:03:47 +02:00
contain: layout style;
2023-09-03 18:00:52 +02:00
@apply w-full rounded-lg transition-transform;
box-shadow: 0px 0px 8px theme(colors.black / 40%);
& img {
@apply rounded-lg shadow-lg duration-300;
&:hover {
scale: 1.005;
}
}
2023-08-31 19:57:26 +02:00
2023-09-03 18:00:52 +02:00
&:after {
--size: 5rem;
color: red;
z-index: -1000;
content: ' ';
@apply rounded-lg shadow-2xl;
width: calc(100% + var(--size) * 0.5);
height: calc(100% + var(--size) * 0.5);
pointer-events: none;
position: absolute;
left: calc(var(--size) * -0.25);
top: calc(var(--size) * -0.25);
/* background: red; */
background: rgba(255, 255, 255, 0.05);
border: rgba(255, 255, 255, 0.1) solid 1px;
}
2023-08-31 19:57:26 +02:00
}
.background-blurred {
position: absolute;
opacity: 0.3;
2023-09-03 18:00:52 +02:00
min-width: calc(120% + 200px);
2023-08-31 19:57:26 +02:00
height: calc(120% + 200px);
pointer-events: none;
2023-09-03 18:00:52 +02:00
top: -45%;
2023-08-31 19:57:26 +02:00
left: 50%;
translate: -50%;
z-index: -10;
2023-09-03 18:00:52 +02:00
filter: contrast(2.5);
2023-09-07 21:03:47 +02:00
contain: layout size style paint;
2023-08-31 19:57:26 +02:00
mask-image: radial-gradient(farthest-side, black, transparent);
}
</style>