-
Notifications
You must be signed in to change notification settings - Fork 0
/
script.js
92 lines (75 loc) · 2.86 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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
$(document).ready(function() {
jQuery.fx.interval = 5;
var html = $("html");
var mainContainer = $("#mainContainer");
$(document).on("click","#solverLink, #reset", function() {
mainContainer.animate({opacity:"0"}, function() {
mainContainer.load("SolverMainContainer.html", function() {
mainContainer.animate({opacity:"1"});
$("#form").validate({
onfocusout: false,
onkeyup: false,
errorPlacement: function() {
return true;
},
highlight: function(element) {
$(element).animate({backgroundColor:"rgba(250, 192, 144, 1)"})
.animate({backgroundColor:"rgba(250, 192, 144, 0.01)"});
},
submitHandler: function() {
var animateOnSubmit = $("#animateOnSubmit");
var loadingGif = $("#loadingGif");
html.css("overflow","hidden");
animateOnSubmit.animate({top:"-=10px"})
.animate({top:"+=350px", opacity:"0"}, function() {
loadingGif.css("display","inline").animate({opacity:"1"});
});
var formData = $("#form").serialize();
$.ajax({
type: "GET",
url: "/solve",
data: formData,
cache: false,
success: function(data) {
loadingGif.fadeOut(function() {
animateOnSubmit.html(data).animate({top:"-=350px", opacity:"1"})
.animate({top:"+=10px"}, function() {
html.css("overflow","auto");
});
});
}
});
return false;
}
});
});
});
});
$(document).on("click","#algorithmLink", function() {
mainContainer.animate({opacity:"0"}, function() {
mainContainer.load("AlgorithmMainContainer.html", function() {
mainContainer.animate({opacity:"1"});
});
});
});
$(document).on("click","#codeLink", function() {
mainContainer.animate({opacity:"0"}, function() {
mainContainer.load("CodeMainContainer.html", function() {
mainContainer.animate({opacity:"1"});
});
});
});
$(document).on("mouseenter",".homeLink", function() {
$(".homeLink").animate({opacity:"0"});
});
$(document).on("mouseleave",".homeLink", function() {
$(".homeLink").animate({opacity:"1"});
});
$(document).on("click",".homeLink", function() {
mainContainer.animate({opacity:"0"}, function() {
mainContainer.load("HomeMainContainer.html", function() {
mainContainer.animate({opacity:"1"});
});
});
});
});