-
Notifications
You must be signed in to change notification settings - Fork 6
/
index.html
219 lines (182 loc) · 9.27 KB
/
index.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
<!doctype html>
<html lang="en-US">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="A Web Component using Web Notifications API is amazing">
<title><Notification Elements></title>
<!-- Stylesheets -->
<link rel="stylesheet" href="http://yui.yahooapis.com/pure/0.4.2/pure-min.css">
<link rel="stylesheet" href="assets/css/style.css">
<link href='http://fonts.googleapis.com/css?family=Roboto' rel='stylesheet' type='text/css'>
<!-- Import Web Components Polyfill -->
<script src="app/bower_components/webcomponentsjs/webcomponents.min.js"></script>
<!-- Import Custom Element -->
<link rel="import" href="src/notification-elements.html">
</head>
<body>
<header class="header">
<div class="wrapper">
<div class="wc-icon">
<img src="assets/img/icon-wc.png" alt="Web Components logo">
</div>
<h1 class="header-title">
<div class="first-line"><<span class="highlight">notification</span></div>
<div class="second-line"><span class="highlight">elements</span>></div>
</h1>
<p class="header-subtitle">
A Web Component using Web Notifications API is amazing.
</p>
<p class="gh-btn pure-hidden-phone">
<iframe src="http://ghbtns.com/github-btn.html?user=mateusortiz&repo=notification-elements&type=watch&count=true&size=large" allowtransparency="true" frameborder="0" scrolling="0" width="150" height="30"></iframe>
<iframe src="http://ghbtns.com/github-btn.html?user=mateusortiz&repo=notification-elements&type=fork&count=true&size=large" allowtransparency="true" frameborder="0" scrolling="0" width="150" height="30"></iframe>
</p>
</div>
</header>
<!-- Main Wrapper -->
<main class="main-wrapper">
<!-- Install Web Component -->
<div class="main">
<h2 class="main-head is-center"><span>Install</span></h2>
<section class="section pure-g-r">
<div class="center">
<div class="pure-u-1">
<h4 class="main-subhead">Install the web component with bower</h4>
<pre>$ bower install notification-elements</pre>
<a class="pure-button pure-button-primary" href="https://github.com/mateusortiz/notification-elements">Fork on GitHub</a>
<a class="pure-button pure-button-primary" href="https://github.com/mateusortiz/notification-elements/archive/master.zip">Download Zip</a>
</div>
</div>
</section>
</div>
<!-- Notification element -->
<div class="box-demo 1-box-large pure-g">
<section class="center section pure-u-1">
<h2 class="main-head main-head-box"><notification-elements></h2>
<p>Provides Notifications very easy using Web notification API and web components.</p>
<!-- Demo notification #1 -->
<p>The first demo, we have some standard <strong>Notification</strong> attributes, which when clicked triggers the <strong>notification</strong></p>
<div class="demo">
<h3>Simple notification</h3>
</div>
<pre><code><notification-elements header="Bienvenido" body="This is a simple notification!"></notification-elements></code></pre>
<!-- Demo notification #2 -->
<p>The second demo, you can define which <strong>icon, title, body, language, and Duration</strong> using <strong>attributes</strong> of notification, and other things.</p>
<notification-elements id="button-notification-1" header="Meooow!" body="I'm the Octocat!" icon="http://forum.webflow.com/plugins/emoji/images/octocat.png"></notification-elements>
<script>
window.addEventListener('polymer-ready', function(e) {
document.querySelector('#demo-btn').addEventListener('click', function(e) {
document.querySelector('#button-notification-1').notify();
});
});
</script>
<div class="demo">
<button id="demo-btn" class="pure-button pure-button-primary">Notification</button>
</div>
<pre><code><notification-elements id="button-notification-1 header="Meooow!" body="I'm the Octocat!" icon="http://forum.webflow.com/plugins/emoji/images/octocat.png"></notification-elements>
<script>
var demoBtn = document.querySelector('#demo-btn'),
notifyElement = document.querySelector('#button-notification-1');
demoBtn.addEventListener('click', function(e) {
notifyElement.notify();
});
</script>
</code></pre>
<!-- attributes -->
<h2 class="main-head main-head-box">Attributes</h2>
<table class="pure-table pure-table-striped">
<thead>
<tr>
<th>Attributes</th>
<th>Options</th>
<th>Default</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr class="pure-table-odd">
<td>icon</td>
<td>String</td>
<td>icon.png</td>
<td>Specifies whether there is a icon in the notification.</td>
</tr>
<tr>
<td>body</td>
<td>String</td>
<td>Bienvenido</td>
<td>Specifies your body notification</td>
</tr>
<tr class="pure-table-odd">
<td>header</td>
<td>String</td>
<td>This is a simple notification!</td>
<td>Specifies your text notification</td>
</tr>
<tr>
<td>duration</td>
<td>int</td>
<td>10</td>
<td>Specifies the time of notification</td>
</tr>
</tbody>
</table>
<!-- Events -->
<h2 class="main-head main-head-box">Events</h2>
<table class="pure-table pure-table-striped">
<thead>
<tr>
<th>Event</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr class="pure-table-odd">
<td>onclick</td>
<td>It is triggered each time the user clicks on the notification.</td>
</tr>
<tr>
<td>onshow</td>
<td>It is triggered when the notification is displayed.</td>
</tr>
<tr class="pure-table-odd">
<td>onerror</td>
<td>It is triggered each time the notification encounters an error.</td>
</tr>
<tr>
<td>onclose</td>
<td>It is triggered when the user closes the notification.</td>
</tr>
</tbody>
</table>
</section>
</div>
<!-- Usage -->
<section class="main">
<h2 class="main-head is-center"><span>Usage</span></h2>
<div class="section pure-g-r center">
<div class="pure-u-1">
<h4 class="main-subhead">1. Import Web Components Polyfill</h4>
<pre><code><script src="bower_components/platform/platform.js"></script></code></pre>
<h4 class="main-subhead">2. Import Custom Element</h4>
<pre><code><link rel="import" href="src/notification-elements.html"></code></pre>
<h4 class="main-subhead">3. Using It</h4>
<pre><code><notification-elements></notification-elements></code></pre>
<h4 class="main-subhead">4. Enjoy it!</h4>
</div>
</div>
</section>
<!-- Footer -->
<footer class="credits pure-u-1 is-center">
<p>
Developed with <span class="heart">♥</span> by <a href="https://www.twitter.com/mteusortiz">Mateus Ortiz</a>
</p>
</footer>
</main>
<!-- Script Polyfill -->
<script src="assets/js/notification.js"></script>
<!-- HighLight -->
<link rel="stylesheet" href="assets/css/default.css">
<script src="assets/js/highlight.pack.js"></script>
<script>hljs.initHighlightingOnLoad();</script>
</body>
</html>