Skip to content

Commit

Permalink
fixed lint
Browse files Browse the repository at this point in the history
  • Loading branch information
onmax committed May 23, 2024
1 parent d54d0d7 commit 2946828
Show file tree
Hide file tree
Showing 10 changed files with 253 additions and 32 deletions.
14 changes: 9 additions & 5 deletions app.vue
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,12 @@ const validatorDetail = computed(() => !!route.params.address)
</script>

<template>
<div flex="~ col gap-64" size-screen mx-auto max-h-screen max-w-1200 py-20 px-32>
<div flex="~ col gap-64" mx-auto size-screen max-h-screen max-w-1200 px-32 py-20>
<header flex="~ gap-32 row items-center">
<div i-nimiq:logos-nimiq-horizontal dark:i-nimiq:logos-nimiq-white-horizontal !w-90 !h-24 ml-16 />
<NuxtLink v-if="validatorDetail" to="/" arrow-back block ghost-btn w-max>Go Back</NuxtLink>
<div i-nimiq:logos-nimiq-horizontal ml-16 h-24 w-90 dark:i-nimiq:logos-nimiq-white-horizontal />
<NuxtLink v-if="validatorDetail" to="/" block w-max arrow-back ghost-btn>
Go Back
</NuxtLink>
<div flex-auto />
<NuxtLink to="https://github.com/onmax/nimiq-validators" i-nimiq:logos-github-mono target="_blank" />
<button i-nimiq:moon @click="() => toggleDark()" />
Expand All @@ -23,8 +25,10 @@ const validatorDetail = computed(() => !!route.params.address)
<NuxtPage />
</main>

<footer pb-40 self-center>
Learn about the <NuxtLink to="/validator-trust-score" text-blue arrow>Validator Trust Score</NuxtLink>
<footer self-center pb-40>
Learn about the <NuxtLink to="/validator-trust-score" text-blue arrow>
Validator Trust Score
</NuxtLink>
</footer>
</div>
</template>
2 changes: 0 additions & 2 deletions content/vts.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ $$
$$
n = batches_in_a_day \* d
$$

### **Adjusting for High-Reliability Expectations**
Expand All @@ -56,7 +55,6 @@ R=-c+1-\sqrt{-\bar{R}^{2}+2c\bar{R}+\left(c-1\right)^{2}}
\\~\\
\text{Center of circle at (c,-c+1), where }
c=-0.16
$$

