{"id":574430,"student_id":2589,"content":"{\"html\":\"\u003c!DOCTYPE html\u003e\\n\u003chtml\u003e\\n\u003chead\u003e\\n \u003ctitle\u003eDocument\u003c/title\u003e\\n \u003cscript src=\\\"https://code.jquery.com/jquery-3.3.1.min.js\\\"\u003e\u003c/script\u003e\\n\u003c/head\u003e\\n\u003cbody\u003e\\n \u003cdiv id=\\\"bar\\\"\u003e\u003c/div\u003e\\n \u003ch2 class=\\\"level js-level\\\"\u003e Level: ? \u003c/h2\u003e\\n \u003ch1 class=\\\"js-formula\\\"\u003e? + ? = ?\u003c/h1\u003e\\n \u003cdiv class=\\\"btn-group\\\"\u003e\\n \u003cbutton class=\\\"btn-yes js-yes\\\"\u003eO\u003c/button\u003e\\n \u003cbutton class=\\\"btn-no js-no\\\"\u003eX\u003c/button\u003e\\n \u003c/div\u003e\\n \u003ch2 class=\\\"gameover js-gameover\\\"\u003eGameOver\u003c/h2\u003e\\n\u003c/body\u003e\\n\u003c/html\u003e\",\"css\":\"body {\\n text-align: center;\\n color: #555555;\\n font-family: Arial;\\n}\\n\\nh1 {\\n font-size: 4rem;\\n}\\n\\n.gameover {\\n color: #ec6d67;\\n display: none;\\n}\\n\\n#bar {\\n width: 100%;\\n height: 10px;\\n background-color: #f1c40f;\\n margin-bottom: 60px;\\n}\\n\\n.btn-group {\\n width: 200px;\\n display: flex;\\n justify-content: center;\\n margin: 0 auto;\\n}\\n\\nbutton {\\n padding: .5rem 1.5rem;\\n font-size: 2rem;\\n font-weight: bold;\\n outline: none;\\n cursor: pointer;\\n}\\n\\n.btn-yes {\\n color: #2cbeff;\\n border: 3px solid #2cbeff;\\n}\\n\\n.btn-yes:hover {\\n color: #fff;\\n background-color: #2cbeff;\\n}\\n\\n.btn-no {\\n color: #ec6d67;\\n border: 3px solid #ec6d67;\\n}\\n\\n.btn-no:hover {\\n color: #fff;\\n background-color: #ec6d67;\\n}\",\"js\":\"\"}","created_at":"2023-07-23T20:14:43.536+08:00","updated_at":"2023-07-23T20:15:12.813+08:00","name":"【綜合練習】算術炸彈:實作 2 - 解答","language":"web","screenshot":{"url":null},"parent_id":574427,"plugin":"var timer = 0;\nvar level = 0;\nvar correct;\n\nfunction start () {\n var a = Math.floor(Math.random()*10);\n var b = Math.floor(Math.random()*10);\n var answer = a + b;\n \n correct = Math.random() \u003e 0.5;\n if (!correct) answer += 1 + Math.floor(Math.random()*5);\n \n timer = 0;\n level++;\n $('.js-level').text('level:' + level);\n $('.js-formula').text(`${a} + ${b} = ${answer}`);\n}\n\nfunction gameOver () {\n timer = 100;\n $('.js-gameover').show();\n $('button').hide();\n}\n\nstart();\n\n$('.js-yes').click(function () {\n if (correct) start();\n else gameOver();\n});\n\n$('.js-no').click(function () {\n if (!correct) start();\n else gameOver();\n});\n\n\nsetInterval(function () {\n timer += 0.1 + 0.01*level;\n $('#bar').css('width', timer + '%')\n if (timer \u003e 100) gameOver();\n});","description":null,"note":null,"status":"public","like_student_ids":[],"is_featured":false,"views":41,"hashid":"rdvs4epjw","is_content_changed":false,"review_status":"unsubmitted","submitted_at":null,"reviewed_at":null,"advise":null,"is_deleted":false}
[{"id":13034665,"file_name":"koding.png","project_id":574430,"asset_id":661677,"created_at":"2023-07-23T20:15:12.812+08:00","updated_at":"2023-07-23T20:15:12.812+08:00"}]
橘蘋學習平台
橘蘋學習平台
我的作品
檢視專案頁
匯出
複製
匯入
刪除
下載 Android APP (APK)
截圖
前往網站頁面
1:1:1
1:1
full
用手機掃描下方 QRCode 進行安裝
或您也可以
下載 APK
到這台電腦
用手機掃描下方 QRCode 進行安裝
或您也可以
下載 APK
到這台電腦