From 116ebcd40a02d69da4caeafaeb6de40373d35ad7 Mon Sep 17 00:00:00 2001 From: Yonghyun Date: Mon, 16 Aug 2021 20:35:18 +0900 Subject: [PATCH 1/5] make login without js --- css/login.css | 53 +++++++++++++++++++++++++++++++++++++++++++++ css/style.css | 8 +++++++ index.html | 38 ++++++++++++++++++++++++++++++++ javascript/login.js | 0 login.html | 23 -------------------- package-lock.json | 4 +++- package.json | 3 ++- 7 files changed, 104 insertions(+), 25 deletions(-) create mode 100644 css/login.css create mode 100644 css/style.css create mode 100644 index.html create mode 100644 javascript/login.js delete mode 100644 login.html diff --git a/css/login.css b/css/login.css new file mode 100644 index 0000000..6a917f3 --- /dev/null +++ b/css/login.css @@ -0,0 +1,53 @@ +.login-body { + display: flex; + flex-direction: column; + justify-content: space-between; + align-items: center; +} + +.menu-bar { + width: 100%; + height: 60px; + background-color: navy; +} + +.login-main { + display: flex; + flex-direction: column; + align-items: center; + justify-content: center; +} + +.login-main header { + margin-bottom: 100px; +} + +.login-main section { + margin-bottom: 70px; +} + +.login-footer { + margin-bottom: 25px; +} + +.ask { + display: flex; + flex-direction: column; + align-items: center; + font-size: 25px; + font-weight: bold; +} + +.ask form input { + width: 300px; + font-size: 45px; + border: none; + border-bottom: 2px solid black; + margin-top: 40px; + text-align: center; +} + +.ask form input:focus { + outline: none; + border-bottom-color: blue; +} diff --git a/css/style.css b/css/style.css new file mode 100644 index 0000000..0cb4349 --- /dev/null +++ b/css/style.css @@ -0,0 +1,8 @@ +@import "./login.css"; + +html, +body { + height: 100%; + margin: 0; + padding: 0; +} diff --git a/index.html b/index.html new file mode 100644 index 0000000..e702d6b --- /dev/null +++ b/index.html @@ -0,0 +1,38 @@ + + + + + + + login + + + + + + +
+
+

2021 SMARCLE Makers-day 박람회에 오신 것을 환영합니다!

