const afterRisizeListenersList = [];
function triggerAfterResizeListeners() {
afterRisizeListenersList.forEach(function(o) {
if (typeof o.callBack === "function") {
o.callBack.apply(null, o.arguments);
}
})
}
var unsplash = '';
var colorThief = new ColorThief();
var imgs = document.querySelectorAll('img');
$.ajax({
url: "https://api.unsplash.com/photos/?&client_id=f0afe99aaf46a21c572d5dd3d620f3cf96e287a52e8af381f4bbaa5729a02215",
success: function(result) {
unsplash = result;
$('img').each(function(i) {
$(this).attr('src', unsplash[i].urls.small);
});
$("img").one("load", function() {
var c = colorThief.getColor(this);
$(this).css('background',rgbToHex(c[0], c[1], c[2]));
$(this).on('click', function() {
var modal = $('#myModal');
paletteModal(this, modal);
})
}).each(function(i) {
afterRisizeListenersList.push({
callBack: function() {
colorPalette(this);
},
arguments: []
});