-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbase0.html
More file actions
229 lines (170 loc) · 7.3 KB
/
base0.html
File metadata and controls
229 lines (170 loc) · 7.3 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
<!DOCTYPE html>
<html lang="ko" dir="ltr">
<head>
<!-- base -->
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="author:" content="Hueeng">
<meta name="keywords:" content="Hueeng 메인페이지">
<meta name="twitter:" content="Hueeng 메인페이지">
<meta name="google-site-verification" content="W5clWZwJhP4iOYzAb3DmRfKW0ei6GqPLjZfTEJpbrYg" />
<!-- sns share -->
<meta property="og:url" content="">
<meta property="og:title" content="Hueeng 메인페이지">
<meta property="og:type" content="website">
<meta property="og:image" content="img/share.png">
<meta property="og:description" content="Hyeeng 메인페이지">
<!--favicon-->
<link rel="shortcut icon" href="./img/favicon.ico">
<link rel="apple-touch-icon-precomposed" href="./img/favicon.ico">
<title></title>
<!-- css -->
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-1BmE4kWBq78iYhFldvKuhfTAU6auU8tT94WrHftjDbrCEXSU1oBoqyl2QvZ6jIW3" crossorigin="anonymous">
<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=Jua&display=swap" rel="stylesheet">
<link rel="stylesheet" href="./css/main.css">
<link rel="stylesheet" href="./css/default.css">
<link rel="stylesheet" href="./css/menu.css">
<script type="text/javascript" src="https://openapi.map.naver.com/openapi/v3/maps.js?ncpClientId=qomyjx86xy"></script>
</head>
<body>
<div class="container">
<section id="main" class="mx-auto mt-5 py-5 px-3">
<h1>저녁은 뭘 먹을까?</h1>
<p>한식, 일식, 중식, 양식, 분식, 카페/디저트, 프렌차이즈 (식권대장 기준)</p>
</br>
<div class="food">
<table>
<thead>
<tr>
<td> <img id="food" src="./img/food/1.png" height="200px"width="200px"></td>
<td id="food_name"> </td>
</tr>
</thead>
</table>
</div>
</br>
</br>
<div id="map" style="width:100%;height:400px;"></div>
<script>
var HOME_PATH = window.HOME_PATH || '.';
var MARKER_SPRITE_X_OFFSET = 29,
MARKER_SPRITE_Y_OFFSET = 50,
MARKER_SPRITE_POSITION = {
"A0": [0, 0],
"B0": [MARKER_SPRITE_X_OFFSET, 0],
"C0": [MARKER_SPRITE_X_OFFSET * 2, 0],
"D0": [MARKER_SPRITE_X_OFFSET * 3, 0],
"E0": [MARKER_SPRITE_X_OFFSET * 4, 0],
"F0": [MARKER_SPRITE_X_OFFSET * 5, 0],
"G0": [MARKER_SPRITE_X_OFFSET * 6, 0],
"H0": [MARKER_SPRITE_X_OFFSET * 7, 0],
"I0": [MARKER_SPRITE_X_OFFSET * 8, 0],
"A1": [0, MARKER_SPRITE_Y_OFFSET],
"B1": [MARKER_SPRITE_X_OFFSET, MARKER_SPRITE_Y_OFFSET],
"C1": [MARKER_SPRITE_X_OFFSET * 2, MARKER_SPRITE_Y_OFFSET],
"D1": [MARKER_SPRITE_X_OFFSET * 3, MARKER_SPRITE_Y_OFFSET],
"E1": [MARKER_SPRITE_X_OFFSET * 4, MARKER_SPRITE_Y_OFFSET],
"F1": [MARKER_SPRITE_X_OFFSET * 5, MARKER_SPRITE_Y_OFFSET],
"G1": [MARKER_SPRITE_X_OFFSET * 6, MARKER_SPRITE_Y_OFFSET],
"H1": [MARKER_SPRITE_X_OFFSET * 7, MARKER_SPRITE_Y_OFFSET],
"I1": [MARKER_SPRITE_X_OFFSET * 8, MARKER_SPRITE_Y_OFFSET],
"A2": [0, MARKER_SPRITE_Y_OFFSET * 2],
"B2": [MARKER_SPRITE_X_OFFSET, MARKER_SPRITE_Y_OFFSET * 2],
"C2": [MARKER_SPRITE_X_OFFSET * 2, MARKER_SPRITE_Y_OFFSET * 2],
"D2": [MARKER_SPRITE_X_OFFSET * 3, MARKER_SPRITE_Y_OFFSET * 2],
"E2": [MARKER_SPRITE_X_OFFSET * 4, MARKER_SPRITE_Y_OFFSET * 2],
"F2": [MARKER_SPRITE_X_OFFSET * 5, MARKER_SPRITE_Y_OFFSET * 2],
"G2": [MARKER_SPRITE_X_OFFSET * 6, MARKER_SPRITE_Y_OFFSET * 2],
"H2": [MARKER_SPRITE_X_OFFSET * 7, MARKER_SPRITE_Y_OFFSET * 2],
"I2": [MARKER_SPRITE_X_OFFSET * 8, MARKER_SPRITE_Y_OFFSET * 2]
};
var position = new naver.maps.LatLng(37.5157636, 127.0346995);
var map = new naver.maps.Map('map', {
center: new naver.maps.LatLng(37.5157636, 127.0346995),
zoom: 16
});
var bounds = map.getBounds(),
southWest = bounds.getSW(),
northEast = bounds.getNE(),
lngSpan = northEast.lng() - southWest.lng(),
latSpan = northEast.lat() - southWest.lat();
var markers = [],
infoWindows = [];
var markerOptions = {
position: position.destinationPoint(90, 15),
map: map,
icon: {
url: './img/favicon.ico',
size: new naver.maps.Size(50, 52),
origin: new naver.maps.Point(0, 0),
anchor: new naver.maps.Point(25, 26)
}
};
for (var key in MARKER_SPRITE_POSITION) {
var position = new naver.maps.LatLng(
southWest.lat() + latSpan * Math.random(),
southWest.lng() + lngSpan * Math.random());
var marker = new naver.maps.Marker({
map: map,
position: position,
title: key,
icon: {
url: HOME_PATH + './img/food/1.png',
size: new naver.maps.Size(24, 37),
anchor: new naver.maps.Point(12, 37),
origin: new naver.maps.Point(MARKER_SPRITE_POSITION[key][0], MARKER_SPRITE_POSITION[key][1])
},
zIndex: 100
});
var infoWindow = new naver.maps.InfoWindow({
content: '<div style="width:150px;text-align:center;padding:10px;">The Letter is <b>"' + key.substr(0, 1) + '"</b>.</div>'
});
markers.push(marker);
infoWindows.push(infoWindow);
};
naver.maps.Event.addListener(map, 'idle', function() {
updateMarkers(map, markers);
});
function updateMarkers(map, markers) {
var mapBounds = map.getBounds();
var marker, position;
for (var i = 0; i < markers.length; i++) {
marker = markers[i]
position = marker.getPosition();
if (mapBounds.hasLatLng(position)) {
showMarker(map, marker);
} else {
hideMarker(map, marker);
}
}
}
function showMarker(map, marker) {
if (marker.setMap()) return;
marker.setMap(map);
}
function hideMarker(map, marker) {
if (!marker.setMap()) return;
marker.setMap(null);
}
// 해당 마커의 인덱스를 seq라는 클로저 변수로 저장하는 이벤트 핸들러를 반환합니다.
function getClickHandler(seq) {
return function(e) {
var marker = markers[seq],
infoWindow = infoWindows[seq];
if (infoWindow.getMap()) {
infoWindow.close();
} else {
infoWindow.open(map, marker);
}
}
}
for (var i = 0, ii = markers.length; i < ii; i++) {
naver.maps.Event.addListener(markers[i], 'click', getClickHandler(i));
}
var marker = new naver.maps.Marker(markerOptions);
</script>
<script src="./js/food.js" charset="utf-8"></script>
</body>
</html>