+
+
+ 당신의 이름은 무엇인가요? +
+ +
+
+
+ 당신의 신분은 무엇인가요? +
+ +
+
+
+ + + + diff --git a/javascript/login.js b/javascript/login.js new file mode 100644 index 0000000..e69de29 diff --git a/login.html b/login.html deleted file mode 100644 index 8389d7e..0000000 --- a/login.html +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - login - - - -
-
- -
- -
-
-
- -
-
- - diff --git a/package-lock.json b/package-lock.json index 200e0d0..b635974 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,8 @@ { - "requires": true, + "name": "simulation", + "version": "1.0.0", "lockfileVersion": 1, + "requires": true, "dependencies": { "@babel/code-frame": { "version": "7.14.5", diff --git a/package.json b/package.json index bfdaf80..bbfd2e2 100644 --- a/package.json +++ b/package.json @@ -20,5 +20,6 @@ "bugs": { "url": "https://github.com/Jiyajiwon/simulation/issues" }, - "homepage": "https://github.com/Jiyajiwon/simulation#readme" + "homepage": "https://github.com/Jiyajiwon/simulation#readme", + "keywords": [] } From 82c17e5379fcde3cf7481f0852221ca76aed8599 Mon Sep 17 00:00:00 2001 From: Yonghyun Date: Mon, 16 Aug 2021 21:42:58 +0900 Subject: [PATCH 2/5] make login localstorage --- css/login.css | 5 ++++ index.html | 13 +++++++--- javascript/login.js | 59 +++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 73 insertions(+), 4 deletions(-) diff --git a/css/login.css b/css/login.css index 6a917f3..4d63747 100644 --- a/css/login.css +++ b/css/login.css @@ -51,3 +51,8 @@ outline: none; border-bottom-color: blue; } + +/* js 관련 css */ +.hidden { + display: none; +} diff --git a/index.html b/index.html index e702d6b..076e619 100644 --- a/index.html +++ b/index.html @@ -6,6 +6,7 @@ login + @@ -19,20 +20,24 @@

2021 SMARCLE Makers-day 박람회에 오신 것을 환영합니다!

당신의 이름은 무엇인가요? -
- + +
+
당신의 신분은 무엇인가요? -
- + +
+
룰루 랄라
+ + diff --git a/javascript/login.js b/javascript/login.js index e69de29..68f7a0a 100644 --- a/javascript/login.js +++ b/javascript/login.js @@ -0,0 +1,59 @@ +const loginNameForm = document.querySelector(".form-name"); +const loginPositionForm = document.querySelector(".form-position"); +const loginNameInput = document.querySelector(".input-name"); +const loginPositionInput = document.querySelector(".input-position"); + +const loginName = document.querySelector(".name"); +const loginPosition = document.querySelector(".position"); + +const CLASS_HIDDEN = "hidden"; + +const NAME_KEY = "name"; +const POSITION_KEY = "position"; + +function nameSubmit(event) { + event.preventDefault(); + loginNameForm.classList.add(CLASS_HIDDEN); + const name =loginNameInput.value; + localStorage.setItem(NAME_KEY, name); + paintName(); +} + +function positionSubmit(event) { + event.preventDefault(); + loginPositionForm.classList.add(CLASS_HIDDEN); + const position =loginPositionInput.value; + localStorage.setItem(POSITION_KEY, position); + paintPosition(); +} + +function paintName() { + const name = localStorage.getItem(NAME_KEY); + loginName.innerText = `Hello ${name}`; + loginName.classList.remove(CLASS_HIDDEN); +} + +function paintPosition() { + const position = localStorage.getItem(POSITION_KEY); + loginPosition.innerText = `Hello ${position}`; + loginPosition.classList.remove(CLASS_HIDDEN); +} + +const savedName = localStorage.getItem(NAME_KEY); +const savedPosition = localStorage.getItem(POSITION_KEY); + +if (savedName === null) { + loginNameForm.classList.remove(CLASS_HIDDEN); + loginNameForm.addEventListener("submit", nameSubmit); +} else { + paintName(); + paintPosition(); +} + +if (savedPosition === null) { + loginPositionForm.classList.remove(CLASS_HIDDEN); + loginPositionForm.addEventListener("submit", positionSubmit); +} else { + paintName(); + paintPosition(); +} \ No newline at end of file From c160d5179a141e9781f7eae8928c104f55911cbb Mon Sep 17 00:00:00 2001 From: emilyjiminroh Date: Tue, 17 Aug 2021 11:20:04 +0900 Subject: [PATCH 3/5] revert --- revert.html | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 revert.html diff --git a/revert.html b/revert.html new file mode 100644 index 0000000..e69de29 From dd2702e650e5781a130a20e3bf4d24209945edda Mon Sep 17 00:00:00 2001 From: emilyjiminroh Date: Tue, 17 Aug 2021 13:27:53 +0900 Subject: [PATCH 4/5] delete plz --- delete.html | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 delete.html diff --git a/delete.html b/delete.html new file mode 100644 index 0000000..e93247f --- /dev/null +++ b/delete.html @@ -0,0 +1,10 @@ + + + + + + + 지워져 제발.... + + + From acfcdc2979dad0fe89e966b2ff4852811d1cb7fb Mon Sep 17 00:00:00 2001 From: emilyjiminroh Date: Tue, 17 Aug 2021 15:57:50 +0900 Subject: [PATCH 5/5] create modal --- revert.html => js/modal.js | 0 modal.html | 97 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 97 insertions(+) rename revert.html => js/modal.js (100%) create mode 100644 modal.html diff --git a/revert.html b/js/modal.js similarity index 100% rename from revert.html rename to js/modal.js diff --git a/modal.html b/modal.html new file mode 100644 index 0000000..316fd14 --- /dev/null +++ b/modal.html @@ -0,0 +1,97 @@ + + + + + + + Document + + + + + + + + +