Skip to content

Commit

Permalink
perf(404): set image width with cloudinary
Browse files Browse the repository at this point in the history
  • Loading branch information
shadow81627 committed Dec 4, 2019
1 parent bc3ba8c commit fa37f3e
Showing 1 changed file with 26 additions and 9 deletions.
35 changes: 26 additions & 9 deletions components/error/404.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,31 +2,36 @@
<div>
<img
sizes="100vw"
alt=""
class="error__img img-fluid"
src="https://res.cloudinary.com/pocketpasta/image/upload/c_scale,dpr_auto,g_auto,w_auto,f_auto,q_auto:low/v1575402067/anna-pascale-GoqEgxAgQw0-unsplash_qq2jte.jpg"
alt
class="cld-responsive error__img img-fluid"
data-src="https://res.cloudinary.com/pocketpasta/image/upload/c_scale,dpr_auto,w_auto,f_auto,q_auto:low/v1575402067/anna-pascale-GoqEgxAgQw0-unsplash_qq2jte.jpg"
/>
<div id="message" class="card bg-light card-body">
<h2>404</h2>
<h1>{{ $t('error.404.heading') }}</h1>
<p>
{{ $t('error.404.description') }}
</p>
<nuxt-link :to="localePath('index')" class="btn btn-primary">{{
$t('layout.navigation.home')
}}</nuxt-link>
<p>{{ $t('error.404.description') }}</p>
<nuxt-link :to="localePath('index')" class="btn btn-primary">
{{ $t('layout.navigation.home') }}
</nuxt-link>
</div>
</div>
</template>

<script>
/* global cloudinary */
export default {
props: {
error: {
type: Object,
default: () => {},
},
},
mounted() {
// Initialize
const cl = cloudinary.Cloudinary.new({ cloud_name: '<Cloud Name>' });
// Call
cl.responsive();
},
head() {
return {
title: this.$t('error.404.heading'),
Expand All @@ -36,6 +41,12 @@ export default {
name: 'description',
content: this.$t('error.404.description'),
},
{
hid: 'description',
name: 'description',
content: 'DPR, Width',
'http-equiv': 'Accept-CH',
},
],
link: [
{
Expand All @@ -45,6 +56,12 @@ export default {
crossorigin: 'anonymous',
},
],
script: [
{
src:
'https://cdnjs.cloudflare.com/ajax/libs/cloudinary-core/2.3.0/cloudinary-core-shrinkwrap.min.js',
},
],
};
},
};
Expand Down

1 comment on commit fa37f3e

@vercel
Copy link

@vercel vercel bot commented on fa37f3e Dec 4, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.