Add simple icons (#564)

This commit is contained in:
Kieran 2025-01-14 12:53:35 -08:00 committed by GitHub
parent 40cde43be1
commit ca90da49f5
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
12 changed files with 109 additions and 260 deletions

View file

@ -347,6 +347,38 @@ module.exports = {
},
{ values }
)
}),
plugin(function ({ matchComponents, theme }) {
let iconsDir = path.join(__dirname, './vendor/simple-icons')
let values = {}
fs.readdirSync(iconsDir).forEach((file) => {
let name = path.basename(file, '.svg')
values[name] = { name, fullPath: path.join(iconsDir, file) }
})
matchComponents(
{
si: ({ name, fullPath }) => {
let content = fs
.readFileSync(fullPath)
.toString()
.replace(/\r?\n|\r/g, '')
return {
[`--si-${name}`]: `url('data:image/svg+xml;utf8,${content}')`,
'-webkit-mask': `var(--si-${name})`,
mask: `var(--si-${name})`,
'mask-repeat': 'no-repeat',
'background-color': 'currentColor',
'vertical-align': 'middle',
display: 'inline-block',
width: theme('spacing.5'),
height: theme('spacing.5')
}
}
},
{ values }
)
})
]
}

View file

@ -0,0 +1 @@
<svg role="img" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><title>Discord</title><path d="M20.317 4.3698a19.7913 19.7913 0 00-4.8851-1.5152.0741.0741 0 00-.0785.0371c-.211.3753-.4447.8648-.6083 1.2495-1.8447-.2762-3.68-.2762-5.4868 0-.1636-.3933-.4058-.8742-.6177-1.2495a.077.077 0 00-.0785-.037 19.7363 19.7363 0 00-4.8852 1.515.0699.0699 0 00-.0321.0277C.5334 9.0458-.319 13.5799.0992 18.0578a.0824.0824 0 00.0312.0561c2.0528 1.5076 4.0413 2.4228 5.9929 3.0294a.0777.0777 0 00.0842-.0276c.4616-.6304.8731-1.2952 1.226-1.9942a.076.076 0 00-.0416-.1057c-.6528-.2476-1.2743-.5495-1.8722-.8923a.077.077 0 01-.0076-.1277c.1258-.0943.2517-.1923.3718-.2914a.0743.0743 0 01.0776-.0105c3.9278 1.7933 8.18 1.7933 12.0614 0a.0739.0739 0 01.0785.0095c.1202.099.246.1981.3728.2924a.077.077 0 01-.0066.1276 12.2986 12.2986 0 01-1.873.8914.0766.0766 0 00-.0407.1067c.3604.698.7719 1.3628 1.225 1.9932a.076.076 0 00.0842.0286c1.961-.6067 3.9495-1.5219 6.0023-3.0294a.077.077 0 00.0313-.0552c.5004-5.177-.8382-9.6739-3.5485-13.6604a.061.061 0 00-.0312-.0286zM8.02 15.3312c-1.1825 0-2.1569-1.0857-2.1569-2.419 0-1.3332.9555-2.4189 2.157-2.4189 1.2108 0 2.1757 1.0952 2.1568 2.419 0 1.3332-.9555 2.4189-2.1569 2.4189zm7.9748 0c-1.1825 0-2.1569-1.0857-2.1569-2.419 0-1.3332.9554-2.4189 2.1569-2.4189 1.2108 0 2.1757 1.0952 2.1568 2.419 0 1.3332-.946 2.4189-2.1568 2.4189Z"/></svg>

After

Width:  |  Height:  |  Size: 1.3 KiB

1
assets/vendor/simple-icons/github.svg vendored Normal file
View file

