From 98543f60eb9bfd519d837c6fdeb3a298a64f3004 Mon Sep 17 00:00:00 2001 From: Mitchell McCaffrey Date: Sun, 31 May 2020 15:35:03 +1000 Subject: [PATCH] Added log image helper function --- src/helpers/shared.js | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/helpers/shared.js b/src/helpers/shared.js index 7552d7b..8f11569 100644 --- a/src/helpers/shared.js +++ b/src/helpers/shared.js @@ -39,3 +39,14 @@ export function toDegrees(angle) { export function lerp(a, b, alpha) { return a * (1 - alpha) + b * alpha; } + +// Console log an image +export function logImage(url, width, height) { + const style = [ + "font-size: 1px;", + `padding: ${height}px ${width}px;`, + `background: url(${url}) no-repeat;`, + "background-size: contain;", + ].join(" "); + console.log("%c ", style); +}