Skip to content
Open
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 client/app/app.vue
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,6 @@ function setup(rpc: HintsRpc, host: HostClient) {
<NuxtLayout v-else-if="connected">
<NuxtPage />
</NuxtLayout>
<NLoading v-else />
<Loading v-else />
</div>
</template>
68 changes: 68 additions & 0 deletions client/app/assets/styles.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
:root {
--nui-c-context: 125, 125, 125;
}

html {
background-color: #fff;
}

html.dark {
background-color: #151515;
color: #fff;
color-scheme: dark;
}

::selection {
background: #8884;
}

.shiki .line {
display: inline-block;
position: relative;
width: 100%;
}

.shiki.diff .line > span {
filter: saturate(0.75);
opacity: 0.75;
}

.shiki.diff .line-added,
.shiki.diff .line-removed {
scroll-margin: 5em;
}

.shiki.diff .line-added > span,
.shiki.diff .line-removed > span {
opacity: 1 !important;
position: inherit;
scroll-margin: 20px;
z-index: 100;
}

.shiki.diff .line-added > span {
color: #218c3b !important;
}

.shiki.diff .line-removed > span {
color: #d15547 !important;
}

.shiki .line-added::after,
.shiki .line-removed::after {
bottom: 0;
content: "";
display: block;
left: 0;
position: absolute;
right: 0;
top: 0;
}

.shiki .line-added::after {
background-color: #43885420;
}

.shiki .line-removed::after {
background-color: #8f4c3926;
}
5 changes: 5 additions & 0 deletions client/app/components/Badge.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<template>
<span class="n-badge">
<slot />
</span>
</template>
20 changes: 20 additions & 0 deletions client/app/components/Button.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<script setup lang="ts">
withDefaults(defineProps<{
disabled?: boolean
type?: 'button' | 'submit' | 'reset'
}>(), {
disabled: false,
type: 'button',
})
</script>

<template>
<button
:type="type"
:disabled="disabled || undefined"
:tabindex="disabled ? undefined : 0"
class="n-button n-button-base n-transition n-disabled:n-disabled active:n-button-active focus-visible:n-focus-base hover:n-button-hover"
>
<slot />
</button>
</template>
5 changes: 5 additions & 0 deletions client/app/components/Card.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<template>
<div class="n-card n-card-base">
<slot />
</div>
</template>
8 changes: 4 additions & 4 deletions client/app/components/FeatureCards/HtmlValidateCard.vue
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ const errorCount = computed(() =>
to="/html-validate"
class="block"
>
<n-card class="flex items-center justify-between p-4 hover:border-neutral-400 dark:hover:border-neutral-500">
<Card class="flex items-center justify-between p-4 hover:border-neutral-400 dark:hover:border-neutral-500">
<div class="flex items-center gap-3 min-w-0">
<Icon
name="material-symbols:code"
Expand All @@ -33,14 +33,14 @@ const errorCount = computed(() =>
</div>
</div>
</div>
<n-tip
<Tip
v-if="errorCount"
size="small"
type="error"
:bordered="false"
>
{{ errorCount }} errors
</n-tip>
</n-card>
</Tip>
</Card>
</NuxtLink>
</template>
8 changes: 4 additions & 4 deletions client/app/components/FeatureCards/HydrationCard.vue
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ const hydrationCount = computed(() => hydration.value.length)
to="/hydration"
class="block"
>
<n-card class="flex items-center justify-between p-4 hover:border-neutral-400 dark:hover:border-neutral-500">
<Card class="flex items-center justify-between p-4 hover:border-neutral-400 dark:hover:border-neutral-500">
<div class="flex items-center gap-3 min-w-0">
<Icon
name="material-symbols:water-full"
Expand All @@ -23,14 +23,14 @@ const hydrationCount = computed(() => hydration.value.length)
</div>
</div>
</div>
<n-tip
<Tip
v-if="hydrationCount"
size="small"
type="error"
:bordered="false"
>
{{ hydrationCount }} issues
</n-tip>
</n-card>
</Tip>
</Card>
</NuxtLink>
</template>
8 changes: 4 additions & 4 deletions client/app/components/FeatureCards/LazyLoadCard.vue
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ const lazyLoadCount = computed(() =>
to="/component-lazy-load"
class="block"
>
<n-card class="flex items-center justify-between p-4 hover:border-neutral-400 dark:hover:border-neutral-500">
<Card class="flex items-center justify-between p-4 hover:border-neutral-400 dark:hover:border-neutral-500">
<div class="flex items-center gap-3 min-w-0">
<Icon
name="material-symbols:speed"
Expand All @@ -28,14 +28,14 @@ const lazyLoadCount = computed(() =>
</div>
</div>
</div>
<n-tip
<Tip
v-if="lazyLoadCount"
size="small"
type="warning"
:bordered="false"
>
{{ lazyLoadCount }} suggestions
</n-tip>
</n-card>
</Tip>
</Card>
</NuxtLink>
</template>
4 changes: 2 additions & 2 deletions client/app/components/FeatureCards/ThirdPartyScriptsCard.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
to="/third-party-scripts"
class="block"
>
<n-card class="p-4 flex items-center gap-3 hover:border-neutral-400 dark:hover:border-neutral-500">
<Card class="p-4 flex items-center gap-3 hover:border-neutral-400 dark:hover:border-neutral-500">
<Icon
name="material-symbols:extension"
class="text-xl text-violet-500"
Expand All @@ -16,6 +16,6 @@
Analyze third-party scripts speed.
</div>
</div>
</n-card>
</Card>
</NuxtLink>
</template>
8 changes: 4 additions & 4 deletions client/app/components/FeatureCards/WebVitalsCard.vue
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ const { allMetrics } = useHostWebVitals()
to="/web-vitals"
class="block"
>
<n-card
<Card
class="flex items-center justify-between p-4 hover:border-neutral-400 dark:hover:border-neutral-500"
>
<div class="flex items-center gap-3 min-w-0">
Expand All @@ -24,11 +24,11 @@ const { allMetrics } = useHostWebVitals()
</div>
</div>
</div>
<n-badge
<Badge
v-if="allMetrics.length"
>
{{ allMetrics.length }} issues
</n-badge>
</n-card>
</Badge>
</Card>
</NuxtLink>
</template>
8 changes: 4 additions & 4 deletions client/app/components/HtmlValidateIssue.vue
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,13 @@
</script>

<template>
<n-card class="p4 grid gap-3">
<Card class="p4 grid gap-3">
<header class="flex items-center justify-between">
<div class="min-w-0">
<span class="text-sm font-semibold">{{ report.path || 'Unknown path' }}</span>
<span class="text-xs text-neutral-400 ml-2">{{ report.results.length }} issues</span>
</div>
<n-button
<Button
title="Remove"
size="small"
quaternary
Expand All @@ -49,7 +49,7 @@
name="material-symbols:delete-outline"
class="text-lg"
/>
</n-button>
</Button>
</header>

<div class="grid gap-4">
Expand All @@ -67,8 +67,8 @@
<div
w-full
overflow-auto
v-html="html"

Check warning on line 70 in client/app/components/HtmlValidateIssue.vue

View workflow job for this annotation

GitHub Actions / ci

'v-html' directive can lead to XSS attack
/>
</div>
</n-card>
</Card>
</template>
4 changes: 2 additions & 2 deletions client/app/components/HtmlValidateMessage.vue
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,12 @@ function getColorClassBySeverity(severity: number): string {
<template>
<tr class="border-b border-neutral-100 dark:border-neutral-800 last:border-b-0">
<td class="py-2">
<n-tip
<Tip
size="small"
:class="getColorClassBySeverity(message.severity)"
>
{{ SEVERITY_MAP[message.severity] || 'Unknown' }}
</n-tip>
</Tip>
</td>
<td class="py-2">
<code class="text-xs bg-neutral-100 dark:bg-neutral-800 px-1.5 py-0.5 rounded">
Expand Down
20 changes: 10 additions & 10 deletions client/app/components/HydrationIssue.vue
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@
</script>

<template>
<n-card
<Card
p-4
relative
w-full
Expand All @@ -98,7 +98,7 @@
</div>
</div>
<div class="flex gap-2">
<n-button
<Button
v-if="element"
size="small"
quaternary
Expand All @@ -111,8 +111,8 @@
name="material-symbols:file-open-outline"
class="text-lg"
/>
</n-button>
<n-button
</Button>
<Button
size="small"
quaternary
@click="copy(fullPre)"
Expand All @@ -122,8 +122,8 @@
class="text-lg"
/>
<span class="ml-1">Copy pre</span>
</n-button>
<n-button
</Button>
<Button
size="small"
quaternary
@click="copy(fullPost)"
Expand All @@ -133,8 +133,8 @@
class="text-lg"
/>
<span class="ml-1">Copy post</span>
</n-button>
<n-button
</Button>
<Button
title="Remove"
size="small"
quaternary
Expand All @@ -144,15 +144,15 @@
name="material-symbols:delete-outline"
class="text-lg"
/>
</n-button>
</Button>
</div>
</div>

<div
class="w-full mt-3 overflow-auto rounded-lg"
v-html="diffHtml"

Check warning on line 153 in client/app/components/HydrationIssue.vue

View workflow job for this annotation

GitHub Actions / ci

'v-html' directive can lead to XSS attack
/>
</n-card>
</Card>
</template>

<style lang="scss" scoped>
Expand Down
10 changes: 10 additions & 0 deletions client/app/components/Loading.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<template>
<div class="n-loading n-panel-grids-center">
<div class="flex flex-col animate-pulse items-center text-lg">
<div class="i-carbon-circle-dash animate-spin text-4xl op50" />
<slot>
Loading...
</slot>
</div>
</div>
</template>
7 changes: 7 additions & 0 deletions client/app/components/Tip.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<template>
<div class="n-tip n-tip-base">
<div>
<slot />
</div>
</div>
</template>
4 changes: 2 additions & 2 deletions client/app/components/WebVitals/CLSMetric.vue
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ const formatTime = (time: number) => `${time.toFixed(0)}ms`
</script>

<template>
<n-card p-2>
<Card p-2>
<div
flex
flex-col
Expand Down Expand Up @@ -146,5 +146,5 @@ const formatTime = (time: number) => `${time.toFixed(0)}ms`
<span>ID: {{ metric.id }}</span>
</div>
</div>
</n-card>
</Card>
</template>
4 changes: 2 additions & 2 deletions client/app/components/WebVitals/INPMetric.vue
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const formatTime = (time: number) => `${time.toFixed(0)}ms`
</script>

<template>
<n-card p-2>
<Card p-2>
<div
flex
flex-col
Expand Down Expand Up @@ -240,5 +240,5 @@ const formatTime = (time: number) => `${time.toFixed(0)}ms`
<span>ID: {{ metric.id }}</span>
</div>
</div>
</n-card>
</Card>
</template>
Loading
Loading