Skip to content

Instantly share code, notes, and snippets.

@uploadcare-user
uploadcare-user / responsive-images-8.html
Last active September 19, 2018 17:41
Art Direction combined with variable resolution
<picture>
<source media="(max-width: 600px)"
srcset="cropped_art_direction_300.jpg 300w,
cropped_art_direction_600.jpg 600w"
sizes="300px">
<img src="art_direction.jpg" alt="An example of art direction"
srcset="art_direction_600.jpg 600w,
art_direction_1200 1200w"
sizes="600px">
</picture>
@uploadcare-user
uploadcare-user / responsive-images-9.html
Created September 19, 2018 17:49
Example of implementing the WebP image format in the <picture> tag
<picture>
<source type="image/webp"
srcset="example-300.webp 300w,
example-600.webp 600w"
sizes="300px">
<img src="example.jpg"
srcset="example-300.jpg 300w,
example-600.jpg 600w"
sizes="300px">
@uploadcare-user
uploadcare-user / responsive-images-10.html
Created September 19, 2018 18:18
Uploadcare JPEG formatting
<img src="https//ucarecdn.com/:uuid/-/format/jpeg/">
@uploadcare-user
uploadcare-user / responsive-images-11.html
Created September 19, 2018 18:19
Uploadcare automatic image formatting
<img src="https//ucarecdn.com/:uuid/-/format/auto/">
@uploadcare-user
uploadcare-user / responsive-images-12.html
Created September 19, 2018 18:20
Uploadcare simplified WebP formatting and variable resolution (no <picture> tag)
<img src="https://ucarecdn.com/:uuid/-/format/auto/"
srcset="https://ucarecdn.com/:uuid/-/format/auto/-/resize/300x/ 300w,
https://ucarecdn.com/:uuid/-/format/auto/-/resize/600x/ 600w"
sizes="300px">
@uploadcare-user
uploadcare-user / responsive-images-13.sh
Created September 19, 2018 18:23
CLI formatting of GIF image to MP4 video
ffmpeg -i input.gif output.mp4
@uploadcare-user
uploadcare-user / responsive-images-14.html
Created September 19, 2018 18:24
Uploadcare gif2video example
<video width=”384” height=”216” autoplay loop muted webkit-playsinline playsinline>
<source src=”https://ucarecdn.com/:uuid/gif2video/-/format/mp4/road.gif”
type=”video/mp4”>
</video>
@uploadcare-user
uploadcare-user / responsive-images-15.html
Created September 19, 2018 18:26
Uploadcare GIF to WebM and MP4 example
<video width=”384” height=”216” autoplay loop muted webkit-playsinline playsinline>
<source src=”https://ucarecdn.com/:uuid/gif2video/-/format/webm/road.gif”
type=”video/webm”>
<source src=”https://ucarecdn.com/:uuid/gif2video/-/format/mp4/road.gif”
type=”video/mp4”>
</video>