-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinfoModify.html
More file actions
145 lines (134 loc) · 4.28 KB
/
infoModify.html
File metadata and controls
145 lines (134 loc) · 4.28 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
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" href="style.css" />
<style>
body {
font-family: 'Inter', sans-serif;
}
.form-container {
display: flex;
flex-direction: column;
align-items: flex-start;
margin: 0 auto;
max-width: 500px;
}
.form-group {
display: flex;
align-items: center;
width: 100%;
margin-bottom: 15px;
}
.form-group p {
width: 200px;
margin: 0;
font-weight: bold;
text-align: right;
}
.form-group input {
flex: 1;
padding: 10px;
font-size: 16px;
border: 1px solid rgba(0, 0, 0, 0.1);
box-shadow: 3px 3px 7px rgba(0, 0, 0, 0.05);
border-radius: 7px;
height: 30px;
margin-left: 20px;
}
.signup-container {
display: flex;
justify-content: center;
width: 100%;
margin-top: 20px;
}
#modify-button, #back-button {
flex-direction: row;
padding: 10px 20px;
font-size: 16px;
background-color: #cacaca;
color: white;
border: none;
border-radius: 5px;
cursor: pointer;
}
#modify-button:hover {
background-color: black;
}
.bottom {
display: flex;
justify-content: center;
width: 100%;
gap: 10px;
}
</style>
</head>
<body>
<h1>Life Tracker</h1>
<ul>
<li><a href="scheduler.html">Scheduler</a></li>
<li class="dropdown">
<a href="timer.html">Timer</a>
<div class="dropdown-content">
<a href="stopwatch.html">Stopwatch</a>
</div>
</li>
<li><a href="song.html">Song</a></li>
<li><a href="diary.html">Diary</a></li>
<li><a href="myPage.html" id="selected-list">My page</a></li>
</ul>
<h2>회원정보</h2>
<br><br><br>
<form class="form-container">
<div class="form-group">
<p>이름:</p>
<input type="text" id="name" placeholder="name">
</div> <br>
<div class="form-group">
<p>이메일:</p>
<input type="text" id="account" placeholder="E-mail" readonly>
</div>
<div class="form-group">
<p>새 비밀번호:</p>
<input type="password" id="pw" placeholder="password">
</div>
<div class="form-group">
<p>새 비밀번호 확인:</p>
<input type="password" id="pwRE" placeholder="password check">
</div> <br>
<div class="form-group">
<p>생년월일:</p>
<input type="date" id="birthday" placeholder="birthday">
</div>
<div class="form-group">
<p>전화번호:</p>
<input type="text" id="ph_num" placeholder="phone">
</div>
<br><br><br><br><br>
<div class="bottom">
<input type="button" value="Submit" id="modify-button">
<button type="button" id="back-button">Back</button>
</div>
</form>
<script type="module">
import { auth, db, ref, set, get, getUserInfo } from './js/firebase.js';
auth.onAuthStateChanged(async (user) => {
if (user) {
try {
const userInfo = await getUserInfo(user.uid);
if (userInfo) {
document.getElementById('name').value = userInfo.name;
document.getElementById('account').value = userInfo.email;
document.getElementById('birthday').value = userInfo.birthday;
document.getElementById('ph_num').value = userInfo.phone;
}
} catch (error) {
console.error('사용자 정보를 가져오는 중 에러 발생:', error);
}
} else {
console.log('사용자가 로그인하지 않았습니다.');
}
});
</script>
<script type="module" src="js/infomodify.js"></script>
</body>
</html>