-
Notifications
You must be signed in to change notification settings - Fork 462
/
index.html
125 lines (99 loc) · 5.01 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Meny - A three dimensional and space efficient menu concept</title>
<meta name="description" content="A three dimensional and space efficient menu created with JavaScript and CSS 3.">
<meta name="author" content="Hakim El Hattab">
<meta name="viewport" content="width=800, user-scalable=no">
<link href='https://fonts.googleapis.com/css?family=Lato:400,700,400italic,700italic' rel='stylesheet' type='text/css'>
<link rel="stylesheet" href="css/demo.css">
</head>
<body>
<div class="meny">
<h2>More Experiments</h2>
<ul>
<li><a href="http://lab.hakim.se/avgrund/">Avgrund</a></li>
<li><a href="http://lab.hakim.se/radar/">Radar</a></li>
<li><a href="http://lab.hakim.se/forkit-js/">forkit.js</a></li>
<li><a href="http://lab.hakim.se/scroll-effects/">stroll.js</a></li>
<li><a href="http://lab.hakim.se/zoom-js">zoom.js</a></li>
<li><a href="http://lab.hakim.se/reveal-js">reveal.js</a></li>
<li><a href="http://itunes.apple.com/us/app/sinuous/id543097218">Sinuous for iOS</a></li>
<li><a href="http://hakim.se/experiments/css/domtree/">DOM Tree</a></li>
<li><a href="http://hakim.se/experiments/css/holobox/">Holobox</a></li>
<li><a href="http://hakim.se/experiments/html5/404/netmag.html">404</a></li>
</ul>
</div>
<div class="meny-arrow"></div>
<div class="contents">
<article>
<h1>Meny</h1>
<p>
A three dimensional and space efficient menu.
</p>
<p>
Move your mouse towards the arrow — or swipe in from the arrow if you're on a touch device — to open.
Test it with any page by appending a URL, like so: <a href="http://lab.hakim.se/meny/?u=http://hakim.se">lab.hakim.se/meny/?u=http://hakim.se.</a>
</p>
<p>
Meny can be positioned on any side of the screen: <br>
<a href="http://lab.hakim.se/meny/?p=top">top</a>
- <a href="http://lab.hakim.se/meny/?p=right">right</a>
- <a href="http://lab.hakim.se/meny/?p=bottom">bottom</a>
- <a href="http://lab.hakim.se/meny/?p=left">left</a>
</p>
<p>
Instructions and download at <a href="http://github.com/hakimel/meny">github.com/hakimel/meny</a>.
</p>
<p>
The name, <em>Meny</em>, is swedish.
</p>
<small>
Created by <a href="https://twitter.com/hakimel">@hakimel</a> / <a href="http://hakim.se/">http://hakim.se</a>
</small>
</article>
<div class="sharing">
<a href="https://twitter.com/share" class="twitter-share-button" data-text="Meny - a three dimensional and space efficient menu concept by @hakimel" data-url="http://lab.hakim.se/meny" data-count="small" data-related="hakimel"></a>
<iframe id="facebook-button" src="https://www.facebook.com/plugins/like.php?href=http%3A%2F%2Flab.hakim.se%2Fmeny%2F&layout=button_count&show_faces=false&width=83&action=like&font=arial&colorscheme=light&height=21" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:85px; height:24px; position: relative; top: 4px;" allowTransparency="true"></iframe>
</div>
<a href="https://github.com/hakimel/meny"><img style="position: absolute; top: 0; right: 0; border: 0;" src="https://github-camo.global.ssl.fastly.net/365986a132ccd6a44c23a9169022c0b5c890c387/68747470733a2f2f73332e616d617a6f6e6177732e636f6d2f6769746875622f726962626f6e732f666f726b6d655f72696768745f7265645f6161303030302e706e67" alt="Fork me on GitHub"></a>
</div>
<script src="js/meny.js"></script>
<script>
// Create an instance of Meny
var meny = Meny.create({
// The element that will be animated in from off screen
menuElement: document.querySelector( '.meny' ),
// The contents that gets pushed aside while Meny is active
contentsElement: document.querySelector( '.contents' ),
// [optional] The alignment of the menu (top/right/bottom/left)
position: Meny.getQuery().p || 'left',
// [optional] The height of the menu (when using top/bottom position)
height: 200,
// [optional] The width of the menu (when using left/right position)
width: 260,
// [optional] Distance from mouse (in pixels) when menu should open
threshold: 40,
// [optional] Use mouse movement to automatically open/close
mouse: true,
// [optional] Use touch swipe events to open/close
touch: true
});
// API Methods:
// meny.open();
// meny.close();
// meny.isOpen();
// Events:
// meny.addEventListener( 'open', function(){ console.log( 'open' ); } );
// meny.addEventListener( 'close', function(){ console.log( 'close' ); } );
// Embed an iframe if a URL is passed in
if( Meny.getQuery().u && Meny.getQuery().u.match( /^http/gi ) ) {
var contents = document.querySelector( '.contents' );
contents.style.padding = '0px';
contents.innerHTML = '<div class="cover"></div><iframe src="'+ Meny.getQuery().u +'" style="width: 100%; height: 100%; border: 0; position: absolute;"></iframe>';
}
</script>
<script type="text/javascript" src="https://platform.twitter.com/widgets.js"></script>
</body>
</html>