누가봐도 인생 1회차의 기록장

전체 글 77

[노마드코더] 바닐라 JS로 크롬 앱 만들기 #07 (weather)

getCurrentPosition() : 장치의 현재 위치를 가져옴 openwhathermap 사이트 : https://openweathermap.org/ Сurrent weather and forecast - OpenWeatherMap Access current weather data for any location on Earth including over 200,000 cities! The data is frequently updated based on the global and local weather models, satellites, radars and a vast network of weather stations. how to obtain APIs (subscriptions w openweat..

[노마드코더] 바닐라 JS로 크롬 앱 만들기 #06 (to do list)

JSON.stringify () : javaScript 값이나 객체를 string(문자열)으로 만들어줌 JSON.parse() : JSON 문자열의 구문을 분석하고, 그 결과에서 JavaScript 값이나 객체를 생성함 fliter() : 지우고 싶은 (배열)아이템을 제외함, 넣고 싶은 아이템은 반드시 true로 리턴함, filter 는 원래 array를 변경하지 않고 새 array를 생성함 // filter 예제 function abc(item) { return item !==3 } [1,2,3,4,5].filter(abc); // 결과 [1,2,4,5] parseInt() : 문자열을 숫자로 바꿔줌 to do list 만들기 const toDoForm = document.querySelector("#..

[노마드코더] 바닐라 JS로 크롬 앱 만들기 #05 (quotes, background)

Math.random() : 랜덤한 숫자 Math.ceil() : 올림 Math.round() : 반올림 Math:floor() : 내림 랜덤하게 노래 / 가수 제목 표시하기 ( Quotes 대신) const quotes = [ { title : "꽃길만 걷자", singer : "버블 사운드" }, { title : "있잖아", singer : "데이식스" }, { title : "너를 생각해", singer : "주시크" }, { title : "savage", singer : "aespa" }, { title : "My Universe", singer : "방탄소년단" }, { title : "나의 첫사랑", singer : "다비치" }, { title : "Only You", singer : "..

[노마드코더] 바닐라 JS로 크롬 앱 만들기 #04 (clock)

setIntervals : '매 n초/분…마다' 무언가를 실행하고 싶을 때 사용 setTimeout : 일정 시간 후에 실행하게 함 new Date : 오늘 날짜 (getDate/Day/FullYear/Hours/Minutes/Second) padStart() : string에 쓰는 함수로 원하는 글자수를 만들 때 (앞부분에 string을 추가하여) 사용 ↔ padEnd() "1".padStart(2,"0") // padStart(원하는글자수, "추가할 글자") // 결과 "01" 시계만들기 const clock = document.querySelector("#clock") function getClock (){ const date = new Date(); const hours = String(date...

[노마드코더] 바닐라 JS로 크롬 앱 만들기 #03 (greetings)

username 입력받고 저장하고 불러오기 const loginForm = document.querySelector("#login-form"); const loginInput = document.querySelector("#login-form input"); const greeting = document.querySelector("#greeting"); const HIDDEN_CLASSNAME = "hidden"; const USERNAME_KEY = "username"; function onLoginSubmit (event){ event.preventDefault(); // 브라우저 기본동작 막기 loginForm.classList.add(HIDDEN_CLASSNAME) // form 다시 숨겨주기 c..