Repository navigation
Expand file tree
/
Copy pathindex.html
More file actions
172 lines (172 loc) · 4.02 KB
/
Copy pathindex.html
File metadata and controls
172 lines (172 loc) · 4.02 KB
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
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport"
content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Mobile navigation</title>
<script src="src/jquery.min.js"></script>
<script src="src/jRespond.min.js"></script>
<script src="src/mobile-navigation.js"></script>
<script>
var jRes = jRespond([
{
label: 'mobile',
enter: 0,
exit: 767
},{
label: 'desktop',
enter: 768,
exit: 10000
}
]);
$(document).on('ready', function(){
Shopeca.MobileNavigation.configure({
breakpoint: 'mobile',
jRes: jRes,
heading: 'Menu',
templates: {
button: '<button class="mobile-navigation-button hamburger hamburger--squeeze" type="button"><span class="hamburger-box"><span class="hamburger-inner"></span></span></button>'
}
});
Shopeca.MobileNavigation.addSection('main', {element: $('nav.nav1'), name: 'Hlavní'});
Shopeca.MobileNavigation.addSection('secondary', {element: $('nav.nav2'), name: 'Sekundarni', heading: '<h3>Sekundární menu</h3>'});
Shopeca.MobileNavigation.addSection('tertiary', {element: $('nav.nav3'), name: 'Tercialni', initialize: function (panel) {
setTimeout(function() {
$('a', panel).eq(1).css('backgroundColor', 'red');
}, 2000);
}});
Shopeca.MobileNavigation.addSection('info', {element: $('div.nav4'), name: 'Info'});
});
</script>
<link href="src/hamburgers.css" rel="stylesheet">
<style>
* {
margin: 0;
padding: 0;
}
.mobile-navigation-wrapper {
background: rgba(0,0,0,.2);
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
}
.mobile-navigation-panel {
background: #222;
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
}
.mobile-navigation-button {
position: fixed;
bottom: 20px;
right: 20px;
z-index: 100;
background: indianred;
width: 50px;
height: 50px;
border-radius: 50px;
}
.mobile-navigation-heading {
width: 100%;
height: 50px;
line-height: 50px;
background: indianred;
color: #fff;
padding: 0 20px;
box-sizing: border-box;
}
.mobile-navigation-section {
display: none;
}
.mobile-navigation-section.active {
display: block;
overflow-y: scroll;
overflow-x: hidden;
height: calc(100% - 100px);
color: #fff;
}
.mobile-navigation-section a {
color: #fff;
display: block;
width: 100%;
height: 40px;
line-height: 40px;
padding: 10px 20px;
border-bottom: 1px solid dimgray;
text-decoration: none;
}
.mobile-navigation-section a:hover {
background: #000;
}
.mobile-navigation-section p, .mobile-navigation-section h3 {
padding: 20px 20px 0 20px;
}
.mobile-navigation-section-buttons {
width: 100%;
height: 50px;
line-height: 50px;
background: dimgray;
color: #fff;
padding: 0 20px;
box-sizing: border-box;
position: absolute;
left: 0;
bottom: 0;
}
.mobile-navigation-section-buttons button {
border: 0;
background: #444;
color: #fff;
margin-right: 15px;
height: 40px;
line-height: 40px;
padding: 0 15px;
cursor: pointer;
outline: 0;
}
.mobile-navigation-section-buttons button:hover {
background: #000;
}
.mobile-navigation-section-buttons button.active {
background: indianred;
}
</style>
</head>
<body>
<nav class="nav1">
<a href="">Ahoj</a>
<a href="">Čau</a>
</nav>
<nav class="nav2">
<a href="">Produkty</a>
<a href="">Doplňky</a>
<a href="">Kosmetika</a>
<a href="">Auta</a>
<a href="">Drogerie</a>
<a href="">Produkty</a>
<a href="">Doplňky</a>
<a href="">Kosmetika</a>
<a href="">Auta</a>
<a href="">Drogerie</a>
<a href="">Produkty</a>
<a href="">Doplňky</a>
<a href="">Kosmetika</a>
<a href="">Auta</a>
<a href="">Drogerie</a>
</nav>
<nav class="nav3">
<a href="">Jeste neco</a>
<a href="">Haleluja</a>
</nav>
<div class="nav4">
<h3>Info</h3>
<p>Lorem ipsum neco neco</p>
</div>
</body>
</html>