Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

better handling of classic menu and neomenu #153

Open
kaguy4 opened this issue Oct 22, 2024 · 0 comments
Open

better handling of classic menu and neomenu #153

kaguy4 opened this issue Oct 22, 2024 · 0 comments
Labels
enhancement For stuff that needs to be improved

Comments

@kaguy4
Copy link
Member

kaguy4 commented Oct 22, 2024

both menu types being generated into the page by a file or simply be defined in globalconfig.php file

neomenu having a class that makes it have "display: hidden", then JS toggles the class between them when u check/uncheck the setting. So an improved version of this (copying from Heyuri's source), CTRL+F for "hide":

<div class="boardlist">
		<small class="toplinks"><style>
.neomenu>li {
  float:left;
}
.neomenu li {
  width:13em;
}
.neomenu * {
  z-index:100;
}
.neomenu .menutitle {
  width:auto;
  padding-right:3em;
}
.neomenu .menutitle a:hover {
  background-color:transparent;
}
.boardNav,
.boardlist,
#boardmenu li a {
  color:inherit;
}
.neomenu li a:visited,
.neomenu li a {
  display:block;
  color:inherit;
  text-decoration:none;
}
.neomenu li a:hover {
  background-color:rgba(0,0,0,0.1);
}
.neomenu .reply {
  padding:0;
  margin:0;
}
.neomenu .menulist {
  position:absolute;
  list-style:none;
  display:none;
  border-style:solid;
  border-width:1px;
}
.neomenu>li:hover .menulist {
  display:initial;
}
.neomenu {
  list-style:none;
  margin:0;
  padding:0;
  font-size:10pt;
}
.logo {
  clear:both;
}
.boardNav.reply {
  padding:0!important;
}
</style>

  <style>
    .hide {
      display: none;
    }
  </style>

<script>
window.onload = function() {
  // Get references to both menus
  var classicMenu = document.querySelector('.classicmenu');
  var neoMenu = document.querySelector('.neomenu');

  // Check if 'neomenu' is set to 'true' in localStorage
  if (localStorage.getItem("neomenu") === "true") {
    // Show neomenu and hide classicmenu
    neoMenu.classList.remove('hide');
    classicMenu.classList.add('hide');
  } else {
    // Show classicmenu and hide neomenu (default behavior)
    neoMenu.classList.add('hide');
    classicMenu.classList.remove('hide');
  }
}
</script>


<div class="classicmenu">
[ <a class="bl" title="Overboard" href="[//img.heyuri.net/all/](view-source:https://img.heyuri.net/all/)">all</a> ]
[ <a class="bl" title="Anime/Manga" href="[//img.heyuri.net/a/](view-source:https://img.heyuri.net/a/)">a</a> / 
<a class="bl" title="Off-Topic" href="[//img.heyuri.net/b/](view-source:https://img.heyuri.net/b/)">b</a> / 
<a class="bl" title="2D Cute" href="[//img.heyuri.net/c/](view-source:https://img.heyuri.net/c/)">c</a> / 
<a class="bl" title="Flash" href="[//img.heyuri.net/f/](view-source:https://img.heyuri.net/f/)">f</a> / 
<a class="bl" title="2D Ero" href="[//img.heyuri.net/h/](view-source:https://img.heyuri.net/h/)">h</a> / 
<a class="bl" title="日本語" href="[//img.heyuri.net/jp/](view-source:https://img.heyuri.net/jp/)">jp</a> / 
<a class="bl" title="2D Lolikon" href="[//img.heyuri.net/l/](view-source:https://img.heyuri.net/l/)">l</a> / 
<a class="bl" title="Oekaki" href="[//img.heyuri.net/o/](view-source:https://img.heyuri.net/o/)">o</a> / 
<a class="bl" title="Site Discussion" href="[//img.heyuri.net/q/](view-source:https://img.heyuri.net/q/)">q</a> / 
<a class="bl" title="Strange World" href="[//dis.heyuri.net/sw/](view-source:https://dis.heyuri.net/sw/)">sw</a> / 
<a class="bl" title="Lounge" href="[//dis.heyuri.net/lounge/](view-source:https://dis.heyuri.net/lounge/)">lounge</a> ]
[ <a class="bl" title="Heyuri★CGI" target="_top" href="[//cgi.heyuri.net/](view-source:https://cgi.heyuri.net/)">cgi</a> ]
[ <a class="bl" title="Uploader" href="[//up.heyuri.net/](view-source:https://up.heyuri.net/)">up</a> ]
[ <a class="bl" title="Heyuri Historical Society" href="[//wiki.heyuri.net/index.php?title=Main_Page](view-source:https://wiki.heyuri.net/index.php?title=Main_Page)">wiki</a> ]
</div>



<ul class="neomenu hide">
<li class="menutitle"><a class="extr" href="[https://www.heyuri.net/](view-source:https://www.heyuri.net/)" target="_top"><b>Heyuri!</b></a></li>

<li class="reply">
<a><b>Bulletin Boards</b></a>
<ul class="reply menulist">
<li><a class="extr" href="[//img.heyuri.net/c/](view-source:https://img.heyuri.net/c/)">2D Cute</a></li>
<li><a class="extr" href="[//img.heyuri.net/h/](view-source:https://img.heyuri.net/h/)">2D Ero</a></li>
<li><a class="extr" href="[//img.heyuri.net/l/](view-source:https://img.heyuri.net/l/)">2D Lolikon</a></li>
<li><a class="extr" href="[//img.heyuri.net/a/](view-source:https://img.heyuri.net/a/)">Anime/Manga</a></li>
<li><a class="extr" href="[//dis.heyuri.net/lounge/](view-source:https://dis.heyuri.net/lounge/)">Lounge</a></li>
<li><a class="extr" href="[//img.heyuri.net/f/](view-source:https://img.heyuri.net/f/)">Flash</a></li>
<li><a class="extr" href="[//img.heyuri.net/jp/](view-source:https://img.heyuri.net/jp/)">日本語/Japan</a></li>
<li><a class="extr" href="[//img.heyuri.net/o/](view-source:https://img.heyuri.net/o/)">Oekaki</a></li>
<li><a class="extr" href="[//img.heyuri.net/b/](view-source:https://img.heyuri.net/b/)">Off-Topic</a></li>
<li><a class="extr" href="[//img.heyuri.net/q/](view-source:https://img.heyuri.net/q/)">Site Discussion</a></li>
<li><a class="extr" href="[//dis.heyuri.net/sw/](view-source:https://dis.heyuri.net/sw/)">Strange World</a></li>
<li><a class="extr" href="[//img.heyuri.net/all/](view-source:https://img.heyuri.net/all/)">Overboard</a></li>
</ul>
</li>
@kaguy4 kaguy4 added the enhancement For stuff that needs to be improved label Oct 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement For stuff that needs to be improved
Projects
None yet
Development

No branches or pull requests

1 participant