<i class="television-live"><svg viewBox="0 0 64 64" xmlns="http://www.w3.org/2000/svg">
<path d="m53 55h-42a6.82 6.82 0 0 1 -2.34-.41 7 7 0 0 1 -4.66-6.59v-33a7 7 0 0 1 7-7h42a7 7 0 0 1 7 7v33a7 7 0 0 1 -4.67 6.59 6.72 6.72 0 0 1 -2.33.41zm-42-45a5 5 0 0 0 -5 5v33a5 5 0 0 0 5 5h42a4.91 4.91 0 0 0 1.66-.29 5 5 0 0 0 3.34-4.71v-33a5 5 0 0 0 -5-5z" />
<path d="m48 10h-32a1 1 0 0 1 -1-1 5 5 0 0 1 5-5h24a5 5 0 0 1 5 5 1 1 0 0 1 -1 1zm-30.83-2h29.66a3 3 0 0 0 -2.83-2h-24a3 3 0 0 0 -2.83 2z" />
<path d="m55 60h-46a1 1 0 0 1 -1-1v-5.35a1 1 0 0 1 .43-.82 1 1 0 0 1 .91-.12 4.91 4.91 0 0 0 1.66.29h42a4.91 4.91 0 0 0 1.66-.29 1 1 0 0 1 .91.12 1 1 0 0 1 .43.82v5.35a1 1 0 0 1 -1 1zm-45-2h44v-3.07a6.63 6.63 0 0 1 -1 .07h-42a6.63 6.63 0 0 1 -1-.07z" />
<path d="m52 45h-40a3 3 0 0 1 -3-3v-26a3 3 0 0 1 3-3h40a3 3 0 0 1 3 3v26a3 3 0 0 1 -3 3zm-40-30a1 1 0 0 0 -1 1v26a1 1 0 0 0 1 1h40a1 1 0 0 0 1-1v-26a1 1 0 0 0 -1-1z" />
<path d="m51 51a2 2 0 1 1 2-2 2 2 0 0 1 -2 2z" />
<path d="m44 51a2 2 0 1 1 2-2 2 2 0 0 1 -2 2z" />
<path d="m26 41a17.2 17.2 0 0 1 -3.31-.31 2.94 2.94 0 0 1 -2.37-2.38 18.52 18.52 0 0 1 -.32-4.37c0-.32 0-.65.09-1a15.62 15.62 0 0 1 .26-1.68 18 18 0 0 1 13.94-13.88 15.82 15.82 0 0 1 1.71-.26l1-.09a18.23 18.23 0 0 1 4.39.28 2.94 2.94 0 0 1 2.37 2.38 18.52 18.52 0 0 1 .24 4.37c0 .32 0 .65-.09 1a15.62 15.62 0 0 1 -.26 1.68 18 18 0 0 1 -13.94 13.88 15.82 15.82 0 0 1 -1.67.26l-1 .09q-.52.03-1.04.03zm12-22q-.48 0-1 0l-.89.08a12.4 12.4 0 0 0 -1.46.23 16 16 0 0 0 -12.31 12.4 14.56 14.56 0 0 0 -.24 1.47c0 .29-.05.58-.07.88a15.67 15.67 0 0 0 .24 3.94.94.94 0 0 0 .76.77 15.42 15.42 0 0 0 3.91.25l.89-.08a12.4 12.4 0 0 0 1.46-.23 16 16 0 0 0 12.37-12.42 14.56 14.56 0 0 0 .24-1.47c0-.28.05-.58.07-.88a15.67 15.67 0 0 0 -.24-3.89.94.94 0 0 0 -.76-.77 15.21 15.21 0 0 0 -2.97-.28z" />
<path d="m26 41a17.2 17.2 0 0 1 -3.31-.31 2.94 2.94 0 0 1 -2.37-2.38 18.52 18.52 0 0 1 -.32-4.37c0-.32 0-.65.09-1a15.62 15.62 0 0 1 .26-1.68 18 18 0 0 1 13.94-13.88 15.82 15.82 0 0 1 1.71-.26l1-.09a18.23 18.23 0 0 1 4.39.28 2.94 2.94 0 0 1 2.37 2.38 18.52 18.52 0 0 1 .24 4.37c0 .32 0 .65-.09 1a15.62 15.62 0 0 1 -.26 1.68 18 18 0 0 1 -13.94 13.88 15.82 15.82 0 0 1 -1.67.26l-1 .09q-.52.03-1.04.03zm12-22q-.48 0-1 0l-.89.08a12.4 12.4 0 0 0 -1.46.23 16 16 0 0 0 -12.31 12.4 14.56 14.56 0 0 0 -.24 1.47c0 .29-.05.58-.07.88a15.67 15.67 0 0 0 .24 3.94.94.94 0 0 0 .76.77 15.42 15.42 0 0 0 3.91.25l.89-.08a12.4 12.4 0 0 0 1.46-.23 16 16 0 0 0 12.37-12.42 14.56 14.56 0 0 0 .24-1.47c0-.28.05-.58.07-.88a15.67 15.67 0 0 0 -.24-3.89.94.94 0 0 0 -.76-.77 15.21 15.21 0 0 0 -2.97-.28z" />
<path d="m42 26a7 7 0 0 1 -7-7 6.93 6.93 0 0 1 .08-1.06 1 1 0 0 1 .89-.82c.32 0 .65-.07 1-.09a18.23 18.23 0 0 1 4.39.28 2.94 2.94 0 0 1 2.37 2.38 18.52 18.52 0 0 1 .27 4.37c0 .32 0 .65-.09 1a1 1 0 0 1 -.82.89 6.93 6.93 0 0 1 -1.09.05zm-5-7a5 5 0 0 0 5 5v-.06a15.67 15.67 0 0 0 -.24-3.89.94.94 0 0 0 -.76-.77 15.42 15.42 0 0 0 -3.94-.28z" />
<path d="m26 41a17.2 17.2 0 0 1 -3.31-.31 2.94 2.94 0 0 1 -2.37-2.38 18.52 18.52 0 0 1 -.32-4.37c0-.32 0-.65.09-1a1 1 0 0 1 .82-.89 6.93 6.93 0 0 1 1.09-.05 7 7 0 0 1 7 7 6.93 6.93 0 0 1 -.08 1.06 1 1 0 0 1 -.89.82c-.32 0-.65.07-1 .09s-.69.03-1.03.03zm-4-7v.06a15.67 15.67 0 0 0 .27 3.94.94.94 0 0 0 .76.77 15.42 15.42 0 0 0 3.91.25h.06a5 5 0 0 0 -5-5.02z" />
<path d="m29 33a1 1 0 0 1 -.71-.29 1 1 0 0 1 0-1.42l6-6a1 1 0 0 1 1.42 1.42l-6 6a1 1 0 0 1 -.71.29z" />
<path d="m33 31a1 1 0 0 1 -.71-.29l-2-2a1 1 0 0 1 1.42-1.42l2 2a1 1 0 0 1 0 1.42 1 1 0 0 1 -.71.29z" />
<path d="m35 29a1 1 0 0 1 -.71-.29l-2-2a1 1 0 0 1 1.42-1.42l2 2a1 1 0 0 1 0 1.42 1 1 0 0 1 -.71.29z" />
<path d="m31 33a1 1 0 0 1 -.71-.29l-2-2a1 1 0 0 1 1.42-1.42l2 2a1 1 0 0 1 0 1.42 1 1 0 0 1 -.71.29z" />
</svg></i>
{% set className = className ? className ~ ' ' : '' %}
{% set attributes = className ~ icon | trim %}
{% set insert = true %}
{% if iconType is empty or iconType == 'custom' %}
<i class="{{ attributes }}">{% if insert is defined and insert == true %}{{ source('@customIcons/' ~ icon ~ '.svg') }}{% endif %}</i>
{% elseif iconType is not empty or iconType == 'iconoir' %}
<i class="{{ attributes }}">{% if insert is defined and insert == true %}{{ source('@icons/' ~ icon ~ '.svg') }}{% endif %}</i>
{% endif %}
{
"icon": "television-live"
}
<?php
namespace Theme\Views\Atoms\icon;
use ACFToolkit\Traits\SetWrapperWidth;
use ACFToolkit\Types\CustomAtom;
class Icon extends CustomAtom
{
use SetWrapperWidth;
public string $name = 'icon';
public string $label = 'Icon';
public int $needsJs = 0;
public int $needsVue = 1;
public int $needsVueInitialisation = 0;
public function __construct($name = '', $title = '', $children = [])
{
parent::__construct($name, $title);
$this->addChildren(array_merge($children, [
]));
}
public function getChoices()
{
$customIcons = get_template_directory().'/resources/Views/Assets/dist/custom-icons/*.svg';
$result = [];
$files = glob($customIcons);
foreach($files as $file) {
$filename = basename($file, '.svg');
$result[$filename] = $filename;
}
return $result;
}
}
<?php
namespace Theme\Views\Atoms\icon;
use ACFToolkit\ViewModels\BaseViewModel;
class IconViewModel extends BaseViewModel
{
}
i {
display: inline-block;
width: 26px;
svg {
width: 100%;
vertical-align: top;
}
&.sm {
width: 20px;
}
&.md {
width: 40px;
}
&.lg {
width: 50px;
}
&.xl {
width: 60px;
}
&.star--filled {
svg {
g {
fill: theme('colors.primary');
}
}
}
&.logo {
svg {
g {
fill: theme('colors.primary');
}
}
}
&.logo--white {
svg {
g {
fill: #fff;
}
}
}
&.logo_subline {
svg {
g {
fill: theme('colors.primary');
}
}
}
&.logo_subline--white {
svg {
g {
fill: #fff;
}
}
}
&.logo_subline-subline--accent {
svg {
g {
fill: theme('colors.primary');
&#subline {
fill: theme('colors.accent');
}
}
}
}
&.logo_subline--white-subline--accent {
svg {
g {
fill: #fff;
&#subline {
fill: theme('colors.accent');
}
}
}
}
&.search {
width: 24px;
height: 24px;
}
}
<template>
<i
:class="getTypeClass + '-' + icon + ' ' + className"
v-html="iconSource"
:title="title"
v-if="iconSource"
></i>
</template>
<script>
import IconService from '../../Assets/src/js/services/IconService';
export default {
props: {
className: {
type: String,
default: ''
},
icon: {
type: String,
},
title: {
type: String
},
type: {
type: String,
default: 'custom'
}
},
data: () => {
return {
iconSource: null
}
},
computed: {
getTypeClass(){
return this.type === 'custom' ? 'custom' : 'iconoir'
}
},
async created(){
const {data} = this.type === 'custom' ?
await IconService.getCustom(this.icon) :
await IconService.getIconoir(this.icon)
this.iconSource = data
}
}
</script>
<style>
*[class^="iconoir-"], *[class*=" iconoir-"] {
display: inline-block;
}
</style>
{% include '@atoms/icon/icon.twig' with {
icon: 'icon'
} only %}Fields