{"id":135760,"student_id":1404,"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.0/css/bootstrap.min.css\\\"\u003e\\n \u003cscript src=\\\"https://code.jquery.com/jquery-3.3.1.slim.min.js\\\"\u003e\u003c/script\u003e\\n \u003cscript src=\\\"https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.0/umd/popper.min.js\\\"\u003e\u003c/script\u003e\\n \u003cscript src=\\\"https://stackpath.bootstrapcdn.com/bootstrap/4.1.0/js/bootstrap.min.js\\\"\u003e\u003c/script\u003e\\n\u003c/head\u003e\\n\u003cbody class=\\\"py-4 px-5\\\"\u003e\\n \u003ch3 class=\\\"text-center\\\"\u003e凱薩密碼\u003c/h3\u003e\\n \u003cdiv class=\\\"form-group\\\"\u003e\\n \u003ctextarea class=\\\"form-control js-text\\\" rows=\\\"8\\\" placeholder=\\\"要加密解密的訊息...\\\"\u003e\\nI have a orange, I have a apple\\nuh! orangeapple!\\n \u003c/textarea\u003e\\n \u003c/div\u003e\\n \u003cdiv class=\\\"form-group\\\"\u003e\\n \u003cinput class=\\\"form-control js-offset\\\" type=\\\"number\\\" placeholder=\\\"位移\\\" value=\\\"0\\\"\u003e\\n \u003c/div\u003e\\n \u003cdiv class=\\\"text-center\\\"\u003e\\n \u003cbutton class=\\\"btn btn-warning js-encrypto\\\"\u003e加密\u003c/button\u003e\\n \u003cbutton class=\\\"btn btn-danger js-decrypto\\\"\u003e解密\u003c/button\u003e\\n \u003c/div\u003e\\n\u003c/body\u003e\\n\u003c/html\u003e\",\"css\":\"body {\\n background-color: #222;\\n background-image: url('dust.png');\\n}\",\"js\":\"var alphabet = 'abcdefghijklmnopqrstuvwxyz';\\n\\n// 加密\\n$('.js-encrypto').click(function () {\\n var text = $(\\\".js-text\\\").val();\\n var offset = parseInt($(\\\".js-offset\\\").val());\\n var answer = \\\"\\\";\\n for (var i = 0; i \u003c text.length; i++) {\\n // console.log(text[i]);\\n if (alphabet.indexOf(text[i]) == -1) {\\n //非字母(空格、句號、逗號),不要位移\\n answer += text[i];\\n } else {\\n //字母,要位移\\n var offset_now = alphabet.indexOf(text[i]);\\n var offset_new = offset_now + offset;\\n offset_new = offset_new % 26;\\n answer += alphabet[offset_new];\\n }\\n }\\n $(\\\".js-text\\\").val(answer);\\n});\\n\\n// 解密\\n$('.js-decrypto').click(function () {\\n var text = $(\\\".js-text\\\").val();\\n var offset = parseInt($(\\\".js-offset\\\").val());\\n var answer = \\\"\\\";\\n for (var i = 0; i \u003c text.length; i++) {\\n // console.log(text[i]);\\n if (alphabet.indexOf(text[i]) == -1) {\\n //非字母(空格、句號、逗號),不要位移\\n answer += text[i];\\n } else {\\n //字母,要位移\\n var offset_now = alphabet.indexOf(text[i]);\\n var offset_new = offset_now - offset;\\n offset_new = (offset_new+26) % 26;\\n answer += alphabet[offset_new];\\n }\\n }\\n $(\\\".js-text\\\").val(answer);\\n});\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n// var code = '';\\n// var text = $('.js-text').val();\\n// var offset = $('.js-offset').val();\\n// offset = parseInt(offset);\\n\\n// for (var i=0; i\u003ctext.length; i++) {\\n// var idx = alphabet.indexOf(text[i]);\\n// if (idx != -1) {\\n// idx = (idx + offset)%26;\\n// code += alphabet[idx];\\n// } else {\\n// code += text[i];\\n// }\\n// }\\n// $('.js-text').val(code);\\n\\n// var code = '';\\n// var text = $('.js-text').val();\\n// var offset = $('.js-offset').val();\\n// offset = parseInt(offset);\\n\\n// for (var i=0; i\u003ctext.length; i++) {\\n// var idx = alphabet.indexOf(text[i]);\\n// if (idx != -1) {\\n// idx = (idx - offset + 26)%26;\\n// code += alphabet[idx];\\n// } else {\\n// code += text[i];\\n// }\\n// }\\n\\n// $('.js-text').val(code);\"}","created_at":"2020-03-21T15:48:44.068+08:00","updated_at":"2020-03-28T18:20:22.869+08:00","name":"凱薩密碼 副本","language":"web","screenshot":{"url":"https://cdn1.koding.school/uploads/project/screenshot/135760/cc7a4397d95151b9ddf8db6b7a6f4702.jpg"},"parent_id":33463,"plugin":"","description":null,"note":null,"status":"public","like_student_ids":[],"is_featured":false,"views":68,"hashid":"6rpswj45","is_content_changed":false,"review_status":"unsubmitted","submitted_at":null,"reviewed_at":null,"advise":null,"is_deleted":false}
[{"id":2335852,"file_name":"dust.png","project_id":135760,"asset_id":74596,"created_at":"2020-03-21T15:48:44.075+08:00","updated_at":"2020-03-21T15:48:44.075+08:00"}]
橘蘋學習平台
橘蘋學習平台
我的作品
檢視專案頁
匯出
複製
匯入
刪除
下載 Android APP (APK)
截圖
前往網站頁面
1:1:1
1:1
full
用手機掃描下方 QRCode 進行安裝
或您也可以
下載 APK
到這台電腦
用手機掃描下方 QRCode 進行安裝
或您也可以
下載 APK
到這台電腦