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(nfts): taikoon ui fixes, v3 #17218

Merged
merged 57 commits into from
May 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
57 commits
Select commit Hold shift + click to select a range
8e43906
created svelte lib package
bearni95 May 6, 2024
a044235
storybook scaffolding
bearni95 May 6, 2024
2d75386
storybook cleanup
bearni95 May 6, 2024
b5f64f2
dirty but functional scaffolding on storybook + svelte + tailwind
bearni95 May 7, 2024
943ab16
lib export working properly
bearni95 May 7, 2024
63e3f31
test install for lib in taikoon-ui
bearni95 May 7, 2024
5803954
adding missing commit files
bearni95 May 7, 2024
a019d04
ui lib packaged + footer
bearni95 May 8, 2024
13f593a
readme
bearni95 May 8, 2024
02288e6
added link onto svelte+storybook docs
bearni95 May 8, 2024
1d25e9a
Merge branch 'main' into ui-lib
bearni95 May 14, 2024
82158c3
forge fmt & update contract layout table
bearni95 May 14, 2024
2c4c8b9
forge fmt & update contract layout table
bearni95 May 14, 2024
3399cd1
fixed fonts on storybook
bearni95 May 14, 2024
b98020f
removed autodocs from storybook
bearni95 May 14, 2024
9949571
restored configs for storybook constrols
bearni95 May 14, 2024
6e4dfd4
Merge branch 'ui-lib' of ssh://github.com/taikoxyz/taiko-mono into ui…
bearni95 May 14, 2024
be33a01
refreshed pnpm-lock.yaml
bearni95 May 14, 2024
bc5b2b2
Merge branch 'main' into ui-lib
bearni95 May 14, 2024
5b79b7c
example export/import of lib's tailwind config; fully ported footer o…
bearni95 May 15, 2024
d2e5269
support for light/dark theme switch
bearni95 May 15, 2024
ad36303
scaffolding for color theme exports
bearni95 May 15, 2024
103b9e7
non-theme colors imported
bearni95 May 15, 2024
9d74253
colors and themes included
bearni95 May 16, 2024
4c97906
updated pnpm-lock.yml
bearni95 May 16, 2024
0c33637
Merge branch 'main' into ui-lib
bearni95 May 16, 2024
5c337bb
revert docs involuntary changes
bearni95 May 16, 2024
5cda3ad
reverted protocol changes
bearni95 May 16, 2024
dfd82df
reverting more lefthook auto changes
bearni95 May 16, 2024
14e89b2
Merge branch 'main' into ui-lib
bearni95 May 16, 2024
d4ad089
gha updates
bearni95 May 16, 2024
c24a874
added storybook build step
bearni95 May 16, 2024
b6eddd8
format & lint
bearni95 May 16, 2024
1b078f8
gha to build ui-lib for taikoon-ui
bearni95 May 16, 2024
162068e
Merge branch 'main' into ui-lib
bearni95 May 16, 2024
56d58a7
Merge branch 'ui-lib' of ssh://github.com/taikoxyz/taiko-mono into ui…
bearni95 May 16, 2024
c3b27da
properly included ui-lib build command for taikoon-ui builds
bearni95 May 16, 2024
91672d3
discord color update
bearni95 May 16, 2024
190ad4e
updated release-please
bearni95 May 16, 2024
f705c3f
reduced width of text explanation section
bearni95 May 16, 2024
a12e92f
example animation on information section, dirty
bearni95 May 16, 2024
02c1a26
emergency commit
bearni95 May 16, 2024
a0ac0e7
eslint, format; collection section
bearni95 May 16, 2024
d0f9ba3
Merge branch 'main' into taikoon/design-fixes-v3
bearni95 May 17, 2024
f72fc29
Merge branch 'main' into ui-lib-taikoon-ui-integration
bearni95 May 20, 2024
00bf72a
forge fmt & update contract layout table
bearni95 May 20, 2024
71c7a6c
Merge branch 'main' into ui-lib-taikoon-ui-integration
bearni95 May 20, 2024
bcb8b84
Merge branch 'main' into taikoon/design-fixes-v3
bearni95 May 20, 2024
8f5f579
Merge branch 'main' into ui-lib-taikoon-ui-integration
bearni95 May 20, 2024
9aec65c
svelte:check passing
bearni95 May 20, 2024
207e108
updated import for tailwind config
bearni95 May 20, 2024
1ffe96f
Merge branch 'main' into taikoon/design-fixes-v3
bearni95 May 20, 2024
6dd6ee5
Merge branch 'ui-lib-taikoon-ui-integration' into taikoon/design-fixe…
bearni95 May 20, 2024
2dbd69f
Merge branch 'main' into taikoon/design-fixes-v3
bearni95 May 22, 2024
aaa50af
Merge branch 'taikoon/design-fixes-v3' of ssh://github.com/taikoxyz/t…
bearni95 May 22, 2024
553cead
forge fmt & update contract layout table
bearni95 May 22, 2024
839c45a
Merge branch 'main' into taikoon/design-fixes-v3
bearni95 May 22, 2024
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
@@ -0,0 +1,85 @@
<script lang="ts">
export let size = 'full';
export let role = 'img';
export let ariaLabel = 'animated taikoon';
export let title = {
id: `animated-taikoon-title-${Math.random().toString(36).substring(7)}`,
title: ariaLabel,
};
export let desc = {
id: `animated-taikoon-desc-${Math.random().toString(36).substring(7)}`,
desc: 'An animated taikoon',
};
import { onDestroy, onMount } from 'svelte';

