diff --git a/apps/analytics/src/app.css b/apps/analytics/src/app.css index 75d3999f..7d2b2c92 100644 --- a/apps/analytics/src/app.css +++ b/apps/analytics/src/app.css @@ -1,25 +1,47 @@ -@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;500;600;700;800;900&display=swap'); +@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;500;600;700&family=Montserrat:wght@400;500;700;900&display=swap'); @tailwind base; @tailwind components; @tailwind utilities; @layer base { html { + min-height: 100vh; background-color: #171923; background: linear-gradient(180deg, #171923 0%, #1a202c 100%); } + + body { + overflow: hidden; + } } @layer components { - .card { - @apply bg-gray-700 rounded-3xl px-6 py-5 shadow-xl; + .numeric { + @apply font-mono font-bold; } +} - .data-value { - @apply font-montserrat font-bold text-3xl; - } +.card { + @apply bg-gray-700 rounded-3xl px-6 py-5 shadow-xl; +} - .data-label { - @apply font-montserrat text-sm text-gray-400; - } +.data-value { + @apply numeric font-bold text-3xl; +} + +.data-label { + @apply font-montserrat text-gray-300; +} + +.help { + @apply cursor-help underline decoration-dotted decoration-gray-500 hover:decoration-inherit; +} + +.tooltip { + @apply absolute top-0 left-0 md:ml-4 bg-gray-600 rounded-xl p-3 text-sm font-montserrat w-80; +} + +sub { + bottom: 0; + position: unset; } diff --git a/apps/analytics/src/components/AverageAprChart.svelte b/apps/analytics/src/components/AverageAprChart.svelte deleted file mode 100644 index 6a7e6378..00000000 --- a/apps/analytics/src/components/AverageAprChart.svelte +++ /dev/null @@ -1,65 +0,0 @@ - - -
-
-

Average APR

-
{$displayValue ?? ''}
-
- -
- {#if $data != null} - { - const value = chart.dataset.data[chart.dataIndex] - if (typeof value === 'number') { - return `${chart.dataset.label}: ${value.toFixed(2)}%` - } - }, - }, - }, - }, - }} - /> - {/if} -
-
diff --git a/apps/analytics/src/components/BudgetPerShareChart.svelte b/apps/analytics/src/components/BudgetPerShareChart.svelte deleted file mode 100644 index 0e2b4957..00000000 --- a/apps/analytics/src/components/BudgetPerShareChart.svelte +++ /dev/null @@ -1,52 +0,0 @@ - - -
-
-

Budget per share

-
{$displayValue ?? ''}
-
- -
- {#if $data != null} - - {/if} -
-
diff --git a/apps/analytics/src/components/DailyRewards.svelte b/apps/analytics/src/components/DailyRewards.svelte deleted file mode 100644 index 82795460..00000000 --- a/apps/analytics/src/components/DailyRewards.svelte +++ /dev/null @@ -1,24 +0,0 @@ - - -
-

Daily rewards

-
{$displayValue ?? ''}
-
diff --git a/apps/analytics/src/components/DelegationValueChart.svelte b/apps/analytics/src/components/DelegationValueChart.svelte deleted file mode 100644 index 47442315..00000000 --- a/apps/analytics/src/components/DelegationValueChart.svelte +++ /dev/null @@ -1,53 +0,0 @@ - - -
-
-

Delegation value

-
{$displayValue ?? ''}
-
- -
- {#if $data != null} - - {/if} -
-
diff --git a/apps/analytics/src/components/DelegatorChart.svelte b/apps/analytics/src/components/DelegatorChart.svelte deleted file mode 100644 index 5cdc9ffb..00000000 --- a/apps/analytics/src/components/DelegatorChart.svelte +++ /dev/null @@ -1,53 +0,0 @@ - - -
-
-

Delegator

-
{$displayValue ?? ''}
-
- -
- {#if $data != null} - - {/if} -
-
diff --git a/apps/analytics/src/components/OnlineWorkerChart.svelte b/apps/analytics/src/components/OnlineWorkerChart.svelte deleted file mode 100644 index d31c96b1..00000000 --- a/apps/analytics/src/components/OnlineWorkerChart.svelte +++ /dev/null @@ -1,53 +0,0 @@ - - -
-
-

Online workers

-
{$displayValue ?? ''}
-
- -
- {#if $data != null} - - {/if} -
-
diff --git a/apps/analytics/src/components/PhatContractChart.svelte b/apps/analytics/src/components/PhatContractChart.svelte deleted file mode 100644 index b5ef3e65..00000000 --- a/apps/analytics/src/components/PhatContractChart.svelte +++ /dev/null @@ -1,77 +0,0 @@ - - -
-
-

Phat Contract daily execution

-
{latestExecutionCount ?? ''}
-
- -
- {#if data != null} - - {/if} -
-
diff --git a/apps/analytics/src/components/StakeRatio.svelte b/apps/analytics/src/components/StakeRatio.svelte deleted file mode 100644 index b0d37015..00000000 --- a/apps/analytics/src/components/StakeRatio.svelte +++ /dev/null @@ -1,20 +0,0 @@ - - -
-

Stake Ratio

-
{$stakeRatio ?? ''}
-
diff --git a/apps/analytics/src/lib/Computation.svelte b/apps/analytics/src/lib/Computation.svelte new file mode 100644 index 00000000..5f8cc29e --- /dev/null +++ b/apps/analytics/src/lib/Computation.svelte @@ -0,0 +1,206 @@ + + +

Computation

+
+
+ {#each $display as item, i} + {#if i === 0} + + + {item[0]} + + +
{@html item[1]}
+ {:else} +
+ + {item[0]} + + {item[1]} +
+ {/if} + {/each} +
+
+ + {#each charts as chart} + + `${ + checked ? 'bg-black/20' : 'bg-black/10 text-gray-500' + } p-2 rounded-2xl cursor-pointer text-xs`} + > + + {chart} + + + {/each} + + +
+ {#if $data != null} + + {/if} +
+
+
diff --git a/apps/analytics/src/components/Nav.svelte b/apps/analytics/src/lib/Nav.svelte similarity index 57% rename from apps/analytics/src/components/Nav.svelte rename to apps/analytics/src/lib/Nav.svelte index 9ea03ae8..58b77130 100644 --- a/apps/analytics/src/components/Nav.svelte +++ b/apps/analytics/src/lib/Nav.svelte @@ -4,11 +4,12 @@ MenuButton, MenuItem, MenuItems, - Transition, } from '@rgossiaux/svelte-headlessui' import {ChevronDownIcon} from '@rgossiaux/svelte-heroicons/solid' + import {fade} from 'svelte/transition' + let links: {label: string; href: string}[] = [ - {label: 'Home', href: 'https://phala.network'}, + {label: 'Official Website', href: 'https://phala.network'}, {label: 'Phala App', href: 'https://app.phala.network'}, {label: 'Phat Contract', href: 'https://phat.phala.network'}, {label: 'Phat Bricks', href: 'https://bricks.phala.network'}, @@ -23,32 +24,32 @@

Analytics

- + Phala logo

Analytics

- - - {#each links as link} - {link.label} - {/each} - - + + {#if open} +
+ + {#each links as link} + {link.label} + {/each} + +
+ {/if}