mirror of
https://github.com/primefaces/primevue.git
synced 2025-05-09 17:02:38 +00:00
Styles imported. Components added
This commit is contained in:
parent
3cb3910561
commit
8264983db4
452 changed files with 55902 additions and 0 deletions
85
components/skeleton/Skeleton.vue
Normal file
85
components/skeleton/Skeleton.vue
Normal file
|
@ -0,0 +1,85 @@
|
|||
<template>
|
||||
<div :style="containerStyle" :class="containerClass"></div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: 'Skeleton',
|
||||
props: {
|
||||
shape: {
|
||||
type: String,
|
||||
default: 'rectangle'
|
||||
},
|
||||
size: {
|
||||
type: String,
|
||||
default: null
|
||||
},
|
||||
width: {
|
||||
type: String,
|
||||
default: '100%'
|
||||
},
|
||||
height: {
|
||||
type: String,
|
||||
default: '1rem'
|
||||
},
|
||||
borderRadius: {
|
||||
type: String,
|
||||
default: null
|
||||
},
|
||||
animation: {
|
||||
type: String,
|
||||
default: 'wave'
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
containerClass() {
|
||||
return ['p-skeleton p-component', {
|
||||
'p-skeleton-circle': this.shape === 'circle',
|
||||
'p-skeleton-none': this.animation === 'none'
|
||||
}];
|
||||
},
|
||||
containerStyle() {
|
||||
if (this.size)
|
||||
return {width: this.size, height: this.size, borderRadius: this.borderRadius};
|
||||
else
|
||||
return {width: this.width, height: this.height, borderRadius: this.borderRadius};
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
.p-skeleton {
|
||||
position: relative;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.p-skeleton::after {
|
||||
content: "";
|
||||
animation: p-skeleton-animation 1.2s infinite;
|
||||
height: 100%;
|
||||
left: 0;
|
||||
position: absolute;
|
||||
right: 0;
|
||||
top: 0;
|
||||
transform: translateX(-100%);
|
||||
z-index: 1;
|
||||
}
|
||||
|
||||
.p-skeleton.p-skeleton-circle {
|
||||
border-radius: 50%;
|
||||
}
|
||||
|
||||
.p-skeleton-none::after {
|
||||
animation: none;
|
||||
}
|
||||
|
||||
@keyframes p-skeleton-animation {
|
||||
from {
|
||||
transform: translateX(-100%);
|
||||
}
|
||||
to {
|
||||
transform: translateX(100%);
|
||||
}
|
||||
}
|
||||
</style>
|
Loading…
Add table
Add a link
Reference in a new issue