Activities for kids
With Stuck At Home, you’ll find a huge range of free downloads, products for sale and advice to survive (and maybe even flourish) while you and the kids can’t leave the house!
Educational See all →
With our fun educational resources, your kids will be laughing just as much as they’ll be learning.
Games and Puzzles See all →
Make sure the kids have their thinking caps on when they tackle our selection of engaging games and puzzles.
Arts and Crafts
See all →
Gather the glue, glitter and genius as you unleash the kids’ creativity on our variety of craft activities.
Kids' Colouring-In Pages See all →
Break out the kids’ pencils and markers to get creative with heaps of colouring-in pages featuring our adorable designs.
Hygenie and The Washing Wizard See all →
Teach the kids all about the importance of cleanliness with our magical friends and their adventures.
async function setDynamicBlocks() {
try {
const url = new URL('https\u003A\u002F\u002Fwww.stuckonyou.com\u002Fnz\u002Fbanner\u002Fajax\u002Fload\u002F');
const sections = [];
document
.querySelectorAll('[data-banner-id]')
.forEach(el => sections.push(el.getAttribute('data-banner-id')));
url.searchParams.append('requesting_page_url', url.origin);
url.searchParams.append('sections', sections.toString());
const response = await fetch(url.href, {
headers: {
'Content-Type': 'application/json',
'X-Requested-With': 'XMLHttpRequest'
}
});
const data = await response.json();
const items = data.data.items.fixed;
const elements = document.querySelectorAll('[data-ids]');
const dataItem = [];
for (const element in items) {
dataItem.push(element);
}
for (const element of elements) {
const ids = element.getAttribute('data-ids').split(',');
const config = {
type: element.getAttribute('data-rotate'),
bannerId: element.getAttribute('data-banner-id'),
};
if (dataItem.includes(element.getAttribute('data-ids'))) {
element.style.display = 'block';
} else {
element.style.display = 'none';
}
getByType(config, element, items, ids);
}
} catch (err) {
console.warn(err);
}
}
/**
* Get banner items by type
*/
function getByType(config = null, container, items, ids) {
if (!config) return;
if (config.type === 'random') {
const randomId = ids[Math.floor(Math.random() * ids.length)];
container.insertAdjacentHTML('beforeend', items[randomId].content);
return;
}
if (config.type === 'series') {
showInOrder(config, items, ids);
return;
}
if (config.type === 'shuffle') {
showInOrder(config, items, ids);
return;
}
for (const id of ids) {
const block = items[id];
if (block) {
if(container.innerHTML.indexOf(block.content) == -1)
container.insertAdjacentHTML('beforeend', block.content);
}
}
}
/**
* Show blocks in order
*/
function showInOrder(config, items, ids) {
const bannerId = config.bannerId;
const type = config.type;
let localSeries = JSON.parse(localStorage.getItem('data-dynamic-series'));
if (!localSeries) {
localStorage.setItem(
'data-dynamic-series',
JSON.stringify({
[bannerId]: ids
})
);
localSeries = {
[bannerId]: ids
};
}
if (!localSeries[bannerId]?.length) {
delete localSeries[bannerId];
if (Object.keys(localSeries).length === 0)
localStorage.removeItem('data-dynamic-series');
showInOrder(config, items, ids);
return;
}
let id = localSeries[bannerId][0];
if (type === 'series') {
id = localSeries[bannerId].shift();
}
if (type === 'shuffle') {
const bannerOption = localSeries[bannerId];
if (bannerOption.length === 1) {
id = localSeries[bannerId].shift();
} else {
id = bannerOption[Math.floor(Math.random() * bannerOption.length)];
localSeries[bannerId].filter(item => item !== id);
}
}
if (id) {
const block = document.querySelector(`[data-banner-id="${bannerId}"]`);
if (!items[id]) {
localStorage.removeItem('data-dynamic-series');
showInOrder(config, items, ids);
return;
}
block?.insertAdjacentHTML('beforeend', items[id].content);
}
localStorage.setItem(
'data-dynamic-series',
JSON.stringify(localSeries = {
[bannerId]: localSeries[bannerId]
})
);
}
// get Dynamic Block when change cart qty
document.addEventListener("DOMContentLoaded", () => {
const blockInterval = setInterval(function() {
let target = document.querySelector('.count-item');
if (target) {
clearInterval(blockInterval);
//Create an observer instance.
let observer = new MutationObserver(function(mutations) {
setDynamicBlocks();
});
// Pass in the target node, as well as the observer options.
observer.observe(target, {
attributes: true,
childList: true,
characterData: true
});
}
}, 2000);
setTimeout(function(){
clearInterval(blockInterval);
}, 10000);
});
/** Set blocks */
setDynamicBlocks();