-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathscript.js
71 lines (60 loc) · 1.51 KB
/
script.js
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
jQuery(document).ready(function($) {
setTimeout(function(){
glitch();
}, 2000);
function glitch(){
$(".main").glitch({
amount: 10,
complete: function(canvas){
$(".glitch").html('').append(canvas);
var x = Math.floor(Math.random() * 20) + 1;
if(x>15){
var delay = (Math.random() * 2) + 1;
var next = Math.floor(Math.random() * 5) + 1;
// setTimeout(function(){
setTimeout(function(){
glitch();
}, next*50);
// }, delay*10);
} else {
var delay = (Math.random() * 2) + 1;
var next = Math.floor(Math.random() * 5) + 1;
setTimeout(function(){
$(".glitch").html('');
setTimeout(function(){
glitch();
}, next*1000);
}, delay*200);
}
}
});
}
$("form").on('submit', function(){
var $this = $(this);
var val = $this.find('input[type="email"]').val();
$this.find('input[type="submit"]').val('Tilmelder..');
$.ajax({
url: 'https://forrykt.taokitamoto.dk/submit.php',
type: 'POST',
data: {mail: val},
})
.done(function(data) {
setTimeout(function(){
$(".submit").hide();
$(".done").show();
}, 1000);
});
return false;
});
$(".pragtfuldt").on('click', function(){
$(".mail-box").hide();
$(".submit").show();
$(".open-tilmeld").show();
$(".submit").find('input[type="email"]').val('');
$(".done").hide();
});
$(".open-tilmeld").on('click', function(){
$(this).hide();
$(".mail-box").show();
});
});