diff --git a/src/graphics/Index.tsx b/src/graphics/Index.tsx index 0bd3512..bde4d92 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'; //@ts-ignore import ScoreboardOverlay from './ScoreboardOverlay.png' @@ -15,21 +15,33 @@ export function Index() { const [betweenText, set_betweenText] = useReplicant('betweenText', '') const [flipScore, set_flipScore] = useReplicant('flipScore', 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 ( <> - {showScore ?
-
- - -
+
+ + +
-

{betweenText}

: <> } - {showSpoilerOverlay ? : <> } +

{betweenText}

: <> } + {showSpoilerOverlay ? : <> } ); } diff --git a/src/graphics/LobbyScore.html b/src/graphics/LobbyScore.html index 89ad7fb..aa020fd 100644 --- a/src/graphics/LobbyScore.html +++ b/src/graphics/LobbyScore.html @@ -16,105 +16,6 @@ -moz-osx-font-smoothing: grayscale; text-rendering: optimizeLegibility; } - - .rotate { - animation: rotation 120s infinite linear; - } - - @keyframes rotation { - from { - transform: rotate(0deg); - } - - to { - transform: rotate(359deg); - } - } - - .rightScore img { - animation-direction: reverse; - } - - .leftScore { - position: absolute; - transform: translate(-50%, -50%); - top: 13%; - left: 45%; - } - - .rightScore { - position: absolute; - transform: translate(50%, -50%); - top: 13%; - right: 45%; - } - - .scoreContainer img { - width: 90px; - } - - .scoreContainer { - color: white; - } - - .scoreContainer h1 { - position: absolute; - transform: translate(-50%, -50%); - top: 23%; - text-shadow: 2px 2px 0px #000000; - left: 50%; - } - - .betweenText { - color: white; - transform: translate(-50%, -50%); - position: absolute; - text-shadow: 2px 2px 0px #000000; - top: 12%; - left: 50%; - } - - .spoilerCover { - position: absolute; - width: 100vw; - height: 100vh; - } - - .leftSideIcon { - width: 80px; - height: 80px; - transform: translate(-50%, -50%); - position: absolute; - top: 5%; - left: 26.5%; - } - - .rightSideIcon { - width: 80px; - height: 80px; - transform: translate(50%, -50%); - position: absolute; - top: 5%; - right: 26.5%; - } - - .teamName { - text-transform: uppercase; - color: white; - top: 6.4%; - } - - .leftName { - transform: translate(-50%, -50%); - position: absolute; - left: 35.9%; - } - - .rightName { - transform: translate(50%, -50%); - position: absolute; - right: 35.9%; - } diff --git a/src/graphics/LobbyScore.tsx b/src/graphics/LobbyScore.tsx index 69dc0e2..7282609 100644 --- a/src/graphics/LobbyScore.tsx +++ b/src/graphics/LobbyScore.tsx @@ -1,4 +1,4 @@ -import React from 'react'; +import React, { useEffect, useState } from 'react'; import { useReplicant } from 'use-nodecg'; //@ts-ignore import ScoreboardOverlay from './ScoreboardOverlay.png' @@ -15,11 +15,23 @@ export function LobbyScore() { const [betweenText, set_betweenText] = useReplicant('betweenText', '') const [flipScore, set_flipScore] = useReplicant('flipScore', 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}
- - + +
); diff --git a/src/graphics/ScoreDisplay.tsx b/src/graphics/ScoreDisplay.tsx index 9b146fa..a88e20c 100644 --- a/src/graphics/ScoreDisplay.tsx +++ b/src/graphics/ScoreDisplay.tsx @@ -10,9 +10,9 @@ type ScoreDisplayProps = { export const ScoreDisplay = ({ score, rotate, className }: ScoreDisplayProps) => { return ( -
+

{score}

- +
) } \ No newline at end of file diff --git a/src/graphics/index.html b/src/graphics/index.html index 93c6780..eae1dcc 100644 --- a/src/graphics/index.html +++ b/src/graphics/index.html @@ -16,69 +16,6 @@ -moz-osx-font-smoothing: grayscale; text-rendering: optimizeLegibility; } - - .rotate { - animation: rotation 120s infinite linear; - } - - @keyframes rotation { - from { - transform: rotate(0deg); - } - - to { - transform: rotate(359deg); - } - } - - .rightScore img { - animation-direction: reverse; - } - - .leftScore { - position: absolute; - transform: translate(-50%, -50%); - top: 13%; - left: 45%; - } - - .rightScore { - position: absolute; - transform: translate(50%, -50%); - top: 13%; - right: 45%; - } - - .scoreContainer img { - width: 90px; - } - - .scoreContainer { - color: white; - } - - .scoreContainer h1 { - position: absolute; - transform: translate(-50%, -50%); - top: 23%; - text-shadow: 2px 2px 0px #000000; - left: 50%; - } - - .betweenText { - color: white; - transform: translate(-50%, -50%); - position: absolute; - text-shadow: 2px 2px 0px #000000; - top: 12%; - left: 50%; - } - - .spoilerCover { - position: absolute; - width: 100vw; - height: 100vh; - }