diff --git a/public/favicon.ico b/public/favicon.ico deleted file mode 100644 index e69de29..0000000 diff --git a/public/favicon.png b/public/favicon.png new file mode 100644 index 0000000..a060a2f Binary files /dev/null and b/public/favicon.png differ diff --git a/public/favicon2.png b/public/favicon2.png new file mode 100644 index 0000000..16ec632 Binary files /dev/null and b/public/favicon2.png differ diff --git a/resources/js/app.js b/resources/js/app.js index 60cc0ac..6f1fa76 100644 --- a/resources/js/app.js +++ b/resources/js/app.js @@ -20,3 +20,28 @@ import './bootstrap'; // const app = new Vue({ // el: '#app' // }); + + +function setFaviconNumber(number) { + var canvas = document.createElement('canvas'), + ctx, + img = document.createElement('img'), + link = document.getElementById('favicon').cloneNode(true); + + if (canvas.getContext) { + canvas.height = canvas.width = 48; // set the size + ctx = canvas.getContext('2d'); + img.onload = function () { // once the image has loaded + ctx.drawImage(this, 0, 0); + ctx.font = 'bold 35px "helvetica", sans-serif'; + ctx.fillStyle = '#ffff66'; + ctx.fillText(number, 3, 25); + link.href = canvas.toDataURL('image/png'); + document.body.appendChild(link); + }; + img.src = 'favicon.png'; + } +}; + +usedItems = document.getElementById("usedItems").innerText; +setFaviconNumber(usedItems); diff --git a/resources/views/layouts/app.blade.php b/resources/views/layouts/app.blade.php index f5104c6..4753382 100644 --- a/resources/views/layouts/app.blade.php +++ b/resources/views/layouts/app.blade.php @@ -19,9 +19,12 @@ + + +