@ -0,0 +1 @@
<svg role="img" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><title>GitHub</title><path d="M12 .297c-6.63 0-12 5.373-12 12 0 5.303 3.438 9.8 8.205 11.385.6.113.82-.258.82-.577 0-.285-.01-1.04-.015-2.04-3.338.724-4.042-1.61-4.042-1.61C4.422 18.07 3.633 17.7 3.633 17.7c-1.087-.744.084-.729.084-.729 1.205.084 1.838 1.236 1.838 1.236 1.07 1.835 2.809 1.305 3.495.998.108-.776.417-1.305.76-1.605-2.665-.3-5.466-1.332-5.466-5.93 0-1.31.465-2.38 1.235-3.22-.135-.303-.54-1.523.105-3.176 0 0 1.005-.322 3.3 1.23.96-.267 1.98-.399 3-.405 1.02.006 2.04.138 3 .405 2.28-1.552 3.285-1.23 3.285-1.23.645 1.653.24 2.873.12 3.176.765.84 1.23 1.91 1.23 3.22 0 4.61-2.805 5.625-5.475 5.92.42.36.81 1.096.81 2.22 0 1.606-.015 2.896-.015 3.286 0 .315.21.69.825.57C20.565 22.092 24 17.592 24 12.297c0-6.627-5.373-12-12-12"/></svg>

After

Width:  |  Height:  |  Size: 823 B

View file

@ -700,7 +700,7 @@ defmodule PinchflatWeb.CoreComponents do
attr :class, :string, default: nil
attr :rest, :global
def icon(%{name: "hero-" <> _} = assigns) do
def icon(assigns) do
~H"""
<span class={[@name, @class]} {@rest} />
"""

View file

@ -15,11 +15,12 @@ defmodule PinchflatWeb.Layouts do
attr :text, :string, required: true
attr :href, :any, required: true
attr :target, :any, default: "_self"
attr :icon_class, :string, default: ""
def sidebar_item(assigns) do
~H"""
<li class="text-bodydark1">
<.sidebar_link icon={@icon} text={@text} href={@href} target={@target} />
<.sidebar_link icon={@icon} text={@text} href={@href} target={@target} icon_class={@icon_class} />
</li>
"""
end
@ -89,6 +90,7 @@ defmodule PinchflatWeb.Layouts do
attr :href, :any, required: true
attr :target, :any, default: "_self"
attr :class, :string, default: ""
attr :icon_class, :string, default: ""
def sidebar_link(assigns) do
~H"""
@ -103,7 +105,7 @@ defmodule PinchflatWeb.Layouts do
@class
]}
>
<.icon :if={@icon} name={@icon} /> {@text}
<.icon :if={@icon} name={@icon} class={@icon_class} /> {@text}
</.link>
"""
end

View file

@ -47,8 +47,9 @@
text="Docs"
target="_blank"
href="https://github.com/kieraneglin/pinchflat/wiki"
icon_class="scale-110"
/>
<.sidebar_item icon="hero-cog" text="Github" target="_blank" href="https://github.com/kieraneglin/pinchflat" />
<.sidebar_item icon="si-github" text="Github" target="_blank" href="https://github.com/kieraneglin/pinchflat" />
<li>
<span
class={[
@ -59,7 +60,7 @@
]}
phx-click={show_modal("donate-modal")}
>
<.icon name="hero-currency-dollar" /> Donate
<.icon name="hero-currency-dollar" class="scale-110" /> Donate
</span>
</li>
<li>

View file

