Skip to content

Instantly share code, notes, and snippets.

@namgo
Last active September 20, 2018 17:43
Show Gist options
  • Save namgo/aac094bb7d33f97870708c317827c705 to your computer and use it in GitHub Desktop.
Save namgo/aac094bb7d33f97870708c317827c705 to your computer and use it in GitHub Desktop.
A weird menu system that doesn't really have any application to the real web
<!DOCTYPE html>
<html>
<head>
<title>Einzig Menu Demonstration</title>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<meta charset="utf-8">
<style>
#menu {
display: none;
position: fixed;
border: solid #000;
border-width: 1px 1px;
background-color: white;
z-index: 1;
}
</style>
</head>
<body>
<div id="menu">
-<a href="https://theanarchistlibrary.org/library/max-stirner-the-ego-and-his-own">The Ego and Its Own</a><br/>
-<a href="https://medium.com">medium.com</a>
</div>
<p>This is the einzig menu, it is intended to be a potential replacement for the current way that menus are done on the web.</p>
<p>It is inspired by <a href="https://theanarchistlibrary.org/library/max-stirner-the-ego-and-his-own">The Ego and Its Own</a> but functionally off of the old menus of the openbox window manager menu and its predecessors.</p>
<p>I believe the value of this menu is that you no longer have to present the user instantly with other places to navigate to, but can rather give them the option to navigate if they choose to do so.</p>
<p>This is valuable in saving screen space in a distraction-free almost-single-page-app.</p>
<script>
$(window).click(function(e) {
if(e.target.nodeName != 'A') {
hoverdiv(e);
}
})
function hoverdiv(e){
var left = e.clientX + "px";
var top = e.clientY + "px";
var div = document.getElementById('menu');
div.style.left = left;
div.style.top = top;
$("#menu").toggle();
return false;
}
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment