{"id":42622,"student_id":86,"content":"{\"html\":\"\u003c!DOCTYPE html\u003e\\n\u003chtml\u003e\\n\u003chead\u003e\\n\\t\u003ctitle\u003eDocument\u003c/title\u003e\\n \u003clink rel=\\\"stylesheet\\\" href=\\\"https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css\\\"\u003e\\n \u003cscript src=\\\"https://code.jquery.com/jquery-3.2.1.slim.min.js\\\"\u003e\u003c/script\u003e\\n \u003cscript src=\\\"https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.12.9/umd/popper.min.js\\\"\u003e\u003c/script\u003e\\n \u003cscript src=\\\"https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.min.js\\\"\u003e\u003c/script\u003e\\n\u003c/head\u003e\\n\u003cbody class=\\\"p-3\\\"\u003e\\n \u003cimg src=\\\"tomato.png\\\" class=\\\"tomato-sm\\\"\u003e x\u003cspan class=\\\"js-collect\\\"\u003e0\u003c/span\u003e\\n \u003cdiv class=\\\"center\\\"\u003e\\n \u003cimg src=\\\"tomato.png\\\" class=\\\"tomato-lg js-tomato\\\"\u003e\\n \u003cp class=\\\"timer js-timer\\\"\u003e00:00\u003c/p\u003e\\n \u003cbutton class=\\\"btn btn-danger js-start\\\"\u003erun\u003c/button\u003e\\n \u003c/div\u003e\\n\u003c/body\u003e\\n\u003c/html\u003e\",\"css\":\"body {\\n background-color: #f7df56;\\n font-family: Monaco;\\n}\\n\\n.center {\\n text-align: center;\\n position: absolute;\\n top: 50vh;\\n left: 50vw;\\n color: rgba(255,255,255,.7);\\n transform: translate(-50%, -50%);\\n}\\n\\n.timer {\\n font-size: 5em;\\n font-weight: bold;\\n}\\n\\n.tomato-sm {\\n width: 20px;\\n}\\n\\n.tomato-lg:hover {\\n transform: scale(1.3);\\n}\\n\",\"js\":\"//初始變數設定\\nvar word = [\\\"等待工作\\\",\\\"工作中\\\",\\\"等待休息\\\",\\\"休息中\\\"];\\nvar statue = word[0];\\nvar collect = 0;\\nvar time;\\nvar minute;\\nvar second;\\ncollect = DB.variables.collect || 0;\\n$(\\\".js-collect\\\").text(collect);\\n\\n//初始化\\n$(\\\".js-tomato\\\").hide();\\n\\n//按鈕\\n$(\\\".js-start\\\").click(function(){\\n if (statue === word[0]) {\\n time = 1500;\\n statue = word[1];\\n } else if (statue === word[2]) {\\n time = 300;\\n statue = word[3];\\n }\\n});\\n\\n//番茄\\n$(\\\".js-tomato\\\").click(function(){\\n $(this).hide();\\n collect ++;\\n DB.variables.set(\\\"collect\\\", collect);\\n $(\\\".js-collect\\\").text(collect);\\n});\\n\\n//一秒執行迴圈\\nsetInterval(function(){\\n\\n //分秒計算\\n minute = Math.floor(time / 60);\\n second = time % 60;\\n \\n //狀態切換\\n if (statue === word[1] || statue === word[3]) {\\n \\n //顯示計算\\n if (minute \u003c 10) {\\n if (second \u003c 10) {\\n $(\\\".js-timer\\\").text(\\\"0\\\" + minute + \\\":\\\" + \\\"0\\\" + second);\\n } else {\\n $(\\\".js-timer\\\").text(\\\"0\\\" + minute + \\\":\\\" + second);\\n } \\n } else {\\n if (second \u003c 10) {\\n $(\\\".js-timer\\\").text(minute + \\\":\\\" + \\\"0\\\" + second);\\n } else {\\n $(\\\".js-timer\\\").text(minute + \\\":\\\" + second);\\n }\\n }\\n \\n //避免負值時間\\n if (time \u003e -1){\\n time --;\\n }\\n \\n //狀態機\\n if (time === -1) {\\n if (statue === word[1]) {\\n statue = word[2];\\n alert(\\\"時間到囉!\\\");\\n } else if (statue === word[3]) {\\n statue = word[0];\\n alert(\\\"時間到囉!\\\");\\n $(\\\".js-tomato\\\").show()\\n }\\n }\\n }\\n}, 1000);\"}","created_at":"2018-09-15T16:08:49.532+08:00","updated_at":"2019-11-02T17:32:02.421+08:00","name":"番茄時鐘 副本","language":"web","screenshot":{"url":"https://cdn0.koding.school/uploads/project/screenshot/42622/fe0e122fdf7f79dd2b4aecbcff48cae5.jpg"},"parent_id":22503,"plugin":"","description":null,"note":null,"status":"public","like_student_ids":[],"is_featured":false,"views":122,"hashid":"jzmsz3jj","is_content_changed":false,"review_status":"unsubmitted","submitted_at":null,"reviewed_at":null,"advise":null,"is_deleted":false}
[{"id":748916,"file_name":"tomato.png","project_id":42622,"asset_id":51614,"created_at":"2018-09-15T16:08:49.540+08:00","updated_at":"2018-09-15T16:08:49.540+08:00"}]
橘蘋學習平台
我的作品
檢視專案頁
匯出
複製
匯入
刪除
下載 Android APP (APK)
截圖
前往網站頁面
繁中
简中
English
日本語
1:1:1
1:1
全寬
用手機掃描下方 QRCode 進行安裝
或您也可以
下載 APK
到這台電腦
用手機掃描下方 QRCode 進行安裝
或您也可以
下載 APK
到這台電腦