Skip to content

Instantly share code, notes, and snippets.

View CristinaSolana's full-sized avatar
💭
Making things.

Cristina Solana CristinaSolana

💭
Making things.
View GitHub Profile
{
id
name
description
thumbnail
resourceURI
}
[
{
"id": 1009189,
"name": "Black Widow",
"description": "",
"thumbnail": {
"path": "http://i.annihil.us/u/prod/marvel/i/mg/f/30/50fecad1f395b",
"extension": "jpg"
},
"resourceURI": "http://gateway.marvel.com/v1/public/characters/1009189",
const options = {
root: null, // use null for viewport
rootMargin: '0px',
threshold: 1.0
};
const observer = new IntersectionObserver(callback, options);
const target = document.querySelector('#someSection');
observer.observe(target);
<picture>
<source media="(min-width: 1200px)"
srcset="https://res.cloudinary.com/demo/image/upload/c_scale,w_900,dpr_auto,f_auto/sample.jpg">
<source media="(min-width: 900px)"
srcset="https://res.cloudinary.com/demo/image/upload/c_scale,w_600,dpr_auto,f_auto/sample.jpg">
<img src="https://res.cloudinary.com/demo/image/upload/c_scale,w_300,dpr_auto,f_auto/sample.jpg">
</picture>