From f24f3af3779e04c5c1f6e65be3d9b84461a43715 Mon Sep 17 00:00:00 2001 From: SpikeHD Date: Thu, 14 Jul 2022 18:05:52 -0700 Subject: [PATCH] just another normal everyday feature, nothing to see here --- src/ui/components/TopBar.css | 26 ++++++++++++++++++ src/ui/components/TopBar.tsx | 51 +++++++++++++++++++++++++++++++++++- src/utils/configuration.ts | 1 + 3 files changed, 77 insertions(+), 1 deletion(-) diff --git a/src/ui/components/TopBar.css b/src/ui/components/TopBar.css index f6469f8..30b3239 100644 --- a/src/ui/components/TopBar.css +++ b/src/ui/components/TopBar.css @@ -25,4 +25,30 @@ #version { margin: 0px 6px; color: #434343; +} + +#unassumingButton { + font-weight: bold; + margin: 0px 6px; + color: #141414; + + transition: color 0.2s ease-in-out; +} + +#unassumingButton:hover { + color: #434343; +} + +#unassumingButton.spin { + color: #fff; + animation: spin 0.5s ease-in-out; +} + +@keyframes spin { + from { + transform: rotate(0deg); + } + to { + transform: rotate(360deg); + } } \ No newline at end of file diff --git a/src/ui/components/TopBar.tsx b/src/ui/components/TopBar.tsx index f1fac63..01b23ec 100644 --- a/src/ui/components/TopBar.tsx +++ b/src/ui/components/TopBar.tsx @@ -10,6 +10,7 @@ import gameBtn from '../../resources/icons/game.svg' import Tr from '../../utils/language' import './TopBar.css' +import { getConfig, setConfigOption } from '../../utils/configuration' interface IProps { optFunc: () => void; @@ -19,13 +20,21 @@ interface IProps { interface IState { version: string; + clicks: number; + intv: NodeJS.Timeout | null; } export default class TopBar extends React.Component { constructor(props: IProps) { super(props) - this.state = { version: '0.0.0' } + this.state = { + version: '0.0.0', + clicks: 0, + intv: null + } + + this.activateClick = this.activateClick.bind(this) } async componentDidMount() { @@ -41,6 +50,36 @@ export default class TopBar extends React.Component { appWindow.minimize() } + async activateClick() { + const config = await getConfig() + + // They already got it, no need to reactivate + if (config.swag_mode) return + + if (this.state.clicks === 2) { + setTimeout(() => { + // Gotta clear it so it goes back to regular colors + this.setState({ + clicks: 0 + }) + }, 600) + + // Activate... SWAG MODE + await setConfigOption('swag_mode', true) + + return + } + + if (this.state.clicks < 3) { + this.setState({ + clicks: this.state.clicks + 1, + intv: setTimeout(() => this.setState({ clicks: 0 }), 1500) + }) + + return + } + } + render() { return (
@@ -50,6 +89,16 @@ export default class TopBar extends React.Component { {this.state?.version}
+ { + /** + * HEY YOU + * + * If you're looking at the source code to find the swag mode thing, that's okay! If you're not, move along... + * Just do me a favor and don't go telling everyone about how you found it. If you are just helping someone who + * for some reason needs it, that's fine, but not EVERYONE needs it, which is why it exists in the first place. + */ + } +
?
close diff --git a/src/utils/configuration.ts b/src/utils/configuration.ts index 5ce8863..81def4b 100644 --- a/src/utils/configuration.ts +++ b/src/utils/configuration.ts @@ -43,6 +43,7 @@ export interface Configuration { theme: string https_enabled: boolean debug_enabled: boolean + swag_mode?: boolean } export async function setConfigOption(key: string, value: any): Promise {