Source : https://stackoverflow.com/a/47177899
console.image = function(url, size = 100) {
const image = new Image();
image.src = url;
image.onload = function() {
var style = [
'font-size: 1px;',
'padding: ' + this.height/100*size + 'px ' + this.width/100*size + 'px;',
'background: url('+ url +') no-repeat;',
'background-size: contain;'
].join(' ');
console.log('%c ', style);
};
};
const url = 'https://images.unsplash.com/photo-1593642632823-8f785ba67e45?auto=format&fit=crop&w=300&q=80'
console.image(url, 50);
VM97:3 Uncaught TypeError: console.image is not a function
at :3:9 you liar