Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(web): ✨ Rounded corners on selected assets #3524

Merged
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
class="object-cover transition duration-300 {border
? 'border-[3px] border-immich-dark-primary/80 hover:border-immich-primary'
: ''}"
class:rounded-lg={curve}
class:rounded-xl={curve}
class:shadow-lg={shadow}
class:rounded-full={circle}
class:opacity-0={!thumbhash && !complete}
Expand All @@ -52,7 +52,7 @@
src={thumbHashToDataURL(Buffer.from(thumbhash, 'base64'))}
alt={altText}
class="absolute top-0 object-cover"
class:rounded-lg={curve}
class:rounded-xl={curve}
class:shadow-lg={shadow}
class:rounded-full={circle}
draggable="false"
Expand Down
9 changes: 8 additions & 1 deletion web/src/lib/components/assets/thumbnail/thumbnail.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,9 @@
{#if disabled}
<CheckCircle size="24" class="text-zinc-800" />
{:else if selected}
<CheckCircle size="24" class="text-immich-primary" />
<div class="bg-[#D9DCEF] dark:bg-[#232932] rounded-full">
Copy link
Contributor Author

@paulthvt paulthvt Aug 2, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not proud of this part. At firt, I thought to use bg-immich-primary/20 and dark:bg-immich-dark-primary/20 but since the opacity is not 100%, we can still see the thumbnail through the cicle icon. If there's a better solution, I would be glad to update this part.

<CheckCircle size="24" class="text-immich-primary" />
</div>
{:else}
<CheckCircle size="24" class="text-white/80 hover:text-white" />
{/if}
Expand All @@ -107,10 +109,12 @@
<div
class="absolute h-full w-full select-none bg-gray-100 transition-transform dark:bg-immich-dark-gray"
class:scale-[0.85]={selected}
class:rounded-xl={selected}
>
<!-- Gradient overlay on hover -->
<div
class="absolute z-10 h-full w-full bg-gradient-to-b from-black/25 via-[transparent_25%] opacity-0 transition-opacity group-hover:opacity-100"
class:rounded-xl={selected}
/>

<!-- Favorite asset star -->
Expand Down Expand Up @@ -141,6 +145,7 @@
widthStyle="{width}px"
heightStyle="{height}px"
thumbhash={asset.thumbhash}
curve={selected}
/>
{:else}
<div class="flex h-full w-full items-center justify-center p-4">
Expand All @@ -153,6 +158,7 @@
<VideoThumbnail
url={api.getAssetFileUrl(asset.id, false, true, publicSharedKey)}
enablePlayback={mouseOver}
curve={selected}
durationInSeconds={timeToSeconds(asset.duration)}
/>
</div>
Expand All @@ -165,6 +171,7 @@
pauseIcon={MotionPauseOutline}
playIcon={MotionPlayOutline}
showTime={false}
curve={selected}
playbackOnIconHover
/>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
export let enablePlayback = false;
export let playbackOnIconHover = false;
export let showTime = true;
export let curve = false;
export let playIcon = PlayCircleOutline;
export let pauseIcon = PauseCircleOutline;

Expand Down Expand Up @@ -68,6 +69,7 @@
<video
bind:this={player}
class="h-full w-full object-cover"
class:rounded-xl={curve}
muted
autoplay
src={url}
Expand Down
Loading