-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindexWeek2.html
More file actions
277 lines (220 loc) · 9.86 KB
/
indexWeek2.html
File metadata and controls
277 lines (220 loc) · 9.86 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
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
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<!-- 부트스트랩 사용하기-->
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.0.2/dist/css/bootstrap.min.css" rel="stylesheet"
integrity="sha384-EVSTQN3/azprG1Anm3QDgpJLIm9Nao0Yz1ztcQTwFspd3yD65VohhpuuCOmLASjC" crossorigin="anonymous">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.0.2/dist/js/bootstrap.bundle.min.js"
integrity="sha384-MrcW6ZMFYlzcLA8Nl+NtUVF0sA7MsXsP1UyJoMp4YLEuNSfAP+JcXn/tWtIaxVXM"
crossorigin="anonymous"></script>
<title>스파르타피디아</title>
<link href="https://fonts.googleapis.com/css2?family=Gowun+Dodum&display=swap" rel="stylesheet">
<!-- 폰트 넣기-->
<style>
* {
font-family: 'Gowun Dodum', sans-serif;
}
.mytitle{
width: 100% ;
height: 250px;
background-image: linear-gradient(0deg, rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.5)), url("https://movie-phinf.pstatic.net/20210715_95/1626338192428gTnJl_JPEG/movie_image.jpg");
background-position: center;
background-size: cover;
/*이미지 어둡기: linear-gradient(0deg, rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.5)) */
/*0.5 수치를 조정하면 어두지거나 밝아진다.*/
color: white;
/*text-align: center;*/
/*내용물을 가로방향의 중간에 정렬한다.*/
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
/*박스에 있는 내용물을 중앙에 정렬한다. 항상 4개는 같이 사용한다*/
}
/*mytitle에 있는 버튼에 대해 작업한다*/
.mytitle > button{
width: 200px;
height: 50px;
background-color: transparent;
/*버튼백영은 투명하게*/
color: white;
/*글자색상*/
border-radius: 50px;
/*테두리 반경 즉 둥글게*/
border: 1px solid white;
/*테두리선 두께는 1px 색상은 하얀색*/
margin-top: 10px;
/*바깥위쪽여백*/
}
.mytitle > button:hover{
border: 3px solid white;
}
.mycomment{
color: red;
}
.wrap{
max-width: 1200px;
width: 95%;
/*1200px까지만 커질 수 있지만 그 전까지는 95%만 채워주면 되. 모바일로 볼기 위해 설정한 것임*/
margin: 50px auto 0px auto
}
.mypost{
max-width: 500px;
width: 95%;
/*500px까지만 커질 수 있지만 그 전까지는 95%만 채워주면 되.모바일로 볼기 위해 설정한 것임 */
margin: 50px auto 0px auto;
padding: 30px;
display: none;
/*처음부터 박스가 안보이게 한다*/
box-shadow: 0px 0px 3px 0px gray;
/*그림자 효과 넣기 넣기*/
}
.mybtns{
/*버튼묶음에 대해 작업하기*/
display: flex;
flex-direction: row;
justify-content: center;
align-items: center;
margin-top: 20px;
}
.mybtns > button{
/*박스안에 버튼 개체에 대해 작업하기*/
width: 100px;
height: 40px;
margin-right: 10px;
font-size: 20px;
/*글자 사이즈 선택하기*/
}
</style>
<script>
$.ajax({
type: "GET",
// GET 방식으로 요청한다.
url: "http://spartacodingclub.shop/sparta_api/seoulair",
// 요청하면서 함께 줄 데이터 (GET 요청시엔 비워두세요)
data: {},
success: function (response) { //서버에서 준 결과를 response라는 변수에 담음
let rows = response['RealtimeCityAir']['row']
// 'RealtimeCityAir'값 중 row의 값만 가져와보기
for (let i = 0; i<rows.length; i++){
let gu_name = rows[i]["MSRSTE_NM"]
let gu_mise = rows[i]["IDEX_MVL"]
console.log(gu_name,gu_mise)
// 서버에서 준 결과를 이용해서 나머지 코드를 작성
}
}
})
function open_box(){
$('#post-box').show()
}
// 입력박스창이 기록하기 버튼은 누르면 보이고
// post-box 창은 입력창의 id이다
function close_box() {
$('#post-box').hide()
}
// 닫기 버튼을 클릭하면 숨겨진다.
</script>
</head>
<body>
<!-- 제일위에 있는 기록하기 박스창-->
<div class="mytitle">
<h1>내 생에 최고의 영화들 </h1>
<button onclick="open_box()"> 영화 기록하기</button>
<!-- 버튼 클릭을 하면 open_box를 호출해라-->
</div>
<!-- 입력박스창-->
<div class="mypost" id="post-box">
<!-- 영화url입력박스-->
<div class="form-floating mb-3">
<input type="email" class="form-control" id="url" placeholder="name@example.com">
<label for="url">영화url</label>
</div>
</p>
<!-- 옵션박스-->
<div class="input-group mb-3">
<label class="input-group-text" for="inputGroupSelect01">별점</label>
<select class="form-select" id="inputGroupSelect01">
<option selected>선택하기</option>
<option value="1">⭐</option>
<option value="2">⭐⭐</option>
<option value="3">⭐⭐⭐</option>
<option value="4">⭐⭐⭐⭐</option>
<option value="5">⭐⭐⭐⭐⭐</option>
</select>
</div>
<!-- 코멘트 박스-->
<div class="form-floating">
<textarea class="form-control" placeholder="Leave a comment here" id="floatingTextarea2"
style="height: 100px"></textarea>
<label for="floatingTextarea2">코멘트</label>
</div>
<!-- 버튼 묶음-->
<div class="mybtns">
<button type="button" class="btn btn-primary btn-sm">기록하기</button>
<button onclick="close_box()" type="button" class="btn btn-secondary btn-sm">닫기</button>
<!-- 버튼 클릭을 하면 close_box를 호출해라-->
</div>
</div>
<!-- 영화정보박스-->
<div class="wrap">
<div id="card-box" class="row row-cols-1 row-cols-md-4 g-4">
<!-- row-cols-md-3에서 숫자 4를 변경하면 한 줄에 4장카드가 보인다.-->
<div class="col">
<div class="card">
<img src="https://movie-phinf.pstatic.net/20210728_221/1627440327667GyoYj_JPEG/movie_image.jpg"
class="card-img-top" alt="...">
<!-- 이미지 src"이미지url" 를 넣어서 카드에 이미지를 부여-->
<div class="card-body">
<h5 class="card-title">여기에 제목이 들어감</h5>
<p class="card-text">내용이 들어감</p>
<p>⭐⭐⭐</p>
<p class="mycomment">여기에 코멘트 들어간다</p>
</div>
</div>
</div>
<div class="col">
<div class="card">
<img src="https://movie-phinf.pstatic.net/20210728_221/1627440327667GyoYj_JPEG/movie_image.jpg"
class="card-img-top" alt="...">
<!-- 이미지 src"이미지url" 를 넣어서 카드에 이미지를 부여-->
<div class="card-body">
<h5 class="card-title">여기에 제목이 들어감</h5>
<p class="card-text">내용이 들어감</p>
<p>⭐⭐⭐</p>
<p class="mycomment">여기에 코멘트 들어간다</p>
</div>
</div>
</div>
<div class="col">
<div class="card">
<img src="https://movie-phinf.pstatic.net/20210728_221/1627440327667GyoYj_JPEG/movie_image.jpg"
class="card-img-top" alt="...">
<!-- 이미지 src"이미지url" 를 넣어서 카드에 이미지를 부여-->
<div class="card-body">
<h5 class="card-title">여기에 제목이 들어감</h5>
<p class="card-text">내용이 들어감</p>
<p>⭐⭐⭐</p>
<p class="mycomment">여기에 코멘트 들어간다</p>
</div>
</div>
</div>
<div class="col">
<div class="card">
<img src="https://movie-phinf.pstatic.net/20210728_221/1627440327667GyoYj_JPEG/movie_image.jpg"
class="card-img-top" alt="...">
<!-- 이미지 src"이미지url" 를 넣어서 카드에 이미지를 부여-->
<div class="card-body">
<h5 class="card-title">여기에 제목이 들어감</h5>
<p class="card-text">내용이 들어감</p>
<p>⭐⭐⭐</p>
<p class="mycomment">여기에 코멘트 들어간다</p>
</div>
</div>
</div>
</div>
</div>
</body>
</html>