-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpop.php
304 lines (252 loc) · 6.57 KB
/
pop.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
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
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script>
$(document).ready(function(){
var qu= document.getElementById('q');
qu.onclick=function(){
var s=$( "#slct option:selected" ).text();
var t= document.getElementById("ta").value;
var c= $( "input:checked" ).val();
var s1=s;
window.location.href ='q.php?cat=' +s1+"&ques="+t+"&post="+c;
};
})
</script>
<style>
body {font-family: Arial, Helvetica, sans-serif;}
/* The Modal (background) */
.modal {
display: none; /* Hidden by default */
position: fixed; /* Stay in place */
z-index: 1; /* Sit on top */
padding-top: 100px; /* Location of the box */
left: 0;
top: 0;
width: 100%; /* Full width */
height: 100%; /* Full height */
overflow: auto; /* Enable scroll if needed */
background-color: rgb(0,0,0); /* Fallback color */
background-color: rgba(0,0,0,0.4); /* Black w/ opacity */
}
/* Modal Content */
.modal-content {
border-radius: 20px;
position: relative;
background-color: #fefefe;
margin: auto;
padding: 0;
border: 1px solid #888;
width: 40%;
box-shadow: 0 4px 8px 0 rgba(0,0,0,0.2),0 6px 20px 0 rgba(0,0,0,0.19);
-webkit-animation-name: animatetop;
-webkit-animation-duration: 0.4s;
animation-name: animatetop;
animation-duration: 0.4s
}
/* Add Animation */
@-webkit-keyframes animatetop {
from {top:-300px; opacity:0}
to {top:0; opacity:1}
}
@keyframes animatetop {
from {top:-300px; opacity:0}
to {top:0; opacity:1}
}
/* The Close Button */
.close {
color: white;
float: right;
font-size: 28px;
font-weight: bold;
}
.close:hover,
.close:focus {
color: #000;
text-decoration: none;
cursor: pointer;
}
.modal-header {
padding: 2px 16px;
background-color: rgba(235, 0, 0, .78);
color: white;
border-top-left-radius: 20px;
border-top-right-radius: 20px;
}
.modal-body {padding: 2px 16px;}
.button {
background-color: rgba(235, 0, 0, .78); /* Green */
border: none;
color: white;
padding: 15px 32px;
text-align: center;
text-decoration: none;
display: inline-block;
font-size: 16px;
margin: 4px 2px;
cursor: pointer;
-webkit-transition-duration: 0.4s; /* Safari */
transition-duration: 0.4s;
}
.button1 {
box-shadow: 0 8px 16px 0 rgba(0,0,0,0.2), 0 6px 20px 0 rgba(0,0,0,0.19);
}
.center-on-page {
position: relative;
}
h1 {
text-align: center;
}
/* Reset Select */
select {
outline: 0;
box-shadow: none;
border: 0 !important;
background: rgba(235, 0, 0, .78);
background-image: none;
}
/* Custom Select */
.select {
position: relative;
display: block;
width: 20em;
height: 3em;
line-height: 3;
background: rgba(235, 0, 0, .78);
overflow: hidden;
border-radius: .25em;
}
select {
width: 100%;
height: 100%;
margin: 0;
padding: 0 0 0 .5em;
color: #fff;
cursor: pointer;
}
select::-ms-expand {
display: none;
}
/* Arrow */
.select::after {
content: '\25BC';
position: absolute;
top: 0;
right: 0;
bottom: 0;
padding: 0 1em;
background: rgba(235, 0, 0, .78);
pointer-events: none;
}
/* Transition */
.select:hover::after {
color:black;
}
.select::after {
-webkit-transition: .25s all ease;
-o-transition: .25s all ease;
transition: .25s all ease;
}
.first_question_prompt {
border-radius: 4px;
border: 1px solid #e2e2e2;
padding: 8px;
margin-bottom: 16px;
background: #f9f9f9;
position:relative;
}
textarea{
display: block;
box-sizing: padding-box;
overflow: hidden;
padding: 10px;
width: 100%;
font-size: 20px;
margin: 50px auto;
box-shadow: 2px 2px 8px rgba(black, .3);
border-radius: 10px;
border: 6px solid rgba(235, 0, 0, .78) ;
}
</style>
</head>
<body>
<!-- The Modal -->
<div id="myModal" class="modal">
<!-- Modal content -->
<div class="modal-content">
<div class="modal-header">
<span class="close">×</span>
<h2>Ask a question...</h2>
</div>
<div class="modal-body">
<form>
<div class="center-on-page">
<div class="first_question_prompt">
<p>How to quickly get a good answer:</p>
<ul class="tip_list">
<li>Keep your question short and to the point</li>
<li>Check for grammar or spelling errors</li>
<li>Phrase it like a question</li>
<li>Make sure it hasn't been asked before</li>
</ul><br>
<div class="select"style="margin-left: 90px">
<select name="slct" id="slct">
<option>Choose category of question</option>
<option value="1">Programming</option>
<option value="2">Science</option>
<option value="3">Books</option>
<option value="4">Economics</option>
<option value="5">Movies</option>
<option value="6">Music</option>
<option value="7">Sports</option>
<option value="8">Gaming</option>
<option value="9">Food</option>
<option value="10">Travelling</option>
</select>
</div>
<textarea class='autoExpand' rows='2' data-min-rows='2' id="ta"placeholder='Start your question with "What", "How", "Why", etc.'></textarea><br>
<div class="ch">Post : <input type="checkbox" name="posted" value="open"> To all
<input type="checkbox" name="posted" value="group" checked> To group<br></div>
</div>
</div>
<input type="button" class="button button1" id="q" value="Post">
</div>
</div>
<script>
// Get the modal
var modal = document.getElementById('myModal');
// Get the button that opens the modal
var btn = document.getElementById("myBtn");
// Get the <span> element that closes the modal
var span = document.getElementsByClassName("close")[0];
// When the user clicks the button, open the modal
btn.onclick = function() {
modal.style.display = "block";
}
// When the user clicks on <span> (x), close the modal
span.onclick = function() {
modal.style.display = "none";
}
// When the user clicks anywhere outside of the modal, close it
window.onclick = function(event) {
if (event.target == modal) {
modal.style.display = "none";
}
}
$(document)
.one('focus.autoExpand', 'textarea.autoExpand', function(){
var savedValue = this.value;
this.value = '';
this.baseScrollHeight = this.scrollHeight;
this.value = savedValue;
})
.on('input.autoExpand', 'textarea.autoExpand', function(){
var minRows = this.getAttribute('data-min-rows')|0, rows;
this.rows = minRows;
rows = Math.ceil((this.scrollHeight - this.baseScrollHeight) / 16);
this.rows = minRows + rows;
});
</script>
</body>
</html>