|
1 | 1 | <template> |
2 | | - <div class="fab-wrapper" v-on-clickaway="away" :style="[pos, {zIndex: styles.zIndex}]" > |
3 | | - <div class="actions-container" :style="listPos"> |
| 2 | + <div :id="styles.position + '-wrapper'" class="fab-wrapper" v-on-clickaway="away" |
| 3 | + :style="[pos, {zIndex: styles.zIndex}]"> |
| 4 | + <div :id="styles.position + '-action'" class="actions-container" :style="listPos"> |
4 | 5 | <transition name="fab-actions-appear" |
5 | 6 | :enter-active-class="transitionEnter" |
6 | 7 | :leave-active-class="transitionLeave" |
|
32 | 33 | pos: {} |
33 | 34 | } |
34 | 35 | }, |
35 | | - props: ['styles', 'actions'], |
| 36 | + props: { |
| 37 | + styles: { |
| 38 | + default: () => { |
| 39 | + return { |
| 40 | + bgColor: '#333333', |
| 41 | + position: 'bottom-right' |
| 42 | + } |
| 43 | + } |
| 44 | + }, |
| 45 | + actions: {} |
| 46 | + }, |
36 | 47 | computed: { |
37 | 48 | listPos() { |
38 | 49 | let mask = {}; |
|
109 | 120 | }, |
110 | 121 | moveTransition() { |
111 | 122 | if (this.styles.position === 'top-right' || this.styles.position === 'top-left') { |
112 | | - let wrapper = document.getElementsByClassName('fab-wrapper'); |
113 | | - let el = document.getElementsByClassName('actions-container'); |
114 | | - wrapper[0].appendChild(el[0]); |
| 123 | + let wrapper = document.getElementById(this.styles.position + '-wrapper'); |
| 124 | + let el = document.getElementById(this.styles.position + '-action'); |
| 125 | + wrapper.appendChild(el); |
115 | 126 | } |
116 | 127 | } |
117 | 128 | }, |
|
193 | 204 | } |
194 | 205 |
|
195 | 206 | /* Rules for sizing the icon. */ |
196 | | - .material-icons.md-18 { font-size: 18px; } |
197 | | - .material-icons.md-24 { font-size: 24px; } |
198 | | - .material-icons.md-36 { font-size: 36px; } |
199 | | - .material-icons.md-48 { font-size: 48px; } |
| 207 | + .material-icons.md-18 { |
| 208 | + font-size: 18px; |
| 209 | + } |
| 210 | +
|
| 211 | + .material-icons.md-24 { |
| 212 | + font-size: 24px; |
| 213 | + } |
| 214 | +
|
| 215 | + .material-icons.md-36 { |
| 216 | + font-size: 36px; |
| 217 | + } |
| 218 | +
|
| 219 | + .material-icons.md-48 { |
| 220 | + font-size: 48px; |
| 221 | + } |
200 | 222 |
|
201 | 223 | /* Rules for using icons as black on a light background. */ |
202 | | - .material-icons.md-dark { color: rgba(0, 0, 0, 0.54); } |
203 | | - .material-icons.md-dark.md-inactive { color: rgba(0, 0, 0, 0.26); } |
| 224 | + .material-icons.md-dark { |
| 225 | + color: rgba(0, 0, 0, 0.54); |
| 226 | + } |
| 227 | +
|
| 228 | + .material-icons.md-dark.md-inactive { |
| 229 | + color: rgba(0, 0, 0, 0.26); |
| 230 | + } |
204 | 231 |
|
205 | 232 | /* Rules for using icons as white on a dark background. */ |
206 | | - .material-icons.md-light { color: rgba(255, 255, 255, 1); } |
207 | | - .material-icons.md-light.md-inactive { color: rgba(255, 255, 255, 0.3); } |
| 233 | + .material-icons.md-light { |
| 234 | + color: rgba(255, 255, 255, 1); |
| 235 | + } |
| 236 | +
|
| 237 | + .material-icons.md-light.md-inactive { |
| 238 | + color: rgba(255, 255, 255, 0.3); |
| 239 | + } |
208 | 240 |
|
209 | 241 | @media screen and (max-width: 768px) { |
210 | 242 | .fab-list { |
211 | 243 | margin: 2vh 1.8vw; |
212 | 244 | } |
| 245 | +
|
213 | 246 | .fab-list li { |
214 | 247 | width: 40px; |
215 | 248 | height: 40px; |
216 | 249 | } |
| 250 | +
|
217 | 251 | .fab-list li i { |
218 | 252 | font-size: 24px !important; |
219 | 253 | } |
| 254 | +
|
220 | 255 | .fab { |
221 | 256 | width: 55px; |
222 | 257 | height: 55px; |
223 | 258 | } |
| 259 | +
|
224 | 260 | .fab i { |
225 | 261 | font-size: 34px !important; |
226 | 262 | } |
|
0 commit comments