-
Notifications
You must be signed in to change notification settings - Fork 273
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat!: screen based responsive (#182)
Co-authored-by: Sebastien Chopin <[email protected]>
- Loading branch information
Showing
10 changed files
with
213 additions
and
113 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
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 |
---|---|---|
@@ -1,21 +1,70 @@ | ||
<template> | ||
<div class="container"> | ||
<h2>Local SVG image</h2> | ||
<NuxtImg layout="responsive" src="images/nuxt-white.svg" /> | ||
<!-- <h2>nuxt-img</h2> | ||
<NuxtImg | ||
:sizes="{ sm: 100, md: 500 }" | ||
src="/images/damavand.jpg" | ||
/> | ||
<h2>Local JPEG image</h2> | ||
<NuxtImg layout="responsive" src="/images/damavand.jpg" /> | ||
<h2>nuxt-picture</h2> | ||
<NuxtPicture | ||
:sizes="{ sm: 100, md: 500 }" | ||
src="/images/damavand.jpg" | ||
/> --> | ||
<div style="width: 50vw"> | ||
i'm 50vw | ||
</div> | ||
<nuxt-img | ||
src="/logos/nuxt.png" | ||
sizes="sm:100vw md:50vw lg:400px" | ||
/> | ||
<img src="/_ipx/logos/nuxt.png?w=384" alt="nuxt" sizes="(max-width: 640px) 640px, 384px" srcset="/_ipx/logos/nuxt.png?w=640 640w, /_ipx/logos/nuxt.png?w=384 384w" data-v-7d203d15=""> | ||
<br> | ||
<nuxt-picture | ||
src="/logos/nuxt.png" | ||
sizes="sm:100vw md:50vw lg:400px" | ||
/> | ||
<br> | ||
<nuxt-img | ||
src="/logos/nuxt.png" | ||
:sizes="{ sm: '100vw', md: '50vw', lg: 400 }" | ||
/> | ||
<br> | ||
<img | ||
src="/logos/nuxt.png" | ||
sizes="(max-width: 640px) 100vw, (max-width: 768px) 50vw, 400px" | ||
:srcset="`${l(320)} 320w,${l(640)} 640w,${l(384)} 384w,${l(400)} 400w`" | ||
> | ||
</div> | ||
</template> | ||
|
||
<h2>JPEG image from remote url</h2> | ||
<NuxtImg layout="responsive" src="https://upload.wikimedia.org/wikipedia/commons/thumb/4/4e/Aconcagua2016.jpg/600px-Aconcagua2016.jpg" /> | ||
<script> | ||
export default { | ||
methods: { | ||
l (txt) { | ||
return 'https://textoverimage.moesif.com/image?image_url=https%3A%2F%2Fraw.githubusercontent.com%2Fnuxt%2Fnuxt.js%2Fdev%2F.github%2Fnuxt.png&text=' + txt | ||
} | ||
} | ||
} | ||
</script> | ||
|
||
<h2>PNG image on Cloudinary</h2> | ||
<NuxtImg layout="responsive" provider="cloudinary" src="/remote/nuxt-org/blog/going-full-static/main" /> | ||
<style scoped> | ||
@media (max-width: 640px) { | ||
img2 { | ||
max-width: 100vw; | ||
width: 100vw; | ||
} | ||
} | ||
<h2>JPEG image on TwicPics</h2> | ||
<NuxtImg layout="responsive" provider="twicpics" src="/football.jpg" /> | ||
@media (max-width: 768px) { | ||
img2 { | ||
max-width: 50vw; | ||
width: 50vw; | ||
} | ||
} | ||
<h2>JPEG image on Fastly</h2> | ||
<NuxtImg layout="responsive" provider="fastly" src="/image.jpg" /> | ||
</div> | ||
</template> | ||
img2 { | ||
max-width: 300px; | ||
width: 300px; | ||
} | ||
</style> |
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
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.