From 7964a8d6ba5da351191e5878787396debab1a63f Mon Sep 17 00:00:00 2001 From: soufiane Date: Mon, 2 Mar 2026 12:52:02 +0100 Subject: [PATCH] wait #8027 @4:00 --- .../views/scripts/common/body.phtml | 1 + .../views/scripts/common/spritesvg.phtml | 160 ++++++++++++++++++ js/002-common.js | 46 +++++ less/410-features.less | 1 + 4 files changed, 208 insertions(+) create mode 100644 framework/application/views/scripts/common/spritesvg.phtml diff --git a/framework/application/views/scripts/common/body.phtml b/framework/application/views/scripts/common/body.phtml index e576ffc..054d2a8 100644 --- a/framework/application/views/scripts/common/body.phtml +++ b/framework/application/views/scripts/common/body.phtml @@ -14,6 +14,7 @@ if ($this->navigation()->view->currentPage) { } echo '' . "\n"; +echo $this->render('common/spritesvg.phtml'); echo $this->bannerCookies(); echo $this->render('admin/mockup.phtml'); echo $this->render('admin/nav.phtml'); diff --git a/framework/application/views/scripts/common/spritesvg.phtml b/framework/application/views/scripts/common/spritesvg.phtml new file mode 100644 index 0000000..8b21c28 --- /dev/null +++ b/framework/application/views/scripts/common/spritesvg.phtml @@ -0,0 +1,160 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + '; \ No newline at end of file diff --git a/js/002-common.js b/js/002-common.js index 2a979c6..2e9042c 100644 --- a/js/002-common.js +++ b/js/002-common.js @@ -67,6 +67,13 @@ function load_common() { $(window).on('cubeitresize', _resize); _resize(); + + $(".feature-icon").each(function() { + const icon = $(this)[0].classList[1]; + if(getSpriteIcon(icon)) { + $(this).append(getSpriteIcon(icon)) + } + }) } function _resize() { @@ -181,4 +188,43 @@ function setZoom(ww) { function isMobile() { return Modernizr.mq('(max-width: 900px)'); +} + +function getSpriteIcon(icon, attrs, dimensions) { + var a = []; + var iconSymbol = $('svg symbol[id="' + icon + '"]'); + if (iconSymbol.length > 1) { + $('svg symbol[id="' + icon + '"]:not(:last)').remove(); + iconSymbol = $('svg symbol[id="' + icon + '"]'); + } + + if (iconSymbol.length == 0) { + return ''; // Bail out because symbol doesn't exist + } + + if (attrs == undefined) { + attrs = {}; + } + if (attrs.viewBox == null) { + attrs.viewBox = iconSymbol.get(0).attributes.viewBox.value; + } + if (dimensions === true) { + var vb = attrs.viewBox.split(' '); + attrs.x = vb[0]; + attrs.y = vb[1]; + attrs.width = vb[2]; + attrs.height = vb[3]; + } + if (attrs.class == null) { + attrs.class = icon; + } else { + attrs.class += ' ' + icon; + } + + attrs.class += ' nav-icon svg-icon'; // Common class for all icons + + $.each(attrs, function (k, v) { + a.push(k + '="' + v + '"'); + }); + return ''; } \ No newline at end of file diff --git a/less/410-features.less b/less/410-features.less index ee95bda..49a5036 100644 --- a/less/410-features.less +++ b/less/410-features.less @@ -283,6 +283,7 @@ line-height: 49px; margin-bottom: 12px; margin-right: 30px; + width: 65px; [data-cols="2"] & { margin-right: 20px; -- 2.39.5