-
Notifications
You must be signed in to change notification settings - Fork 8
/
smoke-code.html
executable file
·186 lines (163 loc) · 5.79 KB
/
smoke-code.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
<!doctype html>
<html class="polymer-ui-full-bleed">
<head>
<title>polymer-ui-carousel</title>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<!-- load toolkit -->
<script src="bower_components/platform/platform.js"></script>
<link rel="stylesheet" href="bower_components/polymer-ui-base-css/base.css">
<link rel="import" href="polymer-ui-carousel.html">
<script src="bower_components/prismjs/prism.js"></script>
<link rel="stylesheet" type="text/css" href="bower_components/prismjs/prism.css">
<link rel="stylesheet" type="text/css" href="bower_components/prismjs/prism-okadia.css">
<style>
polymer-ui-carousel {
display: block;
height: 420px;
width: 800px;
background: #2d2d2d;
margin: 30px;
clear:both;
}
polymer-ui-carousel ^^ polymer-ui-animated-pages {
overflow: hidden;
}
polymer-ui-carousel ^^ polymer-ui-animated-pages ::content > div {
background: #f5f2f0;
}
.description {
height: 70px;
position: absolute;
bottom: 0px;
left: 50%;
z-index: 15;
margin-left: -50%;
padding: 15px;
list-style: none;
text-align: center;
background: #1f2036;
color: white;
font-family: "Open Sans", Helvetica, Arial, sans-serif;
}
.language-mark {
width:100%;
background: #f5f2f0;
}
:not(pre) > code[class*="language-"]{
border-radius: 0px;
border:0px;
box-shadow:none;
padding: .10em 2.2em 5em;
}
@media only screen and (min-width: 900px) {
/* tablets and desktop */
polymer-ui-carousel {
width: 800px;
}
}
@media only screen and (min-width: 768px) and (max-width: 899px) {
/* tablets and desktop */
polymer-ui-carousel {
width: 700px;
}
}
@media only screen and (max-width: 767px) {
/* phones */
polymer-ui-carousel {
width: 400px;
}
}
@media only screen and (max-width: 350px) {
/* phones */
polymer-ui-carousel {
width: 300px;
}
code[class*="language-"]{
font-size: 8px;
}
polymer-ui-carousel ^^ #controls {
display: none;
}
}
</style>
</head>
<body class="polymer-ui-body-text polymer-ui-full-bleed polymer-ui-light-bg" unresolved>
<polymer-ui-carousel textLabels="false">
<div>
<code class="language-markup">
<link rel="import" href="../bower_components/polymer/polymer.html">
<polymer-element name="my-element" noscript>
<template>
<span>Hello from <b>my-element</b>. This is my Shadow DOM.</span>
</template>
</polymer-element>
</code>
<span class="description">
Polymer provides extra goodies for creating declarative, souped-up custom elements. We call these “Polymer elements”. From the outside they look just like any other DOM element, but inside they’re filled with handy features like two-way data binding.
</span>
</div>
<div>
<code class="language-markup">
<link rel="import" href="../bower_components/polymer/polymer.html">
<link rel="import" href="../bower_components/polymer-ajax/polymer-ajax.html">
<polymer-element name="my-element" noscript>
<template>
<span>I'm <b>my-element</b>. This is my Shadow DOM.</span>
<polymer-ajax url="http://example.com/json" auto response="{{resp}}">
</polymer-ajax>
<textarea value="{{resp}}"></textarea>
</template>
</polymer-element>
</code>
<span class="description">
By composing simple elements together we can build richer, more complex components. To reuse other elements in your <polymer-element>, install the element in your app.
</span>
</div>
<div>
<code class="language-markup">
<link rel="import"
href="/components/polymer/polymer.html">
<polymer-element name="proto-element">
<template>
<span>I'm <b>proto-element</b>. Check out my prototype.</span>
</template>
<script>
Polymer('proto-element', {
ready: function() {
//...
}
});
</script>
</polymer-element>
</code>
<span class="description">
When you’re creating a new element, you’ll often need to expose a public API so users can configure it. To define a public API, include a <script> tag that calls Polymer('your-tagname'). The Polymer(...) constructor is a convenience wrapper for document.registerElement.
</span>
</div>
<div>
<code class="language-markup">
<link rel="import" href="/components/polymer/polymer.html">
<polymer-element name="ready-element">
<template>
This element has a ready() method.
<span id="el">Not ready...</span>
</template>
<script>
Polymer('ready-element', {
owner: "Daniel",
ready: function() {
this.$.el.textContent = this.owner +
" is ready!";
}
});
</script>
</polymer-element>
</code>
<span class="description">
Lifecycle callbacks are special methods you can define on your element which fire when the element goes through important transitions.
</span>
</div>
</polymer-ui-carousel>
</body>
</html>