home๊ฐ•์˜ ํ™ˆ์œผ๋กœ
Section 0. ์ธํŠธ๋กœ
Lesson 4. ๐Ÿฐ HTML, CSS, JavaScript๊ฐ€ ๋ญ”๊ฐ€์š”?

์˜์ƒ์˜ ์ดˆ์‹œ๊ณ„ ์˜ˆ์ œ

์ฐธ๊ณ ๋กœ๋งŒ ์‚ดํŽด๋ณด์„ธ์š”. ๐Ÿ™‚

HTML ์ฝ”๋“œ

<!DOCTYPE html> <html lang="ko"> <head> <meta charset="UTF-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Yalco Stopwatch</title> <link rel="stylesheet" href="./style.css"> <script defer src="./script.js"></script> </head> <body> <div class="stopwatch"> <h1>yalco stopwatch</h1> <div class="stopwatch__interface"> <span id="screen">00:00:00</span> <button id="button">โ–ถ</button> </div> </div> </body> </html>

CSS ์ฝ”๋“œ

@import url('https://fonts.googleapis.com/css2?family=Press+Start+2P&display=swap'); @import url('https://fonts.googleapis.com/css2?family=Noto+Sans+KR&display=swap'); body, h1, button { all: unset; } body { display: flex; justify-content: center; align-items: center; width: 100vw; height: 100vh; background-color: #ddd; } .stopwatch { display: inline-block; padding: 48px 32px 72px 32px; background-color: white; border: 4px solid #aaa; border-radius: 24px; box-shadow: 4px 4px 12px rgba(0, 0, 0, 0.25); } .stopwatch h1 { display: block; margin-bottom: 16px; font-family: 'Noto Sans KR', sans-serif; text-transform:uppercase; color: gray; } .stopwatch__interface { display: flex; align-items: center; gap: 10px; } .stopwatch__interface > * { height: 72px; line-height: 72px; border-radius: 4px; } .stopwatch__interface span { display: inline-block; width: 248px; font-family: 'Press Start 2P', cursive; font-size: 1.6em; font-weight: bold; text-align: center; color: white; background-color: #555; } .stopwatch__interface button { width: 80px; font-family: 'Noto Sans KR', sans-serif; font-size: 1.6em; text-align: center; color: white; background-color: steelblue; cursor: pointer; transition: background-color 0.35s ease-in-out; }

JavaScript ์ฝ”๋“œ

const screen = document.getElementById('screen') const toggleButton = document.getElementById('button') let timeInterval let stopWatchOn = false let seconds = 0 toggleButton.addEventListener('click', () => { stopWatchOn = !stopWatchOn toggleButton.innerHTML = stopWatchOn ? 'โ– ' : 'โ–ถ' toggleButton.style.backgroundColor = stopWatchOn ? 'tomato' : 'steelblue' if (!stopWatchOn) { clearInterval(timeInterval) seconds = 0 screen.innerHTML = '00:00:00' } else { timeInterval = setInterval(() => { seconds++ const mm = String(Math.floor(seconds / 6000) % 60).padStart(2, '0') const ss = String(Math.floor(seconds / 100) % 60).padStart(2, '0') const cs = String(seconds % 100).padStart(2, '0') screen.innerHTML = `${mm}:${ss}:${cs}` }, 10); } })

๐Ÿค”์–„์ฝ”์—๊ฒŒ ์งˆ๋ฌธํ•˜๊ธฐ์งˆ๋ฌธ์€ ๋ฐ˜.๋“œ.์‹œ ์ด๋ฆฌ๋กœ ๋ณด๋‚ด์ฃผ์„ธ์š”! ( ๊ฐ•์˜์‚ฌ์ดํŠธ ์งˆ๋ฌธ๊ธฐ๋Šฅ โœ– )

๊ฐ•์˜์—์„œ ์ดํ•ด๊ฐ€ ์•ˆ ๋˜๊ฑฐ๋‚˜ ์‹ค์Šต์ƒ ๋ฌธ์ œ๊ฐ€ ์žˆ๋Š” ๋ถ€๋ถ„,
์„ค๋ช…์ด ์ž˜๋ชป๋˜์—ˆ๊ฑฐ๋‚˜ ๋ฏธํกํ•œ ๋ถ€๋ถ„์„ ๋ฉ”์ผ๋กœ ์•Œ๋ ค์ฃผ์„ธ์š”!

๋‹ต๋ณ€๋“œ๋ฆฐ ๋’ค ํ•„์š”ํ•  ๊ฒฝ์šฐ ๋ณธ ํŽ˜์ด์ง€์—
๊ด€๋ จ ๋‚ด์šฉ์„ ์ถ”๊ฐ€/์ˆ˜์ •ํ•˜๋„๋ก ํ•˜๊ฒ ์Šต๋‹ˆ๋‹ค.

์ด๋ฉ”์ผ ์ฃผ์†Œ
yalco@yalco.kr
๋ฉ”์ผ ์ œ๋ชฉ (๋ฐ˜๋“œ์‹œ ์•„๋ž˜ ์ œ๋ชฉ์„ ๋ถ™์—ฌ๋„ฃ์–ด์ฃผ์„ธ์š”!)
[์งˆ๋ฌธ] ์ œ๋Œ€๋กœ ํŒŒ๋Š” HTML & CSS (๋ฌด๋ฃŒ ํŒŒํŠธ) 0-4

๐Ÿ›‘์งˆ๋ฌธ ์ „ ํ•„๋…!!

  • ๊ตฌ๊ธ€๋ง์„ ๋จผ์ € ํ•ด ์ฃผ์„ธ์š”. ๋“ค์–ด์˜ค๋Š” ์งˆ๋ฌธ์˜ ์ ˆ๋ฐ˜ ์ด์ƒ์€ ๊ตฌ๊ธ€์— ๊ฒ€์ƒ‰ํ•ด ๋ณด๋ฉด 1๋ถ„ ์ด๋‚ด๋กœ ๋‹ต์„ ์ฐพ์„ ์ˆ˜ ์žˆ๋Š” ๋‚ด์šฉ๋“ค์ž…๋‹ˆ๋‹ค.
  • ์˜ค๋ฅ˜ ๋ฉ”์‹œ์ง€๊ฐ€ ์žˆ์„ ๊ฒฝ์šฐ ์ด๋ฅผ ๊ตฌ๊ธ€์— ๋ณต๋ถ™ํ•ด์„œ ๊ฒ€์ƒ‰ํ•ด๋ณด๋ฉด ๋Œ€๋ถ€๋ถ„ ์งง์€ ์‹œ๊ฐ„ ๋‚ด ํ•ด๊ฒฐ๋ฐฉ๋ฒ•์„ ์ฐพ์„ ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.
  • ๊ฐ•์˜ ํŽ˜์ด์ง€์— ์ถ”๊ฐ€์‚ฌํ•ญ ๋“ฑ ๋†“์นœ ๋ถ€๋ถ„์ด ์—†๋Š”์ง€ ํ™•์ธํ•ด์ฃผ์„ธ์š”. ์ž์ฃผ ๋“ค์–ด์˜ค๋Š” ์งˆ๋ฌธ์€ ํŽ˜์ด์ง€์— ์ถ”๊ฐ€์‚ฌํ•ญ์œผ๋กœ ์—…๋ฐ์ดํŠธ๋ฉ๋‹ˆ๋‹ค.
  • "์œ ๋ฃŒํŒŒํŠธ์˜ ๊ฐ•์˜ํŽ˜์ด์ง€๋Š” ์–ด๋”” ์žˆ๋‚˜์š”?" - ๊ฐ ์˜์ƒ์˜ ์‹œ์ž‘๋ถ€๋ถ„ ๊ฒ€์€ ํ™”๋ฉด๋งˆ๋‹ค ํ•ด๋‹น ์ฑ•ํ„ฐ์˜ ๊ฐ•์˜ํŽ˜์ด์ง€ ๋งํฌ๊ฐ€ ์žˆ์Šต๋‹ˆ๋‹ค.
  • ์งˆ๋ฌธ์„ ๋ณด๋‚ด์ฃผ์‹ค ๋•Œ๋Š” ๋ฌธ์ œ๊ฐ€ ์–ด๋–ป๊ฒŒ ๋ฐœ์ƒํ–ˆ๊ณ  ์–ด๋–ค ์ƒํ™ฉ์ธ์ง€ ๋“ฑ์„ ๊ตฌ์ฒด์ ์œผ๋กœ ์ ์–ด์ฃผ์„ธ์š”. ์Šคํฌ๋ฆฐ์ƒท์„ ์ฒจ๋ถ€ํ•ด์ฃผ์‹œ๋ฉด ๋”์šฑ ์ข‹์Šต๋‹ˆ๋‹ค.
๐ŸŒ Why not change the world?