<iframe src="https://www.desmos.com/calculator/zqemsh7yay" width="100%" height="500px"></iframe>
Expand Down
1 change: 1 addition & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,6 @@ export default withNuxt(
antfu({
unocss: true,
formatters: true,
files: ['**/*.ts', '**/*.vue', '**/*.md'],
}),
)
2 changes: 1 addition & 1 deletion nuxt.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -111,5 +111,5 @@ export default defineNuxtConfig({
remarkPlugins: ['remark-math'],
rehypePlugins: ['rehype-mathjax'],
}
}
},
})
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,11 @@
"drizzle-zod": "^0.5.1",
"eslint": "^9.2.0",
"eslint-plugin-format": "^0.1.1",
"lint-staged": "^15.2.4",
"nimiq-css": "^0.0.96",
"rehype-mathjax": "^6.0.0",
"remark-math": "^6.0.0",
"simple-git-hooks": "^2.11.1",
"vite-plugin-top-level-await": "^1.4.1",
"vite-plugin-wasm": "^3.3.0",
"wrangler": "^3.56.0"
Expand Down
3 changes: 1 addition & 2 deletions packages/nimiq-vts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,7 @@
"prepublishOnly": "nr build",
"release": "bumpp && npm publish",
"start": "esno src/index.ts",
"typecheck": "tsc --noEmit",
"prepare": "simple-git-hooks"
"typecheck": "tsc --noEmit"
},
"dependencies": {
"defu": "^6.1.4",
Expand Down
62 changes: 42 additions & 20 deletions pages/validator/[address].vue
Original file line number Diff line number Diff line change
Expand Up @@ -13,51 +13,73 @@ const validator = computed(() => {
<div v-if="validator">
<!-- TODO Remove w-max -->
<div flex="~ gap-16 items-center">
<NuxtImg :src="validator.icon" :alt="validator.name" size-64 shrink-0 object-contain
:style="{ 'view-transition-name': `logo-${validator.id}` }" />
<NuxtImg
:src="validator.icon" :alt="validator.name" size-64 shrink-0 object-contain
:style="{ 'view-transition-name': `logo-${validator.id}` }"
/>
<div flex="~ col gap-2" relative>
<h1 text-28 lh-none pb-4 :style="{ 'view-transition-name': `h-${validator.id}` }">{{ validator.name }}</h1>
<h1 pb-4 text-28 lh-none :style="{ 'view-transition-name': `h-${validator.id}` }">
{{ validator.name }}
</h1>
<Address :validator text-15 tracking-wide :style="{ 'view-transition-name': `address-${validator.id}` }" />
</div>
<div flex-auto />
<div v-if="validator.tag === ValidatorTag.Nimiq" self-start bg-green-400 pill-sm text-green-1100
flex="~ items-center gap-8">
<div i-nimiq:icons-lg-verified-filled aria-hidden />
<div
v-if="validator.tag === ValidatorTag.Nimiq" self-start bg-green-400 text-green-1100 pill-sm
flex="~ items-center gap-8"
>
<div aria-hidden i-nimiq:icons-lg-verified-filled />
<span>Maintained by Nimiq</span>
</div>
<NuxtLink v-if="validator.website" :to="validator.website" self-start ml-auto arrow pill-sm pill-tertiary>{{
validator.website?.replace(/https?:\/\//, '') }}</NuxtLink>
<NuxtLink v-if="validator.website" :to="validator.website" ml-auto self-start arrow pill-sm pill-tertiary>
{{
validator.website?.replace(/https?:\/\//, '') }}
</NuxtLink>
</div>
<!-- <p v-if="validator.description" mt-8 ml-80 text-neutral-800>{{ validator.description }}</p> -->

<div flex="~ col items-center justify-center" mt-96>
<h3 text="center neutral-900" font-bold mb-0>{{ validator.name }}'s score is</h3>
<ScorePie mt-32 text-40 size-128 mx-auto :score="validator.total"
:style="{ 'view-transition-name': `score-${validator.id}` }" />
<h3 text="center neutral-900" mb-0 font-bold>
{{ validator.name }}'s score is
</h3>
<ScorePie
mx-auto mt-32 size-128 text-40 :score="validator.total"
:style="{ 'view-transition-name': `score-${validator.id}` }"
/>
<div flex="~ items-center gap-48" mt-64>
<div>
<h4 label text="12 center">size</h4>
<ScorePie text="28 neutral/70" mt-6 size-80 mx-auto :score="validator.size" />
<h4 label text="12 center">
size
</h4>
<ScorePie text="28 neutral/70" mx-auto mt-6 size-80 :score="validator.size" />
</div>
<div>
<h4 label text="12 center">liveness</h4>
<ScorePie text="28 neutral/70" mt-6 size-80 mx-auto :score="validator.liveness" />
<h4 label text="12 center">
liveness
</h4>
<ScorePie text="28 neutral/70" mx-auto mt-6 size-80 :score="validator.liveness" />
</div>
<div>
<h4 label text="12 center">reliability</h4>
<ScorePie text="28 neutral/70" mt-6 size-80 mx-auto :score="validator.reliability" />
<h4 label text="12 center">
reliability
</h4>
<ScorePie text="28 neutral/70" mx-auto mt-6 size-80 :score="validator.reliability" />
</div>
</div>
<!-- <div self-stretch w-2 bg-neutral-300 mx-48 /> -->

<p text-neutral-900 block max-w-700 mt-32>
<p mt-32 block max-w-700 text-neutral-900>
{{ validator }}
</p>
</div>
</div>

<div v-else>
<p font-semibold text-center>Validator {{ route.params.address }} not found</p>
<NuxtLink to="/" arrow-back pill-blue mx-auto mt-16>Go back</NuxtLink>
<p text-center font-semibold>
Validator {{ route.params.address }} not found
</p>
<NuxtLink to="/" mx-auto mt-16 arrow-back pill-blue>
Go back
</NuxtLink>
</div>
</template>
Loading

0 comments on commit 2946828

Please sign in to comment.