This repository has been archived by the owner on Dec 25, 2023. It is now read-only.
forked from electerious/basicContext
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpopIn.html
114 lines (84 loc) · 2.49 KB
/
popIn.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
<!doctype html>
<html lang="en">
<meta charset="utf-8">
<title>basicContext Demo</title>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/normalize/3.0.3/normalize.min.css">
<link rel="stylesheet" href="http://code.ionicframework.com/ionicons/2.0.1/css/ionicons.min.css">
<link rel="stylesheet" href="../../dist/basicContext.min.css">
<link rel="stylesheet" href="../../dist/themes/default.min.css">
<link rel="stylesheet" href="../../dist/addons/popin.min.css">
<style>
html {
width: 100%;
height: 100%;
}
body {
min-height: 100%;
font-size: 14px;
}
a {
display: inline-block;
position: absolute;
margin: 5px;
padding: 6px 10px;
background: #4393e6;
color: #fff;
text-decoration: none;
border-radius: 3px;
-moz-user-select: none;
-webkit-user-select: none;
-ms-user-select: none;
user-select: none;
}
a.topleft {
top: 0;
left: 0;
}
a.topright {
top: 0;
right: 0;
}
a.bottomleft {
bottom: 0;
left: 0;
}
a.bottomright {
bottom: 0;
right: 0;
}
a.center {
top: 50%;
left: 50%;
-webkit-transform: translate(-50%, -50%);
transform: translate(-50%, -50%);
}
</style>
<a href="#" class="topleft">Click me!</a>
<a href="#" class="topright">Click me!</a>
<a href="#" class="bottomleft">Click me!</a>
<a href="#" class="bottomright">Click me!</a>
<a href="#" class="center">Click me!</a>
<script src="../../dist/basicContext.min.js"></script>
<script>
var onClick = function(e) {
var clicked = function() { alert('Item clicked!') }
var items = [
{ title: 'Add Sites', icon: 'ion-plus-round', fn: clicked },
{ title: 'Reset Login', icon: 'ion-person', fn: clicked },
{ title: 'Help', icon: 'ion-help-buoy', fn: clicked },
{ title: 'Disabled', icon: 'ion-minus-circled', fn: clicked, disabled: true },
{ title: 'Invisible', icon: 'ion-eye-disabled', fn: clicked, visible: false },
{ },
{ title: 'Logout', icon: 'ion-log-out', fn: clicked }
]
basicContext.show(items, e)
}
document.addEventListener('DOMContentLoaded', function() {
document.querySelector('a.topleft').addEventListener('click', onClick)
document.querySelector('a.topright').addEventListener('click', onClick)
document.querySelector('a.bottomleft').addEventListener('click', onClick)
document.querySelector('a.bottomright').addEventListener('click', onClick)
document.querySelector('a.center').addEventListener('click', onClick)
})
</script>
</html>