@ -18,11 +18,7 @@
"limit": 100,
"name": "PromEx service start",
"showIn": 0,
"tags": [
"prom_ex",
"pinchflat",
"start"
],
"tags": ["prom_ex", "pinchflat", "start"],
"type": "tags"
},
{
@ -33,11 +29,7 @@
"limit": 100,
"name": "PromEx service stop",
"showIn": 0,
"tags": [
"prom_ex",
"pinchflat",
"stop"
],
"tags": ["prom_ex", "pinchflat", "stop"],
"type": "tags"
}
]
@ -108,9 +100,7 @@
"justifyMode": "auto",
"orientation": "auto",
"reduceOptions": {
"calcs": [
"last"
],
"calcs": ["last"],
"fields": "",
"values": false
},
@ -314,9 +304,7 @@
"justifyMode": "auto",
"orientation": "auto",
"reduceOptions": {
"calcs": [
"last"
],
"calcs": ["last"],
"fields": "/^name$/",
"values": false
},
@ -370,9 +358,7 @@
"justifyMode": "auto",
"orientation": "auto",
"reduceOptions": {
"calcs": [
"last"
],
"calcs": ["last"],
"fields": "/^sha$/",
"values": false
},
@ -426,9 +412,7 @@
"justifyMode": "auto",
"orientation": "auto",
"reduceOptions": {
"calcs": [
"last"
],
"calcs": ["last"],
"fields": "/^author$/",
"values": false
},
@ -482,9 +466,7 @@
"justifyMode": "auto",
"orientation": "auto",
"reduceOptions": {
"calcs": [
"last"
],
"calcs": ["last"],
"fields": "/^version$/",
"values": false
},
@ -538,9 +520,7 @@
"justifyMode": "auto",
"orientation": "auto",
"reduceOptions": {
"calcs": [
"last"
],
"calcs": ["last"],
"fields": "/^modules$/",
"values": false
},
@ -618,17 +598,10 @@
"to": "now"
},
"timepicker": {
"refresh_intervals": [
"5s",
"10s",
"30s",
"1m",
"5m"
]
"refresh_intervals": ["5s", "10s", "30s", "1m", "5m"]
},
"timezone": "",
"title": "Pinchflat - PromEx Application Dashboard",
"uid": "7DBBC471C5775585391E8F24D1E62319",
"version": 1
}

View file

@ -18,11 +18,7 @@
"limit": 100,
"name": "PromEx service start",
"showIn": 0,
"tags": [
"prom_ex",
"pinchflat",
"start"
],
"tags": ["prom_ex", "pinchflat", "start"],
"type": "tags"
},
{
@ -33,11 +29,7 @@
"limit": 100,
"name": "PromEx service stop",
"showIn": 0,
"tags": [
"prom_ex",
"pinchflat",
"stop"
],
"tags": ["prom_ex", "pinchflat", "stop"],
"type": "tags"
}
]
@ -122,9 +114,7 @@
"justifyMode": "center",
"orientation": "auto",
"reduceOptions": {
"calcs": [
"last"
],
"calcs": ["last"],
"fields": "",
"values": false
},
@ -336,9 +326,7 @@
"justifyMode": "auto",
"orientation": "auto",
"reduceOptions": {
"calcs": [
"lastNotNull"
],
"calcs": ["lastNotNull"],
"fields": "",
"values": false
},
@ -400,9 +388,7 @@
"justifyMode": "auto",
"orientation": "auto",
"reduceOptions": {
"calcs": [
"last"
],
"calcs": ["last"],
"fields": "",
"values": false
},
@ -650,9 +636,7 @@
"justifyMode": "auto",
"orientation": "auto",
"reduceOptions": {
"calcs": [
"last"
],
"calcs": ["last"],
"fields": "",
"values": false
},
@ -714,9 +698,7 @@
"justifyMode": "auto",
"orientation": "auto",
"reduceOptions": {
"calcs": [
"last"
],
"calcs": ["last"],
"fields": "",
"values": false
},
@ -919,9 +901,7 @@
"justifyMode": "auto",
"orientation": "auto",
"reduceOptions": {
"calcs": [
"last"
],
"calcs": ["last"],
"fields": "",
"values": false
},
@ -983,9 +963,7 @@
"justifyMode": "auto",
"orientation": "auto",
"reduceOptions": {
"calcs": [
"last"
],
"calcs": ["last"],
"fields": "",
"values": false
},
@ -2341,17 +2319,10 @@
"to": "now"
},
"timepicker": {
"refresh_intervals": [
"5s",
"10s",
"30s",
"1m",
"5m"
]
"refresh_intervals": ["5s", "10s", "30s", "1m", "5m"]
},
"timezone": "",
"title": "Pinchflat - PromEx Beam Dashboard",
"uid": "14B578642B07F5DEA133D4DE6A6AAD0A",
"version": 1
}

View file