let ariaDescribedby = `${title.id || ''} ${desc.id || ''}`;
let hasDescription = false;
$: if (title.id || desc.id) {
hasDescription = true;
} else {
hasDescription = false;
}

$: primaryColor = '#E81899'; // primary
$: secondaryColor = '#FF6FC8'; // secondary

const colorPairs = [
{ primary: '#4752ef', secondary: '#fae600' },
{ primary: '#6d74bc', secondary: '#e71001' },
{ primary: '#e501e7', secondary: '#0040fa' },
];

$: colorPairIndex = 0;

let animationIntervalId: any;
onMount(() => {
animationIntervalId = setInterval(
() => {
colorPairIndex = (Math.random() * colorPairs.length) | 0;
primaryColor = colorPairs[colorPairIndex].primary;
secondaryColor = colorPairs[colorPairIndex].secondary;
},
250 * Math.random() + 500,
//750
);
});

onDestroy(() => {
animationIntervalId && clearInterval(animationIntervalId);
});
</script>

<svg
xmlns="http://www.w3.org/2000/svg"
{...$$restProps}
{role}
width={size}
height={size}
stroke="none"
aria-label={ariaLabel}
aria-describedby={hasDescription ? ariaDescribedby : undefined}
viewBox="91 61 149 98">
{#if title.id && title.title}
<title id={title.id}>{title.title}</title>
{/if}
{#if desc.id && desc.desc}
<desc id={desc.id}>{desc.desc}</desc>
{/if}
<rect stroke="none" x="106.895" y="93.4868" width="50.1963" height="50.1963" fill="white" />
<rect stroke="none" x="124.464" y="93.4868" width="32.6276" height="32.6276" fill={secondaryColor} />
<rect stroke="none" x="156" y="92" width="18" height="52" fill="#0B101B" />
<rect stroke="none" x="173.405" y="93.4868" width="50.1963" height="50.1963" fill="white" />
<rect stroke="none" x="190.974" y="93.4868" width="32.6276" height="32.6276" fill={secondaryColor} />
<path
fill-rule="evenodd"
clip-rule="evenodd"
stroke="none"
d="M223.601 77.173H106.895V93.4868H223.601V77.173ZM140.778 93.4869H157.091V109.801H140.778V93.4869ZM207.288 93.4869H223.601V109.801H207.288V93.4869Z"
fill="#0B101B" />
<path
fill-rule="evenodd"
clip-rule="evenodd"
stroke="none"
d="M223.602 60.8594H239.915V143.683L239.915 159.997H173.405V143.683L223.602 143.683L223.602 77.1732H106.895V143.683H157.091V159.997H90.5812V143.683H90.5813V60.8595H106.895V60.8594H223.602Z"
fill={primaryColor} />
</svg>
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
export { default as AnimatedEyes } from './AnimatedEyes.svelte';
export { default as AnimatedTaikoon } from './AnimatedTaikoon.svelte';
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
export let tokenIds: number[] = [];
let windowSize: 'sm' | 'md' | 'lg' = 'md';

export let disableClick = false;

export let title: string = 'The Collection';

export let isLoading = false;
Expand Down Expand Up @@ -45,7 +47,7 @@
<div class={taikoonsWrapperClasses}>
{#each tokenIds as tokenId}
<a
href={`#${tokenId}`}
href={disableClick ? '#' : `#${tokenId}`}
class={classNames('w-full', 'rounded-xl', 'lg:rounded-3xl', 'md:rounded-2xl', 'overflow-hidden')}>
<NftRenderer size="full" {tokenId} />
</a>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<script lang="ts">
import { t } from 'svelte-i18n';

import { AnimatedEyes } from '$components/AnimatedTaikoon';
import { classNames } from '$lib/util/classNames';
import { Section } from '$ui/Section';

Expand All @@ -17,22 +18,35 @@
'leading-relaxed',
);
const contentClasses = classNames(
'w-3/4',
'md:font-normal',
'md:text-[57px]/[64px]',
'text-content-primary',
'font-medium',
'font-clash-grotesk',
'text-4xl',
);

$: eyes = Array.from({ length: 12 }, (_, i) => i);
</script>

<Section height="min">
<p class={titleClasses}>
{$t('content.sections.information.title')}
</p>
<Section>
<div class={classNames('py-32')}>
<p class={titleClasses}>
{$t('content.sections.information.title')}
</p>

<div class={contentClasses}>
{$t('content.sections.information.text')}
</div>

<div class={contentClasses}>
{$t('content.sections.information.text')}
<div class={classNames('w-full', 'h-min', 'flex', 'absolute', 'left-0', 'bottom-0')}>
<!-- eslint-disable-next-line @typescript-eslint/no-unused-vars -->
{#each eyes as _}
<div class={classNames('w-1/12', 'h-max', 'flex', 'justify-center', 'items-center')}>
<AnimatedEyes />
</div>
{/each}
</div>
</div>
<slot />
</Section>
120 changes: 120 additions & 0 deletions packages/taikoon-ui/src/components/sections/Preview.section.svelte
Original file line number Diff line number Diff line change
@@ -0,0 +1,120 @@
<script lang="ts">
import { onMount } from 'svelte';

import { AnimatedArrow } from '$components/AnimatedArrow';
import { Collection } from '$components/Collection';
import { Page } from '$components/Page';
import { classNames } from '$lib/util/classNames';
import { Section } from '$ui/Section';

$: tokenIds = [] as number[];

onMount(async () => {
tokenIds = Array.from({ length: 50 }, (_, i) => i + 1);
});

const titleClasses = classNames(
'w-full',
'text-left',
'text-primary',
'mb-4',
'uppercase',
'tracking-normal',
'text-[16px]/[24px]',
'font-bold',
'font-sans',
'leading-relaxed',
);

const titleRowClasses = classNames('flex', 'flex-row', 'justify-between', 'items-center', 'mb-12');

const bottomRowClasses = classNames(
'h-[10vh]',
'py-6',
'w-full',
'flex',
'flex-row',
'justify-center',
'items-center',
);

const collectionTitleClasses = classNames('text-[57px]/[64px]', 'font-clash-grotesk', 'font-medium');

const exploreMoreButtonClasses = classNames(
'bg-[#E81899]',
'font-sans',
'w-max',
'text-[#F3F3F3]',
'px-3',
'py-2',
'rounded-full',
'flex',
'flex-row',
'items-center',
'justify-center',
'text-base',
'font-bold',
'gap-2.5',
'hover:bg-[#C8047D]',
);

const viewMoreButtonClasses = classNames(
'border',
'border-primary',
'font-sans',
'w-max',
'text-[#F3F3F3]',
'px-3',
'py-2',
'rounded-full',
'flex',
'flex-row',
'items-center',
'justify-center',
'text-base',
'font-bold',
'gap-2.5',
'hover:bg-[#C8047D]',
);

$: isHovered = false;

const topRowClasses = classNames('absolute', 'z-50', 'top-32', 'left-0', 'px-16', 'w-full');

const collectionWrapperClasses = classNames('w-full', 'h-[90vh]');
</script>

<Page class="z-0">
<Section animated class="relative" width="xl">
<div class={collectionWrapperClasses}>
<Collection disableClick={true} {tokenIds} title="The 888 Collection" />
</div>
<div class={topRowClasses}>
<p class={titleClasses}>Explore Taikoons</p>

<div class={titleRowClasses}>
<div class={collectionTitleClasses}></div>

<a
href="/collection"
on:mouseenter={() => (isHovered = true)}
on:mouseleave={() => (isHovered = false)}
class={exploreMoreButtonClasses}>
Explore More
<AnimatedArrow {isHovered} />
</a>
</div>
</div>

<div class={bottomRowClasses}>
<a
href="/collection"
on:mouseenter={() => (isHovered = true)}
on:mouseleave={() => (isHovered = false)}
class={viewMoreButtonClasses}>
View More
<AnimatedArrow {isHovered} />
</a>
</div>
</Section>
</Page>
1 change: 1 addition & 0 deletions packages/taikoon-ui/src/components/sections/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ export { default as FaqSection } from './Faq.section.svelte';
export { default as FooterSection } from './Footer.section.svelte';
export { default as HeadingSection } from './Heading.section.svelte';
export { default as InformationSection } from './Information.section.svelte';
export { default as PreviewSection } from './Preview.section.svelte';
2 changes: 2 additions & 0 deletions packages/taikoon-ui/src/routes/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
FooterSection,
HeadingSection,
InformationSection,
PreviewSection,
} from '$components/sections';
import isCountdownActive from '$lib/util/isCountdownActive';
import { Button } from '$ui/Button';
Expand Down Expand Up @@ -41,6 +42,7 @@
</HeadingSection>
{/if}
<InformationSection />
<PreviewSection />
<div bind:this={scrollTarget}>
<FaqSection />
</div>
Expand Down
1 change: 1 addition & 0 deletions packages/taikoon-ui/tailwind.config.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import UiLibConfig from '@taiko/ui-lib/tailwind'
import daisyuiPlugin from 'daisyui'
import UiLibConfig from '@taiko/ui-lib/tailwind'

/** @type {import('tailwindcss').Config} */
export default {
Expand Down
Loading