Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Yeon dong/1week #4

Merged
merged 3 commits into from
Apr 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 35 additions & 0 deletions yeon-dong#1week/모달 만들기/css/style.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
body {
font-family: sans-serif;
}

.modal-wrapper {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
background: rgba(0, 0, 0, 0.5);
display: flex;
align-items: center;
justify-content: center;
} /*모달 주변 부분*/

.modal {
background: white;
padding: 24px 16px;
border-radius: 4px;
width: 320px;
} /*모달*/

.modal-title {
font-size: 24px;
font-weight: bold;
}

.modal p {
font-size: 16px;
}

.close-wrapper {
text-align: right;
}
24 changes: 24 additions & 0 deletions yeon-dong#1week/모달 만들기/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<!DOCTYPE html>
<html>
<head>
<title>모달 만들기</title>
<meta charset="UTF-8" />
<link rel="stylesheet" href="./css/style.css">
</head>

<body>
<h1>안녕하세요!</h1>
<p>내용내용내용</p>
<button id="open">버튼 열기</button>
<div class="modal-wrapper" style="display: none;">
<div class="modal">
<div class="modal-title">안녕하세요</div>
<p>모달 내용은 어쩌고 저쩌고..</p>
<div class="close-wrapper">
<button id="close">닫기</button>
</div>
</div>
</div>
<script src="./js/modal.js"></script>
</body>
</html>
11 changes: 11 additions & 0 deletions yeon-dong#1week/모달 만들기/js/modal.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
const open = document.getElementById('open');
const close = document.getElementById('close');
const modal = document.querySelector('.modal-wrapper');

open.onclick = () => {
modal.style.display = "flex";
};

close.onclick = () => {
modal.style.display = "none";
};
78 changes: 78 additions & 0 deletions yeon-dong#1week/미션_TodoList/css/style.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
body {
background-color: #ECF0F6;
background-size: cover;
background-repeat: no-repeat;
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
margin: 0;
font-family: sans-serif;
}

h1{
margin-bottom: 50px;
}

h3{
margin-bottom: 0px;
}

.container {
height: 70%;
width: 70%;
padding: 20px;
border-radius: 5px;
text-align: center;
}

form{
margin-top: 20px;
}

input{
padding: 10px;
width: 60%;
font-style: italic;
color: gray;
}

.every-box{
display: flex;
justify-content: center;
}

.todo-list{
margin-left: 120px;
margin-right: 120px;
}

.finsh-list{
margin-left: 120px;
margin-right: 120px;
}

#todoList{
padding-left: 0px;
}

#doneList{
padding-left: 0px;
}

li{
padding-left: 0px;
list-style: none;
display: flex;
justify-content: space-between;
border-bottom: 4px solid white;
margin-bottom: 10px;
}

span{
margin: 10px 0px;
}

button{
margin: 10px 0px;
}
35 changes: 35 additions & 0 deletions yeon-dong#1week/미션_TodoList/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Todo List</title>
<link rel="stylesheet" href="./css/style.css">
</head>
<body>
<div class="container">
<h1>UMC Study Plan</h1>
<hr width="90%" color="white" noshade/>
<div class="todo-box">
<form onsubmit="return false">
<input type="text" id="todo" name="todo" placeholder="스터디 계획을 작성해보세요!" onkeypress="onKeyUp(event)">
</form>
<div class="every-box">
<div class="todo-list">
<h3>해야할 일</h3>
<hr width="90%" color="white" noshade/>
<ul id="todoList">
</ul>
</div>
<div class="finsh-list">
<h3>해낸 일</h3>
<hr width="90%" color="white" noshade/>
<ul id="doneList">
</ul>
</div>
</div>
</div>
</div>
<script src="./js/todoList.js" charset="UTF-8"></script>
</body>
</html>
40 changes: 40 additions & 0 deletions yeon-dong#1week/미션_TodoList/js/todoList.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
let addValue = document.getElementById('todo');
const todoList = document.querySelector('#todoList');
const doneList = document.getElementById('doneList');

function onKeyUp(event){
if(event.keyCode == 13 && addValue.value !== ''){
createTodo();
}
};

