Add toggle script for details
This commit is contained in:
parent
4bc1a909bb
commit
4e86d180a2
|
@ -11,7 +11,7 @@
|
||||||
<div class="player_count">Players Online: {{player_count}}/{{max_players}}</div>
|
<div class="player_count">Players Online: {{player_count}}/{{max_players}}</div>
|
||||||
<div class="items">
|
<div class="items">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<a class="item news" href="/news">
|
<a class="item news" onclick="return toggleDetails(this)">
|
||||||
<div class="icon"></div>
|
<div class="icon"></div>
|
||||||
<div class="text">News</div>
|
<div class="text">News</div>
|
||||||
</a>
|
</a>
|
||||||
|
@ -20,13 +20,13 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<a class="item map" href="https://play.geekify.de">
|
<a class="item map" href="https://play.geekify.de" target="_blank">
|
||||||
<div class="icon"></div>
|
<div class="icon"></div>
|
||||||
<div class="text">Map</div>
|
<div class="text">Map</div>
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<a class="item whitelist" href="/request">
|
<a class="item whitelist" id="whitelist" onclick="return toggleDetails(this)">
|
||||||
<div class="icon"></div>
|
<div class="icon"></div>
|
||||||
<div class="text">Request Invite</div>
|
<div class="text">Request Invite</div>
|
||||||
</a>
|
</a>
|
||||||
|
@ -41,5 +41,6 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<script src="/js/index.js"></script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
|
@ -89,7 +89,9 @@ body {
|
||||||
}
|
}
|
||||||
|
|
||||||
.details {
|
.details {
|
||||||
display: flex;
|
/* Hidden by default */
|
||||||
|
/*display: flex;*/
|
||||||
|
display: none;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
10
homepage/static/js/index.js
Normal file
10
homepage/static/js/index.js
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
function toggleDetails(e) {
|
||||||
|
var parentElement = e.parentElement
|
||||||
|
var detailsElement = parentElement.querySelector(".details");
|
||||||
|
if (detailsElement.style.display === "none") {
|
||||||
|
detailsElement.style.display = "flex";
|
||||||
|
} else {
|
||||||
|
detailsElement.style.display = "none";
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
Loading…
Reference in a new issue