{"id":147987,"student_id":2002,"content":"{\"html\":\"\u003c!DOCTYPE html\u003e\\n\u003chtml\u003e\\n\u003chead\u003e\\n\\t\u003ctitle\u003eDocument\u003c/title\u003e\\n\\t\u003clink rel=\\\"stylesheet\\\" href=\\\"https://stackpath.bootstrapcdn.com/bootstrap/4.1.0/css/bootstrap.min.css\\\" integrity=\\\"sha384-9gVQ4dYFwwWSjIDZnLEWnxCjeSWFphJiwGPXr1jddIhOegiu1FwO5qRGvFXOdJZ4\\\" crossorigin=\\\"anonymous\\\"\u003e\\n\\t\u003cscript src=\\\"https://code.jquery.com/jquery-3.3.1.slim.min.js\\\" integrity=\\\"sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo\\\" crossorigin=\\\"anonymous\\\"\u003e\u003c/script\u003e\\n \u003cscript src=\\\"https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.0/umd/popper.min.js\\\" integrity=\\\"sha384-cs/chFZiN24E4KMATLdqdvsezGxaGsi4hLGOzlXwp5UZB1LY//20VyM2taTB4QvJ\\\" crossorigin=\\\"anonymous\\\"\u003e\u003c/script\u003e\\n \u003cscript src=\\\"https://stackpath.bootstrapcdn.com/bootstrap/4.1.0/js/bootstrap.min.js\\\" integrity=\\\"sha384-uefMccjFJAIv6A+rW+L4AHf99KvxDjWSu1z9VI8SKNVmz4sk7buKt/6v9KI65qnm\\\" crossorigin=\\\"anonymous\\\"\u003e\u003c/script\u003e\\n\u003c/head\u003e\\n\u003cbody class=\\\"text-center p-4\\\"\u003e\\n \u003ch2\u003e摩斯密碼\u003c/h2\u003e\\n \u003ctextarea class=\\\"form-control\\\" rows=\\\"8\\\" cols=\\\"40\\\" id=\\\"text\\\"\u003e\u003c/textarea\u003e\\n \u003cdiv class=\\\"m-2\\\"\u003e\\n \u003cbutton class=\\\"btn btn-primary\\\" id=\\\"encode\\\"\u003e編碼\u003c/button\u003e\\n \u003cbutton class=\\\"btn btn-primary\\\" id=\\\"decode\\\"\u003e解碼\u003c/button\u003e\\n \u003cbutton class=\\\"btn btn-primary\\\" id=\\\"play\\\"\u003e播放\u003c/button\u003e \\n \u003c/div\u003e\\n\u003c/body\u003e\\n\u003c/html\u003e\",\"css\":\"body {\\n background-image: url('dust.png');\\n}\",\"js\":\"/**\\n* encodeTable -\u003e 編碼用對照表\\n* decodeTable -\u003e 解碼用對照表\\n*/\\n$('#decode').click(decode);\\n$('#encode').click(encode);\\n$('#play').click(play);\\n\\n// 編碼\\nfunction encode () {\\n var text = \\\" \\\";\\n var input = $(\\\"#text\\\").val();\\n input.split(\\\" \\\").forEach(function (w) {\\n w.split(\\\"\\\").forEach(function (a) {\\n text += encodeTable[a] + \\\" \\\";\\n });\\n text += \\\" \\\";\\n });\\n text = text.trim();\\n $(\\\"#text\\\").val(text);\\n}\\n\\n// 解碼\\nfunction decode () {\\n var text = \\\" \\\";\\n var input = $(\\\"#text\\\").val();\\n input.split(\\\" \\\").forEach(function (w) {\\n w.split(\\\" \\\").forEach(function (a) {\\n text += decodeTable[a] + \\\" \\\";\\n });\\n text += \\\" \\\";\\n });\\n text = text.trim();\\n $(\\\"#text\\\").val(text);\\n}\\n\\n// 播放\\nfunction play () {\\n var code = $(\\\".form-control\\\").val().split(\\\"\\\");\\n run();\\n function run() {\\n var c = code.shift();\\n if (c == \\\".\\\") {\\n playNote(500, 50);\\n }\\n if (c == \\\"-\\\") {\\n playNote(500, 200);\\n }\\n if (c == \\\".\\\") {\\n setTimeout(run, 150);\\n }\\n if (c == \\\"-\\\") {\\n setTimeout(run, 300);\\n }\\n if (c == \\\" \\\") {\\n setTimeout(run , 100);\\n }\\n }\\n}\"}","created_at":"2020-05-10T13:45:37.949+08:00","updated_at":"2020-05-10T15:08:09.512+08:00","name":"摩斯密碼 副本","language":"web","screenshot":{"url":"https://cdn2.koding.school/uploads/project/screenshot/147987/01a1e7ab7250d3b92109cc7b37275864.jpg"},"parent_id":33465,"plugin":"var encodeTable = {\n A: '.-',\n B: '-...',\n C: '-.-.',\n D: '-..',\n E: '.',\n F: '..-.',\n G: '--.',\n H: '....',\n I: '..',\n J: '.---',\n K: '-.-',\n L: '.-..',\n M: '--',\n N: '-.',\n O: '---',\n P: '.--.',\n Q: '--.-',\n R: '.-.',\n S: '...',\n T: '-',\n U: '..-',\n V: '...-',\n W: '.--',\n X: '-..-',\n Y: '-.--',\n Z: '--..',\n a: '.-',\n b: '-...',\n c: '-.-.',\n d: '-..',\n e: '.',\n f: '..-.',\n g: '--.',\n h: '....',\n i: '..',\n j: '.---',\n k: '-.-',\n l: '.-..',\n m: '--',\n n: '-.',\n o: '---',\n p: '.--.',\n q: '--.-',\n r: '.-.',\n s: '...',\n t: '-',\n u: '..-',\n v: '...-',\n w: '.--',\n x: '-..-',\n y: '-.--',\n z: '--..',\n 1: '.----',\n 2: '..---',\n 3: '...--',\n 4: '....-',\n 5: '.....',\n 6: '-....',\n 7: '--...',\n 8: '---..',\n 9: '----.',\n 0: '-----',\n '.': '.-.-.-',\n ':': '---...',\n ',': '--..--',\n ';': '-.-.-.',\n '?': '..--..',\n '=': '-...-',\n \"'\": '.----.',\n '/': '-..-.',\n '!': '-.-.--',\n '-': '-....-',\n '_': '..--.-',\n '\"': '.-..-.',\n '(': '-.--.',\n ')': '-.--.-',\n '$': '...-..-',\n '\u0026': '.-...',\n '@': '.--.-.',\n '+': '.-.-.'\n}\n\nvar decodeTable = {};\nfor (var key in encodeTable) {\n decodeTable[encodeTable[key]] = key;\n}\n\nvar audioCtx = new (window.AudioContext || window.webkitAudioContext)();\n\nfunction playNote(frequency, duration) {\n // create Oscillator node\n var oscillator = audioCtx.createOscillator();\n\n oscillator.type = 'square';\n oscillator.frequency.value = frequency; // value in hertz\n oscillator.connect(audioCtx.destination);\n oscillator.start();\n\n setTimeout(\n function(){\n oscillator.stop();\n }, duration);\n}","description":null,"note":null,"status":"public","like_student_ids":[],"is_featured":false,"views":51,"hashid":"rdvskerp","is_content_changed":false,"review_status":"unsubmitted","submitted_at":null,"reviewed_at":null,"advise":null,"is_deleted":false}
[{"id":2561904,"file_name":"dust.png","project_id":147987,"asset_id":51276,"created_at":"2020-05-10T13:45:37.954+08:00","updated_at":"2020-05-10T13:45:37.954+08:00"}]
橘蘋學習平台
橘蘋學習平台
我的作品
檢視專案頁
匯出
複製
匯入
刪除
下載 Android APP (APK)
截圖
前往網站頁面
1:1:1
1:1
full
用手機掃描下方 QRCode 進行安裝
或您也可以
下載 APK
到這台電腦
用手機掃描下方 QRCode 進行安裝
或您也可以
下載 APK
到這台電腦