Skip to content

Commit

Permalink
sound works, need to record sounds now
Browse files Browse the repository at this point in the history
  • Loading branch information
Kavelin committed Nov 13, 2023
1 parent 17d8f5a commit 7f9f99c
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 23 deletions.
16 changes: 9 additions & 7 deletions pages/learn/[level].vue
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
{{ words[curWord].word }}
<span v-if="showDef">: {{ words[curWord].def }} </span>
</h1>
<div id="mostAccRom" v-if="showDef"> <b> {{ words[curWord].rom }} </b> <button v-if="'sound' in words[curWord]" v-on:click="playSound">🔊</button></div>
<input type="text" v-if="!showDef" @keypress.enter="() => (showDef ? nextWord() : check())" v-model="mainInput" />
<div id="correction" v-html="correction"></div>
<button @click="() => (showDef ? nextWord() : check())">
Expand All @@ -57,12 +58,6 @@ import initDraw from "./initDraw";
const route = useRoute();
const router = useRouter();
interface Word {
image?: String;
sound?: String;
word: String;
def: String;
}
let curLevel = ref(Number(route.params.level));
let curWord = ref(0);
let curPage = ref(0);
Expand Down Expand Up @@ -174,14 +169,21 @@ let check = () => {
showDef.value = !showDef.value;
correction.value = "";
mainInput.value = "";
playSound();
}
else {
correction.value =
mainInput.value.slice(0, val.curInp) +
`<span class='correction'>${val.curEnglish}</span>` +
mainInput.value.slice(val.curInp + val.curEnglish.length);
}
};
}
let playSound = () => {
if ('sound' in words.value[curWord.value]) {
var snd = new Audio("/sounds/" + words.value[curWord.value].sound);
snd.play();
}
}
let nextWord = async () => {
showDef.value = !showDef.value;
mainInput.value = "";
Expand Down
32 changes: 16 additions & 16 deletions pages/learn/levels.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,14 @@
"Now, let's put what you've learned to practice!"
],
"words": [
{ "word": "அம்மா", "def": "mom" },
{ "word": "அப்பா", "def": "dad" },
{ "word": "பாப்பா", "def": "baby" },
{ "word": "மாமா", "def": "uncle" },
{ "word": "ஆமாம்", "def": "yes" },
{ "word": "படம்", "def": "picture" },
{ "word": "பாடம்", "def": "lesson" },
{ "word": "பட்டம்", "def": "kite" }
{ "word": "அம்மா", "def": "mom", "rom":"ammaa"},
{ "word": "அப்பா", "def": "dad", "rom":"appaa"},
{ "word": "பாப்பா", "def": "baby", "rom":"paappaa"},
{ "word": "மாமா", "def": "uncle", "rom":"maamaa"},
{ "word": "ஆமாம்", "def": "yes", "rom":"aamaam"},
{ "word": "படம்", "def": "picture", "rom":"padam"},
{ "word": "பாடம்", "def": "lesson", "rom":"paadam"},
{ "word": "பட்டம்", "def": "kite", "rom":"pattam"}
]
},
{
Expand All @@ -61,11 +61,11 @@
"Now let's review what you learned!<br/>"
],
"words": [
{ "word": "சட்டம்", "def": "frame" },
{ "word": "மட்டம்", "def": "level" },
{ "word": "கட்டடம்", "def": "building" },
{ "word": "காகம்", "def": "crow" },
{ "word": "தாத்தா", "def": "grandfather" }
{ "word": "சட்டம்", "def": "frame", "rom":"sattam"},
{ "word": "மட்டம்", "def": "level","rom":"mattam" },
{ "word": "கட்டடம்", "def": "building","rom":"kattadam" },
{ "word": "காகம்", "def": "crow", "rom":"kaagam"},
{ "word": "தாத்தா", "def": "grandfather", "rom":"thaaththaa"}

]
},
Expand Down Expand Up @@ -173,7 +173,7 @@

{ "word": "தலை", "def": "head", "rom": "thalai" },
{ "word": "மழை", "def": "rain", "rom": "malai" },
{ "word": "மலை", "def": "mountain", "rom": "malai" },
{ "word": "மலை", "def": "mountain", "rom": "malai" },
{ "word": "கதை", "def": "story", "rom": "kathai" },
{ "word": "கடை", "def": "shop", "rom": "kadai" },

Expand All @@ -196,8 +196,8 @@
"Now let's see how these new consonants ய் and வ் will appear with எ and ஏ. <br/> ய் with எ is <b>யெ (ye)</b> <br/> ய் with ஏ is <b>யே (yae)</b> <br/>வ் with எ is <b>வெ (ve)</b> <br/> வ் with ஏ is <b>வே (vae)</b>"
],
"words": [
{ "word": "வா", "def": "come", "rom": "vaa" },
{ "word": "வால்", "def": "tail", "rom": "vaal" },
{ "word": "வா", "def": "come", "rom": "vaa"},
{ "word": "வால்", "def": "tail", "rom": "vaal" , "sound":"vaal.mp3"},
{ "word": "வாய்", "def": "mouth", "rom": "vaay" },
{ "word": "நாய்", "def": "dog", "rom": "naay" },
{ "word": "தாய்", "def": "mother", "rom": "thaay" },
Expand Down
Binary file added public/sounds/hi.mp3
Binary file not shown.
Binary file added public/sounds/vaal.mp3
Binary file not shown.

0 comments on commit 7f9f99c

Please sign in to comment.