This repository has been archived by the owner on Jun 13, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 197
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(website): support lazy loading the images from the blog section
- Loading branch information
Showing
17 changed files
with
2,187 additions
and
77 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -81,4 +81,8 @@ pre[class*=language-] { | |
@apply mt-2; | ||
} | ||
} | ||
|
||
table { | ||
display: table; | ||
} | ||
} |
Binary file added
BIN
+50.4 KB
...s/website/assets/img/blog/statusfy-release-v-0-2-0/scheduled-maintenance-en.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+49.3 KB
...s/website/assets/img/blog/statusfy-release-v-0-2-0/scheduled-maintenance-es.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,101 @@ | ||
<template> | ||
<span | ||
v-lazy-container="{ selector: 'img' }" | ||
class="image-placeholder" | ||
:class="{ fluid: fluid, 'rounded-full': rounded }" | ||
> | ||
<img | ||
:src="imagePlaceholder" | ||
:data-src="imageSource" | ||
:data-loading="imagePlaceholder" | ||
:width="`${width}`" | ||
:height="`${height}`" | ||
:class="finalClass" | ||
:alt="alt" | ||
> | ||
</span> | ||
</template> | ||
|
||
<script> | ||
export default { | ||
props: { | ||
source: { | ||
type: String, | ||
required: true | ||
}, | ||
alt: { | ||
type: String, | ||
required: true | ||
}, | ||
width: { | ||
type: Number, | ||
required: true | ||
}, | ||
height: { | ||
type: Number, | ||
required: true | ||
}, | ||
classes: { | ||
type: String, | ||
default: '' | ||
}, | ||
fluid: { | ||
type: Boolean, | ||
default: false | ||
}, | ||
rounded: { | ||
type: Boolean, | ||
default: false | ||
} | ||
}, | ||
computed: { | ||
imageSource() { | ||
return require(`~/assets/img/${this.source}`) | ||
}, | ||
imagePlaceholder() { | ||
return require(`~/assets/img/${this.source}?lqip`) | ||
}, | ||
finalClass() { | ||
let theClass = this.classes | ||
if (this.rounded) { | ||
theClass += ' rounded-full' | ||
} | ||
return theClass | ||
} | ||
} | ||
} | ||
</script> | ||
|
||
<style lang="scss" scoped> | ||
.image-placeholder { | ||
overflow: hidden; | ||
line-height: 0; | ||
display: inline-block; | ||
&.fluid { | ||
img { | ||
width: 100%; | ||
max-width: 100%; | ||
height: auto; | ||
} | ||
} | ||
} | ||
img { | ||
transition: all ease 0.3s; | ||
opacity: 0.95; | ||
filter: blur(15px); | ||
&[lazy='loading'] { | ||
opacity: 1; | ||
filter: blur(15px); | ||
} | ||
&[lazy='loaded'] { | ||
opacity: 1; | ||
filter: none; | ||
} | ||
} | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -295,4 +295,10 @@ export default { | |
top: -30px; | ||
} | ||
} | ||
.markdown-body { | ||
>>> .anchor { | ||
@apply hidden; | ||
} | ||
} | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
import Vue from 'vue' | ||
import ImageResponsive from "~/components/Image.vue"; | ||
|
||
Vue.component('ImageResponsive', ImageResponsive) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.