@ -18,11 +18,7 @@
"limit": 100,
"name": "PromEx service start",
"showIn": 0,
"tags": [
"prom_ex",
"pinchflat",
"start"
],
"tags": ["prom_ex", "pinchflat", "start"],
"type": "tags"
},
{
@ -33,11 +29,7 @@
"limit": 100,
"name": "PromEx service stop",
"showIn": 0,
"tags": [
"prom_ex",
"pinchflat",
"stop"
],
"tags": ["prom_ex", "pinchflat", "stop"],
"type": "tags"
}
]
@ -121,9 +113,7 @@
"justifyMode": "auto",
"orientation": "auto",
"reduceOptions": {
"calcs": [
"lastNotNull"
],
"calcs": ["lastNotNull"],
"fields": "",
"values": false
},
@ -177,9 +167,7 @@
"justifyMode": "auto",
"orientation": "auto",
"reduceOptions": {
"calcs": [
"lastNotNull"
],
"calcs": ["lastNotNull"],
"fields": "",
"values": false
},
@ -233,9 +221,7 @@
"justifyMode": "auto",
"orientation": "auto",
"reduceOptions": {
"calcs": [
"lastNotNull"
],
"calcs": ["lastNotNull"],
"fields": "",
"values": false
},
@ -289,9 +275,7 @@
"justifyMode": "auto",
"orientation": "auto",
"reduceOptions": {
"calcs": [
"lastNotNull"
],
"calcs": ["lastNotNull"],
"fields": "",
"values": false
},
@ -345,9 +329,7 @@
"justifyMode": "auto",
"orientation": "auto",
"reduceOptions": {
"calcs": [
"last"
],
"calcs": ["last"],
"fields": "/^repo$/",
"values": false
},
@ -407,9 +389,7 @@
"justifyMode": "auto",
"orientation": "auto",
"reduceOptions": {
"calcs": [
"last"
],
"calcs": ["last"],
"fields": "/^database_host$/",
"values": false
},
@ -469,9 +449,7 @@
"justifyMode": "auto",
"orientation": "auto",
"reduceOptions": {
"calcs": [
"last"
],
"calcs": ["last"],
"fields": "/^database_name$/",
"values": false
},
@ -531,9 +509,7 @@
"justifyMode": "auto",
"orientation": "auto",
"reduceOptions": {
"calcs": [
"last"
],
"calcs": ["last"],
"fields": "/init_pool_size/",
"values": false
},
@ -593,9 +569,7 @@
"justifyMode": "auto",
"orientation": "auto",
"reduceOptions": {
"calcs": [
"last"
],
"calcs": ["last"],
"fields": "/init_timeout_duration/",
"values": false
},
@ -1264,17 +1238,10 @@
"to": "now"
},
"timepicker": {
"refresh_intervals": [
"5s",
"10s",
"30s",
"1m",
"5m"
]
"refresh_intervals": ["5s", "10s", "30s", "1m", "5m"]
},
"timezone": "",
"title": "Pinchflat - PromEx Ecto Dashboard",
"uid": "449823C137E6C016E4480ADDA42E94EE",
"version": 1
}

View file

