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

modern app ui #3788

Draft
wants to merge 8 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
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
2 changes: 1 addition & 1 deletion app/app.nix
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ _: {
{
packages = {
app = jsPkgs.buildNpmPackage {
npmDepsHash = "sha256-WjabrGBsnp+AbkpCEPyseEH0RJU3SjntS1SBum5gMXM=";
npmDepsHash = "sha256-AQv8y9nIDlMwlDX7D1R8iR+5RSkSJHx+s9By4tr87kU=";
src = ./.;
sourceRoot = "app";
npmFlags = [
Expand Down
24 changes: 23 additions & 1 deletion app/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 4 additions & 3 deletions app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,12 @@
"postinstall": "patch-package"
},
"dependencies": {
"temporal-polyfill": "^0.2.5",
"mode-watcher": "0.5.0",
"svelte-sonner": "^0.3.27",
"@cosmjs/amino": "^0.33.0",
"@cosmjs/cosmwasm-stargate": "0.33.0",
"@cosmjs/proto-signing": "^0.33.0",
"@cosmjs/stargate": "0.33.0",
"@cosmjs/tendermint-rpc": "^0.33.0",
"@number-flow/svelte": "^0.3.3",
"@tanstack/match-sorter-utils": "^8.19.4",
"@tanstack/query-core": "5.61.5",
"@tanstack/svelte-query": "5.61.5",
Expand All @@ -35,8 +33,11 @@
"cmdk-sv": "^0.0.18",
"gql.tada": "1.8.10",
"graphql-request": "7.1.2",
"mode-watcher": "0.5.0",
"svelte-persisted-store": "^0.11.0",
"svelte-radix": "^1.1.1",
"svelte-sonner": "^0.3.27",
"temporal-polyfill": "^0.2.5",
"three": "0.170.0",
"valibot": "0.42.1",
"vaul-svelte": "^0.3.2",
Expand Down
10 changes: 5 additions & 5 deletions app/src/lib/components/DegenTrace.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,9 @@ $: statusText = {
}

const statusTitle = {
transferring: "TRANSFER IN PROGRESS",
transferred: "TRANSFER COMPLETE",
acknowledged: "TRANSFER CONFIRMED"
transferring: "Transfer in progress",
transferred: "Transfer complete",
acknowledged: "Transfer confirmed"
}

$: progress = progressMap[transferStatus]
Expand Down Expand Up @@ -94,12 +94,12 @@ $: delayAck = medianAck ? Math.max(0, elapsed - medianAck) : 0
</script>

{#if !$stats.isError}
<div class="border border-2 p-4 space-y-4 w-full">
<div class="border rounded p-4 space-y-4 w-full">
<h2 class="text-lg font-bold">{title}</h2>

<!-- PROGRESS LINE -->
<div class="w-full">
<div class="relative h-4 bg-gray-200 overflow-hidden border border-2 border-black">
<div class="relative h-4 bg-neutral-800 overflow-hidden border-2 border-black">
<!-- Vertical markers at 33% and 66% -->
<div class="absolute left-[33%] top-0 h-full w-[2px] bg-black"></div>
<div class="absolute left-[66%] top-0 h-full w-[2px] bg-black"></div>
Expand Down
6 changes: 3 additions & 3 deletions app/src/lib/components/connect/connect.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -54,16 +54,16 @@ $: if ($navigating) sheetOpen = false
builders={[builder]}
class={cn(
$connectedWallets === 1 ? "w-[75px]" : "w-[50px]",
"space-x-1.5 lg:w-[180px] text-md bg-accent text-black ml-auto",
"space-x-1.5 lg:w-[160px] text-md bg-white text-black ml-auto",
"hover:bg-cyan-300/90",
$sepoliaStore.connectionStatus === "connected" &&
$cosmosStore.connectionStatus === "connected",
)}
on:click={() => (sheetOpen = !sheetOpen)}
size="sm"
>
<WalletIcon class="size-6 text-black" />
<span class="font-supermolot font-bold uppercase lg:block hidden">
<!--<WalletIcon class="size-6 text-black" />!-->
<span class="font-bold lg:block hidden">
{buttonText}
</span>
<span class={cn($connectedWallets === 1 ? "font-supermolot font-bold uppercase" : "hidden")}>
Expand Down
2 changes: 1 addition & 1 deletion app/src/lib/components/footer.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ let buttons = [

<footer
class={cn(
'uppercase font-supermolot font-bold text-xl',
'font-bold text-xl',
'border-t bg-card',
'grid md:hidden grid-cols-4 place-content-center items-center',
// styling children
Expand Down
2 changes: 1 addition & 1 deletion app/src/lib/components/header/header.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ import { routes } from "$lib/components/navigation/index.ts"
: [
"h-9",
currentRoute
? "bg-foreground text-primary-foreground !hover:bg-foreground !hover:text-primary-foreground"
? " !hover:bg-foreground !hover:text-primary-foreground"
: "",
],
)}
Expand Down
4 changes: 2 additions & 2 deletions app/src/lib/components/packet-path.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export let packet: {
<section class="flex flex-col sm:flex-row">
<div class="flex-1 lex-col text-muted-foreground">
<h2
class="font-supermolot uppercase md:font-expanded text-2xl font-extrabold text-foreground whitespace-nowrap"
class="capitalize md:font-expanded text-2xl font-extrabold text-foreground whitespace-nowrap"
>
<ChainDetails highlightEnabled={false} {chains} chainId={packet.source_chain_id}/>
</h2>
Expand Down Expand Up @@ -53,7 +53,7 @@ export let packet: {
</div>
<div class="flex-1 sm:text-right flex-col text-muted-foreground">
<h2
class="font-supermolot uppercase md:font-expanded text-2xl font-extrabold text-foreground whitespace-nowrap"
class="capitalize md:font-expanded text-2xl font-extrabold text-foreground whitespace-nowrap"
>
<ChainDetails highlightEnabled={false} {chains} chainId={packet.destination_chain_id}/>
</h2>
Expand Down
8 changes: 4 additions & 4 deletions app/src/lib/components/search/search-bar.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export let onInputChange: ((event: InputEvent) => void) | undefined = undefined
export let windowWidth = window.innerWidth
</script>

<div class="flex justify-end">
<div class="flex justify-end rounded">
<Button size="icon" variant="outline" class="sm:hidden" on:click={onInputClick}>
<SearchIcon class="size-5 text-muted-foreground"/>
</Button>
Expand All @@ -34,10 +34,10 @@ export let windowWidth = window.innerWidth
? 'Search for address or tx hash...'
: 'Search...'}
class={cn(
'h-10 cursor-pointer',
'h-10 cursor-pointer rounded',
'dark:hover:bg-muted hover:bg-secondary',
'shadow-sm transition-colors placeholder:text-muted-foreground',
'w-full bg-background pl-8 self-stretch lowercase border-[1px] border-input',
'w-full bg-background pl-8 self-stretch border border-input',
'focus-visible:border-secondary focus-visible:outline-none focus-visible:ring-0 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50',
)}
/>
Expand All @@ -46,7 +46,7 @@ export let windowWidth = window.innerWidth
'h-7 gap-0.5 px-1.5',
'text-white dark:text-black',
'absolute select-none pointer-events-none',
'right-1.5 top-1.5 items-center border bg-primary font-mono text-xs font-medium opacity-100 hidden md:inline-flex',
'right-1.5 top-1.5 items-center rounded bg-primary font-mono text-xs font-medium opacity-100 hidden md:inline-flex',
)}
>
<span class="text-sm mb-1"><span class="text-lg mr-0.25">⌘</span>K</span>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ let cubeCount = 16
let logoWidth = cubeWidth * cubeCount + gap * (cubeCount - 1)
let cubesY = cubeWidth * 2 + gap
$: cubeDelta = (20 - cubeWidth) / 2
let strokeWidth = 2.5
let strokeWidth = 1

let threeContainer: HTMLElement
let threeCanvas: HTMLCanvasElement
Expand Down
29 changes: 11 additions & 18 deletions app/src/lib/components/stats-bar-stat.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import { deviceWidth } from "$lib/utilities/device.ts"
import { cn } from "$lib/utilities/shadcn.ts"
import LoadingDots from "$lib/components/loading-dots.svelte"
import NumberFlow from "@number-flow/svelte"

export let label: string
export let value: number | string
Expand All @@ -13,35 +14,27 @@ function formatValue(value: number | string): string {
}
return value
}

let valueAnimated = 0

$: if (!Number.isNaN(+value)) {
valueAnimated = +value
}
</script>

<div class={cn("uppercase flex px-6 py-4 border-none", $deviceWidth >= 888 ? "w-fit" : "w-full")}>
<div class="text-xl pt-2 font-bold divide-y" on:copy={(event) => {
<div class={cn("capitalize flex px-6 py-4 border-none", $deviceWidth >= 888 ? "w-fit" : "w-full")}>
<div class="text-xl font-bold" on:copy={(event) => {
event?.clipboardData?.setData('text/plain', value.toString());
event.preventDefault();
}}>
<h3 class="text-sm pb-2">{label}</h3>
<h3 class="text-xs pt-2 text-muted-foreground">{label}</h3>
{#if !value}
<div class="flex justify-start">
<LoadingDots class="size-6"/>
</div>
{:else }
{#key value}
<p class="text-xl pt-2 font-bold" class:blink={blink}>{formatValue(value)}</p>
{/key}
<p class="text-xl font-bold"><NumberFlow value={valueAnimated}/></p>
{/if}
</div>
<slot/>
</div>

<style lang="postcss">
.blink {
animation: blink-animation 0.5s;
}

@keyframes blink-animation {
0% { @apply text-accent; }
100% { @apply text-primary; }
}
</style>

18 changes: 9 additions & 9 deletions app/src/lib/components/trace.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -98,19 +98,19 @@ $: console.log(pTraces)

<DegenTrace {sourceChainId} {destinationChainId} {transferStatus} {sentTimestamp}/>

<ol class="max-w-full w-full -my-4"> <!-- offset padding surplus !-->
<ol class="max-w-full w-full -mb-2 mt-2"> <!-- offset padding surplus !-->
{#each pTraces as trace, index}
<li class="flex gap-4 w-full">
<div class="flex flex-col items-center">
<!-- top trace connector !-->
<div class={cn(
"w-1 flex-1",
index !== 0 ? "dark:bg-neutral-500 bg-black" : "",
"w-[2px] flex-1",
index !== 0 ? "dark:bg-neutral-800 bg-black" : "",
)}></div>
<div class={cn(
"size-12 border-4 dark:border-neutral-500 relative transition-all duration-300",
trace.status === "PENDING" ? "bg-white dark:bg-neutral-700" :
trace.status === "IN_PROGRESS" ? "bg-white dark:bg-neutral-700" :
"size-10 border-2 rounded dark:border-neutral-800 relative transition-all duration-300",
trace.status === "PENDING" ? "bg-white dark:bg-neutral-900" :
trace.status === "IN_PROGRESS" ? "bg-white dark:bg-neutral-900" :
trace.status === "COMPLETED" ? "bg-accent" :
trace.status === "ERROR" ? "bg-black" :
trace.status === "WARNING" ? "bg-yellow-300" : ""
Expand All @@ -130,14 +130,14 @@ $: console.log(pTraces)
{/if}
</div>
<!-- bottom trace connector !-->
<div class={cn("w-1 flex-1",
index === pTraces.length - 1 ? "bg-transparent" : "dark:bg-neutral-500 bg-black",
<div class={cn("w-[2px] flex-1",
index === pTraces.length - 1 ? "bg-transparent" : "dark:bg-neutral-800 bg-black",
index !== pTraces.length - 1 &&
trace.status !== "ERROR" &&
trace.status !== "WARNING" ? "bg-black" : "")
}></div>
</div>
<div class="font-bold py-4 flex flex-col min-h-[80px] max-w-[calc(100%-80px)] break-words justify-center">
<div class="font-bold flex flex-col min-h-[60px] max-w-[calc(100%-80px)] break-words justify-center">
{#if trace.timestamp}
<p class="text-xs -mb-1 text-muted-foreground">{toIsoString(new Date(trace.timestamp)).split('T')[1]} on {toDisplayName(trace.chain?.chain_id, chains)} at {#if trace.block_url}<a class="underline" target="_blank" href={trace.block_url}>{trace.height}</a>{:else}{trace.height}{/if}</p>
{/if}
Expand Down
2 changes: 1 addition & 1 deletion app/src/lib/components/transfer-details.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ let processedTransfers = derived(
?.explorers?.at(0)}
{#if transfer.source_chain_id !== null && transfer.destination_chain_id !== null}
<Card.Root
class="flex flex-col w-full lg:w-auto max-w-full overflow-y-hidden overflow-x-auto justify-self-center dark:bg-muted"
class="flex flex-col w-full lg:w-auto max-w-full overflow-y-hidden overflow-x-auto justify-self-center"
>
<Card.Header
class="font-bold text-md text-center break-words text-muted-foreground flex flex-row gap-2 justify-center"
Expand Down
2 changes: 1 addition & 1 deletion app/src/lib/components/ui/badge/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { type VariantProps, tv } from "tailwind-variants"
export { default as Badge } from "./badge.svelte"

export const badgeVariants = tv({
base: "inline-flex select-none items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",
base: "inline-flex font-bold select-none items-center rounded-full border px-2.5 py-0.5 text-xs transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",
variants: {
variant: {
default:
Expand Down
14 changes: 7 additions & 7 deletions app/src/lib/components/ui/button/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,16 @@ import type { Button as ButtonPrimitive } from "bits-ui"
import Root from "./button.svelte"

const buttonVariants = tv({
base: "inline-flex items-center justify-center whitespace-nowrap text-sm font-supermolot font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",
base: "rounded inline-flex items-center justify-center whitespace-nowrap text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",
variants: {
variant: {
default: "bg-primary text-primary-foreground hover:bg-primary/90 uppercase font-semibold",
destructive: "bg-destructive text-destructive-foreground hover:bg-destructive/90",
default: "bg-primary capitalize text-primary-foreground hover:bg-primary/90 font-semibold",
destructive: "bg-destructive capitalize text-destructive-foreground hover:bg-destructive/90",
outline:
"border border-muted-foreground bg-background hover:bg-accent hover:text-accent-foreground dark:hover:text-black",
secondary: "bg-secondary text-secondary-foreground uppercase hover:bg-secondary/80",
ghost: "hover:bg-accent hover:text-accent-foreground font-sans ",
link: "text-primary no-underline hover:no-underline font-supermolot font-bold text-md decoration-transparent uppercase rounded-none border-solid"
"border capitalize border-muted-foreground bg-background hover:bg-accent hover:text-accent-foreground dark:hover:text-black",
secondary: "bg-secondary capitalize text-secondary-foreground hover:bg-secondary/80",
ghost: "hover:bg-accent capitalize hover:text-accent-foreground font-sans ",
link: "text-primary no-underline capitalize hover:no-underline font-bold text-md decoration-transparent rounded-none border-solid"
},
size: {
default: "h-10 px-4 py-2",
Expand Down
2 changes: 1 addition & 1 deletion app/src/lib/components/ui/card/card.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export { className as class }
</script>

<div
class={cn('border bg-card text-card-foreground shadow-sm dark:bg-muted', className)}
class={cn('border rounded bg-card text-card-foreground shadow-sm', className)}
{...$$restProps}
>
<slot />
Expand Down
2 changes: 1 addition & 1 deletion app/src/lib/components/ui/table/table-cell.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export { className as class }
</script>

<td
class={cn('px-2 py-1 align-middle [&:has([role=checkbox])]:pr-0', className)}
class={cn('px-[16px] py-[6px] align-middle [&:has([role=checkbox])]:pr-0', className)}
{...$$restProps}
on:click
on:keydown
Expand Down
2 changes: 1 addition & 1 deletion app/src/lib/components/ui/table/table-head.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export { className as class }

<th
class={cn(
'h-12 px-2 text-left align-middle font-bold uppercase [&:has([role=checkbox])]:pr-0',
'px-[16px] h-12 text-left text-sm align-middle font-normal text-muted-foreground capitalize [&:has([role=checkbox])]:pr-0',
className,
)}
{...$$restProps}
Expand Down
2 changes: 1 addition & 1 deletion app/src/lib/components/ui/table/table.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export { className as class }
</script>

<div class="relative w-full overflow-auto">
<table class={cn('w-full caption-bottom text-sm', className)} {...$$restProps}>
<table class={cn('w-full caption-bottom ', className)} {...$$restProps}>
<slot />
</table>
</div>
2 changes: 1 addition & 1 deletion app/src/lib/components/ui/tooltip/tooltip-content.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export { className as class }
{transitionConfig}
{sideOffset}
class={cn(
"z-40 overflow-hidden border bg-popover bg-black px-3 py-1.5 text-sm text-popover-foreground shadow-md",
"z-40 overflow-hidden border bg-popover dark:bg-background rounded px-3 py-1.5 text-sm text-popover-foreground shadow-md",
className
)}
{...$$restProps}
Expand Down
Loading