about summary refs log tree commit diff stats
path: root/js
diff options
context:
space:
mode:
authorelioat <elioat@tilde.institute>2024-01-05 22:21:18 -0500
committerelioat <elioat@tilde.institute>2024-01-05 22:21:18 -0500
commit0e96c88697f9dd9b1b4b45b084a7a28c2f47b524 (patch)
tree55f227c22003547449d5462f015de355bb848a68 /js
parent0f6ff2d0856e9e0009a94911e3c2eb2ca6ab2d67 (diff)
downloadtour-0e96c88697f9dd9b1b4b45b084a7a28c2f47b524.tar.gz
*
Diffstat (limited to 'js')
-rw-r--r--js/name-gen/app.js7
1 files changed, 7 insertions, 0 deletions
diff --git a/js/name-gen/app.js b/js/name-gen/app.js
index a151520..2e97c06 100644
--- a/js/name-gen/app.js
+++ b/js/name-gen/app.js
@@ -13,6 +13,13 @@ syllables.forEach(syllable => {
 const generateName = () => {
     const nameLength = Math.floor(Math.random() * 3) + 2;
     const nameSyllables = Array.from({ length: nameLength }, () => syllables[Math.floor(Math.random() * syllables.length)]);
+    
+    if (Math.random() < 0.5) {
+        const vowels = ['a', 'e', 'i', 'o', 'u', 'y', 'ou', 'ey'];
+        const randomVowel = vowels[Math.floor(Math.random() * vowels.length)];
+        nameSyllables[nameLength - 1] += randomVowel;
+    }
+    
     const name = nameSyllables.join('').charAt(0).toUpperCase() + nameSyllables.join('').slice(1);
     return { name, nameSyllables };
 };