Skip to content

Commit

Permalink
v1.1.1 - Minor update
Browse files Browse the repository at this point in the history
  • Loading branch information
kaubu committed Dec 1, 2023
1 parent 23350f2 commit 20cce1f
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 6 deletions.
19 changes: 14 additions & 5 deletions src/views/Generator.vue
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,9 @@
<input type="checkbox" class="checkbox" v-model="unfoundedNamesUsed">
</label>

<input type="range" min="0" max="2" value="0" class="range mt-5" step="1" v-model="sex"/>
<input type="range" min="0" max="3" value="0" class="range mt-5" step="1" v-model="sex"/>
<div class="w-full flex justify-between text-xs px-2">
<span>Any</span>
<span>Unisex</span>
<span>Male</span>
<span>Female</span>
Expand Down Expand Up @@ -77,14 +78,20 @@
<tr v-for="(namePair, index) in generatedNamesTable">
<!-- {{ console.log(`index = ${index}`) }} -->
<th>{{ index + 1 }}</th>
<td v-if="lastNamesUsed">
<td v-if="lastNamesUsed && (!livingNamesUsed && !quickenedNamesUsed && !frozenNamesUsed && !unfoundedNamesUsed)">
{{ namePair[1].english_name }}
</td>
<td v-else-if="lastNamesUsed">
{{ namePair[0].english_name }} {{ namePair[1].english_name }}
</td>
<td v-else>
{{ namePair[0].english_name }}
</td>

<td v-if="lastNamesUsed">
<td v-if="lastNamesUsed && (!livingNamesUsed && !quickenedNamesUsed && !frozenNamesUsed && !unfoundedNamesUsed)">
{{ namePair[1].anglish_name }}
</td>
<td v-else-if="lastNamesUsed">
{{ namePair[0].anglish_name }} {{ namePair[1].anglish_name }}
</td>
<td v-else>
Expand Down Expand Up @@ -178,9 +185,11 @@ function generateFirstName(num: number) {
namesPool = namesPool.filter((name) => {
if (sex.value == 0) {
return name;
} else if ((name.kind == "Male" || name.kind == "Unisex") && sex.value == 1) {
} else if (name.kind == "Unisex" && sex.value == 1) {
return name;
} else if ((name.kind == "Male" || name.kind == "Unisex") && sex.value == 2) { // Male
return name;
} else if ((name.kind == "Female" || name.kind == "Unisex") && sex.value == 2) {
} else if ((name.kind == "Female" || name.kind == "Unisex") && sex.value == 3) { // Female
return name;
}
// else {
Expand Down
2 changes: 1 addition & 1 deletion vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,5 @@ export default defineConfig({
'@': fileURLToPath(new URL('./src', import.meta.url))
}
},
base: "https://pure-english.github.io/name-generator/",
base: "/name-generator/",
})

0 comments on commit 20cce1f

Please sign in to comment.