mirror of
https://github.com/Xevion/the-office.git
synced 2025-12-09 16:08:50 -06:00
Add ImageSkeleton component, improve breadcrumb skeleton scss, restructure Skeleton.vue
This commit is contained in:
@@ -38,19 +38,6 @@
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.breadcrumb-skeleton {
|
||||
background-color: $grey-3;
|
||||
height: 48px;
|
||||
|
||||
& > .card-body {
|
||||
padding: 0 0 0 1em;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
<style lang="scss">
|
||||
.card-title {
|
||||
font-family: "Montserrat", sans-serif;
|
||||
@@ -127,7 +114,7 @@ export default {
|
||||
this.fetch();
|
||||
},
|
||||
methods: {
|
||||
fetch() {
|
||||
async fetch() {
|
||||
// Fetch the episode, then scroll - already fetched episode should scroll immediately
|
||||
this.$store.dispatch(types.FETCH_EPISODE, {season: this.params.season, episode: this.params.episode})
|
||||
.then(() => {
|
||||
|
||||
20
src/components/ImageSkeleton.vue
Normal file
20
src/components/ImageSkeleton.vue
Normal file
@@ -0,0 +1,20 @@
|
||||
<template>
|
||||
<div class="image-skeleton" />
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: "ImageSkeleton"
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
.image-skeleton {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
background-color: $grey-4;
|
||||
display: block;
|
||||
border-radius: 3px;
|
||||
}
|
||||
|
||||
</style>
|
||||
@@ -1,11 +1,34 @@
|
||||
<template>
|
||||
<div class="outer-skeleton">
|
||||
<div class="skeleton" :class="[animated ? undefined : 'no-animate']" :style="[style, inner_style]" />
|
||||
<div
|
||||
class="skeleton"
|
||||
:class="[animated ? undefined : 'no-animate']"
|
||||
:style="[style, innerStyle]"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
<style lang="scss" scoped>
|
||||
|
||||
<style lang="scss">
|
||||
.breadcrumb-skeleton {
|
||||
height: 48px;
|
||||
|
||||
& > .card-body {
|
||||
padding: 0 0 0 1em;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
}
|
||||
|
||||
.outer-skeleton {
|
||||
padding: 0.35em 0.3em 0.35em 0.35em;
|
||||
|
||||
.breadcrumb-skeleton > {
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
.skeleton {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
display: block;
|
||||
line-height: 1;
|
||||
background-size: 200px 100%;
|
||||
@@ -19,9 +42,6 @@
|
||||
animation: none;
|
||||
}
|
||||
}
|
||||
|
||||
.outer-skeleton {
|
||||
padding: 0.2em 0;
|
||||
}
|
||||
|
||||
@-webkit-keyframes SkeletonLoading {
|
||||
@@ -33,7 +53,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
@keyframes SkeletonLoa,ding {
|
||||
@keyframes SkeletonLoading {
|
||||
0% {
|
||||
background-position: -200px 0;
|
||||
}
|
||||
@@ -41,19 +61,16 @@
|
||||
background-position: calc(200px + 100%) 0;
|
||||
}
|
||||
}
|
||||
|
||||
span {
|
||||
font-size: 24px;
|
||||
}
|
||||
</style>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
props: {
|
||||
inner_style: {
|
||||
type: Object
|
||||
innerStyle: {
|
||||
type: Object,
|
||||
default: null,
|
||||
},
|
||||
inner_class: {
|
||||
innerClass: {
|
||||
type: String,
|
||||
default: ''
|
||||
},
|
||||
@@ -61,22 +78,25 @@ export default {
|
||||
type: Boolean,
|
||||
default: true
|
||||
},
|
||||
border_radius: {
|
||||
borderRadius: {
|
||||
type: String,
|
||||
default: ''
|
||||
},
|
||||
primary_color: {
|
||||
primaryColor: {
|
||||
type: String,
|
||||
default: '',
|
||||
},
|
||||
secondary_color: {
|
||||
secondaryColor: {
|
||||
type: String,
|
||||
default: '',
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
style() {
|
||||
return {
|
||||
'--primary-color': this.primary_color,
|
||||
'--secondary-color': this.secondary_color,
|
||||
'--border-radius': this.border_radius
|
||||
'--primary-color': this.primaryColor,
|
||||
'--secondary-color': this.secondaryColor,
|
||||
'--border-radius': this.borderRadius
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user