-
Notifications
You must be signed in to change notification settings - Fork 3
/
index.html
451 lines (422 loc) · 14.5 KB
/
index.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
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
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
<!doctype html>
<html lang="en">
<head>
<!-- Required meta tags -->
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/normalize/8.0.1/normalize.min.css" />
<link href="https://fonts.googleapis.com/css?family=Roboto+Slab:400,700" rel="stylesheet">
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css">
<!-- Bootstrap CSS -->
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css" integrity="sha384-MCw98/SFnGE8fJT3GXwEOngsV7Zt27NXFoaoApmYm81iuXoPkFOJwJ8ERdknLPMO"
crossorigin="anonymous">
<title>IT Bobo Standup generator</title>
<style>
body{
font-family: "Roboto Slab", Arial,sans-serif;
font-size: 14px;
}
h1{
font-size: 18px;
}
nav{
background-color: #6200ea;
color:white;
}
nav .title{
text-align: center;
padding: 18px 0;
}
nav .title h1{
margin:0;
}
form{
padding: 16px;
padding-bottom: 100px;
/* border-left: 4px solid transparent; */
/* transition: all 0.4s; */
}
form:hover{
box-sizing: content-box;
/* border-left: 4px solid #d81b60; */
}
.container .row{
/* padding: 6px 0; */
}
.no-padding{
padding: 0;
}
.preview-box{
padding-top: 15px;
max-height: 90%;
overflow: hidden;
}
.preview{
line-height: 1.4rem;
padding: 10px;
margin-bottom: 10px;
/*background-color: #ffebee;*/
width: 100%;
}
.fab{
z-index: 200;
background: #d81b60;
border-radius: 50%;
display: flex;
justify-content: center;
align-items: center;
height: 55px;
margin: 1rem;
position: fixed;
width: 55px;
transition: all 0.3s cubic-bezier(.25,.8,.25,1);
bottom: 20px;
right:20px;
color: white;
border:0;
font-size: 18px;
box-shadow: 0 6px 18px rgba(0,0,0,0.1), 0 10px 10px rgba(0,0,0,0.1);
}
.fab:hover {
box-shadow: 0 14px 28px rgba(0,0,0,0.25), 0 10px 10px rgba(0,0,0,0.22);
}
/* .btn-preview-copy{
display: none;
} */
.preview p{
margin:0;
}
em{
opacity: 0.5;
}
.modal-control{
/* position: relative;
bottom:18px; */
}
.speech-wrapper {
padding-left: 20px;
padding-right: 20px;
margin-top:10px;
padding-bottom:36px;
margin-bottom: 18px;
}
.speech-wrapper .bubble {
width: 100%;
height: auto;
display: block;
background: #f5f5f5;
border-radius: 4px;
box-shadow: 2px 8px 5px #000;
position: relative;
margin: 0 0 25px;
}
.speech-wrapper .bubble.alt {
margin: 0 0 0 0px;
}
.speech-wrapper .bubble .txt {
padding: 8px 55px 8px 14px;
}
.speech-wrapper .bubble .txt .name {
font-weight: 600;
font-size: 12px;
margin: 0 0 4px;
color: #3498db;
}
.speech-wrapper .bubble .txt .name span {
font-weight: normal;
color: #b3b3b3;
}
.speech-wrapper .bubble .txt .name.alt {
color: #2ecc71;
}
.speech-wrapper .bubble .txt .message {
font-size: 12px;
margin: 0;
color: #2b2b2b;
}
.speech-wrapper .bubble .txt .timestamp {
font-size: 11px;
position: absolute;
bottom: 8px;
right: 10px;
text-transform: uppercase;
color: #999;
}
.speech-wrapper .bubble .bubble-arrow {
position: absolute;
width: 0;
bottom: 42px;
left: -16px;
height: 0;
}
.speech-wrapper .bubble .bubble-arrow.alt {
right: -2px;
bottom: 40px;
left: auto;
}
.speech-wrapper .bubble .bubble-arrow:after {
content: "";
position: absolute;
border: 0 solid transparent;
border-top: 9px solid #f5f5f5;
border-radius: 0 20px 0;
width: 15px;
height: 30px;
transform: rotate(145deg);
}
.speech-wrapper .bubble .bubble-arrow.alt:after {
transform: rotate(45deg) scaleY(-1);
}
body .preview-box{
position: fixed;
top: -150%;
transition: 0.4s all;
padding-bottom: 15px;
}
body .preview-box .speech-wrapper{
max-height: calc(100vh - 265px);
overflow: scroll;
min-height: 300px;
}
body.modal-open .preview-box{
top:32px;
width: calc(100% - 40px);
background: #fff;
border-radius: 2px;
box-shadow: 0 3px 6px rgba(0,0,0,0.16), 0 3px 6px rgba(0,0,0,0.23);
z-index: 100;
}
body.modal-open .overlay{
background-color: rgba(0, 0, 0,0.5);
z-index: 25;
width: 100%;
height: 100%;
position: fixed;
}
.btn-close-modal{
/* position: absolute; */
}
.btn{
margin-left: 3px;
margin-right: 3px;
}
@media(min-width: 576px){
.no-padding{
padding: 15px;
}
.preview-box{
padding-top: 20px;
}
.fab{
display: none;
}
.overlay{
display: none;
}
body .preview-box{
position: relative;
}
body .preview-box .speech-wrapper{
max-height:none;
overflow:visible;
min-height:unset;
}
.btn-close-modal{
display: none;
}
body.modal-open .preview-box{
top:unset;
width: unset;
background: #fff;
border-radius: 0;
box-shadow:unset;
z-index: 100;
}
}
</style>
</head>
<body>
<div class="overlay btn-generate"></div>
<nav>
<div class="title">
<h1>Standup Report Generator</h1>
</div>
</nav>
<div class="container">
<div class="row justify-content-center">
<div class="col-12 col-md-6 col-lg-4 no-padding data-input">
<form action="" class="form-input">
<div class="form-group">
<label for="name">Your name:</label>
<input type="text" id="name" class="form-control" placeholder="Not specified">
</div>
<div class="form-group">
<label for="past-on">On yesterday or:</label>
<input type="text" id="past-on" class="form-control" placeholder="eg. friday or 24-8-2018, default is yesterday">
</div>
<div class="form-group">
<label for="past-content">What did you do:</label>
<textarea class="form-control" name="" id="past-content" cols="30" rows="6"></textarea>
</div>
<div class="form-group">
<label for="obstacle">Obstacle:</label>
<textarea class="form-control" name="" id="obstacle" cols="30" rows="6"></textarea>
</div>
<div class="form-group">
<label for="today-content">What will you do today:</label>
<textarea class="form-control" name="" id="today-content" cols="30" rows="6"></textarea>
</div>
<div class="form-group">
<label for="today-target">Target today:</label>
<textarea class="form-control" name="" id="today-target" cols="30" rows="6"></textarea>
</div>
</form>
<hr class="d-none d-md-block"/>
</div>
<div class="col-12 col-md-6 col-lg-4 preview-box">
<div class="row">
<div class="col">
<p>Preview:</p>
</div>
</div>
<div class="row">
<div class="col">
<div class="speech-wrapper">
<div class="bubble alt">
<div class="txt">
<p class="name alt">+353 87 1234 567<span> ~ <span class="name"></span></span></p>
<div class="message preview">
<i>No preview</i>
</div>
<span class="timestamp"><span class="time"></span></span>
</div>
<div class="bubble-arrow alt"></div>
</div>
</div>
</div>
</div>
<div class="row modal-control">
<div class="col text-right">
<button class="btn btn-success btn-copy btn-preview-copy">Copy</button><div class="btn btn-info btn-close-modal btn-generate">Close</div>
</div>
</div>
</div>
</div>
</div>
<button class="fab btn-generate">
<i class="fa fa-play" aria-hidden="true"></i>
</button>
<!-- Optional JavaScript -->
<!-- jQuery first, then Popper.js, then Bootstrap JS -->
<script src="https://code.jquery.com/jquery-3.3.1.slim.min.js" integrity="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo"
crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.3/umd/popper.min.js" integrity="sha384-ZMP7rVo3mIykV+2+9J3UJ46jBk0WLaUAdn689aCwoqbBJiSnjAK/l8WvCWPIPm49"
crossorigin="anonymous"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/js/bootstrap.min.js" integrity="sha384-ChfqqxuZUCnJSK3+MXmPNIyE6ZbWh2IMqE241rYiqJxyMiZ6OW/JmZQ5stwEULTy"
crossorigin="anonymous"></script>
</body>
<script>
var str = '';
var $name = $('#name');
var $preview = $('.preview');
var $pastOn = $('.data-input #past-on');
var $obstacle = $('.data-input #obstacle');
var $pastContent = $('.data-input #past-content');
var $todayContent = $('.data-input #today-content');
var $todayTarget = $('.data-input #today-target');
var $chatName = $('span.name');
var $chatTime = $('span.time');
var $btnGenerate = $('.btn-generate');
$btnGenerate.on('click', function(e){
e.preventDefault();
$('body').toggleClass('modal-open');
});
setInterval(function () {
var d = new Date();
$chatTime.text(d.getHours() + ':' + d.getMinutes());
}, 1000);
$('.data-input').on('keyup', '.form-input', function (e) {
var tempStr = '';
$chatName.text($name.val());
str = '';
if ($name.val() === '') {
str += '<em>Name not specified</em><br />';
}
else {
str += "<strong>" + $name.val() + "</strong><br />";
}
if ($pastOn.val() === '') {
str += 'Yesterday:<br />';
}
else {
str += 'On ' + $pastOn.val() + ':<br />'
}
if ($pastContent.val() === '') {
str += '<p><em>none</em></p>';
}
else {
tempStr = '';
$.each($pastContent.val().split("\n"), function (index, item){
tempStr += '<p>• ' + item + '</p>';
});
str += tempStr;
}
str += '<br />Obstacle:<br />';
if ($obstacle.val() === '') {
str += '<p><em>none</em></p>';
}
else {
tempStr = '';
$.each($obstacle.val().split("\n"), function (index, item){
tempStr += '<p>• ' + item + '</p>';
});
str += tempStr;
}
str += '<br />Today:<br />';
if ($todayContent.val() === '') {
str += '<p><em>none</em></p>';
}
else {
tempStr = '';
$.each($todayContent.val().split("\n"), function (index, item){
tempStr += '<p>• ' + item + '</p>';
});
str += tempStr;
}
str += '<br />Target:<br />';
if ($todayTarget.val() === '') {
str += '<p><em>none</em></p>';
}
else {
tempStr = '';
$.each($todayTarget.val().split("\n"), function (index, item){
tempStr += '<p>• ' + item + '</p>';
});
str += tempStr;
}
str = str.replace(new RegExp("\n", 'g'), "<br />");
$preview.html(str);
});
function copy(text) {
text = text.replace(new RegExp('<strong>', 'g'), "*");
text = text.replace(new RegExp('</strong>', 'g'), "*");
text = text.replace(new RegExp('<em>', 'g'), "_");
text = text.replace(new RegExp('</em>', 'g'), "_");
text = text.replace(new RegExp('<p>', 'g'), "");
text = text.replace(new RegExp('</p>', 'g'), '\n');
text = text.replace(new RegExp('<br />', 'g'), '\n');
var parser = new DOMParser;
var dom = parser.parseFromString(text, 'text/html');
var text = dom.body.textContent;
var $temp = $("<textarea>");
$("body").append($temp);
$temp.val(text).select();
document.execCommand("copy");
$temp.remove();
}
$('.btn-copy').on('click', function (e) {
e.preventDefault();
copy(str);
});
</script>
</html>