-
Notifications
You must be signed in to change notification settings - Fork 0
/
writeguest.html
235 lines (229 loc) · 7.14 KB
/
writeguest.html
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
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
<!DOCTYPE html>
<html lang="ko">
<head>
<meta charset="UTF-8">
<title>JJUTOPIA</title>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.2/css/bootstrap.min.css">
<style>
@font-face {
font-family: "My Font";
src: url("THE_Oegyeinseolmyeongseo.ttf");
}
body{
margin:0;
background-color: #F1F1F1;
font-family: "My Font";
display: flex;
flex-direction: column;
align-items: center;
}
header {
width: 1440px;
height: 250px;
display: flex;
flex-direction: column;
align-items: center;
}
header img {
margin : 45px 0 35px 0;
}
header nav {
width: 1024px;
border-top: 1px solid #939393;
border-bottom: 1px solid #939393;
}
header nav ul {
margin : 10px;
list-style: none;
display: flex;
justify-content: center;
}
header nav ul li a {
margin: 15px;
text-decoration: none;
font-size: 20px;
color: #5C5C5C;
}
header nav ul li a:hover {
color: #a1a1a1;
}
main {
margin: 40px;
}
.container {
width: 900px;
}
footer {
border-top: 1px solid #939393;
width: 1024px;
height: 50px;
display: flex;
justify-content: flex-end;
}
footer div {
font-family: Roboto;
color: #5C5C5C;
width: 540px;
display: flex;
justify-content: flex-end;
align-items: center;
}
.mypage {
margin-right: 0px;
display: flex;
align-items: center;
}
@media ( max-width: 768px ){
body {width: 768px; overflow-x: auto;}
header {
width: 768px;
}
header nav {
width: 700px;
}
.container {
width: 650px;
}
footer {
width: 700px;
}
footer div {
width: 380px;
}
}
@media ( max-width: 414px ){
body {width: 414px; overflow-x: auto;}
header {
width: 414px;
height: 150px;
}
header img {
margin : 30px 0 15px 0;
width: 200px;
height: 80px;
}
header nav {
width: 350px;
border-top: 1px solid #939393;
border-bottom: 1px solid #939393;
}
header nav ul {
margin : 8px;
}
header nav ul li a {
margin: 15px;
font-size: 15px;
}
main {
font-size: 13px;
}
.container {
width: 310px;
}
.form-control {
font-size: 13px;
}
footer {
width: 350px;
height: 35px;
}
footer div {
width: 200px;
}
}
</style>
</head>
<body>
<header>
<a href="index.html">
<img src="image/logo.PNG" alt="My Image" width="310" height="120">
</a>
<nav>
<ul>
<li><a href="./mepage.html">me</a> </li>
<li><a href="./projectpage.html">project</a></li>
<li><a href="./dailypage.html">daily</a></li>
<li><a href="./guestpage.html"><strong><U>guest</U></strong></a></li>
</ul>
</nav>
</header>
<main>
<div class="container">
<div class="row">
<form method="get" action="guestpage.html">
<table class="table table-borderless" style="text-align: center; border: 1px solid #dddddd">
<thread>
<tr>
<th clospan= "2" style="background-color: #eeeeee; text-align: center;">방명록・ᴗ・</th>
</tr>
</thread>
<tbody class="content">
<tr>
<td><input type="text" class="form-control" placeholder="글 제목" id="title" maxlength="50"></td>
</tr>
<tr>
<td><input type="text" class="form-control" placeholder="작성자" id="username" maxlength="10"></td>
</tr>
<tr>
<td><textarea type="text" class="form-control" placeholder="글 내용" id="content" maxlength="2048" style="height: 350px;"></textarea></td>
</tr>
</tbody>
</table>
<input type="submit" class="btn btn-primary pull-right" style="background-color: #78aac3; border-color: #78aac3;" value="등록">
</form>
</div>
</div>
</main>
<footer>
<div>©minju
<div class="mypage">
<a href="https://www.instagram.com/0205_jju/">
<img src="image/instagram.png" alt="My Image" width="30" height="30">
</a>
<a href="https://github.com/kookminju">
<img src="image/git.png" alt="My Image" width="22" height="22">
</a>
</div>
</div>
</footer>
<script type="text/javascript" src="https://code.jquery.com/jquery-3.2.0.min.js" ></script>
<script src="https://www.gstatic.com/firebasejs/6.2.0/firebase-app.js"></script>
<script src="https://www.gstatic.com/firebasejs/6.2.0/firebase-database.js"></script>
<script>
// Your web app's Firebase configuration
var firebaseConfig = {
apiKey: "AIzaSyBUFX93Aj5ehAaShRvKvhP-asQZbkEm_Uw",
authDomain: "jjuguest.firebaseapp.com",
databaseURL: "https://jjuguest.firebaseio.com",
projectId: "jjuguest",
storageBucket: "jjuguest.appspot.com",
messagingSenderId: "914843368286",
appId: "1:914843368286:web:afce25afb607c736932dcf"
};
// Initialize Firebase
firebase.initializeApp(firebaseConfig);
// Get a reference to the database service
const database = firebase.database();
function writePost(title, username, content) {
// A post entry.
let day = new Date();
let date = day.getFullYear() + "-" + (day.getMonth()+1) + "-" + day.getDate();
const postData = {
title,
username,
date,
content,
};
// Get a key for a new Post.
const newPostKey = firebase.database().ref().child('posts').push(postData);
}
$('.btn').click(function(){
var title = document.getElementById("title").value;
var username = document.getElementById("username").value;
var content = document.getElementById("content").value;
writePost(title, username, content);
});
console.log(database);
</script>
</body>
</html>