hyprland-website/src/routes/HeroBackground.svelte
Visual-Dawg 6ec7cfa1b8
Update design - use Sveltekit (#28)
* first push

* feature cards, hall of fame

* playing around

* community slice

* home

* mobile home

* wtf happend with the git

* something

* stuff

* stuff

* remove blur on nav on mobile

* wall of fame, improve performance

* always use current year for copyright

* close navbar on navigation for mobile

* improve performance community slice

* improve performance features slice

* prepare performance improvement for rice thumbnails

* .

* .

* more stuff

* new hero effect experiment

* .

* work

* .

* .

* more stuf

* hide discord profile image if image is not loaded yet

* update links to rices

* .

* fix postinstall not running

* .

* remove quotes

* remove .gitattributes

* update readme

* Footer: Fix bottom margin

* HeroBackground: Remove images+animations

* Remove discord

* InstallSection: Change button label

* Revert "Remove discord"

This reverts commit 3e3eab848c.

* Revert "HeroBackground: Remove images+animations"

This reverts commit 4979bf2a39.

* improve hero rice

* small improvments

* small css adjustments

* update Hero

* upgrade dependencies

* fix prettier

* improve navbar on mobile

* add top ricers to community slice

* improve hero

* improve preview slice

* add plugins section

* Add OpenSus

* set min width for quotes in discord profiles

* update nix install command

* improve patternbackground mouse follow

* improve pattern mouse follow

* fix play button for autoplay blocked users

* pluginsSlice, sync videos playback state

* add fullscreen button to videos

* clean up package.json

* slide pluginsSlice video on hover on desktop

* PluginsSlice: small improvments

* priotize loading logo

* add meta tags

* previewRice: make fullscreen button bigger

* pluginSlice fix fullscreen btn with sliding

* update readme

* fix typo

* ssr logo as svg
Use the svg directly so that it does not need to get fetched anymore

* pluginsSlice: animate in

* communityslice: sort by size

* communityslice: add a profile

* walloffame cleanup

* WallOfFame: Nicer wisdoms

* add grain to gradients

* decrease grain strength

* remove unused imports

* add space winners

* small clean up

* use aylur settings video

* increase grain strength

* fix grain path

* contest: date as pill

* famedrice: colored titles

* update Aylurs video

* pluginsSlice: decrease video gap

* pluginsSlice: improve mobile padding

* pluginSlice: improve play btn position

* installSlice: improve padding on mobile

* add flick0s rice as honorable mention

* rename WoF to HoF

* add Slackware

* Revert "add Slackware"

This reverts commit defc756cc6.

* Revert "add flick0s rice as honorable mention"

This reverts commit 8cffcad8cb.

* add outfoxxeds plugin video

* pluginSlice: update outfoxxed caption

* pluginSlice: outfoxxed video thumb

* pluginsSlice: refractor, add outfoxxed thumbnail

* video: Fix autoplay detection for Firefox

* Video: Fix poster size

* reencode aylurs file bc firefox errors

* PreviewRice: refactor

* remove console.log

* PluginsSlice: fix playback sync logic

* update readme

* fix typo

* also use more modern encoding for videos

* pluginsSlice: Improve outfoxxed caption

* InstallSlice: Shorten NixOs command for formatting

* HoF: Fix japane decorative title on mobile

* PluginsSlice: Improve video display on mobile

* PluginsSlice: Improve caption padding on mobile

* PluginsSlice: outfoxxed all lowercase

* fix typ

* remove no-index

* HoF: Update japanese wisdom

* remove unused dependency

* fix grammar

* blurredImages: add shebang

* HoF: Use data file to generate rices

* use discord link as constant

* heroBgTile: smooth fade-out of img

* Video: Add pause button

* pluginSlice: add slide in button

* remove  AV1 webm video  and only use h264 mp4

* video: small play button plays video

* pluginsSlice: nicer slide button

* reeconde end_4 rice, delete unused AV1 video files

* HeroBackground: use transition for artwork tiles
2023-11-25 20:31:55 +00:00

219 lines
4.6 KiB
Svelte
Executable file

<script>
export let backgroundData
const { workspacesPerRow, gapLength, workspaceHeight, height, leftColumns, rightColumns } =
backgroundData
const REVEAL_DURATION = 800 // in ms
</script>
<div class="wrapper" aria-hidden="true" style:--reveal-duration={REVEAL_DURATION + 'ms'}>
<div
class="inner-wrapper"
style={`--amount: ${workspacesPerRow}; --workspace-gap: ${gapLength}px;--workspace-height: ${workspaceHeight}px; --length: ${height}px;`}
>
<!-- Gradient background -->
<div class="top-light" />
<div class="columns left" aria-hidden="true">
{#each leftColumns as column}
<div class="column">
{#each column as workspace}
<div class="workspace">
{#each workspace as tiles}
<div class="tiles">
{#each tiles as { color, image }}
<div class="tile" style:--color={color} class:hasImage={image}>
{#if image}
<img src={image} class="h-full w-full object-contain" alt="" />
{/if}
</div>
{/each}
</div>
{/each}
</div>
{/each}
</div>
{/each}
</div>
<div class="columns right" aria-hidden="true">
{#each rightColumns as column}
<div class="column">
{#each column as workspace}
<div class="workspace">
{#each workspace as tiles}
<div class="tiles">
{#each tiles as { color, image }}
<div class="tile" style:--color={color} class:hasImage={image}>
{#if image}
<img src={image} class="h-full w-full object-contain" alt="" />
{/if}
</div>
{/each}
</div>
{/each}
</div>
{/each}
</div>
{/each}
</div>
</div>
</div>
<style lang="postcss">
.left {
transform: rotateY(10deg);
}
.right {
transform: rotateY(-10deg);
}
.wrapper {
width: 100vw;
display: flex;
align-items: center;
justify-content: center;
height: calc(100vh - 48px);
contain: strict;
pointer-events: none;
@apply max-sm:hidden;
}
.inner-wrapper {
position: absolute;
perspective: 100px;
height: 100%;
width: max(100vw, 2200px);
contain: strict;
display: flex;
mask-image: linear-gradient(to top, transparent 0%, black 20%);
contain: layout style content;
pointer-events: none;
&::after {
content: ' ';
background: radial-gradient(80% 250%, theme(colors.black) 10%, transparent 50%);
position: absolute;
top: 50%;
left: 50%;
translate: -50% -50%;
width: 100%;
height: 100%;
z-index: -10;
pointer-events: none;
contain: strict;
}
}
.columns {
display: flex;
gap: 2rem;
flex-grow: 1;
mask-image: linear-gradient(to top, transparent 0%, black 30%);
z-index: -10;
height: var(--length);
min-height: var(--length);
max-height: var(--length);
contain: layout style content;
}
.column {
display: flex;
flex-direction: column;
height: 200%;
width: 100%;
gap: var(--workspace-gap);
z-index: -50;
contain: layout style content;
}
.workspace {
display: flex;
gap: 8px;
min-height: var(--workspace-height);
max-height: var(--workspace-height);
width: 100%;
contain: layout style content;
}
.tiles {
display: flex;
flex-direction: column;
gap: 8px;
flex-grow: 1;
contain: layout style content;
}
.tile {
border: var(--color) 2px solid;
flex-grow: 1;
height: var(--height);
border-radius: 12px;
pointer-events: auto;
transition: all 700ms ease-in-out;
opacity: 0.5;
contain: strict;
pointer-events: all;
filter: brightness(1);
&:hover {
opacity: 1;
scale: 1.02;
background-color: color-mix(in hsl, var(--color), transparent 20%);
box-shadow:
0px 0px 10px var(--color),
0px 0px 40px var(--color);
}
&.hasImage {
transition:
all var(--reveal-duration) ease-in-out,
scale var(--reveal-duration) cubic-bezier(1, -0.4, 0.165, 1),
filter var(--reveal-duration) cubic-bezier(1, -0.4, 0.165, 1);
}
&.hasImage:hover {
scale: 1.2;
filter: brightness(1.1);
}
& img {
opacity: 0;
transition: opacity var(--reveal-duration) cubic-bezier(1, -0.4, 0.165, 1);
pointer-events: none;
}
&:hover img {
opacity: 1;
/* transition: opacity 2s var(--artwork-delay); */
}
}
.top-light {
background: url('/imgs/grain.webp'),
radial-gradient(
100% 80% at top,
theme(colors.cyan.500 / 50%) 0%,
theme(colors.sky.500 / 20%),
transparent
);
mask-image: radial-gradient(
100% 80% at top,
white,
rgba(0, 0, 0, 1),
rgba(0, 0, 0, 1),
transparent
);
width: 100%;
height: 100%;
position: absolute;
z-index: 10;
top: 0;
left: 0;
pointer-events: none;
contain: strict;
}
</style>