function createTodo(){
const newLi = document.createElement('li'); // li 생성
const newBtn = document.createElement('button'); // button 생성
const newSpan = document.createElement('span'); // span 생성

newLi.appendChild(newSpan); // li안에 span 담기
newLi.appendChild(newBtn); // li안에 button 담기

newSpan.textContent = addValue.value; // span 안에 value값 담기
newBtn.innerText = "완료";

todoList.appendChild(newLi);

newBtn.addEventListener('click', (event) => finsh(event));
addValue.value = '';
}

function finsh(event){
const delBtn = document.createElement('button'); // button 생성
delBtn.innerText = "삭제";

doneList.appendChild(event.target.parentElement);
event.target.parentElement.appendChild(delBtn); // 삭제버튼 추가
event.target.remove(); //완료버튼 삭제
delBtn.addEventListener('click', (event) => delTodo(event));
}

function delTodo(event){
event.target.parentElement.remove();
}
102 changes: 102 additions & 0 deletions yeon-dong#1week/미션_회원가입 validation/css/style.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
body {
background-color: #ACD8E6;
background-size: cover;
background-repeat: no-repeat;
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
margin: 0;
font-family: sans-serif;
}

.validation_text {
margin-top: 1px;
margin-bottom: 10px;
}

.container {
background-color: rgb(223, 240, 245);
height: 70%;
width: 50%;
padding: 20px;
border-radius: 5px;
}

.login-box {
text-align: center;
display: flex;
flex-direction: column;
align-items: center;
}

form {
width: 50%;
}

.labels {
text-align: left;
width: 100%;
margin-top: 2px;
}

.labels_first {
text-align: left;
width: 100%;
margin-top: 10px;
}

input {
padding: 6px 6px 6px 6px;
border-color: white;
border-radius: 5px;
background-color: rgb(223, 240, 245);
width: 100%;
}

#submitButton {
background-color: #808080;
color: white;
font-weight: 200;
width: 40%;
margin-bottom: 10px;
padding: 6px 6px 6px 6px;
}

.hide{
color: rgba(255, 0, 0, 0);
text-align: left;
}

.modal-wrapper {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
background: rgba(0, 0, 0, 0.5);
display: flex;
align-items: center;
justify-content: center;
} /*모달 주변 부분*/

.modal {
background: white;
padding: 24px 16px;
border-radius: 4px;
width: 320px;
text-align: center;
} /*모달*/

.modal-title {
font-size: 24px;
font-weight: bold;
}

.modal p {
font-size: 16px;
}

.close-wrapper {
text-align: right;
}
45 changes: 45 additions & 0 deletions yeon-dong#1week/미션_회원가입 validation/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>연동의 회원가입</title>
<link rel="stylesheet" href="./css/style.css">
</head>
<body>
<div class="container">
<div class="login-box">
<h2 class="validation_text">회원가입</h2>
<hr width="60%" color="white" noshade/>
<form>
<div class="labels_first"><label for="username">이름</label></div>
<input type="text" id="username" name="username">
<div class="username-error hide">필수 입력 항목입니다!</div>
<div class="labels"><label for="email">이메일</label></div>
<input type="email" id="email" name="email">
<div class="email-error hide">올바른 이메일 형식이 아닙니다!</div>
<div class="labels"><label for="age">나이</label></div>
<input type="age" id="age" name="age">
<div class="age-error hide">나이를 입력해주세요!</div>
<div class="labels"><label for="password">비밀번호</label></div>
<input type="password" id="password" name="password">
<div class="password-error hide">비밀번호는 최소 4자리 이상이어야 합니다.</div>
<div class="labels"><label for="verifyPassword">비밀번호 확인</label></div>
<input type="password" id="verifyPassword" name="verifyPassword">
<div class="verifyPassword-error hide">비밀번호가 일치하지 않습니다.</div>
</form>
<input id="submitButton" type="submit" value="가입하기">
</form>
</div>
</div>
<div class="modal-wrapper" style="display: none">
<div class="modal">
<div class="modal-title">가입성공!</div>
<p>umc 챌린저 가입을 축하합니다!!</p>
<div class="close-wrapper">
<button id="close">닫기</button>
</div>
</div>
</div>
<script src="./js/validation.js" charset="UTF-8"></script>
</body>
</html>
Loading