Pfusch lol

This commit is contained in:
Flummi 2018-02-19 11:15:33 +01:00
parent 06bebbd6ae
commit f8fbcf0384
3 changed files with 19 additions and 2 deletions

View File

@ -154,6 +154,9 @@ menu
{ {
background-color: #777; background-color: #777;
} }
menu li > ul.hidden {
display: none;
}
menu li p menu li p
{ {

13
public/js/main.js Normal file
View File

@ -0,0 +1,13 @@
$(document).ready(() => {
switch(window.location.pathname.split(/\//)[1]) {
case "v": $("li:eq(1)").addClass("active"); break;
case "u": $("li:eq(3)").addClass("active"); break;
case "a":
$("li:eq(5)").addClass("active");
$("li:eq(5) > ul").removeClass("hidden");
break;
default:
$("li:eq(0)").addClass("active");
break;
}
});

View File

@ -15,13 +15,13 @@
<p id="info">a javascript pastebin</p> <p id="info">a javascript pastebin</p>
</header> </header>
<menu> <menu>
<li class="active highlight"><a href="/">New paste</a></li> <li class="highlight"><a href="/">New paste</a></li>
<li class="highlight"><a href="/v">View pastes</a></li> <li class="highlight"><a href="/v">View pastes</a></li>
<li><hr></li> <li><hr></li>
<li class="highlight"><a href="/u">Login</a></li> <li class="highlight"><a href="/u">Login</a></li>
<li><hr></li> <li><hr></li>
<li class="highlight"><a href="/a">About</a> <li class="highlight"><a href="/a">About</a>
<ul class="submenu"> <ul class="submenu hidden">
<li><a href="/a/howto">How to</a></li> <li><a href="/a/howto">How to</a></li>
<li><a href="/a/contact">Contact</a></li> <li><a href="/a/contact">Contact</a></li>
<li><a href="/a/statistics">Statistics</a></li> <li><a href="/a/statistics">Statistics</a></li>
@ -35,6 +35,7 @@
<script type="text/javascript" src="/js/jquery-3.1.0.min.js"></script> <script type="text/javascript" src="/js/jquery-3.1.0.min.js"></script>
<script type="text/javascript" src="/js/jquery.timeago.js"></script> <script type="text/javascript" src="/js/jquery.timeago.js"></script>
<script type="text/javascript" src="/js/main.js"></script>
<script> <script>
$(document).ready(() => { $(document).ready(() => {
let s = $.timeago.settings; let s = $.timeago.settings;