-
Notifications
You must be signed in to change notification settings - Fork 0
/
02-fade.html
50 lines (39 loc) · 1.35 KB
/
02-fade.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
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title><ui-component></title>
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=0, minimum-scale=1.0, maximum-scale=1.0">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<!-- Importing Web Component's Polyfill -->
<script src="../components/webcomponentsjs/webcomponents.min.js"></script>
<!-- Importing Custom Elements -->
<link rel="import" href="../index.html">
<!-- Example styles -->
<link rel="stylesheet" type="text/css" href="styles.css">
</head>
<body>
<h2>Overlay: Fade</h2>
<p class="info">Click the button to spawn a new overlay, that will fade in 3 seconds and then automatically be removed from the DOM.</p>
<code>
<ui-overlay animation="fade" delay="3" duration="2"></ui-overlay>
</code>
<button>Hit me!</button>
<!-- Example logic -->
<script type="text/javascript">
// elements
var body = document.getElementsByTagName('body')[0];
var button = document.getElementsByTagName('button')[0];
// events
button.addEventListener("click", function(){
// new overlay
var e = document.createElement('ui-overlay');
e.setAttribute("animation", "fade");
e.setAttribute("delay", 3);
e.setAttribute("duration", 2);
body.appendChild(e);
});
</script>
</body>
</html>