From 395efa4fd6ab63859b2c5738ae3a85573b73db4c Mon Sep 17 00:00:00 2001 From: Coow Date: Sun, 8 Oct 2023 15:46:32 +0200 Subject: [PATCH] Updated Bundle to use NodeCG-Themer --- src/dashboard/CasterManager.tsx | 10 ------ src/graphics/Index.tsx | 26 ++++++++++---- src/graphics/index.html | 60 --------------------------------- 3 files changed, 19 insertions(+), 77 deletions(-) diff --git a/src/dashboard/CasterManager.tsx b/src/dashboard/CasterManager.tsx index 10f23a0..bb2a047 100644 --- a/src/dashboard/CasterManager.tsx +++ b/src/dashboard/CasterManager.tsx @@ -43,16 +43,6 @@ export function CasterManager() { set_caster2(temp) } - //, show_caster2_social, show_observer, show_observer_social - - //Currently not working, waiting for assistance - //@ts-ignore - //waitForReplicants([show_caster1_social]).then(() => { - // console.log("Replicants avaliabe") - //}).catch((error) => { - // console.log(error) - //}) - return ( <>
diff --git a/src/graphics/Index.tsx b/src/graphics/Index.tsx index d08c987..79dcabd 100644 --- a/src/graphics/Index.tsx +++ b/src/graphics/Index.tsx @@ -1,4 +1,4 @@ -import React from 'react'; +import React, { useEffect, useState } from 'react'; import { useReplicant } from 'use-nodecg'; export function Index() { @@ -16,20 +16,32 @@ export function Index() { const [observer_social, set_observer_social] = useReplicant('observersocial', ''); const [show_observer_social, set_show_observer_social] = useReplicant('showobserversocial', false); + const [theme, set_theme] = useReplicant<{ value: string; label: string; }>('theme', { value: '../../../assets/nodecg-themer/themes/default.css', label: 'default' }, { namespace: 'nodecg-themer' }); + + const [themeDiv, set_themeDiv] = useState(<>) + + useEffect(() => { + console.log(theme) + if (!theme) return; + console.log(theme) + set_themeDiv() + }, [theme]) + return ( <> -
+ {themeDiv} +

{caster1}

-
+

{caster2}

{show_caster1_social ? -
+

{caster1_social}

@@ -37,21 +49,21 @@ export function Index() { } {show_caster2_social ? -
+

{caster2_social}

: <> } {show_observer ? -
+

Observer: {observer}

: <>} {show_observer_social && show_observer ?
-
+

{observer_social}

diff --git a/src/graphics/index.html b/src/graphics/index.html index b304d2a..d7c7fee 100644 --- a/src/graphics/index.html +++ b/src/graphics/index.html @@ -14,66 +14,6 @@ font-family: Monsterrat; font-weight: 700; } - - .caster1 { - color: white; - position: absolute; - text-align: center; - transform: translate(-50%, -50%); - top: 944px; - left: 330px; - } - - .caster1social { - color: white; - position: absolute; - text-align: center; - transform: translate(-50%, -50%); - top: 990px; - left: 330px; - } - - .caster2 { - color: white; - position: absolute; - text-align: center; - transform: translate(50%, -50%); - top: 944px; - right: 330px; - } - - .caster2social { - color: white; - position: absolute; - text-align: center; - transform: translate(50%, -50%); - top: 990px; - right: 330px; - } - - - .observer { - color: white; - position: absolute; - text-align: center; - transform: translate(-50%, -50%); - top: 965px; - left: 50%; - } - - .observerSocial { - color: white; - position: absolute; - text-align: center; - transform: translate(-50%, -50%); - top: 1000px; - left: 50%; - } - - .xsvg { - fill: white; - height: 35px; - }