[React] 타이머 만들기 react-compound-timer 라이브러리 활용
·
Project/Timer Project
react-compound-timer 라이브러리를 사용하여 타이머를 만들어보았다. https://www.npmjs.com/package/react-compound-timer react-compound-timer Timer compound react component www.npmjs.com 코드에 관한 설명은 위 링크 내용을 참고해주세요 import React from 'react' import Timer from 'react-compound-timer/build'; export default function SetTimer() { const Hours = Timer.Hours const Minutes = Timer.Minutes const Seconds = Timer.Seconds console.dir..
[JavaScript] 타이머 만들기 [배치 / 초기화버튼 / 마무리]
·
Project/Timer Project
결과 스타일 변경 초기화 기능을 추가 Font Awesome 아이콘은 fontawesome 위 사이트를 통해 받아왔다. 코드 [ timer.html ] 00:00:00 [ style.css ] 간단한 배치와, 크기만 설정해 주었다. .timer-box { display: flex; flex-direction: column; align-items: center; margin-top: 125px; } .timer { font-size: 60px; margin-bottom: 30px; transition: all 1s; } .timer-form__Btn { display: flex; flex-direction: row; justify-content: center; text-align: center; paddi..
[JavaScript] 타이머 만들기 [타이머 기능 구현 / 시작, 정지 버튼]
·
Project/Timer Project
개발 동기 타이머 어플을 사용하여 공부 시간을 측정하고 있는데, 배우고 있는 JavaScript를 통해 타이머를 직접 만들고 싶다는 생각이 들어서 만들게 되었다. 계획 매초 1씩 증가하는 타이머 기능을 만들 예정이다. 버튼(button)을 이용하여 타이머의 시작, 정지, 초기화 기능을 나타내 줄 예정이다. 타이머 기능 let TIME = 0; // 타이머 실행 버튼 function startButton() { updateTimer(); stopButton(); setInterval(updateTimer, 1000); // 매 초당 updateTimer 반복 } //... 생략 // 타이머 증가 함수 function updateTimer(){ const hours = Math.floor(TIME/3600)..