-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdesktop.html
137 lines (117 loc) · 3.64 KB
/
desktop.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
<!DOCTYPE html>
<html lang="en" class="demo">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Dynamic Demo</title>
<link rel="stylesheet" href="assets/css/region-picker.css">
<script src="mock/region-data.js"></script>
<style>
* {
-webkit-tap-highlight-color: rgba(0, 0, 0, 0);
-moz-tap-highlight-color: rgba(0, 0, 0, 0);
-ms-tap-highlight-color: rgba(0, 0, 0, 0);
-o-tap-highlight-color: rgba(0, 0, 0, 0);
}
*,
*:before,
*:after {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
position: relative;
margin: 0 auto;
font: 12px "Noto Sans SC", "Open Sans";
background-color: #ffffff;
color: #333333;
-webkit-tap-highlight-color: rgba(0, 0, 0, 0);
-moz-tap-highlight-color: rgba(0, 0, 0, 0);
-ms-tap-highlight-color: rgba(0, 0, 0, 0);
-o-tap-highlight-color: rgba(0, 0, 0, 0);
overflow-x: hidden;
-webkit-font-smoothing: antialiased;
-moz-font-smoothing: antialiased;
-ms-font-smoothing: antialiased;
-o-font-smoothing: antialiased;
}
html,
body {
-webkit-text-size-adjust: none;
-moz-text-size-adjust: none;
-ms-text-size-adjust: none;
-o-text-size-adjust: none;
text-size-adjust: none;
}
.demo body {
width: 100vw;
height: 100vh;
overflow: hidden;
}
.demo #container {
margin: 0 auto;
display: block;
position: relative;
width: 600px;
height: 600px;
}
.demo #container .region-picker-container {
position: relative;
margin: 40px auto;
}
.demo #demo-topbar {
width: 100%;
margin: 0 auto 20px;
background: #000;
}
.demo #demo-topbar span {
color: #fff;
font-size: 24px;
display: inline-block;
line-height: 100%;
vertical-align: middle;
}
.demo #demo-topbar .button-group {
margin: 0 auto;
width: 400px;
}
.demo #demo-topbar button {
width: 120px;
margin: 4px;
padding: 8px;
}
.demo .debug-output {
background: #000;
color: #fff;
height: 50px;
line-height: 2;
font-size: 25px;
text-align: center;
}
</style>
</head>
<body>
<div id="demo-topbar">
<div class="button-group">
<span>ACTION: </span>
<button id="show-modal">Show Modal</button>
<button id="hide-modal">Hide Modal</button>
</div>
</div>
<div id="container">
<!-- container for region picker -->
</div>
<script src="assets/js/region-picker.js"></script>
<script>
let instance = RegionPicker("#container", {
data: window.RegionOptions.region, baseDir: "", preselected: "cn", updater: function (data) {
console.log(data)
}
});
document.getElementById('show-modal').addEventListener('click', instance.Show);
document.getElementById('hide-modal').addEventListener('click', instance.Hide);
document.getElementById('show-modal').click(); // switch modal to show instead of hide (default)
</script>
</body>
</html>