-
Notifications
You must be signed in to change notification settings - Fork 3
/
demo.html
295 lines (232 loc) · 11 KB
/
demo.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
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
<!DOCTYPE html>
<html lang="en" dir="ltr">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, shrink-to-fit=no">
<title>Modal Box by Patrick LEFEVRE</title>
<!-- Remove Tap Highlight on Windows Phone IE -->
<meta name="msapplication-tap-highlight" content="no">
<!--[if IEMobile]><meta http-equiv="cleartype" content="on"><![endif]-->
<!--[if IE]><meta content="IE=edge,chrome=1" http-equiv="X-UA-Compatible"><meta http-equiv="imagetoolbar" content="no"><![endif]-->
<script>
/*! loadFonts.js by cara-tm.com - MIT license */
'use strict';function loadFonts(U,t,c){var args=Array.prototype.slice.call(arguments,3),xhr=new XMLHttpRequest();xhr.ontimeout=function(){console.error('The request for '+U+' timed out.')};xhr.onload=function(){if(xhr.readyState===4){if(xhr.status===200){c.apply(xhr,args);console.log('Fonts Loaded!')}else{console.error(xhr.statusText)};console.timeEnd("Process")}};xhr.open('GET',U,true);xhr.timeout=t;xhr.send(null)}function inject(){var e=this.responseText,h=document.getElementsByTagName('head')[0],a=document.getElementsByTagName('link')[0],s=document.createElement('style');s.media='only screen';s.innerHTML=e;if('undefined'!=typeof s){h.insertBefore(h.appendChild(s),a)}}
/*! Loader */
loadFonts('https://fonts.googleapis.com/css?family=Noto+Sans|Open+Sans+Condensed:300&subset=latin', 9500, inject);
</script>
<link rel="stylesheet" href="css/modal-box.min.css" media="screen">
<link rel="stylesheet" href="css/custom.min.css" media="screen">
<style>
/*! ============================
CSS rules for this page demo
*/
/**
* Waiting for Google font loader: hide the entire page
*/
.wf-loading {
opacity: 0;
visibility: hidden;
height: 100%;
overflow: hidden
}
/**
* All is fine: display the document
*/
.wf-active {
opacity: 1;
visibility: visible
}
.wrapper {
width: 96%;
margin: 0 2%;
padding: 1em 0 3em
}
.wrapper p {
padding: 0 2% 10px;
font-size: 20px;
line-height: 1.5
}
p.first-line {
float: left;
clear: both;
width: 96%
}
/* Custom fonts */
@media only screen and (min-width: 720px) {
.header-modal {font-family: 'Noto Sans', sans-serif}
.modal-dialog .inner-dialog strong{font-family: 'Noto Sans', sans-serif}
.modal-dialog .inner-dialog p,
.footer-modal {font-family: 'Open Sans', sans-serif}
}
/**
* Position of the close text
*/
.modal .close-span {
margin-left: 2.2em;
color: #aaa;
}
.modal-message .close-span {
margin-left: auto;
margin-right: 2.5em;
text-align: right
}
/**
* The buttons
*/
.button {
float: left;
margin: 0 .5em 1em 0;
padding: .8em .5em 1em;
background: #0b7cd7;
color: #fff;
text-decoration: none;
font-size: 18px;
line-height: 1;
-webkit-text-decoration-skip: ink;
text-decoration-skip: ink
}
.button:hover {text-decoration: underline}
/**
* For JS fallback if used
*/
html .visible {
display: block;
opacity: 1;
visibility: visible;
background: #fff
}
html .visible ~ .wrapper {
visibility: hidden;
height: 0
}
html .visible .modal {-ms-transform: none;transform: none}
/*! Simple Scrollbar https://github.com/buzinas/simple-scrollbar */
.ss-wrapper {
overflow: hidden;
position: relative;
z-index: 1;
float: left;
width: 100%;
height: 100%
}
.ss-content {
overflow: auto;
overflow-x: hidden;
position: relative;
right: -18px;
left: 0;
width: 100%;
height: 100%;
padding: 0 32px 0 0
}
.ss-scroll {
opacity: 0;
position: relative;
z-index: 2;
top: 0;
width: 6px;
cursor: pointer;
-webkit-border-radius: 4px;
border-radius: 4px;
-webkit-transition: opacity 0.25s linear;
-o-transition: opacity 0.25s linear;
transition: opacity 0.25s linear
}
html .modal-dialog .modal .ss-container {
overflow: hidden;
max-height: 47vh;
height: 9.766em
}
.ss-container:hover .ss-scroll {
opacity: 1;
background: #d9d9d9;
background: rgba(0,0,0,0.15)
}
.ss-grabbed {
-o-user-select: none;
-moz-user-select: none;
-khtml-user-select: none;
-webkit-user-select: none;
user-select: none
}
</style>
<noscript>
<link rel="prefetch" href="https://fonts.googleapis.com/css?family=Open+Sans|Noto+Sans&lang=en" media="screen">
</noscript>
</head>
<body>
<div role="dialog" aria-modal="true" aria-haspopup="true" tabindex="-1" aria-live="assertive" aria-describedby="dialog-description" class="modal-dialog dialog" id="openModal">
<div role="document" class="modal">
<span class="close-span"><strong>Close</strong> <a href="#close" title="Close" class="close push__left no__select bounceInUp" id="close-modal" onclick="document.getElementById('openModal').style.display='none';return true;">×</a></span>
<div class="header-modal no__select">
<span><strong class="static">☸</strong> Parameters</span>
</div>
<div class="inner-dialog">
<h2 id="dialog-description">Modal Box</h2>
<p>This is a sample modal box that can be created using the powers of CSS3.</p>
<p>You could do a lot of things here like have a pop-up ad that shows when your website loads, or create a login/register form for users.</p>
<p>This is a sample modal box that can be created using the powers of CSS3.</p>
<p>You could do a lot of things here like have a pop-up ad that shows when your website loads, or create a login/register form for users.</p>
<p>This is a sample modal box that can be created using the powers of CSS3.</p>
<p>You could do a lot of things here like have a pop-up ad that shows when your website loads, or create a login/register form for users.</p>
<p>This is a sample modal box that can be created using the powers of CSS3.</p>
<p>You could do a lot of things here like have a pop-up ad that shows when your website loads, or create a login/register form for users.</p>
<p>This is a sample modal box that can be created using the powers of CSS3.</p>
<p>You could do a lot of things here like have a pop-up ad that shows when your website loads, or create a login/register form for users.</p>
<p>This is a sample modal box that can be created using the powers of CSS3.</p>
<p>You could do a lot of things here like have a pop-up ad that shows when your website loads, or create a login/register form for users.</p>
</div> <!-- /inner-dialog -->
<div class="footer-modal footer-push__left no__select">
<a href="#close" class="" id="footer-close" onclick="document.getElementById('openModal').style.display='none';return true;">Close</a><a href="https://www.cara-tm.com" target="_blank" class="">Help</a>
</div>
</div> <!-- /modal -->
</div> <!-- /modal-dialog -->
<div role="dialog" aria-modal="true" aria-haspopup="true" tabindex="-1" aria-live="assertive" aria-describedby="dialog-description" class="modal-dialog dialog" id="openMessage">
<div role="document" class="modal modal-message">
<span class="close-span"><strong>Close</strong> <a href="demo.html" title="Close" class="close no__select" id="close-msg" onclick="document.getElementById('openMessage').style.display='none';return true;">×</a></span>
<div class="inner-dialog">
<strong id="dialog-dscription">Message Box</strong>
<p><!--
<span class="info-sign"><strong>ℹ</strong></span>
<span class="warning-sign"><strong>⚠</strong></span>
-->
<span class="success-sign"><strong>✔</strong></span>
<!--
<span class="error-sign"><strong>✕</strong></span>
-->
This is a sample modal message box suitable for infos. ✌
</p>
</div> <!-- /inner-dialog -->
</div> <!-- /modal -->
</div> <!-- /modal-dialog -->
<div class="wrapper">
<p class="first-line">
<a href="#open" class="button">A simple link</a>
<a href="#openModal" class="button" id="link1" onclick="document.getElementById('openModal').style.display='block';return true;">Open Modal Box</a>
<a href="#openMessage" class="button" id="link2" onclick="document.getElementById('openMessage').style.display='block';return true;">Open Modal Message</a>
</p>
<p>This is a sample modal box that can be created using the powers of CSS3.</p>
<p>This is a sample modal box that can be created using the powers of CSS3.</p>
<p>This is a sample modal box that can be created using the powers of CSS3.</p>
<p>This is a sample modal box that can be created using the powers of CSS3.</p>
<p>This is a sample modal box that can be created using the powers of CSS3.</p>
<p>This is a sample modal box that can be created using the powers of CSS3.</p>
<p>This is a sample modal box that can be created using the powers of CSS3.</p>
<p>This is a sample modal box that can be created using the powers of CSS3.</p>
<p>This is a sample modal box that can be created using the powers of CSS3.</p>
<p>This is a sample modal box that can be created using the powers of CSS3.</p>
<p>This is a sample modal box that can be created using the powers of CSS3.</p>
<p>This is a sample modal box that can be created using the powers of CSS3.</p>
<p>This is a sample modal box that can be created using the powers of CSS3.</p>
<p>This is a sample modal box that can be created using the powers of CSS3.</p>
<p>This is a sample modal box that can be created using the powers of CSS3.</p>
<p>This is a sample modal box that can be created using the powers of CSS3.</p>
</div> <!-- /wrapper -->
<script>
/*! Simple Scrollbar - https://github.com/buzinas/simple-scrollbar - MIT license */
(function(n,t){function u(n){n.hasOwnProperty("data-simple-scrollbar")||Object.defineProperty(n,"data-simple-scrollbar",new SimpleScrollbar(n))}function e(n,i){function f(n){var t=n.pageY-u;u=n.pageY;r(function(){i.el.scrollTop+=t/i.scrollRatio})}function e(){n.classList.remove("ss-grabbed");t.body.classList.remove("ss-grabbed");t.removeEventListener("mousemove",f);t.removeEventListener("mouseup",e)}var u;n.addEventListener("mousedown",function(i){return u=i.pageY,n.classList.add("ss-grabbed"),t.body.classList.add("ss-grabbed"),t.addEventListener("mousemove",f),t.addEventListener("mouseup",e),!1})}function i(n){for(this.target=n,this.bar='<div class="ss-scroll">',this.wrapper=t.createElement("div"),this.wrapper.setAttribute("class","ss-wrapper"),this.el=t.createElement("div"),this.el.setAttribute("class","ss-content"),this.wrapper.appendChild(this.el);this.target.firstChild;)this.el.appendChild(this.target.firstChild);this.target.appendChild(this.wrapper);this.target.insertAdjacentHTML("beforeend",this.bar);this.bar=this.target.lastChild;e(this.bar,this);this.moveBar();this.el.addEventListener("scroll",this.moveBar.bind(this));this.el.addEventListener("mouseenter",this.moveBar.bind(this));this.target.classList.add("ss-container")}function f(){for(var i=t.querySelectorAll("*[ss-container]"),n=0;n<i.length;n++)u(i[n])}var r=n.requestAnimationFrame||n.setImmediate||function(n){return setTimeout(n,0)};i.prototype={moveBar:function(){var t=this.el.scrollHeight,i=this.el.clientHeight,n=this;this.scrollRatio=i/t;r(function(){n.bar.style.cssText="height:"+i/t*100+"%; top:"+n.el.scrollTop/t*100+"%;right:-"+(n.target.clientWidth-n.bar.clientWidth-20)+"px;"})}};t.addEventListener("DOMContentLoaded",f);i.initEl=u;i.initAll=f;n.SimpleScrollbar=i})(window,document);
/* Init */
var el = document.querySelector('.inner-dialog');
SimpleScrollbar.initEl(el);
</script>
</body></html>