From 2612df3f378ab755e0c49033b5d1cea038924daa Mon Sep 17 00:00:00 2001 From: Saltssaumure Date: Fri, 1 Sep 2023 07:55:47 +0100 Subject: [PATCH] Fix #1: add platformindicators support --- scss/fsi.scss | 2 + scss/plugin/_PlatformIndicators.scss | 65 ++++++++++++++++++++++++++++ scss/plugin/_index.scss | 1 + svg/default/desktop.svg | 4 ++ svg/default/desktop2.svg | 4 ++ svg/default/web.svg | 4 ++ 6 files changed, 80 insertions(+) create mode 100644 scss/plugin/_PlatformIndicators.scss create mode 100644 scss/plugin/_index.scss create mode 100644 svg/default/desktop.svg create mode 100644 svg/default/desktop2.svg create mode 100644 svg/default/web.svg diff --git a/scss/fsi.scss b/scss/fsi.scss index cacb192..31b7859 100644 --- a/scss/fsi.scss +++ b/scss/fsi.scss @@ -1,3 +1,5 @@ +@forward "./plugin"; + @use "./mask"; $statuses: "online-mobile", "online", "idle", "dnd", "offline", "streaming"; diff --git a/scss/plugin/_PlatformIndicators.scss b/scss/plugin/_PlatformIndicators.scss new file mode 100644 index 0000000..6d3f517 --- /dev/null +++ b/scss/plugin/_PlatformIndicators.scss @@ -0,0 +1,65 @@ +// https://github.com/Puyodead1/replugged-platformindicators +// https://github.com/Vendicated/Vencord/blob/main/src/plugins/platformIndicators.tsx +// https://github.com/Strencher/BetterDiscordStuff/tree/master/PlatformIndicators + +$desktop-path: "M 4.4 24 A 1.2 1.2 90 0 1 4.4 21.6 H 7.2 V 17.6 H 3.6 A 3.6 3.6 90 0 1 0 14 V 3.6 A 3.6 3.6 90 0 1 3.6 0 H 20.4 A 3.6 3.6 90 0 1 24 3.6 V 14 A 3.6 3.6 90 0 1 20.4 17.6 H 16.8 V 21.6 H 19.6 A 1.2 1.2 90 0 1 19.6 24 Z M 9.6 17.6 V 21.6 H 14.4 V 17.6 Z M 20.4 2.4 H 3.6 A 1.2 1.2 90 0 0 2.4 3.6 V 14 A 1.2 1.2 90 0 0 3.6 15.2 H 20.4 A 1.2 1.2 90 0 0 21.6 14 V 3.6 A 1.2 1.2 90 0 0 20.4 2.4 Z"; +$web-path: "M 12 0 C 18.63 0 24 5.37 24 12 C 24 18.63 18.63 24 12 24 C 5.37 24 0 18.63 0 12 C 0 5.37 5.37 0 12 0 Z M 15.53 17.4 H 8.47 C 9.25 20.3 10.62 22.2 12 22.2 S 14.74 20.3 15.53 17.4 Z M 6.61 17.4 H 3.34 A 10.24 10.24 90 0 0 8.26 21.49 C 7.63 20.51 7.11 19.28 6.73 17.88 L 6.61 17.4 Z M 20.66 17.4 H 17.39 C 17 19 16.44 20.4 15.74 21.49 A 10.23 10.23 90 0 0 20.43 17.74 L 20.66 17.4 Z M 6.11 9.6 H 2.08 L 2.08 9.62 A 10.23 10.23 90 0 0 1.8 12 C 1.8 13.27 2.03 14.48 2.45 15.6 H 6.26 A 25.02 25.02 90 0 1 6.11 9.6 Z M 16.08 9.6 H 7.92 A 22.76 22.76 90 0 0 8.09 15.6 H 15.91 A 22.77 22.77 90 0 0 16.08 9.6 Z M 21.92 9.6 H 17.89 C 17.96 10.38 18 11.18 18 12 A 24.36 24.36 90 0 1 17.74 15.6 H 21.55 A 10.18 10.18 90 0 0 22.2 12 C 22.2 11.17 22.1 10.37 21.92 9.6 Z M 8.26 2.51 L 8.23 2.52 A 10.24 10.24 90 0 0 2.7 7.8 H 6.36 C 6.73 5.7 7.39 3.87 8.26 2.51 Z M 12 1.8 L 11.86 1.8 C 10.34 1.94 8.88 4.35 8.2 7.8 H 15.81 C 15.13 4.36 13.67 1.96 12.15 1.81 L 12 1.8 Z M 15.74 2.51 L 15.87 2.72 C 16.68 4.05 17.29 5.8 17.64 7.8 H 21.3 A 10.24 10.24 90 0 0 16.09 2.65 L 15.74 2.51 Z"; +$mobile-path: "M 7.75 0 a 2.25 2.25 0 0 1 2.25 2.25 v 10.5 a 2.25 2.25 0 0 1 -2.25 2.25 h -5.5 a 2.25 2.25 0 0 1 -2.25 -2.25 v -10.5 a 2.25 2.25 0 0 1 2.25 -2.25 h 5.5 Z M 7.75 1.5 h -5.5 a 0.75 0.75 0 0 0 -0.75 0.75 v 10.5 c 0 0.414 0.336 0.75 0.75 0.75 h 5.5 a 0.75 0.75 0 0 0 0.75 -0.75 v -10.5 a 0.75 0.75 0 0 0 -0.75 -0.75 Z M 6.249 10.5 a 0.75 0.75 0 0 1 0.002 1.5 l -2.5 0.004 a 0.75 0.75 0 0 1 -0.002 -1.5 l 2.5 -0.004 Z"; + +:is(.vc-platform-indicator, .platform-indicators) { + :is(svg[width="20"], svg[style^="width: 20"]) { + path[d^="M4 2.5"] { + d: path($desktop-path); + } + path[d^="M12 2"] { + d: path($web-path); + } + } +} + +// Replugged +.platform-indicators { + gap: 4px; + + svg[style^="width: 20"] { + width: 17px !important; + height: 17px !important; + + path[d^="M15.5 1"] { + d: path($mobile-path); + transform: scale(1.6); + } + } +} + +// Vencord +.vc-platform-indicator { + svg[width="20"] { + width: 17px; + height: 17px; + } + + svg[width="17"] path { + d: path($mobile-path); + transform: scale(100); + } +} + +// BetterDiscord +.PI-indicatorContainer { + gap: 2px; + + .PI-icon_desktop path { + d: path($desktop-path); + } + .PI-icon_mobile { + transform: none; + path { + d: path($mobile-path); + transform: scale(2.6); + } + } + .PI-icon_web path { + d: path($web-path); + } +} diff --git a/scss/plugin/_index.scss b/scss/plugin/_index.scss new file mode 100644 index 0000000..fd26d85 --- /dev/null +++ b/scss/plugin/_index.scss @@ -0,0 +1 @@ +@forward "./PlatformIndicators"; diff --git a/svg/default/desktop.svg b/svg/default/desktop.svg new file mode 100644 index 0000000..efe45b6 --- /dev/null +++ b/svg/default/desktop.svg @@ -0,0 +1,4 @@ + + + \ No newline at end of file diff --git a/svg/default/desktop2.svg b/svg/default/desktop2.svg new file mode 100644 index 0000000..52a3ca4 --- /dev/null +++ b/svg/default/desktop2.svg @@ -0,0 +1,4 @@ + + + \ No newline at end of file diff --git a/svg/default/web.svg b/svg/default/web.svg new file mode 100644 index 0000000..64040c2 --- /dev/null +++ b/svg/default/web.svg @@ -0,0 +1,4 @@ + + + \ No newline at end of file