사용자 도구

사이트 도구


모르스_부호_변환기

차이

문서의 선택한 두 판 사이의 차이를 보여줍니다.

차이 보기로 링크

양쪽 이전 판이전 판
모르스_부호_변환기 [2026/09/05 09:25] akpil모르스_부호_변환기 [2026/09/05 09:28] (현재) akpil
줄 8: 줄 8:
  
 <code> <code>
- 
 # 2026.09.05  # 2026.09.05 
 # morse-letter to morse ver 0.7 # morse-letter to morse ver 0.7
줄 77: 줄 76:
             function playBeep(symbol) {             function playBeep(symbol) {
                 if (symbol === ' ' || symbol === '/') return 0; // 공백일 때는 비프음 소요 시간 0 반환                 if (symbol === ' ' || symbol === '/') return 0; // 공백일 때는 비프음 소요 시간 0 반환
-                +
                 const oscillator = audioCtx.createOscillator();                 const oscillator = audioCtx.createOscillator();
                 const gainNode = audioCtx.createGain();                 const gainNode = audioCtx.createGain();
-                +
                 oscillator.connect(gainNode);                 oscillator.connect(gainNode);
                 gainNode.connect(audioCtx.destination);                 gainNode.connect(audioCtx.destination);
                 oscillator.type = 'sine';                 oscillator.type = 'sine';
                 oscillator.frequency.setValueAtTime(600, audioCtx.currentTime);                 oscillator.frequency.setValueAtTime(600, audioCtx.currentTime);
-                +
                 const duration = (symbol === '-') ? 0.2 : 0.07;                 const duration = (symbol === '-') ? 0.2 : 0.07;
                 gainNode.gain.setValueAtTime(0.1, audioCtx.currentTime);                 gainNode.gain.setValueAtTime(0.1, audioCtx.currentTime);
-                +
                 oscillator.start();                 oscillator.start();
                 oscillator.stop(audioCtx.currentTime + duration);                 oscillator.stop(audioCtx.currentTime + duration);
-                +
                 return duration; // 재생된 시간 반환                 return duration; // 재생된 시간 반환
             }             }
줄 102: 줄 101:
                     unit.innerHTML = `<span class="char">${item.char === ' ' ? '공백' : item.char}</span><span class="morse" id="m-${item.id}"></span>`;                     unit.innerHTML = `<span class="char">${item.char === ' ' ? '공백' : item.char}</span><span class="morse" id="m-${item.id}"></span>`;
                     displayArea.appendChild(unit);                     displayArea.appendChild(unit);
-                    +
                     const morseSpan = document.getElementById(`m-${item.id}`);                     const morseSpan = document.getElementById(`m-${item.id}`);
-                    +
                     // 해당 문자의 모르스 부호를 한 기호씩 출력                     // 해당 문자의 모르스 부호를 한 기호씩 출력
                     for (const symbol of item.morse) {                     for (const symbol of item.morse) {
                         morseSpan.innerText += symbol;                         morseSpan.innerText += symbol;
-                        +
                         if (symbol === '/' || symbol === ' ') {                         if (symbol === '/' || symbol === ' ') {
                             // 스페이스 기호가 나오면 0.3초(300ms) 동안 대기                             // 스페이스 기호가 나오면 0.3초(300ms) 동안 대기
줄 137: 줄 136:
         # 자모 분리 및 대문자화         # 자모 분리 및 대문자화
         processed_chars = list(j2hcj(h2j(input_text.upper())))         processed_chars = list(j2hcj(h2j(input_text.upper())))
-        +
         for i, char in enumerate(processed_chars):         for i, char in enumerate(processed_chars):
             pair_data.append({             pair_data.append({
줄 144: 줄 143:
                 'morse': MORSE_DICT.get(char, char)                 'morse': MORSE_DICT.get(char, char)
             })             })
-            +
     return render_template_string(HTML_TEMPLATE, pair_data=pair_data, input_text=input_text)     return render_template_string(HTML_TEMPLATE, pair_data=pair_data, input_text=input_text)
  
모르스_부호_변환기.txt · 마지막으로 수정됨: 저자 akpil

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki