{"id":44570,"student_id":183,"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 read = $('#text').val()\\n var code = ''\\n var split = read.split(\\\" \\\")\\n split.forEach(function(w) {\\n var array = w.split(\\\"\\\")\\n array.forEach(function(a) {\\n code += encodeTable[a] + ' '\\n })\\n code += ' '\\n })\\n $('#text').val(code)\\n}\\n\\n// 解碼\\nfunction decode () {\\n var read = $('#text').val()\\n read = read.trim()\\n var code = ''\\n var split = read.split(\\\" \\\")\\n split.forEach(function(w) {\\n var array = w.split(\\\" \\\")\\n array.forEach(function(a) {\\n code += decodeTable[a]\\n })\\n code += ' '\\n })\\n $('#text').val(code)\\n}\\n\\n// 播放\\nfunction play () {\\n var read = $('#text').val()\\n var split = read.split(\\\"\\\")\\n function run() {\\n var t = split.shift()\\n if (t == '.') {\\n playNote(5000, 100)\\n setTimeout(run, 200);\\n }\\n if (t == '-') {\\n playNote(5000, 400)\\n setTimeout(run, 600);\\n }\\n if (t == ' ') {\\n setTimeout(run, 500);\\n }\\n }\\n run()\\n}\"}","created_at":"2018-10-06T19:48:39.192+08:00","updated_at":"2019-11-12T10:29:54.642+08:00","name":"摩斯密碼 副本","language":"web","screenshot":{"url":"https://cdn4.koding.school/uploads/project/screenshot/44570/c88dbbd1f448ae2240f4ab8ea5cdd032.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":73,"hashid":"yeys49v2","is_content_changed":false,"review_status":"unsubmitted","submitted_at":null,"reviewed_at":null,"advise":null,"is_deleted":false}
[{"id":785142,"file_name":"dust.png","project_id":44570,"asset_id":51276,"created_at":"2018-10-06T19:48:39.201+08:00","updated_at":"2018-10-06T19:48:39.201+08:00"}]
橘蘋學習平台
橘蘋學習平台
我的作品
檢視專案頁
匯出
複製
匯入
刪除
下載 Android APP (APK)
截圖
前往網站頁面
1:1:1
1:1
full
用手機掃描下方 QRCode 進行安裝
或您也可以
下載 APK
到這台電腦
用手機掃描下方 QRCode 進行安裝
或您也可以
下載 APK
到這台電腦