-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat: add marquee * feat: ui changes * feat: add top 10 in marques --------- Co-authored-by: Rotimi Best <[email protected]>
- Loading branch information
1 parent
f9914b2
commit 4d80d95
Showing
10 changed files
with
201 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
import Root from './marquee.svelte'; | ||
import MarqueeCard from './marquee-card.svelte'; | ||
|
||
export { Root, Root as Marquee, MarqueeCard }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
<script lang="ts"> | ||
import { cn } from '$lib/utils'; | ||
import starIcon from '$lib/assets/star.svg'; | ||
export let author_avatar: string; | ||
export let name: string; | ||
export let author: string; | ||
export let description: string; | ||
export let stars: number; | ||
export let link: string; | ||
</script> | ||
|
||
<a | ||
href={link} | ||
target="_blank" | ||
class={cn( | ||
'relative w-72 cursor-pointer overflow-hidden rounded-2xl border p-4', | ||
// light styles | ||
'border-gray-950/[.1] bg-gray-950/[.01] hover:bg-gray-950/[.05]', | ||
// dark styles | ||
'dark:border-gray-50/[.1] dark:bg-gray-50/[.10] dark:hover:bg-gray-50/[.15]' | ||
)} | ||
> | ||
<div class="flex flex-row justify-between items-center"> | ||
<div class="flex flex-row items-center gap-2"> | ||
<img | ||
class="rounded-full" | ||
width="32" | ||
height="32" | ||
alt="" | ||
src={author_avatar} | ||
/> | ||
<div class="flex flex-col"> | ||
<!-- svelte-ignore a11y-structure --> | ||
<figcaption class="text-sm font-medium dark:text-white"> | ||
{name} | ||
</figcaption> | ||
<p class="text-xs font-medium dark:text-white/40">{author}</p> | ||
</div> | ||
</div> | ||
<div class="flex items-center gap-2"> | ||
<img src={starIcon} alt="" class="w-5 text-white fill-white" /> | ||
<p class="text-xs">{stars}</p> | ||
</div> | ||
</div> | ||
<blockquote class="mt-2 text-sm line-clamp-3">{description}</blockquote> | ||
</a> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
<script lang="ts"> | ||
import { cn } from '$lib/utils'; | ||
export let pauseOnHover: boolean = false; | ||
export let vertical: boolean = false; | ||
export let repeat: number = 4; | ||
export let reverse: boolean = false; | ||
let className: any = ''; | ||
export { className as class }; | ||
</script> | ||
|
||
<div | ||
class={cn( | ||
'group flex overflow-hidden p-2 [--duration:2s] [--gap:1rem] [gap:var(--gap)]', | ||
{ | ||
'flex-row': !vertical, | ||
'flex-col': vertical, | ||
}, | ||
className | ||
)} | ||
> | ||
{#each { length: repeat } as _, i (i)} | ||
<div | ||
class={cn('flex shrink-0 justify-around [gap:var(--gap)]', { | ||
'animate-marquee flex-row': !vertical, | ||
'animate-marquee-vertical flex-col': vertical, | ||
'group-hover:[animation-play-state:paused]': pauseOnHover, | ||
'[animation-direction:reverse]': reverse, | ||
})} | ||
> | ||
<slot>Default</slot> | ||
</div> | ||
{/each} | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
<script> | ||
export let data = { | ||
author: '', | ||
author_link: '', | ||
author_avatar: '' | ||
}; | ||
</script> | ||
|
||
<div class="flex items-center gap-3"> | ||
<a href={`${data.author_link}`}> | ||
<img src={data.author_avatar} alt="" class="w-7 rounded-full" /> | ||
</a> | ||
|
||
<a href={`${data.author_link}`}> {data.author}</a> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
<script lang="ts"> | ||
import type { Repository } from '$lib/types/repository'; | ||
import { Marquee, MarqueeCard } from '$lib/components/marquee'; | ||
import { BorderBeam } from '$lib/components/border-beam'; | ||
export let data: Repository[] = []; | ||
let firstRow = data.slice(0, data.length / 2); | ||
let secondRow = data.slice(data.length / 2); | ||
</script> | ||
|
||
<div | ||
class="relative flex h-full w-full flex-col items-center justify-center overflow-hidden rounded-lg border bg-background py-2 mb-5" | ||
> | ||
<BorderBeam size={300} duration={12} /> | ||
<h2 | ||
class="mt-5 scroll-m-20 border-b pb-4 md:text-3xl text-center font-semibold tracking-tight transition-colors first:mt-0" | ||
> | ||
The Odogwu's | ||
</h2> | ||
<Marquee pauseOnHover class="[--duration:20s]"> | ||
{#each firstRow as item} | ||
<MarqueeCard {...item} /> | ||
{/each} | ||
</Marquee> | ||
<Marquee reverse pauseOnHover class="[--duration:20s]"> | ||
{#each secondRow as item} | ||
<MarqueeCard {...item} /> | ||
{/each} | ||
</Marquee> | ||
<div | ||
class="pointer-events-none absolute inset-y-0 left-0 w-1/3 bg-gradient-to-r from-white dark:from-background" | ||
></div> | ||
<div | ||
class="pointer-events-none absolute inset-y-0 right-0 w-1/3 bg-gradient-to-l from-white dark:from-background" | ||
></div> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters