-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.php
152 lines (139 loc) · 4.7 KB
/
index.php
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
<?php
require("header.php");
?>
<div class="container">
<div class="row">
<div class="col-sm-8">
<img src="./static/images/smilehand.gif" width="30%"/>
<h3>Hello Hello!</h3>
</div>
<div class="col-sm-4">
<br/><br/>
<a href="./duck.html">
<img src="./static/images/ducky_flip_v.png" width="90px"/>
</a>
<a href="javascript:var audio2 = new Audio('./static/sounds/Dramatic-chipmunk.mp3'); audio2.play();">
<img src="./static/images/slide.png" id="myImg" width="100px"/>
</a>
</div>
</div>
<div class="row" style="margin-top: 20px;">
<div class="col-sm-12">
<div class="container">
<div class="panel panel-warning">
<div class="panel-heading">
<h3 class="panel-title">
** 이벤트들
</h3>
</div>
<div class="panel-body">
<ul>
<li><a href="https://youtu.be/0Da8ZhKcNKQ?t=8" style="cursor: text;">중요한 공지</a> (2020년 12월 11일)</li>
<li><a data-toggle="modal" data-target="#eventsModal" data-id="11">드디어!!!</a> (2020년 10월 28일)</li>
<li><a data-toggle="modal" data-target="#eventsModal" data-id="10">거북이 궁둥이</a> (2020년 10월 15일)</li>
<li><a data-toggle="modal" data-target="#eventsModal" data-id="9">오늘은</a> (2020년 9월 11일)</li>
<li><a data-toggle="modal" data-target="#eventsModal" data-id="8">닭강정</a> (2020년 4월 8일)</li>
</ul>
</div>
</div>
</div>
</div>
</div>
</div>
<footer class="footer-footer" style="margin-bottom: 0;">
<div class="container">
<div class="col-sm-8">
</div>
<div class="col-sm-4">
<div class="footer-policy-group--web">
<a class="footer-link footer-link--right" href="personal.php">개인정보 처리방침</a>
</div>
</div>
</div>
</footer>
<div id="mytextModal" class="textmodal">
<div class="textmodal-content">
<div class="textmodal-header">
<span class="txtclose">x</span>
</div>
<div class="textmodal-body">
<h3 id="txt"></h3>
</div>
</div>
</div>
<!-- The Modal -->
<div id="myModal" class="modal">
<span class="close">X</span>
<img class="modal-content" id="img01" style="cursor: pointer;">
<div id="caption"></div>
</div>
<!-- Modal for events -->
<div class="modal fade" id="eventsModal" tabindex="-1" role="dialog" aria-labelledby="eventsModalLabel" aria-hidden="true">
<div class="modal-dialog modal-dialog-centered modal-lg" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="eventsModalLabel"></h5>
</div>
<div class="modal-body">
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal">네</button>
</div>
</div>
</div>
</div>
<script>
var events_modal = $('#eventsModal');
events_modal.on('show.bs.modal', function (event) {
var target = $(event.relatedTarget);
var event_id = target.data('id');
var modal = $(this)
var xhttp = new XMLHttpRequest();
xhttp.open("GET", "events_get.php?event_id=" + event_id, true);
xhttp.onreadystatechange = function() {
if (this.readyState == 4 && this.status == 200) {
var resp = (JSON && JSON.parse(this.responseText) || $.parseJSON(this.responseText));
modal.find('.modal-title').text(resp.title);
modal.find('.modal-body').html(resp.content);
}
};
xhttp.send();
});
var txtmodal = document.getElementById('mytextModal');
var txtspan = document.getElementsByClassName("txtclose")[0];
$('.txtmod').click(function(){
txtmodal.style.display = "block";
txt.innerHTML = this.title;
})
txtspan.onclick = function() {
txtmodal.style.display = "none";
}
$(document).keyup(function(ev){
if(ev.keyCode == 27)
txtmodal.style.display = "none";
});
var modal = document.getElementById('myModal');
var img = document.getElementById('myImg');
var modalImg = document.getElementById("img01");
var captionText = document.getElementById("caption");
img.onclick = function(){
modal.style.display = "block";
modalImg.src = this.src;
modalImg.alt = this.alt;
captionText.innerHTML = this.alt;
}
// Get the <span> element that closes the modal
var span = document.getElementsByClassName("close")[0];
// When the user clicks on <span> (x), close the modal
modalImg.onclick = function() {
modal.style.display = "none";
}
span.onclick = function() {
modal.style.display = "none";
}
$(document).keyup(function(ev) {
if(ev.keyCode == 27) modal.style.display = "none";
});
</script>
</body>
</html>