@ -18,11 +18,7 @@
"limit": 100,
"name": "PromEx service start",
"showIn": 0,
"tags": [
"prom_ex",
"pinchflat",
"start"
],
"tags": ["prom_ex", "pinchflat", "start"],
"type": "tags"
},
{
@ -33,11 +29,7 @@
"limit": 100,
"name": "PromEx service stop",
"showIn": 0,
"tags": [
"prom_ex",
"pinchflat",
"stop"
],
"tags": ["prom_ex", "pinchflat", "stop"],
"type": "tags"
}
]
@ -236,9 +228,7 @@
"displayMode": "lcd",
"orientation": "horizontal",
"reduceOptions": {
"calcs": [
"lastNotNull"
],
"calcs": ["lastNotNull"],
"fields": "",
"values": false
},
@ -433,9 +423,7 @@
"justifyMode": "center",
"orientation": "auto",
"reduceOptions": {
"calcs": [
"lastNotNull"
],
"calcs": ["lastNotNull"],
"fields": "",
"values": false
},
@ -490,9 +478,7 @@
"justifyMode": "center",
"orientation": "auto",
"reduceOptions": {
"calcs": [
"lastNotNull"
],
"calcs": ["lastNotNull"],
"fields": "",
"values": false
},
@ -547,9 +533,7 @@
"justifyMode": "center",
"orientation": "auto",
"reduceOptions": {
"calcs": [
"lastNotNull"
],
"calcs": ["lastNotNull"],
"fields": "",
"values": false
},
@ -2351,9 +2335,7 @@
"justifyMode": "auto",
"orientation": "auto",
"reduceOptions": {
"calcs": [
"lastNotNull"
],
"calcs": ["lastNotNull"],
"fields": "",
"values": false
},
@ -2411,9 +2393,7 @@
"justifyMode": "auto",
"orientation": "auto",
"reduceOptions": {
"calcs": [
"lastNotNull"
],
"calcs": ["lastNotNull"],
"fields": "",
"values": false
},
@ -2471,9 +2451,7 @@
"justifyMode": "auto",
"orientation": "auto",
"reduceOptions": {
"calcs": [
"lastNotNull"
],
"calcs": ["lastNotNull"],
"fields": "",
"values": false
},
@ -2531,9 +2509,7 @@
"justifyMode": "auto",
"orientation": "auto",
"reduceOptions": {
"calcs": [
"lastNotNull"
],
"calcs": ["lastNotNull"],
"fields": "",
"values": false
},
@ -2881,17 +2857,10 @@
"to": "now"
},
"timepicker": {
"refresh_intervals": [
"5s",
"10s",
"30s",
"1m",
"5m"
]
"refresh_intervals": ["5s", "10s", "30s", "1m", "5m"]
},
"timezone": "",
"title": "Pinchflat - PromEx Oban Dashboard",
"uid": "AF9058A0496CA7FF8D4FA747EEDC7AF3",
"version": 1
}

View file

@ -18,11 +18,7 @@
"limit": 100,
"name": "PromEx service start",
"showIn": 0,
"tags": [
"prom_ex",
"pinchflat",
"start"
],
"tags": ["prom_ex", "pinchflat", "start"],
"type": "tags"
},
{
@ -33,11 +29,7 @@
"limit": 100,
"name": "PromEx service stop",
"showIn": 0,
"tags": [
"prom_ex",
"pinchflat",
"stop"
],
"tags": ["prom_ex", "pinchflat", "stop"],
"type": "tags"
}
]
@ -121,9 +113,7 @@
"justifyMode": "auto",
"orientation": "auto",
"reduceOptions": {
"calcs": [
"last"
],
"calcs": ["last"],
"fields": "/^endpoint$/",
"values": false
},
@ -183,9 +173,7 @@
"justifyMode": "center",
"orientation": "auto",
"reduceOptions": {
"calcs": [
"last"
],
"calcs": ["last"],
"fields": "/^port$/",
"values": false
},
@ -246,9 +234,7 @@
"justifyMode": "auto",
"orientation": "auto",
"reduceOptions": {
"calcs": [
"lastNotNull"
],
"calcs": ["lastNotNull"],
"fields": "/^url$/",
"values": false
},
@ -316,9 +302,7 @@
"justifyMode": "center",
"orientation": "auto",
"reduceOptions": {
"calcs": [
"lastNotNull"
],
"calcs": ["lastNotNull"],
"fields": "",
"values": false
},
@ -380,9 +364,7 @@
"justifyMode": "auto",
"orientation": "auto",
"reduceOptions": {
"calcs": [
"lastNotNull"
],
"calcs": ["lastNotNull"],
"fields": "",
"values": false
},
@ -436,9 +418,7 @@
"justifyMode": "auto",
"orientation": "auto",
"reduceOptions": {
"calcs": [
"lastNotNull"
],
"calcs": ["lastNotNull"],
"fields": "",
"values": false
},
@ -492,9 +472,7 @@
"justifyMode": "auto",
"orientation": "auto",
"reduceOptions": {
"calcs": [
"lastNotNull"
],
"calcs": ["lastNotNull"],
"fields": "",
"values": false
},
@ -561,9 +539,7 @@
"justifyMode": "auto",
"orientation": "auto",
"reduceOptions": {
"calcs": [
"lastNotNull"
],
"calcs": ["lastNotNull"],
"fields": "",
"values": false
},
@ -626,9 +602,7 @@
"justifyMode": "auto",
"orientation": "auto",
"reduceOptions": {
"calcs": [
"lastNotNull"
],
"calcs": ["lastNotNull"],
"fields": "",
"values": false
},
@ -682,9 +656,7 @@
"justifyMode": "auto",
"orientation": "auto",
"reduceOptions": {
"calcs": [
"lastNotNull"
],
"calcs": ["lastNotNull"],
"fields": "",
"values": false
},
@ -738,9 +710,7 @@
"justifyMode": "auto",
"orientation": "auto",
"reduceOptions": {
"calcs": [
"lastNotNull"
],
"calcs": ["lastNotNull"],
"fields": "",
"values": false
},
@ -1999,17 +1969,10 @@
"to": "now"
},
"timepicker": {
"refresh_intervals": [
"5s",
"10s",
"30s",
"1m",
"5m"
]
"refresh_intervals": ["5s", "10s", "30s", "1m", "5m"]
},
"timezone": "",
"title": "Pinchflat - PromEx Phoenix Dashboard",
"uid": "970297EC2ACFCF6777A4D3444B63C036",
"version": 1
}

