forked from blikblum/wc-fontawesome
-
Notifications
You must be signed in to change notification settings - Fork 0
/
fa-icon-examples.js
235 lines (196 loc) · 7.39 KB
/
fa-icon-examples.js
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
import { LitElement, html } from 'lit-element'
import { faStyles } from './faStyles.js'
const renderIcon = (type, icon) => {
return html`
<!--
<h3>Non-Existant:</h3>
<fa-icon type=${type} icon="doesnt-exist"></fa-icon>
-->
<h3>Simple:</h3>
<fa-icon type=${type} icon=${icon}></fa-icon>
<h3>Size:</h3>
<fa-icon type=${type} icon=${icon} size="xs"></fa-icon>
<fa-icon type=${type} icon=${icon} size="lg"></fa-icon>
<fa-icon type=${type} icon=${icon} size="6x"></fa-icon>
<h3>Fixed width:</h3>
<fa-icon type=${type} icon=${icon} fixed-width></fa-icon>
<h3>Inverse:</h3>
<fa-icon type=${type} icon=${icon} inverse style="background-color: blue;"></fa-icon>
<h3>List Item:</h3>
<ul class="fa-ul">
<li><fa-icon type=${type} icon=${icon} list-item></fa-icon>List icon</li>
</ul>
<h3>Rotation:</h3>
<fa-icon type=${type} icon=${icon} rotation="90"></fa-icon>
<fa-icon type=${type} icon=${icon} rotation="180"></fa-icon>
<fa-icon type=${type} icon=${icon} rotation="270"></fa-icon>
<h3>Flip:</h3>
<fa-icon type=${type} icon=${icon} flip="horizontal"></fa-icon>
<fa-icon type=${type} icon=${icon} flip="vertical"></fa-icon>
<fa-icon type=${type} icon=${icon} flip="both"></fa-icon>
<h3>Animation:</h3>
<fa-icon type=${type} icon=${icon} spin></fa-icon>
<fa-icon type=${type} icon=${icon} pulse></fa-icon>
<h3>Border:</h3>
<fa-icon type=${type} icon=${icon} border></fa-icon>
<h3>Pull:</h3>
<div style="width: 400px;">
<fa-icon type=${type} icon=${icon} pull="left"></fa-icon>Gatsby believed in the green
light, the orgastic future that year by year recedes before us. It eluded
us then, but that’s no matter — tomorrow we will run faster, stretch our
arms further... And one fine morning — So we beat on, boats against the
current, borne back ceaselessly into the past.
</div>
<br />
<div style="width: 400px;">
<fa-icon type=${type} icon=${icon} pull="right"></fa-icon>Gatsby believed in the green
light, the orgastic future that year by year recedes before us. It eluded
us then, but that’s no matter — tomorrow we will run faster, stretch our
arms further... And one fine morning — So we beat on, boats against the
current, borne back ceaselessly into the past.
</div>
<h3>Swap opacity (duotone icons only):</h3>
<fa-icon type=${type} icon=${icon} swap-opacity></fa-icon>
<h3>Transforms:</h3>
<fa-icon type=${type} icon=${icon} transform="shrink-6 left-4"></fa-icon>
<fa-icon type=${type} icon=${icon} .transform=${{ rotate: 42 }}></fa-icon>
<h3>Mask:</h3>
<fa-icon type=${type} icon=${icon} mask="circle"></fa-icon>
<h3>Custom class (color):</h3>
<style>
.color-red {
color: red;
}
</style>
<fa-icon type=${type} icon=${icon} class="color-red"></fa-icon>
<h3>Symbols:</h3>
<fa-icon icon="spinner" symbol></fa-icon>
<fa-icon type=${type} icon=${icon} symbol="symbol-icon"></fa-icon>
<svg>
<use xlink:href="#fas-fa-spinner"></use>
</svg>
<svg>
<use xlink:href="#symbol-icon"></use>
</svg>
<h3>Layers:</h3>
<h5>With <code>fa-layers</code> component</h5>
<div style="font-size:4em">
<fa-layers class="fa-fw">
<fa-icon icon="square"></fa-icon>
<fa-icon icon="check" inverse transform="shrink-6"></fa-icon>
</fa-layers>
<fa-layers class="fa-fw" style="background:MistyRose">
<fa-icon icon="circle" style="color:Tomato"></fa-icon>
<fa-icon icon="times" inverse transform="shrink-6"></fa-icon>
</fa-layers>
<fa-layers class="fa-fw" style="background:MistyRose">
<fa-icon icon="bookmark"></fa-icon>
<fa-icon
icon="heart"
transform="shrink-10 up-2"
style="color:Tomato"
></fa-icon>
</fa-layers>
<fa-layers class="fa-fw" style="background:MistyRose">
<fa-icon icon="play" transform="rotate--90 grow-2"></fa-icon>
<fa-icon icon="sun" inverse transform="shrink-10 up-2"></fa-icon>
<fa-icon
icon="moon"
inverse
transform="shrink-11 down-4.2 left-4"
></fa-icon>
<fa-icon
icon="star"
inverse
transform="shrink-11 down-4.2 right-4"
></fa-icon>
</fa-layers>
<fa-layers class="fa-fw" style="background:MistyRose">
<fa-icon icon="calendar"></fa-icon>
<fa-text inverse transform="shrink-8 down-3" style="font-weight:900"
>27</fa-text
>
</fa-layers>
<fa-layers class="fa-layers fa-fw" style="background:MistyRose">
<fa-icon icon="certificate"></fa-icon>
<fa-text
inverse
transform="shrink-11.5 rotate--30"
style="font-weight:900"
>NEW</fa-text
>
</fa-layers>
<fa-layers class="fa-layers fa-fw" style="background:MistyRose">
<fa-icon icon="envelope"></fa-icon>
<fa-counter style="background:Tomato">1,419</fa-counter>
</fa-layers>
</div>
<h5>With plain markup</h5>
<div style="font-size:4em">
<span class="fa-layers fa-fw">
<fa-icon icon="square"></fa-icon>
<fa-icon icon="check" inverse transform="shrink-6"></fa-icon>
</span>
<span class="fa-layers fa-fw" style="background:MistyRose">
<fa-icon icon="circle" style="color:Tomato"></fa-icon>
<fa-icon icon="times" inverse transform="shrink-6"></fa-icon>
</span>
<span class="fa-layers fa-fw" style="background:MistyRose">
<fa-icon icon="bookmark"></fa-icon>
<fa-icon
icon="heart"
transform="shrink-10 up-2"
style="color:Tomato"
></fa-icon>
</span>
<span class="fa-layers fa-fw" style="background:MistyRose">
<fa-icon icon="play" transform="rotate--90 grow-2"></fa-icon>
<fa-icon icon="sun" inverse transform="shrink-10 up-2"></fa-icon>
<fa-icon icon="moon" inverse transform="shrink-11 down-4.2 left-4"></fa-icon>
<fa-icon icon="star" inverse transform="shrink-11 down-4.2 right-4"></fa-icon>
</span>
<span class="fa-layers fa-fw" style="background:MistyRose">
<fa-icon icon="calendar"></fa-icon>
<fa-text inverse transform="shrink-8 down-3" style="font-weight:900">27</fa-text>
</span>
<span class="fa-layers fa-fw" style="background:MistyRose">
<fa-icon icon="certificate"></fa-icon>
<fa-text inverse transform="shrink-11.5 rotate--30" style="font-weight:900">NEW</fa-text>
</span>
<span class="fa-layers fa-fw" style="background:MistyRose">
<fa-icon icon="envelope"></fa-icon>
<fa-counter style="background:Tomato">1,419</fa-counter>
</span>
</div>
`
}
class FAIconExamples extends LitElement {
static get styles() {
return [faStyles]
}
static get properties() {
return {
type: { type: String },
icon: { type: String },
}
}
createRenderRoot() {
return this
}
render() {
return renderIcon(this.type, this.icon)
}
}
class FAIconShadowExamples extends LitElement {
static get properties() {
return {
type: { type: String },
icon: { type: String },
}
}
render() {
return renderIcon(this.type, this.icon)
}
}
customElements.define('fa-icon-examples', FAIconExamples)
customElements.define('fa-icon-shadow-examples', FAIconShadowExamples)