Manual update, mobile friendly sites, minor design improvements

This commit is contained in:
MrFry 2019-10-26 10:10:26 +02:00
parent f7b0e727fc
commit 462eff3c75
6 changed files with 60 additions and 48 deletions

View file

@ -5,6 +5,7 @@
<head>
<title>All questions</title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=0.8" />
<style>
body {
font: normal 14px Verdana;
@ -79,7 +80,12 @@
<% include aludni.ejs %>
<% for (var i = 0; i < data.Subjects.length; i++) { %>
<button class="collapsible">
<button
class="collapsible"
style='<%= i % 2 === 0 ? "background-color: #2f2f37" : "" %>'
onmouseenter='mouseEnter(this, <%= i %>)'
onmouseleave='mouseLeave(this, <%= i %>)'
>
<h2>
<table id=<%=i%>>
<td>
@ -90,41 +96,51 @@
</td>
</table>
</h2>
</button>
</button>
<div class="content">
<% var a = data.Subjects[i].toString().split('\n')%>
<% for (var j = 1; j < a.length; j++) { %>
<% if (a[j][0] == '?') { %>
</br>
<% } %>
<%=a[j] %>
</br>
<% } %>
<% for (var j = 1; j < a.length; j++) { %>
<% if (a[j][0] == '?') { %>
</br>
<% } %>
<%=a[j] %>
</br>
<% } %>
</div>
<% } %>
<script>
var coll = document.getElementsByClassName("collapsible");
var i;
<script>
var coll = document.getElementsByClassName("collapsible");
var i;
for (i = 0; i < coll.length; i++) {
coll[i].addEventListener("click", function() {
this.classList.toggle("active");
var content = this.nextElementSibling;
if (content.style.display === "block") {
content.style.display = "none";
} else {
content.style.display = "block";
}
});
}
function openall () {
var coll = document.getElementsByClassName("content");
var i;
for (i = 0; i < coll.length; i++) {
coll[i].style.display = "block";
}
for (i = 0; i < coll.length; i++) {
coll[i].addEventListener("click", function() {
this.classList.toggle("active");
var content = this.nextElementSibling;
if (content.style.display === "block") {
content.style.display = "none";
} else {
content.style.display = "block";
}
</script>
});
}
function openall () {
var coll = document.getElementsByClassName("content");
var i;
for (i = 0; i < coll.length; i++) {
coll[i].style.display = "block";
}
}
function mouseEnter (e, i) {
e.style.backgroundColor = "#555"
}
function mouseLeave (e, i) {
if (i % 2 == 0) {
e.style.backgroundColor = "#2f2f37"
} else {
e.style.backgroundColor = "#212127"
}
}
</script>
<% include b.ejs %>
</body>
</html>