mirror of
https://github.com/legop3/MultiRoombaRover.git
synced 2026-09-16 09:31:20 -04:00
add discord invite button in UI
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
import { useSession } from "../context/SessionContext";
|
||||
import { FaDiscord } from "react-icons/fa";
|
||||
|
||||
export default function DiscordInviteButton({text = "Join our Discord!"}) {
|
||||
const { session } = useSession();
|
||||
const discordInvite = session?.discord?.invite || null;
|
||||
|
||||
if (!discordInvite) return null;
|
||||
|
||||
return (
|
||||
<a
|
||||
href={discordInvite}
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"npm
|
||||
className="inline-flex items-center px-3 py-2 text-white rainbow-animate-bg transition justify-center"
|
||||
// animated rainbow backgound
|
||||
// className="inline-flex items-center px-3 py-2 bg-gradient-to-r from-indigo-500 via-purple-500 to-pink-500 text-white rounded hover:from-indigo-600 hover:via-purple-600 hover:to-pink-600 transition"
|
||||
>
|
||||
<FaDiscord className="mr-2" />
|
||||
{text}
|
||||
</a>
|
||||
);
|
||||
}
|
||||
@@ -1,5 +1,6 @@
|
||||
import { useTelemetryFrame } from '../context/TelemetryContext.jsx';
|
||||
import { useControlSystem } from '../controls/index.js';
|
||||
import DiscordInviteButton from './DiscordInviteButton.jsx';
|
||||
|
||||
export default function DrivePanel() {
|
||||
const {
|
||||
@@ -53,6 +54,7 @@ export default function DrivePanel() {
|
||||
disabled={!roverId}
|
||||
/>
|
||||
</div>
|
||||
{/* <DiscordInviteButton /> */}
|
||||
</section>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import AuthPanel from './AuthPanel.jsx';
|
||||
import { useSession } from '../context/SessionContext.jsx';
|
||||
import DiscordInviteButton from './DiscordInviteButton.jsx';
|
||||
|
||||
const PRIVILEGED_ROLES = new Set(['admin', 'lockdown', 'lockdown-admin']);
|
||||
const RESTRICTED_MODES = new Set(['admin', 'lockdown']);
|
||||
@@ -42,6 +43,9 @@ export default function ModeGateOverlay() {
|
||||
<div className="surface-muted">
|
||||
<AuthPanel />
|
||||
</div>
|
||||
<div className='w-full justify-center items-center'>
|
||||
<DiscordInviteButton text='Join our Discord server for updates!'/>
|
||||
</div>
|
||||
{/* <p className="text-xs text-slate-500">
|
||||
Your controls are paused until access is granted. You will automatically regain the interface once the mode
|
||||
changes or after a successful login.
|
||||
|
||||
@@ -65,4 +65,45 @@ body {
|
||||
.button-danger {
|
||||
@apply px-0.5 py-0.5 text-sm font-medium text-white transition-colors bg-rose-600 hover:bg-rose-500;
|
||||
}
|
||||
|
||||
.rainbow-animate-bg {
|
||||
background: linear-gradient(
|
||||
270deg,
|
||||
#ff0000,
|
||||
#ff7f00,
|
||||
#ffff00,
|
||||
#00ff00,
|
||||
#0000ff,
|
||||
#4b0082,
|
||||
#8b00ff
|
||||
|
||||
/* less colors: */
|
||||
/* #ff0000,
|
||||
#00ff00,
|
||||
#0000ff */
|
||||
|
||||
/* blue, white, pink */
|
||||
/* #00e5ff,
|
||||
#ffffff,
|
||||
#ff69b4 */
|
||||
|
||||
/* discord colors */
|
||||
/* #5865f2,
|
||||
#ffffff,
|
||||
#ff4754 */
|
||||
);
|
||||
background-size: 1400% 1400%;
|
||||
animation: rainbowBG 300s ease infinite;
|
||||
}
|
||||
@keyframes rainbowBG {
|
||||
0% {
|
||||
background-position: 0% 50%;
|
||||
}
|
||||
50% {
|
||||
background-position: 100% 50%;
|
||||
}
|
||||
100% {
|
||||
background-position: 0% 50%;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user