fix: make unavailable sites clickable
Lint / Oxlint (push) Successful in 50s
Lint / TypeScript (push) Successful in 56s
Lint / ESLint (push) Successful in 56s
Deploy / Build (push) Successful in 1m48s
Deploy / Deploy to Stapler (push) Has been cancelled

This commit is contained in:
2026-06-17 17:30:43 +02:00
parent 95fd54ab75
commit a10b8bd7d1
5 changed files with 22 additions and 13 deletions
+19 -8
View File
@@ -3,27 +3,38 @@ import type { Domain } from "@/types";
defineProps<{ defineProps<{
domain: Domain; domain: Domain;
size: string; xl?: boolean;
}>(); }>();
</script> </script>
<template> <template>
<div class="inline-block align-text-top"> <div class="inline-block align-text-top me-2">
<div v-if="domain.searching" class="status" :class="`status-${size}`"></div> <div
v-if="domain.searching"
class="status"
:class="xl ? 'status-xl' : ''"
></div>
<div v-else-if="domain.available" class="inline-grid *:[grid-area:1/1]"> <div v-else-if="domain.available" class="inline-grid *:[grid-area:1/1]">
<div <div
class="status status-success animate-ping" class="status status-success animate-ping"
:class="`status-${size}`" :class="xl ? 'status-xl' : ''"
></div> ></div>
<div class="status status-success" :class="`status-${size}`"></div> <div class="status status-success" :class="xl ? 'status-xl' : ''"></div>
</div> </div>
<div v-else class="inline-grid *:[grid-area:1/1]"> <div v-else class="inline-grid *:[grid-area:1/1]">
<div <div
class="status status-error animate-ping" class="status status-error animate-ping"
:class="`status-${size}`" :class="xl ? 'status-xl' : ''"
></div> ></div>
<div class="status status-error" :class="`status-${size}`"></div> <div class="status status-error" :class="xl ? 'status-xl' : ''"></div>
</div> </div>
</div> </div>
{{ domain.name }} <span v-if="domain.available">{{ domain.name }}</span>
<a
v-else
:href="`https://${domain.name}`"
target="_blank"
class="underline"
>{{ domain.name }}</a
>
</template> </template>
-1
View File
@@ -11,7 +11,6 @@ defineProps<{ factory: DomainFactory }>();
<CoolDomain <CoolDomain
:id="domain.name + domain.searching + domain.available" :id="domain.name + domain.searching + domain.available"
:domain="domain" :domain="domain"
size="md"
></CoolDomain> ></CoolDomain>
<span v-if="domain.searching" <span v-if="domain.searching"
>&nbsp;<span class="loading loading-dots loading-xs"></span >&nbsp;<span class="loading loading-dots loading-xs"></span
-1
View File
@@ -54,7 +54,6 @@ function newDomain() {
<CoolDomain <CoolDomain
:id="domain.name + domain.searching + domain.available" :id="domain.name + domain.searching + domain.available"
:domain="domain" :domain="domain"
size="md"
></CoolDomain> ></CoolDomain>
<span v-if="domain.searching" <span v-if="domain.searching"
>&nbsp;<span class="loading loading-dots loading-xs"></span >&nbsp;<span class="loading loading-dots loading-xs"></span
+1 -1
View File
@@ -84,7 +84,7 @@ watch(i18n.locale, newDomain);
<div> <div>
<h1 class="font-bold" :class="getTextClass()"> <h1 class="font-bold" :class="getTextClass()">
<span v-if="!domain" class="loading loading-spinner loading-xl"></span> <span v-if="!domain" class="loading loading-spinner loading-xl"></span>
<span v-else><CoolDomain :domain="domain" size="xl" /></span> <span v-else><CoolDomain :domain="domain" xl /></span>
</h1> </h1>
<p v-if="state === State.Loading" class="py-6"> <p v-if="state === State.Loading" class="py-6">
{{ $t("page_random.state.loading") }} {{ $t("page_random.state.loading") }}
+2 -2
View File
@@ -68,7 +68,7 @@ export class DomainFactory {
const word = this.randomWord(lang); const word = this.randomWord(lang);
const domain = this.randomDomain(word); const domain = this.randomDomain(word);
if (domain) { if (domain) {
const output = { name: domain, searching: false, available: false }; const output = { name: domain, searching: false, available: true };
this.history.push(output); this.history.push(output);
resolve(output); resolve(output);
return; return;
@@ -91,7 +91,7 @@ export class DomainFactory {
) { ) {
const domain = `${escapedWord.substring(0, escapedWord.length - tldEscaped.length)}.${tld}`; const domain = `${escapedWord.substring(0, escapedWord.length - tldEscaped.length)}.${tld}`;
if (!domain.includes("-.")) { if (!domain.includes("-.")) {
const output = { name: domain, searching: false, available: false }; const output = { name: domain, searching: false, available: true };
this.history.push(output); this.history.push(output);
domains.push(output); domains.push(output);
} }