js

    ๋‚˜๋งŒ์˜ cli ๋งŒ๋“ค์–ด์„œ npm ํŒจํ‚ค์ง€ ๋ฐฐํฌํ•ด๋ณด๊ธฐ

    ๋‚˜๋งŒ์˜ cli ๋งŒ๋“ค์–ด์„œ npm ํŒจํ‚ค์ง€ ๋ฐฐํฌํ•ด๋ณด๊ธฐ

    ๊ฐ€์ž…ํ•˜๊ธฐ https://www.npmjs.com/ npm | Home Bring the best of open source to you, your team, and your company Relied upon by more than 17 million developers worldwide, npm is committed to making JavaScript development elegant, productive, and safe. The free npm Registry has become the center of Java www.npmjs.com ๋จผ์ € npm ํŒจํ‚ค์ง€ ๋ฐฐํฌ๋ฅผ ์œ„ํ•ด npm ์‚ฌ์ดํŠธ์— ๊ฐ€์ž…์ด ๋˜์–ด ์žˆ์–ด์•ผ ํ•œ๋‹ค. 2. $ mkdir [๋””๋ ‰ํ† ๋ฆฌ๋ช…] $ cd [๋””๋ ‰ํ† ๋ฆฌ๋ช…] $ npm init npm..

    ์›น ํŽ˜์ด์ง€์— lottie ํŒŒ์ผ ์ ์šฉํ•ด๋ณด๊ธฐ

    ์›น ํŽ˜์ด์ง€์— lottie ํŒŒ์ผ ์ ์šฉํ•ด๋ณด๊ธฐ

    ๐Ÿ‘€ lottie ๋””์ž์ด๋„ˆ ๋ถ„๊ป˜์„œ lottie json์„ ๋งŒ๋“ค์–ด์ฃผ์…จ๋‹ค. โœ… html ํŽ˜์ด์ง€์— ์ ์šฉํ•ด๋ณด์ž ๐Ÿ“Œ ๊ณต์‹๋ฌธ์„œ ๋ณด๊ธฐ Lottie Docs airbnb.io ๋กœํ‹ฐ : ์—์–ด๋น„์•ค๋น„์—์„œ ๊ฐœ๋ฐœํ•œ ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ ์• ๋‹ˆ๋ฉ”์ด์…˜์€ ๋ฐฑํ„ฐ ๊ธฐ๋ฐ˜, svg๋กœ ์ €์žฅ ๋œ๋‹ค. ๐Ÿ“Œ CDN https://cdnjs.com/libraries/lottie-web lottie-web - Libraries - cdnjs - The #1 free and open source CDN built to make life easier for developers After Effects plugin for exporting animations to SVG + JavaScript or canvas + JavaScript - Simple. Fast. Reli..

    Js, lastindexof ์™€ substring ์„ ์ด์šฉํ•˜์—ฌ ํŒŒ์ผ ํ™•์žฅ์ž ์ถ”์ถœํ•˜๊ธฐ

    Js, lastindexof ์™€ substring ์„ ์ด์šฉํ•˜์—ฌ ํŒŒ์ผ ํ™•์žฅ์ž ์ถ”์ถœํ•˜๊ธฐ

    function getFileExtension(fileName) { let fileLegnth = fileName.length; // ๊ฐ€์žฅ ๋งˆ์ง€๋ง‰์˜ . ์˜ ์œ„์น˜ let lastDot = fileName.lastIndexOf('.'); // .์˜ ๋‹ค์Œ ์œ„์น˜๋ถ€ํ„ฐ ํŒŒ์ผ ์ด ๊ธธ์ด๊นŒ์ง€ let fileExtension = fileName.substring(lastDot + 1 , fileLegnth).toLowercase(); return fileExtension; } .lastIndexOf() ๋ฌธ์ž์—ด ์œ„์น˜๋ฅผ ์ฐพ์Šต๋‹ˆ๋‹ค. indexOf() ์™€ ๋ฐ˜๋Œ€๋กœ ๋’ค์—์„œ๋ถ€ํ„ฐ ์‹œ์ž‘ํ•˜์—ฌ ์ฐพ์•„์คŒ .substring() ํŠน์ • ๋ฌธ์ž์—ด์„ ์ž˜๋ผ๋‚ด์–ด ๋ฐ˜ํ™˜ํ•œ๋‹ค. substring(start, end) ์‹œ์ž‘์œ„์น˜์—์„œ ์ข…๋ฃŒ ์œ„์น˜๊นŒ์ง€ ๋ฌธ์ž์—ด์„ ์ž๋ฅธ๋‹ค. ..

    swiper ๋งˆ์šฐ์Šค ์˜ฌ๋ ธ์„ ๋•Œ ์Šฌ๋ผ์ด๋“œ ์ผ์‹œ์ •์ง€ autoplay stop

    swiper ๋งˆ์šฐ์Šค ์˜ฌ๋ ธ์„ ๋•Œ ์Šฌ๋ผ์ด๋“œ ์ผ์‹œ์ •์ง€ autoplay stop

    swiper ์Šฌ๋ผ์ด๋“œ์— ๋งˆ์šฐ์Šค๋ฅผ ์˜ฌ๋ ธ์„ ๋•Œ ์Šฌ๋ผ์ด๋“œ ๋™์ž‘์„ ์ผ์‹œ์ ์œผ๋กœ ์ •์ง€ํ•˜๊ณ  ์‹ถ์€ ๊ฒฝ์šฐ See the Pen swiper 2 - autoplay stop on hover by jaeheekim (@jaehee) on CodePen. $('.swiper').hover(function() { swiper.autoplay.stop(); }, function(){ swiper.autoplay.start(); }); swiper.autoplay.stop() swiper.autoplay.start() ๋‘ ๊ฐœ ์†์„ฑ์„ ์ด์šฉํ•˜์—ฌ ๋งˆ์šฐ์Šค๊ฐ€ ์˜ฌ๋ ค์กŒ์„ ๋•Œ๋Š” ์Šฌ๋ผ์ด๋“œ stop() ๊ทธ ์™ธ๋Š” ๋‹ค์‹œ start๋กœ ์ ์šฉ๋˜๊ฒŒ๋” ํ•œ๋‹ค. ์ด๋•Œ ์Šฌ๋ผ์ด๋“œ ๋™์ž‘์ด ๋ฉˆ์ถœ ๋•Œ ๊ธฐ์ค€์€ ํ•˜๋‚˜ slider ๊ธฐ์ค€ ํ•˜๋‚˜์˜ ์Šฌ๋ผ์ด๋“œ ์ฒ˜์Œ๊ณผ ๋์ด ๋ชจ๋‘ ์‹œ์ž‘๊ณผ ..

    js ์˜ค๋Š˜ ๋‚ ์งœ YYYY-MM-DD ๋กœ ๋‚˜ํƒ€๋‚ด๊ธฐ

    js ์˜ค๋Š˜ ๋‚ ์งœ YYYY-MM-DD ๋กœ ๋‚˜ํƒ€๋‚ด๊ธฐ

    new Date() const date = new Date(); console.log(date) //Mon Apr 03 2023 13:16:27 GMT+0900 (ํ•œ๊ตญ ํ‘œ์ค€์‹œ) ๋‚ ์งœ ๊ฐ€์ ธ์˜ค๊ธฐ const date = new Date(); const year = date.getFullYear(); const month = date.getMonth(); const day = date.getDate(); console.log(year, month, day); //2023 3 3 //ํ˜„์žฌ ๋‚ ์งœ 2023๋…„ 4์›” 3์ผ ์›” ์ •๋ณด๋ฅผ ๊ฐ€์ ธ์˜ค๊ธฐ ์œ„ํ•ด getMonth()๋ฅผ ํ™œ์šฉํ–ˆ๋‹ค. ์ฃผ์˜ํ•  ์ ์€ 1์›”์€ 0๋ถ€ํ„ฐ ์‹œ์ž‘ํ•˜์—ฌ 12์›”์€ 11๋กœ ๋‚˜ํƒ€๋‚˜๊ธฐ์— +1์„ ํ•ด์ค˜์•ผํ•จ YYYY-MM-DD ํ˜•์‹์œผ๋กœ const date = new Dat..

    ๋‘ ๊ฐœ swiper๋ฅผ ์ด์šฉํ•œ ๋ถ€๋“œ๋Ÿฝ๊ฒŒ ํ๋ฅด๋Š” ์Šฌ๋ผ์ด๋“œ ๋งŒ๋“ค๊ธฐ

    ๋‘ ๊ฐœ swiper๋ฅผ ์ด์šฉํ•œ ๋ถ€๋“œ๋Ÿฝ๊ฒŒ ํ๋ฅด๋Š” ์Šฌ๋ผ์ด๋“œ ๋งŒ๋“ค๊ธฐ

    ๊ฐ„ํ˜น ์ž‘์—…ํ•˜๋‹ค๋ณด๋ฉด ํ๋ฅด๋Š” ๋ฐฐ๋„ˆ์ผ๊นŒ ์Šฌ๋ผ์ด๋“œ์ผ๊นŒ ํ•˜๋Š” ๋ถ€๋ถ„์ด ํ•„์š”ํ•  ๋•Œ๊ฐ€ ์žˆ๋‹ค ์• ๋‹ˆ๋ฉ”์ด์…˜ ์š”์†Œ๋กœ๋„ ๋งŒ๋“ค ์ˆ˜ ์žˆ์ง€๋งŒ swiper๋ฅผ ์ด์šฉํ•œ ์Šฌ๋ผ์ด๋“œ๋กœ ๋งŒ๋“ค์–ด๋ณด๊ธฐ smooth motion of slide ๐Ÿงต ์กฐ๊ฑด ์Šฌ๋ผ์ด๋“œ 2๊ฐœ๊ฐ€ ์„œ๋กœ ๋‹ค๋ฅธ ๋ฐฉํ–ฅ์œผ๋กœ ํ˜๋Ÿฌ๊ฐ€์•ผํ•จ ( ์˜ค๋ฅธ์ชฝ->์™ผ์ชฝ / ์™ผ์ชฝ ->์˜ค๋ฅธ์ชฝ) swiper loop ์˜ต์…˜์„ ์‚ฌ์šฉํ•˜์—ฌ ๋ฌดํ•œ์œผ๋กœ ๋Œ์•„์•ผํ•จ ๋ถ€๋“œ๋Ÿฝ๊ฒŒ ํ๋ฅด๋Š” ์ด๋ฏธ์ง€ ๐Ÿ”ง HTML/CSS/JS 1. HTML 1 2 3 4 5 6 7 8 9 10 1 2 3 4 5 6 7 8 9 10 html layout ์€ swiper js Doc ๊ธฐ๋ณธ๊ตฌ์กฐ๋ฅผ ์ ์šฉํ•˜์—ฌ ์ง„ํ–‰ํ–ˆ๋‹ค. ๋‘ ๊ฐœ์˜ ์Šฌ๋ผ์ด๋“œ๊ฐ€ ์„œ๋กœ ๋‹ค๋ฅธ ๋ฐฉํ–ฅ์œผ๋กœ ํ˜๋Ÿฌ๊ฐ€์•ผ ํ•˜๊ธฐ ๋•Œ๋ฌธ์— ltr rtl ๋ฅผ ์‚ฌ์šฉํ•ด์•ผ ํ•œ๋‹ค. ์ปจํ…Œ์ด๋„ˆ ์š”์†Œ์— ์Šฌ๋ผ์ด๋“œ ๋ฐฉํ–ฅ์„ ์ง€์ •ํ•ด์ฃผ๋Š” ๊ฒƒ์ธ๋ฐ l..

    textarea ๊ธ€์ž์ˆ˜ ์นด์šดํŠธ ๊ธฐ๋Šฅ ๋ฐ ์ œํ•œ

    textarea ๊ธ€์ž์ˆ˜ ์นด์šดํŠธ ๊ธฐ๋Šฅ ๋ฐ ์ œํ•œ

    https://jsfiddle.net/ug98cxsr/ Edit fiddle - JSFiddle - Code Playground jsfiddle.net html ๊ธ€์”จ๋ฅผ ์“ธ ๊ณต๊ฐ„์ธ textarea ์ž…๋ ฅ์ฐฝ์„ ๋งŒ๋“  ํ›„ jQuery ๊ธ€์”จ๊ฐ€ ์ž…๋ ฅ๋  ๋•Œ ๋งˆ๋‹ค => keyup ์ด๋ฒคํŠธ ์•„๋ž˜ ๋ฐ๋ชจ๋ณด๊ธฐ https://jsfiddle.net/ug98cxsr/ Edit fiddle - JSFiddle - Code Playground jsfiddle.net

    tooltip ํˆดํŒ ๋ฌด๋ฃŒ ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ

    tooltip ํˆดํŒ ๋ฌด๋ฃŒ ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ

    ๋‹ค์–‘ํ•œ ๊ธฐ๋Šฅ์„ ๊ฐ€์ง„ ํˆดํŒ(tooltip) ํ™•์ธ ํ•  ์ˆ˜ ์žˆ๋Š” ๋ฌด๋ฃŒ ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ๋ฅผ ์†Œ๊ฐœํ•ฉ๋‹ˆ๋‹ค. 1. popper.js ๋งŽ์ด ์‚ฌ์šฉํ•˜๊ณ  ๋ถ€ํŠธ์ŠคํŠธ๋žฉ์—๋„ ๋“ค์–ด๊ฐ€ ์žˆ๋Š” ํˆดํŒ ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ ! ์šฉ๋Ÿ‰์ด ์ž‘์•„ ์‚ฌ์šฉ๊ฐ์ด ์ข‹๋‹ค๋Š” ์žฅ์ ์ด ์žˆ์Œ https://popper.js.org/ Home Positioning tooltips and popovers is difficult. Popper is here to help! Popper is the de facto standard to position tooltips and popovers in modern web applications. popper.js.org 2. Tippy.js tippy.js๋Š” popper.js๋ฅผ ๊ธฐ๋ฐ˜์œผ๋กœ ์—…๊ทธ๋ ˆ์ด๋“œํ™”ํ•œ ํ”Œ๋Ÿฌ๊ทธ์ธ์œผ๋กœ popper.js์˜ ์Šคํฌ๋กค ์•ก์…˜..