-
Notifications
You must be signed in to change notification settings - Fork 0
/
search.html
182 lines (150 loc) · 7.45 KB
/
search.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
<!DOCTYPE HTML>
<html>
<head>
<title>Daniel's Website</title>
<!-- PS C:\Program Files (x86)\IIS Express> ./iisexpress.exe /path:C:\Users\sanjo\Desktop\Website /port:8000 -->
<!--http://localhost:8000/ -->
<meta charset="utf-8"/>
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- Chrome, Firefox OS and Opera -->
<meta name="theme-color" content="#004f98">
<!-- Windows Phone -->
<meta name="msapplication-navbutton-color" content="#004f98">
<!-- iOS Safari -->
<meta name="apple-mobile-web-app-status-bar-style" content="#004f98">
<meta name="apple-mobile-web-app-capable" content="yes">
<link rel="icon" href="images/logo.png">
<link href="main.css" rel="stylesheet">
<!-- For icons https://fontawesome.com/icons -->
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.1.1/css/all.css"
integrity="sha384-O8whS3fhG2OnA5Kas0Y9l3cfpmYjapjI0E4theH4iuMD+pLhbf6JI0jIMfYcK3yZ" crossorigin="anonymous">
<!-- For Bootstrap -->
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.2/css/bootstrap.min.css"
integrity="sha384-Smlep5jCw/wG7hdkwQ/Z5nLIefveQRIY9nfy6xoR1uRYBtpZgI6339F5dgvm/e9B" crossorigin="anonymous">
<script src="js/jquery.js"></script>
<!-- Mustache -->
<script src="js/mustache.js"></script>
<!-- MathJax -->
<script type="text/javascript" async
src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js?config=TeX-MML-AM_CHTML">
</script>
<!--load page-->
<script>
$(function () {
$("#load_screen").fadeOut(2000, function () {
$("#homeBtn").attr("class", "nav-item active");
$("#content").fadeIn(500, function () {
startWeb();
});
})
})
</script>
</head>
<body>
<div id="load_screen" class="centered">
<img id="chargingLogo" style="height: 200px" src="images/search.png" class="image-fluid rounded mh-100">
</div>
<div id="content">
<header></header>
<div id="found" style="margin-top: 55px">
<h4 class="text-center font-weight-light" style="font-size: 40px; margin-bottom: 30px; margin-top: 80px">Aucun résultat <i class="fas fa-frown"></i></h4>
<div class="col-lg-8 offset-lg-2 text-center alert alert-primary" style="margin-bottom: 375px"><i class="fas fa-info-circle"></i> Si vous ne trouvez pas ce que vous cherchez, ne doutez pas en m'envoyer un mail!</div>
</div>
<div class="container" id="foundCards">
</div>
<footer></footer>
</div>
<!-- Footer -->
<script src="js/footer.js">
</script>
<script>
$(function () {
if (sessionStorage.length !== 0) {
if (sessionStorage.length == 1) {
$("#found").html('<div class="jumbotron jumbotron-fluid" style="padding-top: 60px; padding-bottom: 60px; "> <div class="container"> <h4 class="text-center font-weight-light" style="font-size: 50px">1 résultat trouvé:</h4> </div> </div>');
} else {
$("#found").html('<div class="jumbotron jumbotron-fluid" style="padding-top: 60px; padding-bottom: 60px; "> <div class="container"> <h4 class="text-center font-weight-light" style="font-size: 45px">'+ sessionStorage.length + ' résultats trouvés:</h4> </div> </div>')
}
$("#foundCards").append("<div class='row' id='searchedCards'></div>");
$.getJSON("text/data.json", function (data) {
$.get("mustache_templates/mathCardsTemplate.mst", function (template) {
$("#searchedCards").append("<div class='container-fluid'><h2 class='text-center font-weight-light' style='font-size: 40px; margin-bottom: 30px'>Maths:</h2><hr style='margin-bottom: 40px'></div><div class='container'><div class='row' id='mathSearch'></div></div>");
for (let x = 0; x < sessionStorage.length; x = x + 1) {
let i = 0;
let j = 0;
for (i in data.Maths) {
for (j in data.Maths[i].thèmes) {
if (sessionStorage.getItem(x.toString()) === data.Maths[i].thèmes[j].title) {
let result = Mustache.render(template, data.Maths[i].thèmes[j]);
$("#mathSearch").append(result);
}
}
}
}
if( $("#mathSearch").html() == ""){
$("#mathSearch").append("<div class='col-md-6 offset-md-3'><img class='img-fluid' src='images/mathSearch.png'></div>");
}
})
$.get("mustache_templates/pcCardsTemplate.mst", function (template) {
$("#searchedCards").append("<div class='container-fluid'><h2 class='text-center font-weight-light' style='font-size: 40px; margin-bottom: 30px'>Physique & Chimie:</h2><hr style='margin-bottom: 40px'></div><div class='container'><div class='row' id='physiqueSearch'></div></div>");
for (let x = 0; x < sessionStorage.length; x = x + 1) {
let i = 0;
let j = 0;
for (i in data.PhysiqueChimie) {
for (j in data.PhysiqueChimie[i].thèmes) {
if (sessionStorage.getItem(x.toString()) === data.PhysiqueChimie[i].thèmes[j].title) {
let result = Mustache.render(template, data.PhysiqueChimie[i].thèmes[j]);
$("#physiqueSearch").append(result);
}
}
}
}
if( $("#physiqueSearch").html() == ""){
$("#physiqueSearch").append("<div class='col-md-6 offset-md-3'><img class='img-fluid' src='images/pcSearch.png'></div>");
}
})
})
}
})
</script>
<div class="modal fade" id="aboutMeModal" tabindex="-1" role="dialog" aria-labelledby="aboutMeModalLabel"
aria-hidden="true">
<!-- Modal Content -->
</div>
<!-- Modal about me -->
<script>
$(function () {
$("#aboutMeModal").load("html/about_me.html");
})
</script>
<!-- Jquery & Javascript for Bootstrap -->
<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.2/js/bootstrap.min.js"
integrity="sha384-o+RDsa0aLu++PJvFqy8fFScvbHFLtbvScb8AjopnFD+iEQ7wo/CG0xlczd+2O/em"
crossorigin="anonymous"></script>
<!-- for Poopers and Tooltips -->
<script>
$(function () {
$('[data-toggle="popover"]').popover()
})
$(function () {
$('[data-toggle="tooltip"]').tooltip()
})
</script>
<!-- my Script -->
<script>
function changeIconEmail() {
var icon = document.getElementById("iconEmail").className;
if (icon == "far fa-envelope") {
document.getElementById("iconEmail").className = "far fa-envelope-open";
} else if (icon == "far fa-envelope-open") {
document.getElementById("iconEmail").className = "far fa-envelope";
}
}
</script>
<!-- Header -->
<script src="js/navbar.js"></script>
</body>
</html>