diff --git "a/yoojin/\353\205\270\353\247\210\353\223\234/app.js" "b/yoojin/\353\205\270\353\247\210\353\223\234/app.js" deleted file mode 100644 index 6417946..0000000 --- "a/yoojin/\353\205\270\353\247\210\353\223\234/app.js" +++ /dev/null @@ -1,12 +0,0 @@ -const loginInput = document.querySelector("#login-form input"); -const loginButton = document.querySelector("#login-form button"); - -function onLoginBtnClick() { - console.log("hello", loginInput.value); -} - -if (loginButton) { - loginButton.addEventListener("click", onLoginBtnClick); -} else { - console.error("loginButton이 존재하지 않습니다."); -} diff --git "a/yoojin/\353\205\270\353\247\210\353\223\234/css/style.css" "b/yoojin/\353\205\270\353\247\210\353\223\234/css/style.css" new file mode 100644 index 0000000..f4d336f --- /dev/null +++ "b/yoojin/\353\205\270\353\247\210\353\223\234/css/style.css" @@ -0,0 +1,3 @@ +.hidden { + display: none; +} diff --git "a/yoojin/\353\205\270\353\247\210\353\223\234/img/0.jpeg" "b/yoojin/\353\205\270\353\247\210\353\223\234/img/0.jpeg" new file mode 100644 index 0000000..b299ec9 Binary files /dev/null and "b/yoojin/\353\205\270\353\247\210\353\223\234/img/0.jpeg" differ diff --git "a/yoojin/\353\205\270\353\247\210\353\223\234/img/1.jpeg" "b/yoojin/\353\205\270\353\247\210\353\223\234/img/1.jpeg" new file mode 100644 index 0000000..d6535bc Binary files /dev/null and "b/yoojin/\353\205\270\353\247\210\353\223\234/img/1.jpeg" differ diff --git "a/yoojin/\353\205\270\353\247\210\353\223\234/img/2.jpeg" "b/yoojin/\353\205\270\353\247\210\353\223\234/img/2.jpeg" new file mode 100644 index 0000000..01aee9e Binary files /dev/null and "b/yoojin/\353\205\270\353\247\210\353\223\234/img/2.jpeg" differ diff --git "a/yoojin/\353\205\270\353\247\210\353\223\234/index.html" "b/yoojin/\353\205\270\353\247\210\353\223\234/index.html" index d77a8bb..9441b58 100644 --- "a/yoojin/\353\205\270\353\247\210\353\223\234/index.html" +++ "b/yoojin/\353\205\270\353\247\210\353\223\234/index.html" @@ -1,16 +1,34 @@ - - - + Momentum App -
- - +
+ + +
+

00:00:00

+

