Let your next project be a point of pride and join the work below!
#tfcc-gallery {
max-width: 960px;
margin: auto;
column-count: 2;
column-gap: 1em;
font-family: ‘Georgia’, serif;
}
.gallery-item {
break-inside: avoid;
margin-bottom: 1em;
}
.gallery-item img {
width: 100%;
border-radius: 6px;
box-shadow: 0 2px 6px rgba(0,0,0,0.1);
cursor: pointer;
}
.quote {
background: #f8f8f8;
border-left: 4px solid #999;
padding: 1em;
margin-bottom: 1em;
font-style: italic;
break-inside: avoid;
}
.quote small {
display: block;
margin-top: 0.5em;
text-align: right;
font-style: normal;
color: #555;
} https://cdn.jsdelivr.net/npm/glightbox/dist/js/glightbox.min.js const ACCESS_TOKEN = ‘EAAUCfvSia2sBPGvoRBh4rgp18tfwgPk9NIluyXgWRA1P8ZAC5VJKnQrEvEUg5RgdJpJqEWmuRFkxlZCob0nu5xiuuOTr5SIkiNRflsLGpImqLvGWPmzz5ntHZBZAzfLVjEEgaJJyklGNt0ZBvLKdTyUhKkkyEqeNOPGwoG9F4lvDgvoMItXvDnFR5ZCZAfBDsMlZB4yHGe9w5wLqEdMZD’;
const QUOTES = [
“Quality is never an accident; it is always the result of intelligent effort. — John Ruskin”,
“Buy the best, and you only cry once. — Miles Redd”,
“The bitterness of poor quality remains long after the sweetness of low price is forgotten. — Benjamin Franklin”,
“Good things take time. Great things take intention. — Unknown”,
“Luxury must be comfortable, otherwise it is not luxury. — Coco Chanel”,
“Do it once, do it right, enjoy it forever. — Unknown”,
“Have nothing in your houses that you do not know to be useful or believe to be beautiful. — William Morris”,
“You can’t fake craftsmanship. — Unknown”,
“Craftsmanship names an enduring, basic human impulse… — Richard Sennett”,
“Simplicity is the ultimate sophistication. — Leonardo da Vinci”,
“The details are not the details. They make the design. — Charles Eames”,
“Anything worth doing is worth doing right. — Hunter S. Thompson”,
“Own fewer things, but choose them better. — Unknown”
];
const gallery = document.getElementById(‘tfcc-gallery’);
let paging = ”, quotePool = […QUOTES], postCount = 0;
function injectQuote() {
if (!quotePool.length) quotePool = […QUOTES];
const q = quotePool.splice(Math.floor(Math.random() * quotePool.length), 1)[0];
const parts = q.split(‘—’);
const block = document.createElement(‘div’);
block.className = ‘quote’;
block.innerHTML = `${parts[0]}— ${parts[1] || ‘Unknown’}`;
gallery.appendChild(block);
}
function injectImage(post) {
if (post.media_type !== ‘IMAGE’ && post.media_type !== ‘CAROUSEL_ALBUM’) return;
const wrapper = document.createElement(‘div’);
wrapper.className = ‘gallery-item’;
wrapper.innerHTML = `
`;
gallery.appendChild(wrapper);
}
async function loadPosts() {
const url = new URL(‘https://graph.instagram.com/me/media’);
url.searchParams.set(‘fields’, ‘id,caption,media_type,media_url,permalink’);
url.searchParams.set(‘access_token’, ACCESS_TOKEN);
if (paging) url.searchParams.set(‘after’, paging);
const res = await fetch(url);
const data = await res.json();
data.data.forEach(post => {
if (++postCount % 4 === 0) injectQuote();
injectImage(post);
});
if (data.paging?.cursors?.after) paging = data.paging.cursors.after;
GLightbox({ selector: ‘.glightbox’ });
}
loadPosts();
window.addEventListener(‘scroll’, () => {
if (window.innerHeight + window.scrollY >= document.body.offsetHeight – 200) {
loadPosts();
}
});
