forked from callmenick/Custom-Context-Menu
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex2.html
214 lines (199 loc) · 11.3 KB
/
index2.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
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
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Custom Context Menus!</title>
<link rel="stylesheet" href="reset.css">
<link rel="stylesheet" href="font-awesome-4.7.0/css/font-awesome.css">
<!-- <link rel="stylesheet" href="style.css"> -->
<!-- <link rel="stylesheet" href="theme-1013-dark.css"> -->
<!-- <link rel="stylesheet" href="theme-1014-dark.css"> -->
<!-- <link rel="stylesheet" href="theme-12-light.css"> -->
<!-- <link rel="stylesheet" href="theme-12-dark.css"> -->
</head>
<body>
<header class="primary-header">
<div class="container">
<h1 class="primary-header__title">
My Tasks App <small>using custom context menus</small>
</h1>
</div>
</header>
<main class="content">
<div class="container">
<ul class="tasks">
<li class="task" data-id="3">
<div class="task__content">
Go To Grocery
</div>
<div class="task__actions">
<span class="fa fa-eye"></span>
<span class="fa fa-edit"></span>
<span class="fa fa-times"></span>
</div>
</li>
<li class="task" data-id="2">
<div class="task__content">
Type Some Code
</div>
<div class="task__actions">
<span class="fa fa-eye"></span>
<span class="fa fa-edit"></span>
<span class="fa fa-times"></span>
</div>
</li>
<li class="task" data-id="1">
<div class="task__content">
Build An App
</div>
<div class="task__actions">
<span class="fa fa-eye"></span>
<span class="fa fa-edit"></span>
<span class="fa fa-times"></span>
</div>
</li>
</ul>
<div class="content__footer">
<button>Add A New Task</button>
</div>
</div>
</main>
<footer class="primary-footer">
<div class="container">
<small>© 2015, Context Menu Madness!</small>
</div>
</footer>
<p style="position: relative; left: 50px;">:: Context Menu Result ::</p>
<div id="output"></div>
<nav id="context-menu" class="context-menu">
<ul class="context-menu__items">
<li class="context-menu__item">
<a href="#" class="context-submenu__link sm-link-icon" data-action="sm0"><span class="fa fa-leaf"></span><span class="itemlabel"> Nature List</span><span class="speed"> </span></a>
</li>
<li class="context-menu__item">
<a href="#" class="context-menu__link context-menu__link-disabled separator" data-action="separator" style="cursor:default;"><span class="fa fa-window-minimize" style="transform: scale(100, 1); font-size: 8px;"></span><span class="speed"> </span></a>
</li>
<li class="context-menu__item">
<a href="#" class="context-menu__link" data-action="View"><span class="fa fa-eye"></span><span class="itemlabel"> View Task</span><span class="speed"> </span></a>
</li>
<li class="context-menu__item">
<a href="#" class="context-menu__link context-menu__link-disabled" data-action="Edit" style="cursor:default;"><span class="fa fa-edit"></span><span class="itemlabel"> Edit Task</span><span class="speed"> </span></a>
</li>
<li class="context-menu__item">
<a href="#" class="context-menu__link" data-action="Delete"><span class="fa fa-times"></span><span class="itemlabel"> Delete Task</span><span class="speed"> </span></a>
</li>
<a href="#" class="context-menu__link context-menu__link-disabled separator" data-action="separator" style="cursor:default;"><span class="fa fa-window-minimize" style="transform: scale(100, 1); font-size: 8px;"></span><span class="speed"> </span></a>
</li>
<li class="context-menu__item">
<a href="#" class="context-menu__link" data-action="Edit"><span class="fa fa-edit"></span><span class="itemlabel"> Change Desktop Background Wallpaper</span><span class="speed"> </span></a>
</li>
<li class="context-menu__item">
<a href="#" class="context-submenu__link sm-link-icon" data-action="sm7"><span class="fa fa-gear"></span><span class="itemlabel"> Options</span><span class="speed"> </span></a>
</li>
<li class="context-menu__item">
<a href="#" class="context-submenu__link sm-link-icon" data-action="sm8"><span class="fa fa-plane"></span><span class="itemlabel"> Travel</span><span class="speed"> </span></a>
</li>
<li class="context-menu__item">
<a href="#" class="context-menu__link context-menu__link-disabled" data-action="Paint" style="cursor:default;"><span class="fa fa-paint-brush"></span><span class="itemlabel"> Paint the Moon</span><span class="speed"> </span></a>
</li>
<li class="context-menu__item">
<a href="#" class="context-submenu__link sm-link-icon" data-action="sm10"><span class="fa fa-ellipsis-h"></span><span class="itemlabel"> LongStuff</span><span class="speed"> </span></a>
</li>
</ul>
</nav>
<div id="context-submenu">
<nav id="sm0" class="context-submenu" data-id="0">
<ul class="context-submenu__items">
<li class="context-submenu__item">
<a href="#" class="context-menu__link" data-action="Apple"><span class="fa fa-apple"></span><span class="itemlabel"> Fruit</span><span class="speed"> </span></a>
</li>
<li class="context-submenu__item">
<a href="#" class="context-menu__link" data-action="Paw"><span class="fa fa-paw"></span><span class="itemlabel"> Paw</span><span class="speed"> </span></a>
</li>
<li class="context-submenu__item">
<a href="#" class="context-menu__link" data-action="Tree"><span class="fa fa-tree"></span><span class="itemlabel"> Tree</span><span class="speed"> </span></a>
</li>
</ul>
</nav>
<nav id="sm7" class="context-submenu" data-id="7">
<ul class="context-submenu__items">
<li class="context-submenu__item">
<a href="#" class="context-menu__link" data-action="SMA"><span class="fa fa-check"></span><span class="itemlabel"> SubMenu Item A</span><span class="speed"> </span></a>
</li>
<li class="context-submenu__item">
<a href="#" class="context-menu__link context-menu__link-disabled" data-action="SMB" style="cursor:default;"><span class="fa fa-minus"></span><span class="itemlabel"> SubMenu Item B</span><span class="speed"> </span></a>
</li>
<li class="context-submenu__item">
<a href="#" class="context-menu__link context-menu__link-disabled" data-action="SMC" style="cursor:default;"><span class="fa fa-plus"></span><span class="itemlabel"> SubMenu Item C</span><span class="speed"> </span></a>
</li>
</ul>
</nav>
<nav id="sm8" class="context-submenu" data-id="8">
<ul class="context-submenu__items">
<li class="context-submenu__item">
<a href="#" class="context-menu__link" data-action="2SMA2"><span class="fa fa-car"></span><span class="itemlabel"> Second SubMenu Item 2A</span><span class="speed"> </span></a>
</li>
<li class="context-submenu__item">
<a href="#" class="context-menu__link" data-action="2SMB2"><span class="fa fa-bus"></span><span class="itemlabel"> Second SubMenu Item 2B</span><span class="speed"> </span></a>
</li>
<li class="context-submenu__item">
<a href="#" class="context-menu__link" data-action="2SMC2"><span class="fa fa-train"></span><span class="itemlabel"> Second SubMenu Item 2C</span><span class="speed"> </span></a>
</li>
</ul>
</nav>
<nav id="sm10" class="context-submenu" data-id="10">
<ul class="context-submenu__items">
<li class="context-submenu__item">
<a href="#" class="context-menu__link" data-action="TOGGLEICON"><span class="fa fa-chain"></span><span class="itemlabel"> Click Piggy</span><span class="speed"> </span></a>
</li>
<li class="context-submenu__item">
<a href="#" class="context-menu__link" data-action="Might break"><span class="fa fa-coffee"></span><span class="itemlabel"> This line is a joy to behold</span><span class="speed"> </span></a>
</li>
<li class="context-submenu__item">
<a href="#" class="context-menu__link" data-action="Sure to break"><span class="fa fa-bomb"></span><span class="itemlabel"> Here we go again - another big long line to check stuff out, maybe it will work maybe not.</span><span class="speed"> </span></a>
</li>
</ul>
</nav>
</div>
<script src="main.js"></script>
<script>
/* ******************* not required if style links are used in HEAD ******************* */
var customtheme
if (window.matchMedia) {
// Check if the dark-mode Media-Query matches
if (window.matchMedia('(prefers-color-scheme: dark)').matches) {
// Dark
console.log('DARK mode supported');
customtheme = 'theme-12-dark.css';
} else {
// Light
console.log('LIGHT mode supported');
customtheme = 'theme-12-light.css';
}
} else {
// Default (when Media-Queries are not supported)
console.log('LIGHT/DARK mode not supported');
customtheme = 'style.css'
}
function loadStyle(src) {
return new Promise(function(resolve, reject) {
let link = document.createElement('link');
link.href = src;
link.rel = 'stylesheet';
link.onload = () => resolve(link);
link.onerror = () => reject(new Error(`Style load error for ${src}`));
document.head.append(link);
});
}
window.onload = function() {
loadStyle("style.css")
.then(() => loadStyle(customtheme))
.then(() => {
alert('All styles are loaded!');
})
.catch(err => alert(err));
}
/* **************************************************************************************** */
</script>
</body>
</html>