-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
125 lines (112 loc) · 3.78 KB
/
Copy pathindex.html
File metadata and controls
125 lines (112 loc) · 3.78 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
<!DOCTYPE html>
<html lang="ko">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>비밀번호 검사기</title>
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Gamja+Flower&display=swap" rel="stylesheet">
<style>
body {
background-color: #1e1e1e;
color: #ffffff;
font-family: 'Gamja Flower', cursive;
display: flex;
justify-content: center;
align-items: center;
min-height: 100vh;
margin: 0;
}
.container {
background-color: #2d2d2d;
padding: 40px;
border-radius: 25px;
box-shadow: 0 15px 35px rgba(0,0,0,0.5);
text-align: center;
width: 350px;
border: 2px dashed #555;
}
.mascot-img {
width: 200px;
height: auto;
margin-bottom: 15px;
border-radius: 10px;
}
h2 {
margin-top: 0;
margin-bottom: 20px;
font-size: 32px;
color: #ffd700;
text-shadow: 2px 2px 0px #000;
}
input {
width: 100%;
padding: 15px;
margin-bottom: 15px;
border-radius: 15px;
border: 2px solid #555;
background-color: #383838;
color: white;
font-size: 20px;
font-family: 'Gamja Flower', cursive;
box-sizing: border-box;
text-align: center;
}
input:focus { outline: none; border-color: #ffd700; background-color: #444; }
input::placeholder { color: #aaa; font-size: 18px;}
button {
width: 100%;
padding: 15px;
border-radius: 15px;
border: none;
background-color: #ffd700;
color: #1e1e1e;
font-size: 24px;
cursor: pointer;
font-family: 'Gamja Flower', cursive;
transition: 0.2s;
}
button:hover { background-color: #ffcc00; transform: scale(1.05); }
#result {
margin-top: 20px;
font-size: 22px;
min-height: 30px;
}
.success { color: #4cd964; }
.fail { color: #ff6b6b; }
</style>
</head>
<body>
<div class="container">
<img src="bear.gif" alt="농담곰" class="mascot-img">
<h2>비밀번호 내놔!</h2>
<input type="password" id="passwordInput" placeholder="여기다 적어보라곰">
<button onclick="checkPassword()">확인하기</button>
<p id="result"></p>
</div>
<script>
function validatePassword(password) {
if (password.length < 8) return false;
if (!/[0-9]/.test(password)) return false;
if (!/[A-Z]/.test(password)) return false;
return true;
}
function checkPassword() {
const inputField = document.getElementById('passwordInput');
const resultTag = document.getElementById('result');
const inputValue = inputField.value;
const isValid = validatePassword(inputValue);
if (isValid) {
resultTag.innerText = "오... (통과)";
resultTag.className = "success";
inputField.style.borderColor = "#4cd964";
} else {
resultTag.innerText = "NO!! (8자, 숫자, 대문자 필수)";
resultTag.className = "fail";
inputField.style.borderColor = "#ff6b6b";
}
}
</script>
</body>
</html>