Compare commits

...
3 Commits
Author SHA1 Message Date
klemek ecf427b1e2 feat: dont generate xxx domains
Lint / Oxlint (push) Successful in 46s
Lint / TypeScript (push) Successful in 46s
Lint / ESLint (push) Successful in 1m19s
Deploy / Build (push) Successful in 1m19s
Deploy / Deploy to Stapler (push) Successful in 5m30s
2026-06-26 10:58:22 +02:00
klemek a6a07b7001 fix: restore all tlds 2026-06-26 10:58:09 +02:00
klemek 7f56c3d876 fix: vuejs warn 2026-06-26 10:58:00 +02:00
7 changed files with 127 additions and 65 deletions
+2 -9
View File
@@ -7,15 +7,8 @@ defineProps<{ factory: DomainFactory }>();
<template> <template>
<div> <div>
<p <p v-for="(domain, i) in factory.history.slice().reverse()" :key="`domain-${i}`" class="pt-3">
v-for="(domain, i) in factory.history.slice().reverse()" <CoolDomain :domain="domain"></CoolDomain>
:key="`domain-${i}`"
class="pt-3"
>
<CoolDomain
:id="domain.name + domain.searching + domain.available"
:domain="domain"
></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
></span> ></span>
+16
View File
@@ -60,6 +60,13 @@ function checkAvailability() {
} }
} }
function removeExt() {
if (domain.value) {
props.factory.removeExt(domain.value.extension);
newDomain();
}
}
function getTextClass() { function getTextClass() {
if (!domain.value || domain.value.name.length < 15) { if (!domain.value || domain.value.name.length < 15) {
return "text-5xl"; return "text-5xl";
@@ -121,5 +128,14 @@ watch(i18n.locale, newDomain);
> >
{{ $t("button.new_domain") }} {{ $t("button.new_domain") }}
</button> </button>
<br />
<p v-if="domain && state === State.Ready">
<small
><a class="underline" href="#" @click.prevent="removeExt">{{
$t("page_random.dont_suggest", { ext: `.${domain.extension}` })
}}</a></small
>
</p>
<p v-else>&nbsp;</p>
</div> </div>
</template> </template>
+38
View File
@@ -860,6 +860,7 @@ co.id
my.id my.id
or.id or.id
web.id web.id
ie
ac.il ac.il
co.il co.il
muni.il muni.il
@@ -875,6 +876,43 @@ org.im
plc.co.im plc.co.im
immo immo
immobilien immobilien
in
5g.in
6g.in
ahmdabad.in
ai.in
am.in
bihar.in
biz.in
business.in
ca.in
cn.in
co.in
com.in
coop.in
cs.in
delhi.in
dr.in
er.in
firm.in
gen.in
gujarat.in
ind.in
info.in
int.in
internet.in
io.in
me.in
net.in
org.in
pg.in
post.in
pro.in
travel.in
tv.in
uk.in
up.in
us.in
inc inc
industries industries
info info
+2 -1
View File
@@ -14,7 +14,8 @@
"loading": "Loading the Cool Domain Factory™", "loading": "Loading the Cool Domain Factory™",
"generating": "Generating a new cool domain", "generating": "Generating a new cool domain",
"fetching": "Checking domain availability" "fetching": "Checking domain availability"
} },
"dont_suggest": "Don't generate {ext} domains"
}, },
"page_input": { "page_input": {
"not_found": "No matching domain found.", "not_found": "No matching domain found.",
+2 -1
View File
@@ -14,7 +14,8 @@
"loading": "Chargement de la Cool Domain Factory™", "loading": "Chargement de la Cool Domain Factory™",
"generating": "Création d'un domaine cool", "generating": "Création d'un domaine cool",
"fetching": "Vérification de la disponibilité" "fetching": "Vérification de la disponibilité"
} },
"dont_suggest": "Ne pas génerer des domaines en {ext}"
}, },
"page_input": { "page_input": {
"not_found": "Aucun domaine correspondant.", "not_found": "Aucun domaine correspondant.",
+20 -8
View File
@@ -11,10 +11,12 @@ export class DomainFactory {
words: Record<string, string[]> = {}; words: Record<string, string[]> = {};
generated: string[] = []; generated: string[] = [];
history: Domain[] = []; history: Domain[] = [];
tldList: string[] = [];
init() { init() {
this.words.fr = this.initWords(frenchWords); this.words.fr = this.initWords(frenchWords);
this.words.en = this.initWords(englishWords); this.words.en = this.initWords(englishWords);
this.tldList = TLD_LIST;
} }
escapeWord(word: string): string { escapeWord(word: string): string {
@@ -47,7 +49,7 @@ export class DomainFactory {
} }
randomDomain(word: string): string | null { randomDomain(word: string): string | null {
for (const tld of shuffled(TLD_LIST.slice())) { for (const tld of shuffled(this.tldList.slice())) {
const tldEscaped: string = tld.replace(".", ""); const tldEscaped: string = tld.replace(".", "");
if (word.endsWith(tldEscaped) && word.length > tldEscaped.length + 2) { if (word.endsWith(tldEscaped) && word.length > tldEscaped.length + 2) {
const domain = `${word.substring(0, word.length - tldEscaped.length)}.${tld}`; const domain = `${word.substring(0, word.length - tldEscaped.length)}.${tld}`;
@@ -68,7 +70,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: true }; const output = this.newDomain(domain);
this.history.push(output); this.history.push(output);
resolve(output); resolve(output);
return; return;
@@ -79,19 +81,29 @@ export class DomainFactory {
}); });
} }
removeExt(ext: string): void {
this.tldList = this.tldList.filter((tld: string) => tld !== ext && !tld.endsWith(ext));
}
newDomain(domain: string): Domain {
return {
name: domain,
extension: domain.split(".", 1)[1] ?? "",
searching: false,
available: true,
};
}
allFromWord(word: string): Promise<Domain[]> { allFromWord(word: string): Promise<Domain[]> {
const escapedWord = this.escapeWord(word.replace(/ /gm, "-")); const escapedWord = this.escapeWord(word.replace(/ /gm, "-"));
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
const domains = []; const domains = [];
for (const tld of shuffled(TLD_LIST.slice())) { for (const tld of shuffled(this.tldList.slice())) {
const tldEscaped: string = tld.replace(".", ""); const tldEscaped: string = tld.replace(".", "");
if ( if (escapedWord.endsWith(tldEscaped) && escapedWord.length >= tldEscaped.length + 2) {
escapedWord.endsWith(tldEscaped) &&
escapedWord.length >= tldEscaped.length + 2
) {
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: true }; const output = this.newDomain(domain);
this.history.push(output); this.history.push(output);
domains.push(output); domains.push(output);
} }
+1
View File
@@ -34,6 +34,7 @@ export interface WhoIsEntity {
export interface Domain { export interface Domain {
name: string; name: string;
extension: string;
available: boolean; available: boolean;
searching: boolean; searching: boolean;
} }