{"id":53538,"student_id":10,"content":"{\"html\":\"\u003c!DOCTYPE html\u003e\\n\u003chtml\u003e\\n\u003chead\u003e\\n \u003ctitle\u003eDocument\u003c/title\u003e\\n \u003clink rel=\\\"stylesheet\\\" href=\\\"https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css\\\"\u003e\\n\u003c/head\u003e\\n\u003cbody\u003e\\n \u003cdiv class=\\\"chatbox\\\"\u003e\\n \u003ch5 class=\\\"text-center\\\"\u003eChatBot\u003c/h5\u003e\\n \u003cdiv class=\\\"comments js-comment\\\"\u003e\\n \u003c/div\u003e\\n \u003cinput class=\\\"form-control js-input\\\" placeholder=\\\"說些什麼...\\\" value=\\\"你好\\\"\u003e\\n \u003c/div\u003e\\n \u003cscript src=\\\"https://unpkg.com/rivescript@latest/dist/rivescript.min.js\\\" type=\\\"application/javascript\\\" charset=\\\"utf-8\\\"\u003e\u003c/script\u003e\\n\u003c/body\u003e\\n\u003c/html\u003e\",\"css\":\"body {\\n width: 100vw;\\n height: 100vh;\\n padding: 10px;\\n}\\n\\nh5 {\\n position: absolute;\\n top: 0;\\n width: 100%;\\n border-bottom: 2px solid #ddd;\\n padding-bottom: 10px;\\n color: #666;\\n background-color: #fff;\\n z-index: 1;\\n}\\n\\n.chatbox {\\n max-width: 550px;\\n height: calc(100vh - 20px);\\n margin: auto;\\n position: relative;\\n \\n}\\n\\n.chatbox input {\\n position: absolute;\\n bottom: 0;\\n}\\n\\n.comments {\\n position: absolute;\\n top: 0;\\n left: 0;\\n width: 100%;\\n height: 100%;\\n padding: 50px 10px;\\n overflow-y: scroll;\\n}\\n\\n.comment span {\\n display: inline-block;\\n max-width: 75%;\\n padding: 8px;\\n border-radius: 20px;\\n font-size: .9rem;\\n}\\n\\n.comment.comment-right {\\n text-align: right;\\n}\\n\\n.comment.comment-right span {\\n color: #fff;\\n background-color: rgb(59, 114, 241);\\n}\\n\\n.comment.comment-left span {\\n color: #555;\\n background-color: rgb(210, 210, 210);\\n}\",\"js\":\"var code = \\n`\\n+ (哈囉|你好|嗨|hi|hello)\\n- 你好\\n- 好久不見\\n\\n`\\n\\nfunction talk (text) {\\n \\n};\"}","created_at":"2019-01-10T17:31:35.424+08:00","updated_at":"2019-11-09T18:53:13.633+08:00","name":"ALICE 副本","language":"web","screenshot":{"url":null},"parent_id":52801,"plugin":"var input = document.querySelector('.js-input');\nvar comment = document.querySelector('.js-comment');\n\ninput.addEventListener('keydown', function (e) {\n if (e.keyCode === 13) {\n input.setAttribute('disabled', true);\n var q = input.value;\n addComment(q, 'right');\n setTimeout(function () {\n // addComment(talk(q), 'left');\n talk(q);\n input.removeAttribute('disabled');\n input.focus();\n }, 300 + Math.random()*1000);\n input.value = '';\n }\n});\n\nfunction addComment (text, who) {\n var html = '\u003cp class=\"comment comment-{float}\"\u003e\u003cspan\u003e{text}\u003c/span\u003e\u003c/p\u003e';\n comment.innerHTML += html.replace('{float}', who).replace('{text}', text);\n comment.scrollTop = comment.scrollHeight;\n}","description":null,"note":null,"status":"public","like_student_ids":[],"is_featured":false,"views":512,"hashid":"yeys5w2m","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