๋ณธ๋ฌธ ๋ฐ”๋กœ๊ฐ€๊ธฐ
  • Tried. Failed. Logged.
728x90

๐Ÿ–ฅ๏ธํ”„๋ก ํŠธ์—”๋“œ/HTML | CSS | JAVASCRIPT28

์ž๋ฐ”์Šคํฌ๋ฆฝํŠธ - text to speech(text2speech)(SpeechSynthesisUtterance) function say(m) { var msg = new SpeechSynthesisUtterance(); var voices = window.speechSynthesis.getVoices(); msg.voice = voices[10]; msg.voiceURI = "native"; msg.volume = 1; msg.rate = 1; msg.pitch = 0.8; msg.text = m; msg.lang = 'en-US'; speechSynthesis.speak(msg); } ์ถœ์ฒ˜: https://stackoverflow.com/questions/15653145/using-google-text-to-speech-in-javascript Using Google Text-To-Speech in Javascr.. 2022. 11. 5.
์ž๋ฐ”์Šคํฌ๋ฆฝํŠธ - ๋‚ด ์ปดํ“จํ„ฐ GPU(๊ทธ๋ž˜ํ”ฝ ์นด๋“œ) ์ •๋ณด ๊ฐ€์ ธ์˜ค๊ธฐ(WebGL) var canvas = document.createElement('canvas'); var gl; var debugInfo; var vendor; var renderer; try { gl = canvas.getContext('webgl') || canvas.getContext('experimental-webgl'); } catch (e) { } if (gl) { debugInfo = gl.getExtension('WEBGL_debug_renderer_info'); vendor = gl.getParameter(debugInfo.UNMASKED_VENDOR_WEBGL); renderer = gl.getParameter(debugInfo.UNMASKED_RENDERER_WEBGL); } console.log(.. 2022. 10. 12.
์ž๋ฐ”์Šคํฌ๋ฆฝํŠธ - Pure JavaScript HTML5 to (Animated) GIF Conversion HTML5๋ฅผ GIF๋กœ ๋ณ€ํ™˜ ์‹œํ‚ค๋Š” ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ https://github.com/antimatter15/jsgif/ GitHub - antimatter15/jsgif: Save a HTML5 Canvas to GIF and Animations. A port of as3gif GIFPlayer to JS Save a HTML5 Canvas to GIF and Animations. A port of as3gif GIFPlayer to JS - GitHub - antimatter15/jsgif: Save a HTML5 Canvas to GIF and Animations. A port of as3gif GIFPlayer to JS github.com 2022. 10. 12.
html - debugger(๊ฐœ๋ฐœ์ž ๋„๊ตฌ ๋ฐฉ์ง€) ๋น„ํ™œ์„ฑํ™” https://janger.tistory.com/222 html - ๊ฐœ๋ฐœ์ž ๋„๊ตฌ ๋ง‰๊ธฐ(์‚ฌ์šฉํ•˜๊ธฐ ํž˜๋“ค๊ฒŒ) (function () { (function a() { try { (function b(i) { if (('' + (i / i)).length !== 1 || i % 20 === 0) { (function () { }).constructor('debugger')() } else { debugger } b(++i) } )(0) } catch (e) { s.. janger.tistory.com (function anonymous( ) { debugger }) ์œ„ ๊ฐ™์€ ๊ฐœ๋ฐœ์ž ๋„๊ตฌ๋ฅผ ๋ง‰์œผ๋ ค๊ณ  ์ผ๋ถ€๋กœ debugger๋กœ ๋ธŒ๋ ˆ์ดํฌ ํฌ์ธํŠธ๋ฅผ ์ฃผ๋Š” ์Šคํฌ๋ฆฝํŠธ๊ฐ€ ์กด์žฌํ•  ๊ฒฝ์šฐ ๊ฐœ๋ฐœ์ž ๋„๊ตฌ์—์„œ Sources ํƒญ์— ๋“ค์–ด๊ฐ„ ๋‹ค.. 2022. 8. 16.
CSS - ์ธ๋ผ์ธ ์ฝ”๋“œ ๋ธ”๋Ÿญ ๋Œ€์ถฉ ์ด๋Ÿฐ๊ฒƒ์ž…๋‹ˆ๋‹ค. /* ์ธ๋ผ์ธ ์ฝ”๋“œ ๋ธ”๋Ÿญ */ code { padding: 0.25rem; background-color: #F1F1F1; border-radius: 5px; box-shadow: 0.25px 0.25px 10px rgb(156, 156, 156); font-family: "Consolas", "Sans Mono", "Courier", "monospace"; font-size: 1.0rem; } ์ฐธ๊ณ : https://wordbe.tistory.com/entry/%EC%9D%B8%EB%9D%BC%EC%9D%B8-%EC%BD%94%EB%93%9C%EB%B8%94%EB%9F%AD-%EC%BD%94%EB%93%9C-%EA%B0%95%EC%A1%B0-%EC%BD%94%EB%93%9C-%EB%B0.. 2022. 7. 30.
์ž๋ฐ”์Šคํฌ๋ฆฝํŠธ - for in๊ณผ for of ์ฐจ์ด์  ์ƒ๊น€์ƒˆ var arr = [2, 5, 7, 9, 12]; // for in for(const item in arr){ console.log(item); } // for of for(const item of arr){ console.log(item) } ์ƒ๊น€์ƒˆ๋Š” ์ด๋ ‡๊ฒŒ ์ƒ๊ฒผ์Šต๋‹ˆ๋‹ค. ๋‘˜ ๋‹ค ๋„ˆ๋ฌด ๋˜‘๊ฐ™์ด ์ƒ๊ฒจ์„œ ๊ฐ€๋” ์‚ฌ์šฉํ•˜๋ ค๊ณ  ํ•  ๋•Œ๋งˆ๋‹ค ํ˜ผ๋ž€์ด ์ƒ๊น๋‹ˆ๋‹ค. ์ง€๊ธˆ๋ถ€ํ„ฐ ์ด๋Ÿฐ ์‹์œผ๋กœ ์™ธ์šฐ์‹œ๋ฉด ๋ฉ๋‹ˆ๋‹ค. for in์€ ๊ฐ์ฒด(ํ‚ค ๊ฐ’) ์ˆœํ™˜ for of์€ ๋ฐฐ์—ด ์ˆœํ™˜ ์ฐธ๊ณ ๋กœ ์ƒ๋‹จ ์ฝ”๋“œ์˜ ์‹คํ–‰ ๊ฒฐ๊ณผ๋Š” ์ด๋ ‡์Šต๋‹ˆ๋‹ค. // for in 0 1 2 3 4 // for of 2 5 7 9 12 for of๋Š” ๋ฐฐ์—ด์˜ ๊ฐ’์„ ์ˆœ์„œ๋Œ€๋กœ ์ž˜ ์ถœ๋ ฅํ•˜๋Š” ๋ฐ˜๋ฉด์— for in์€ 0, 1, 2, 3 ๊ฐ™์€ ์ˆซ์ž์˜ ์ˆœํ™˜์„ ๋ฐ˜ํ™˜ํ•ฉ๋‹ˆ๋‹ค. ๋ฐ”๋กœ ๋ˆˆ์น˜์ฑˆ ์‚ฌ๋žŒ๋„ ์žˆ.. 2022. 7. 30.
์ž๋ฐ”์Šคํฌ๋ฆฝํŠธ - map์™€ forEach์˜ ์ฐจ์ด์  Array.prototype.map() map() ๋ฉ”์„œ๋“œ๋Š” ๋ฐฐ์—ด ๋‚ด์˜ ๋ชจ๋“  ์š”์†Œ ๊ฐ๊ฐ์— ๋Œ€ํ•˜์—ฌ ์ฃผ์–ด์ง„ ํ•จ์ˆ˜๋ฅผ ํ˜ธ์ถœํ•œ ๊ฒฐ๊ณผ๋ฅผ ๋ชจ์•„ ์ƒˆ๋กœ์šด ๋ฐฐ์—ด์„ ๋ฐ˜ํ™˜ํ•ฉ๋‹ˆ๋‹ค. ์‹œ๋„ํ•ด๋ณด๊ธฐ Array.prototype.forEach() forEach() ๋ฉ”์„œ๋“œ๋Š” ์ฃผ์–ด์ง„ ํ•จ์ˆ˜๋ฅผ ๋ฐฐ์—ด ์š”์†Œ ๊ฐ๊ฐ์— ๋Œ€ํ•ด ์‹คํ–‰ํ•ฉ๋‹ˆ๋‹ค. ์‹œ๋„ํ•ด๋ณด๊ธฐ map ๋ฉ”์„œ๋“œ์™€ forEach ๋ฉ”์„œ๋“œ์˜ ์ฐจ์ด์  ํฐ ์ฐจ์ด์ ์€ return ๊ฐ’์„ ๋ฐ˜ํ™˜ํ•˜๋ƒ ์•ˆ ํ•˜๋ƒ๊ฐ€ ์žˆ์Šต๋‹ˆ๋‹ค. const map1 = array1.map(x => x * 2); console.log(map1); // [2, 8, 18, 32] ์šฐ์„  map ๊ฐ™์€ ๊ฒฝ์šฐ๋Š” ์ฝœ๋ฐฑ ํ•จ์ˆ˜์˜ ์‹คํ–‰ ๊ฒฐ๊ณผ๋ฅผ return์„ ๊ทธ ๊ฒฐ๊ณผ๋“ค์„ ๋ฐฐ์—ด ํ˜•ํƒœ๋กœ ๋ณ€์ˆ˜์— ์ €์žฅํ•ฉ๋‹ˆ๋‹ค. array1.forEach(element => console.l.. 2022. 7. 30.
์ž๋ฐ”์Šคํฌ๋ฆฝํŠธ - ์‚ฌ์šฉ์ž ๊ณ ์œ ์˜ ํ”„๋กœํ•„ ์‚ฌ์ง„(Identicon) ๊ฐ€๋” ์ปค๋ฎค๋‹ˆํ‹ฐ ์‚ฌ์ดํŠธ๋ฅผ ์ด์šฉํ•˜๋‹ค๋ณด๋ฉด ์œ„์™€ ๊ฐ™์€ ํ˜•ํƒœ์˜ ์‚ฌ์šฉ์ž ํ”„๋กœํ•„๋“ค์„ ํ™•์ธํ•  ์ˆ˜ ์žˆ๋Š”๋ฐ ์ด๋Š” ์‚ฌ์šฉ์ž์˜ ๊ณ ์œ ํ•œ ๋ฒˆํ˜ธ๋กœ ๋งŒ๋“ค์–ด๋‚ด๋Š” ์‚ฌ์šฉ์ž ์‹๋ณ„ ํ”„๋กœํ•„ ์‚ฌ์ง„์ด๋‹ค. ์ •ํ™•ํ•œ ๋ช…์นญ์€ Identicon์ž„. ์ž๋ฐ”์Šคํฌ๋ฆฝํŠธ๋งŒ์„ ์‚ฌ์šฉํ•ด์„œ ๋งŒ๋“ค์—ˆ๋‹ค๊ณ  ํ•œ๋‹ค. ์˜คํ”ˆ์†Œ์Šค์ด๋ฏ€๋กœ ์ง์ ‘ ๊นƒํ—ˆ๋ธŒ์—์„œ ๋‹ค์šดํ•ด์„œ ๋ณธ์ธ์ด ์šด์˜ํ•˜๋Š” ์‚ฌ์ดํŠธ์—๋‹ค ์ ์šฉํ•ด๋„๋œ๋‹ค. https://github.com/stewartlord/identicon.js GitHub - stewartlord/identicon.js: GitHub-style identicons as PNGs or SVGs in JS GitHub-style identicons as PNGs or SVGs in JS . Contribute to stewartlord/identicon.js developm.. 2022. 7. 21.
์ž๋ฐ”์Šคํฌ๋ฆฝํŠธ - Web Notification API(์œˆ๋„์šฐ ์•Œ๋žŒ ๊ธฐ๋Šฅ) window.onload = function () { // ์›น ํŽ˜์ด์ง€ ๋กœ๋“œ ํ›„์— ์•Œ๋ฆผ ๊ถŒํ•œ ํ™•์ธ if (window.Notification) { Notification.requestPermission(); } } function notify() { if (Notification.permission !== 'granted') { alert('notification is disabled'); } else { var notification = new Notification('Notification title', { icon: 'http://cdn.sstatic.net/stackexchange/img/logos/so/so-icon.png', body: 'Notification text', }); notifica.. 2022. 6. 22.
์ž๋ฐ”์Šคํฌ๋ฆฝํŠธ - alertBox function alertBox(msg, delay = 3000){ var container = document.createElement('div'); container.setAttribute('class', 'alertBox-container'); container.style.width = '100%'; container.style.height = '100px'; container.style.position = 'fixed'; container.style.bottom = '0'; container.style.display = 'flex'; container.style.justifyContent = 'center'; var box = document.createElement('div'); box.styl.. 2022. 4. 10.
html - ๊ฐœ๋ฐœ์ž ๋„๊ตฌ ๋ง‰๊ธฐ(์‚ฌ์šฉํ•˜๊ธฐ ํž˜๋“ค๊ฒŒ) (function () { (function a() { try { (function b(i) { if (('' + (i / i)).length !== 1 || i % 20 === 0) { (function () { }).constructor('debugger')() } else { debugger } b(++i) } )(0) } catch (e) { setTimeout(a, 700) } } )() } )(); 2022. 2. 24.
์ž๋ฐ”์Šคํฌ๋ฆฝํŠธ - localStorage์— ํด๋ž˜์Šค ๋ณ€์ˆ˜ ์ €์žฅํ•˜๊ธฐ localStorage.setItem('Todos', JSON.stringify(todosList)); if( localStorage.getItem('Todos') != null && localStorage.getItem('Todos') != undefined && localStorage.getItem('Todos') != '' && localStorage.getItem('Todos') != '[]' ){ todosList = JSON.parse( localStorage.getItem('Todos') ); } 2022. 2. 10.
728x90