{"id":889900,"student_id":10,"content":"{\"html\":\"\u003c!DOCTYPE html\u003e\\n\u003chtml\u003e\\n\u003chead\u003e\\n\\t\u003ctitle\u003eDocument\u003c/title\u003e\\n \u003cscript src=\\\"https://code.jquery.com/jquery-3.2.1.min.js\\\"\u003e\u003c/script\u003e\\n\u003c/head\u003e\\n\u003cbody\u003e\\n \u003ch1\u003eTic Tac Toe\u003c/h1\u003e\\n \u003cdiv class=\\\"grid\\\"\u003e\\n \u003cdiv id=\\\"a\\\"\u003e\u003c/div\u003e\\n \u003cdiv id=\\\"b\\\"\u003e\u003c/div\u003e\\n \u003cdiv id=\\\"c\\\"\u003e\u003c/div\u003e\\n \u003cdiv id=\\\"d\\\"\u003e\u003c/div\u003e\\n \u003cdiv id=\\\"e\\\"\u003e\u003c/div\u003e\\n \u003cdiv id=\\\"f\\\"\u003e\u003c/div\u003e\\n \u003cdiv id=\\\"g\\\"\u003e\u003c/div\u003e\\n \u003cdiv id=\\\"h\\\"\u003e\u003c/div\u003e\\n \u003cdiv id=\\\"i\\\"\u003e\u003c/div\u003e\\n \u003c/div\u003e\\n \u003cbutton\u003e再來一局!\u003c/button\u003e\\n\u003c/body\u003e\\n\u003c/html\u003e\",\"css\":\"/* 預設程式部分 */\\nbody {\\n text-align: center;\\n}\\n\\nh1 {\\n color: #dc685a; /* 給學生複製紅色色碼 */\\n}\\n\\nbutton {\\n padding: 10px;\\n border-width: 0px;\\n border-radius: 5px;\\n margin: 15px;\\n font-size: 16px;\\n color: #fff;\\n background-color: #ecaf4f; /* 給學生複製橘色色碼 */\\n}\\n\\n/* 以下學生要完成的部分 */\\n.grid {\\n width: 330px;\\n height: 330px;\\n margin: auto;\\n}\\n\\n.grid div {\\n width: 100px;\\n height: 100px;\\n border-radius: 10px;\\n margin: 5px;\\n float: left;\\n line-height: 100px;\\n font-size: 4rem;\\n font-weight: bold;\\n color: #ffffff;\\n background-color: #555555;\\n text-shadow: 0px 0px 10px #999;\\n box-shadow: 0px 0px 10px #999;\\n cursor: pointer;\\n transition: background-color 0.2s;\\n}\\n\\n.grid div:hover {\\n background-color: #333333;\\n}\",\"js\":\"\"}","created_at":"2024-11-20T15:19:24.540+08:00","updated_at":"2024-11-20T15:19:45.354+08:00","name":"井字遊戲(試玩版)","language":"web","screenshot":{"url":"/uploads/project/screenshot/889900/bcd752a8691aa31d5ed4c140dc048570.jpg"},"parent_id":3,"plugin":"var current = 'O';\n\n$('.grid div').click(function () {\n if ($(this).text() == '') {\n $(this).text(current);\n if (current == 'O') {\n current = 'X';\n $(this).css('background-color', '#ecaf4f'); // 橘色\n } else {\n current = 'O';\n $(this).css('background-color', '#dc685a'); // 紅色\n }\n }\n\n var a = $('#a').text();\n var b = $('#b').text();\n var c = $('#c').text();\n var d = $('#d').text();\n var e = $('#e').text();\n var f = $('#f').text();\n var g = $('#g').text();\n var h = $('#h').text();\n var i = $('#i').text();\n check(a, b, c);\n check(d, e, f);\n check(g, h, i);\n check(a, d, g);\n check(b, e, h);\n check(c, f, i);\n check(a, e, i);\n check(c, e, g);\n});\n\nfunction check(x, y, z) {\n if (x == y \u0026\u0026 y == z \u0026\u0026 x != '') {\n $('h1').text(x + '獲勝');\n }\n}\n\n$('button').click(function () {\n $('h1').text('Tic Tac Toe');\n $('.grid div').text('');\n $('.grid div').css('background-color', ''); // 為什麼不是設定 #555 ? 因為這樣 hover 的屬性就會失效!\n});","description":null,"note":null,"status":"public","like_student_ids":[],"is_featured":false,"views":251,"hashid":"p93s3ykp3","is_content_changed":false,"review_status":"unsubmitted","submitted_at":null,"reviewed_at":null,"advise":null,"is_deleted":false}
[]
Orange Apple Learning Platform
My Projects
View Project Page
Export
Remix
Import
Delete
Download Android APP (APK)
Screenshot
Open Web Site
繁中
简中
English
日本語
1:1:1
1:1
Full Width
Scan the QRCode below with your phone to install
Or you can
download APK
to this computer
Scan the QRCode below with your phone to install
Or you can
download APK
to this computer