Released Kuli
All checks were successful
Deploy Online Pages / Pages-Deployment (push) Successful in 22s

This commit is contained in:
halsamen 2025-08-15 20:57:59 +09:00
parent 3dcb256229
commit 0ec2ebbcc0
8 changed files with 74 additions and 33 deletions

View File

@ -4,10 +4,10 @@
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="style.css">
<title>苦力 Beta</title>
<title>苦力</title>
</head>
<body>
<div id="hamburger"><span></span><span></span><span></span></div>
<div id="BGMButton">播放音乐</div>
<div id="scoreA">
<img src="src/circle.svg" width="50px" height="50px" alt="○" >
<span id="corrCntA"></span>
@ -46,6 +46,7 @@
<audio src="src/correct.mp3" id="corrSound"></audio>
<audio src="src/correct2.mp3" id="corrSound2"></audio>
<audio src="src/wrong.wav" id="wrongSound"></audio>
<audio src="src/gongzuobeige.mp3" id="BGM"></audio>
<script src="src/words_list.js"></script>
<script src="mkWrongChoice.js"></script>
<script src="script.js"></script>

View File

@ -13,7 +13,8 @@ const consPhoneme = [
["J", "Q", "Zh", "Ch", "Z", "C"],
["X", "Sh", "S"],
["L", "R"],
["H", "F"]
["H", "F"],
["ng"],
];
const vowPhoneme = [
["ā", "á", "ǎ", "à"],
@ -21,7 +22,6 @@ const vowPhoneme = [
["ū", "ú", "ǔ", "ù"],
["ē", "é", "ě", "è"],
["ō", "ó", "ǒ", "ò"],
["ng"]
];
let consPhonemeType;
let foundConsPhoneme = [];
@ -30,8 +30,6 @@ let consWrongList = [];
let wrongList = [];
let consWrong;
let vowWrong;
let temp;
let temptemp;
let zhCheck = -1;
let chCheck = -1;
let shCheck = -1;
@ -148,10 +146,15 @@ function mkWrongChoice(choice){
}
//同グループの自分以外の子音に置換される
for(let i = 0; i < foundConsPhoneme.length; ++i){
for(let j = 0; j < consPhoneme[foundConsPhoneme[i][0]].length; j++){
if(j == foundConsPhoneme[i][1]) continue;
consWrong = choice.replace(consPhoneme[foundConsPhoneme[i][0]][foundConsPhoneme[i][1]], consPhoneme[foundConsPhoneme[i][0]][j])
consWrongList.push(consWrong)
if(consPhoneme[foundConsPhoneme[i][0]][foundConsPhoneme[i][1]] == "ng"){
consWrong = choice.replace("ng", "n")
consWrongList.push(consWrong)
}else{
for(let j = 0; j < consPhoneme[foundConsPhoneme[i][0]].length; j++){
if(j == foundConsPhoneme[i][1]) continue;
consWrong = choice.replace(consPhoneme[foundConsPhoneme[i][0]][foundConsPhoneme[i][1]], consPhoneme[foundConsPhoneme[i][0]][j])
consWrongList.push(consWrong)
}
}
}
consWrongList.push(choice)
@ -185,6 +188,3 @@ function mkWrongChoice(choice){
return wrongList;
}
mkWrongChoice("Zhōngguó");
mkWrongChoice("kuàngquánshuǐ");

View File

@ -5,7 +5,7 @@ let targetLen = target.length;
console.log(targetLen);
let body = document.getElementsByTagName("body")[0];
let clsChg = document.getElementById("clsChg");
let BGMButton = document.getElementById("BGMButton");
let display = document.getElementById("display");
let word = document.getElementById("word");
let pronunc = document.getElementById("pronunc");
@ -24,8 +24,11 @@ let replay = document.getElementById("replay");
let corrSound = document.getElementById("corrSound");
let corrSound2 = document.getElementById("corrSound2");
let wrongSound = document.getElementById("wrongSound");
corrSound.volume = 0.7;
let BGM = document.getElementById("BGM");
corrSound.volume = 1;
wrongSound.volume = 0.5;
BGM.loop = true;
BGM.volume = 1;
let curWordIdx;
let curCorrIdx;
@ -52,6 +55,7 @@ let mistakenWordPronunc;
let mistakenWordPronuncLen;
let mistakenWordPronuncTxt;
let wrongsTxt;
let isOnTheBeat = false;
function randElem(arr) {
//与配列からランダムに要素を一つ取り出して返す関数
@ -99,9 +103,9 @@ function quiz() {
mistakenWordIdx = wrongs[i][0];
//間違い方リストから正答番号を取り出した
mistakenWordPronuncTxt = "" + mistakenWordPronunc + "";
wrongsTxt += "<span style=\"color: black;\">" + target[mistakenWordIdx]["word"] + "</span>"
+ "是 <span style=\"color: black;\">"
+ target[mistakenWordIdx]["pronunc"] + "</span>不是<span style=\"color: black;\">" + wrongs[i][1] + "’。</span><br>"
wrongsTxt += "" + target[mistakenWordIdx]["word"] + ""
+ "<span style=\"color: gold;\">是</span>"
+ target[mistakenWordIdx]["pronunc"] + "<span style=\"color: gold;\">不是" + wrongs[i][1] + "’。</span><br>"
}
imperfect.innerHTML = wrongsTxt.slice(0, -4);
return [null, null];
@ -161,6 +165,7 @@ function start() {
result.style.animation = "";
}
start();
ans[0].addEventListener("click", () => {
if (curCorrIdx == 0) {
//正解の場合
@ -254,3 +259,15 @@ ans[3].addEventListener("click", () => {
}
})
replay.addEventListener("click", start)
BGMButton.addEventListener("click", () => {
if(isOnTheBeat){
BGM.pause();
BGMButton.innerText = "播放音乐";
isOnTheBeat = false;
}else{
BGM.play();
BGMButton.innerText = "停止音乐";
isOnTheBeat = true;
}
})

View File

@ -1 +1 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?><svg xmlns:svg="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg" version="1.1" style="overflow:visible" viewBox="-250 -250 500 500" height="500px" width="500px"><rect fill-opacity="0" fill="rgb(0,0,0)" height="500" width="500" y="-250" x="-250" /><svg version="1.1" y="-250" x="-250" viewBox="-250 -250 500 500" height="500px" width="500px" style="overflow:visible"><g transform="rotate(0,0,0)" stroke-linejoin="round" fill="#fff"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="30" stroke-opacity="1" stroke="rgb(255,0,0)" fill="none" d="m195 0a195 195 0 0 1-195 195a195 195 0 0 1-195-195a195 195 0 0 1 195-195a195 195 0 0 1 195 195z" /></g></svg></svg>
<?xml version="1.0" encoding="UTF-8" standalone="no"?><svg xmlns:svg="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg" version="1.1" style="overflow:visible" viewBox="-250 -250 500 500" height="500px" width="500px"><rect fill-opacity="0" fill="rgb(0,0,0)" height="500" width="500" y="-250" x="-250" /><svg version="1.1" y="-250" x="-250" viewBox="-250 -250 500 500" height="500px" width="500px" style="overflow:visible"><g transform="rotate(0,0,0)" stroke-linejoin="round" fill="#fff"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="30" stroke-opacity="1" stroke="gold" fill="none" d="m195 0a195 195 0 0 1-195 195a195 195 0 0 1-195-195a195 195 0 0 1 195-195a195 195 0 0 1 195 195z" /></g></svg></svg>

Before

Width:  |  Height:  |  Size: 741 B

After

Width:  |  Height:  |  Size: 733 B

View File

@ -1 +1 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?><svg xmlns:svg="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg" version="1.1" style="overflow:visible" viewBox="-250 -250 500 500" height="500px" width="500px"><rect fill-opacity="0" fill="rgb(0,0,0)" height="500" width="500" y="-250" x="-250" /><svg version="1.1" y="-250" x="-250" viewBox="-250 -250 500 500" height="500px" width="500px" style="overflow:visible"><g transform="rotate(45,0,0)" stroke-linejoin="round" fill="#fff"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="37" stroke-opacity="1" stroke="rgb(34,106,216)" fill="none" d="m0-179.7152v359.43" /><path stroke-linecap="round" stroke-linejoin="round" stroke-width="37" stroke-opacity="1" stroke="rgb(34,106,216)" fill="none" d="m-179.7152 0h359.43" /></g></svg></svg>
<?xml version="1.0" encoding="UTF-8" standalone="no"?><svg xmlns:svg="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg" version="1.1" style="overflow:visible" viewBox="-250 -250 500 500" height="500px" width="500px"><rect fill-opacity="0" fill="rgb(0,0,0)" height="500" width="500" y="-250" x="-250" /><svg version="1.1" y="-250" x="-250" viewBox="-250 -250 500 500" height="500px" width="500px" style="overflow:visible"><g transform="rotate(45,0,0)" stroke-linejoin="round" fill="#fff"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="37" stroke-opacity="1" stroke="gold" fill="none" d="m0-179.7152v359.43" /><path stroke-linecap="round" stroke-linejoin="round" stroke-width="37" stroke-opacity="1" stroke="gold" fill="none" d="m-179.7152 0h359.43" /></g></svg></svg>

Before

Width:  |  Height:  |  Size: 821 B

After

Width:  |  Height:  |  Size: 799 B

BIN
Kuli/src/gongzuobeige.mp3 Normal file

Binary file not shown.

View File

@ -1,6 +1,6 @@
function words() {
return[
{ "word": "你", "meaning": ["あなた"], "pronunc": ["nı̌ "] },
{ "word": "你", "meaning": ["あなた"], "pronunc": ["nǐ"] },
{ "word": "好", "meaning": ["良い"], "pronunc": ["hǎo"] },
{ "word": "我", "meaning": ["わたし"], "pronunc": ["wǒ"] },
{ "word": "叫", "meaning": ["~という名前である"], "pronunc": ["jiào"] },
@ -68,7 +68,7 @@ function words() {
{ "word": "老师", "meaning": ["先生"], "pronunc": ["lǎoshī"] },
{ "word": "朋友", "meaning": ["友達"], "pronunc": ["péngyou"] },
{ "word": "日本人", "meaning": ["日本人"], "pronunc": ["Rìběnrén"] },
{ "word": "大学生", "meaning": ["大学生"], "pronunc": ["dàxuéshenḡ"] },
{ "word": "大学生", "meaning": ["大学生"], "pronunc": ["dàxuéshēng"] },
{ "word": "职员", "meaning": ["職員"], "pronunc": ["zhíyuán"] },
{ "word": "小刘", "meaning": ["刘ちゃん(固有名詞)"], "pronunc": ["Xiǎo Liú"] },
{ "word": "都", "meaning": ["みんな"], "pronunc": ["dōu"] },
@ -87,7 +87,7 @@ function words() {
{ "word": "女儿", "meaning": ["娘"], "pronunc": ["nǚér"] },
{ "word": "兄弟姐妹", "meaning": ["兄弟姉妹"], "pronunc": ["xiōngdìjiěmèi"] },
{ "word": "刘燕", "meaning": ["刘燕(固有名詞)"], "pronunc": ["Liú Yàn"] },
{ "word": "吗", "meaning": ["~か?"], "pronunc": ["ma"] },
// { "word": "吗", "meaning": ["~か?"], "pronunc": ["ma"] },
{ "word": "田中明香", "meaning": ["田中明香(固有名詞)"], "pronunc": ["Tiánzhōng Míngxiāng"] },
{ "word": "不", "meaning": ["~ない"], "pronunc": ["bù"] },
{ "word": "这儿", "meaning": ["ここ"], "pronunc": ["zhèr"] },
@ -106,7 +106,7 @@ function words() {
{ "word": "太", "meaning": ["とても"], "pronunc": ["tài"] },
{ "word": "景山", "meaning": ["景山(固有名詞)"], "pronunc": ["Jǐngshān"] },
{ "word": "故宫", "meaning": ["故宮(固有名詞)"], "pronunc": ["Gùgōng"] },
{ "word": "角楼", "meaning": ["隅櫓"], "pronunc": ["Jiǎolóu"] },
{ "word": "角楼", "meaning": ["隅櫓"], "pronunc": ["jiǎolóu"] },
{ "word": "和", "meaning": ["~と"], "pronunc": ["hé"] },
{ "word": "筒子河", "meaning": ["筒子河(固有名詞)"], "pronunc": ["Tǒngzihé"] },
{ "word": "对了", "meaning": ["ところで"], "pronunc": ["Duì le"] },
@ -124,7 +124,7 @@ function words() {
{ "word": "挺…的", "meaning": ["とても"], "pronunc": ["tǐng … de"] },
{ "word": "太…了", "meaning": ["とても"], "pronunc": ["tài … le"] },
{ "word": "有点儿", "meaning": ["ちょっと"], "pronunc": ["yǒudiǎnr"] },
{ "word": "的", "meaning": ["~の"], "pronunc": ["de"] },
// { "word": "的", "meaning": ["~の"], "pronunc": ["de"] },
{ "word": "这", "meaning": ["これ"], "pronunc": ["zhè"] },
{ "word": "哪", "meaning": ["どれ"], "pronunc": ["nǎ"] },
{ "word": "这个", "meaning": ["この"], "pronunc": ["zhège/zhèi ge"] },
@ -182,7 +182,7 @@ function words() {
{ "word": "现在", "meaning": ["現在"], "pronunc": ["xiànzài"] },
{ "word": "就", "meaning": ["すぐに"], "pronunc": ["jiù"] },
{ "word": "带", "meaning": ["~を連れる"], "pronunc": ["dài"] },
{ "word": "吧", "meaning": ["~でしょう?", "~しましょう"], "pronunc": ["ba"] },
// { "word": "吧", "meaning": ["~でしょう?", "~しましょう"], "pronunc": ["ba"] },
{ "word": "里面", "meaning": ["中に"], "pronunc": ["lǐmiàn"] },
{ "word": "有", "meaning": ["(~に~が)ある"], "pronunc": ["yǒu"] },
{ "word": "小卖部", "meaning": ["小売店"], "pronunc": ["xiǎomàibù"] },
@ -254,7 +254,7 @@ function words() {
{ "word": "商店", "meaning": ["お店"], "pronunc": ["shāngdiàn"] },
{ "word": "公共汽车", "meaning": ["バス"], "pronunc": ["gōnggòngqìchē"] },
{ "word": "做", "meaning": ["~をする"], "pronunc": ["zuò"] },
{ "word": "呢", "meaning": ["~だよね"], "pronunc": ["ne"] },
// { "word": "呢", "meaning": ["~だよね"], "pronunc": ["ne"] },
{ "word": "王府井", "meaning": ["王府井(固有名詞)"], "pronunc": ["Wángfǔjǐng"] },
{ "word": "大街", "meaning": ["繁華街"], "pronunc": ["dàjiē"] },
{ "word": "借", "meaning": ["~を借りる"], "pronunc": ["jiè"] },
@ -404,7 +404,7 @@ function words() {
{ "word": "夜景", "meaning": ["夜景"], "pronunc": ["yèjǐng"] },
{ "word": "古建筑", "meaning": ["昔の建築"], "pronunc": ["gǔ jiànzhù"] },
{ "word": "鼓楼", "meaning": ["鼓楼"], "pronunc": ["Gǔlóu"] },
{ "word": "钟楼", "meaning": ["鐘楼"], "pronunc": ["Zhōnglóu"] },
{ "word": "钟楼", "meaning": ["鐘楼"], "pronunc": ["zhōnglóu"] },
{ "word": "研究", "meaning": ["研究"], "pronunc": ["yánjiū"] },
{ "word": "一大早", "meaning": ["朝早く"], "pronunc": ["yídàzǎo"] },
{ "word": "已经", "meaning": ["すでに"], "pronunc": ["yǐjīng"] },
@ -420,7 +420,7 @@ function words() {
{ "word": "一定", "meaning": ["きっと"], "pronunc": ["yídìng"] },
{ "word": "隆福寺", "meaning": ["隆福寺(固有名詞)"], "pronunc": ["Lóngfúsì"] },
{ "word": "小吃", "meaning": ["ちょっとした食事"], "pronunc": ["xiǎochī"] },
{ "word": "过 (アスペクト助詞)", "meaning": ["~したことがある"], "pronunc": ["guo"] },
// { "word": "过 (アスペクト助詞)", "meaning": ["~したことがある"], "pronunc": ["guo"] },
{ "word": "点", "meaning": ["~時"], "pronunc": ["diǎn"] },
{ "word": "分", "meaning": ["~分"], "pronunc": ["fēn"] },
{ "word": "钟", "meaning": ["鐘", "(~時)ちょうど"], "pronunc": ["zhōng"] },
@ -531,7 +531,7 @@ function words() {
{ "word": "人力", "meaning": ["人力"], "pronunc": ["rénlì"] },
{ "word": "建造", "meaning": ["~を建造する"], "pronunc": ["jiànzào"] },
{ "word": "山", "meaning": ["山"], "pronunc": ["shān"] },
{ "word": "得", "meaning": ["(様態補語を伴う動詞に続く)"], "pronunc": ["de"] },
// { "word": "得", "meaning": ["(様態補語を伴う動詞に続く)"], "pronunc": ["de"] },
{ "word": "睡", "meaning": ["寝る"], "pronunc": ["shuì"] },
{ "word": "高中", "meaning": ["高校"], "pronunc": ["gāozhōng"] },
{ "word": "小时", "meaning": ["~時間"], "pronunc": ["xiǎoshí"] },

View File

@ -35,6 +35,29 @@ body {
color: gold;
}
#BGMButton {
font-family: 'Microsoft YaHei', sans-serif;
position: absolute;
display: block;
width: auto;
height: auto;
padding: 5px;
text-align: center;
border-radius: 2rem;
border: 3px solid gold;
background-color: red;
color: gold;
font-size: 4vh;
cursor: pointer;
user-select: none;
transition: all 0.3s;
box-shadow: 0 3px 5px rgba(0, 0, 0, .3);
}
#BGMButton:hover{
opacity: 0.6;
}
#ans_0 {
width: 50%;
height: 40%;
@ -92,7 +115,7 @@ body {
text-align: left;
border: 5px solid gold;
background-color: red;
color:gold;
color:black;
box-shadow: 0 3px 6px rgba(0, 0, 0, .4);
}