+
+ +
+ +
+ +
- + + + + + + diff --git "a/yoojin/\353\205\270\353\247\210\353\223\234/js/app.js" "b/yoojin/\353\205\270\353\247\210\353\223\234/js/app.js" new file mode 100644 index 0000000..cf25d50 --- /dev/null +++ "b/yoojin/\353\205\270\353\247\210\353\223\234/js/app.js" @@ -0,0 +1,14 @@ +const loginForm = document.querySelector("#login-form"); +const loginInput = document.querySelector("#login-form input"); +const greeting = document.querySelector("#greeting"); + +function onLoginSubmit(event) { + event.preventDefault(); + loginForm.classList.add("hidden"); + const username = loginInput.value; + console.log(username); + greeting.innerText = "Hello " + username; + greeting.classList.remove("hidden"); +} + +loginForm.addEventListener("submit", onLoginSubmit); diff --git "a/yoojin/\353\205\270\353\247\210\353\223\234/js/background.js" "b/yoojin/\353\205\270\353\247\210\353\223\234/js/background.js" new file mode 100644 index 0000000..7e587ab --- /dev/null +++ "b/yoojin/\353\205\270\353\247\210\353\223\234/js/background.js" @@ -0,0 +1,6 @@ +const images = ["0.jpeg", "1.jpeg", "2.jpeg"]; +const chosenImage = images[Math.floor(Math.random() * images.length)]; + +const bgImage = document.createElement("img"); +bgImage.src = `img/${chosenImage}`; +document.body.appendChild(bgImage); diff --git "a/yoojin/\353\205\270\353\247\210\353\223\234/js/clock.js" "b/yoojin/\353\205\270\353\247\210\353\223\234/js/clock.js" new file mode 100644 index 0000000..528bc96 --- /dev/null +++ "b/yoojin/\353\205\270\353\247\210\353\223\234/js/clock.js" @@ -0,0 +1,11 @@ +const clock = document.querySelector("h2#clock"); + +function getClock() { + const date = new Date(); + const hours = String(date.getHours()).padStart(2, "0"); + const minutes = String(date.getMinutes()).padStart(2, "0"); + const seconds = String(date.getSeconds()).padStart(2, "0"); + clock.innerText = `${hours}:${minutes}:${seconds}`; +} +getClock(); +setInterval(getClock, 1000); diff --git "a/yoojin/\353\205\270\353\247\210\353\223\234/js/greetings.js" "b/yoojin/\353\205\270\353\247\210\353\223\234/js/greetings.js" new file mode 100644 index 0000000..1eaf235 --- /dev/null +++ "b/yoojin/\353\205\270\353\247\210\353\223\234/js/greetings.js" @@ -0,0 +1,28 @@ +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); + const username = loginInput.value; + localStorage.setItem(USERNAME_KEY, username); + paintingGreetings(username); +} + +function paintingGreetings(username) { + greeting.innerText = "Hello " + username; + greeting.classList.remove(HIDDEN_CLASSNAME); +} + +const savedUsername = localStorage.getItem(USERNAME_KEY); + +if (savedUsername === null) { + loginForm.classList.remove(HIDDEN_CLASSNAME); + loginForm.addEventListener("submit", onLoginSubmit); +} else { + paintingGreetings(savedUsername); +} diff --git "a/yoojin/\353\205\270\353\247\210\353\223\234/js/quotes.js" "b/yoojin/\353\205\270\353\247\210\353\223\234/js/quotes.js" new file mode 100644 index 0000000..eedfe84 --- /dev/null +++ "b/yoojin/\353\205\270\353\247\210\353\223\234/js/quotes.js" @@ -0,0 +1,58 @@ +const quotes = [ + { + quote: + "Without continuous personal development, you are now all that you will ever become and hell starts when the person you are meets the person you could have been.", + author: "Eli Cohen", + }, + { + quote: + "Working hard for something we don't care about is called stressed, working hard for something we love is called passion.", + author: "Simon Sinek", + }, + { + quote: + "Move out of your comfort zone. You can only grow if you are willing to feel awkward and uncomfortable when you try something new.", + author: "Brian Tracy", + }, + { + quote: + "Don't let the fear of losing be greater than the excitement of winning.", + author: "Robert Kiyosaki", + }, + { + quote: + "Develop success from failures. Discouragement and failure are two of the surest stepping stones to success.", + author: "Dale Carnegie", + }, + { + quote: "Action is the foundational key to all success.", + author: "Pablo Picasso", + }, + { + quote: + "The difference between a successful person and others is not a lack of strength, not a lack of knowledge, but rather a lack of will.", + author: "Vince Lombardi", + }, + { + quote: + "It is your determination and persistence that will make you a successful person.", + author: "Kenneth J Hutchins", + }, + { + quote: + "You can waste your life drawing lines. Or you can live your life crossing them.", + author: "Shonda Rhimes", + }, + { + quote: "Be poor, humble and driven. Don't be afraid to shift or pivot.", + author: "Alex Rodriguez", + }, +]; + +const quoteText = document.querySelector("#quote span:first-child"); +const authorText = document.querySelector("#quote span:last-child"); + +const todaysQuote = quotes[Math.floor(Math.random() * quotes.length)]; + +quoteText.innerText = todaysQuote.quote; +authorText.innerText = todaysQuote.author; diff --git "a/yoojin/\353\205\270\353\247\210\353\223\234/js/todo.js" "b/yoojin/\353\205\270\353\247\210\353\223\234/js/todo.js" new file mode 100644 index 0000000..e1cdbee --- /dev/null +++ "b/yoojin/\353\205\270\353\247\210\353\223\234/js/todo.js" @@ -0,0 +1,11 @@ +const toDoFrom = document.getElementById("todo-form"); +const toDoInput = toDoFrom.querySelector("input"); +const toDoList = document.getElementById("todo-list"); + +function handleToDoSubmit(event) { + event.preventDefault(); + const newTodo = toDoInput.value; + toDoInput.value = ""; +} + +toDoFrom.addEventListener("submit", handleToDoSubmit); diff --git "a/yoojin/\353\205\270\353\247\210\353\223\234/style.css" "b/yoojin/\353\205\270\353\247\210\353\223\234/style.css" deleted file mode 100644 index e69de29..0000000