View file

@ -18,11 +18,7 @@
"limit": 100,
"name": "PromEx service start",
"showIn": 0,
"tags": [
"prom_ex",
"pinchflat",
"start"
],
"tags": ["prom_ex", "pinchflat", "start"],
"type": "tags"
},
{
@ -33,11 +29,7 @@
"limit": 100,
"name": "PromEx service stop",
"showIn": 0,
"tags": [
"prom_ex",
"pinchflat",
"stop"
],
"tags": ["prom_ex", "pinchflat", "stop"],
"type": "tags"
}
]
@ -130,9 +122,7 @@
"justifyMode": "auto",
"orientation": "auto",
"reduceOptions": {
"calcs": [
"lastNotNull"
],
"calcs": ["lastNotNull"],
"fields": "",
"values": false
},
@ -187,9 +177,7 @@
"justifyMode": "auto",
"orientation": "auto",
"reduceOptions": {
"calcs": [
"lastNotNull"
],
"calcs": ["lastNotNull"],
"fields": "",
"values": false
},
@ -252,9 +240,7 @@
"justifyMode": "auto",
"orientation": "auto",
"reduceOptions": {
"calcs": [
"lastNotNull"
],
"calcs": ["lastNotNull"],
"fields": "",
"values": false
},
@ -309,9 +295,7 @@
"justifyMode": "auto",
"orientation": "auto",
"reduceOptions": {
"calcs": [
"lastNotNull"
],
"calcs": ["lastNotNull"],
"fields": "/^Value$/",
"values": false
},
@ -374,9 +358,7 @@
"justifyMode": "auto",
"orientation": "auto",
"reduceOptions": {
"calcs": [
"lastNotNull"
],
"calcs": ["lastNotNull"],
"fields": "",
"values": false
},
@ -431,9 +413,7 @@
"justifyMode": "auto",
"orientation": "auto",
"reduceOptions": {
"calcs": [
"lastNotNull"
],
"calcs": ["lastNotNull"],
"fields": "",
"values": false
},
@ -496,9 +476,7 @@
"justifyMode": "auto",
"orientation": "auto",
"reduceOptions": {
"calcs": [
"lastNotNull"
],
"calcs": ["lastNotNull"],
"fields": "",
"values": false
},
@ -553,9 +531,7 @@
"justifyMode": "auto",
"orientation": "auto",
"reduceOptions": {
"calcs": [
"lastNotNull"
],
"calcs": ["lastNotNull"],
"fields": "/^Value$/",
"values": false
},
@ -1395,17 +1371,10 @@
"to": "now"
},
"timepicker": {
"refresh_intervals": [
"5s",
"10s",
"30s",
"1m",
"5m"
]
"refresh_intervals": ["5s", "10s", "30s", "1m", "5m"]
},
"timezone": "",
"title": "Pinchflat - PromEx PhoenixLiveView Dashboard",
"uid": "57C5565313BA3CBE98CC2A2F8C18248F",
"version": 1
}