Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/frontend/src/AuthGate.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React, { useEffect, useRef, useState } from "react";
import { useAuthCheck } from "./api/hooks";
import AuthModal from "./auth/AuthModal";
import AuthModal from "./ui/AuthModal";

/**
* If unauthenticated, it shows the AuthModal as an overlay, but still renders the app behind it.
Expand Down
86 changes: 35 additions & 51 deletions src/frontend/src/styles/AuthModal.scss
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* Auth Modal Styles */
.auth-modal-overlay {
position: fixed;
position: absolute;
inset: 0;
z-index: 50;
display: flex;
Expand All @@ -21,9 +21,8 @@
.auth-modal-backdrop {
position: absolute;
inset: 0;
background-color: rgba(0, 0, 0, 0.1);
backdrop-filter: blur(0.8px);
z-index: 0;
background-color: rgba(0, 0, 0, 0.2);
z-index: -1;
}

/* Modal container with animation */
Expand All @@ -43,13 +42,28 @@
/* Favicon behind modal, relative to wrapper */
.auth-modal-favicon {
position: absolute;
top: -13%;
top: -11.5%;
left: 8%;
width: 65px;
height: 65px;
z-index: 0; /* Behind modal */
pointer-events: none;
user-select: none;
opacity: 0;
animation: fadeInSlideUp 0.3s ease-out forwards;
animation-delay: 1s; /* Delay appearance by 1 second */
}

/* Animation for favicon to slide up and fade in */
@keyframes fadeInSlideUp {
from {
opacity: 0;
transform: translateY(5px);
}
to {
opacity: 1;
transform: translateY(0);
}
}

/* Modal content */
Expand All @@ -59,7 +73,7 @@
padding: 20px;
margin: 12px;
padding-top: 0px;
padding-bottom: 5px;
padding-bottom: 0px;
}

/* Modal title container */
Expand Down Expand Up @@ -92,17 +106,6 @@
color: #fa8933;
}

/* Beta text */
.beta-text {
position: absolute;
color: #555;
font-weight: normal;
font-size: 18px;
display: inline-block;
top: 5%;
right: -3%;
}

/* Modal description */
.auth-modal-description {
margin-top: 35px;
Expand All @@ -112,6 +115,12 @@
line-height: 1.5;
text-align: center;
white-space: pre-line;
max-width: 270px;

.highlight {
color: #cfcfcf;
font-weight: bold;
}
}

/* Sign-in buttons container */
Expand Down Expand Up @@ -176,6 +185,15 @@
color: #a0a0a0;
}

/* Warning message */
.auth-modal-warning {
margin-top: 15px;
text-align: center;
color: #606060bd;
font-size: 12px;
font-weight: 400;
}

/* Animation keyframes */
@keyframes fadeIn {
from {
Expand Down Expand Up @@ -216,38 +234,4 @@
align-items: center;
justify-content: center;
}
.auth-modal-favicon {
width: 70px;
height: 70px;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
padding: 0;
border-radius: 12px;
}
.auth-modal-content {
width: 100%;
max-width: 500px;
padding: 20px;
margin: 12px;
height: auto;
display: block;
}
.auth-modal-title-container {
position: relative;
display: flex;
align-items: center;
justify-content: center;
margin: 0;
gap: 0.5rem;
}
.beta-text {
position: absolute;
color: #555;
font-weight: normal;
font-size: 18px;
display: inline-block;
top: 10%;
right: 15%;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@ import ReactDOM from "react-dom";
import { capture } from "../utils/posthog";
import { Mail } from "lucide-react";
import { queryClient } from "../api/queryClient";
import "../styles/AuthModal.scss";

interface AuthModalProps {
description?: string;
description?: React.ReactNode;
}

const AuthModal: React.FC<AuthModalProps> = ({
description = "A free whiteboard IDE in your browser.",
description = <>Welcome to your <strong className="highlight">whiteboard IDE</strong>. Open <strong className="highlight">terminals</strong> and start coding right away in your own <strong className="highlight">Ubuntu VM</strong>!</>,
warningText = "🚧 This is a beta. Make backups! 🚧",
}) => {
const [isMounted, setIsMounted] = useState(false);

Expand Down Expand Up @@ -63,7 +63,6 @@ const AuthModal: React.FC<AuthModalProps> = ({
<div className="auth-modal-content">
<div id="modal-title" className="auth-modal-title-container">
<h2 className="auth-modal-title">pad<span className="auth-modal-title-dot">.ws</span></h2>
<span className="beta-text">(beta)</span>
</div>
<div className="auth-modal-separator" />

Expand Down Expand Up @@ -139,7 +138,7 @@ const AuthModal: React.FC<AuthModalProps> = ({

{/* Footer */}
<div className="auth-modal-footer">
<a href="https://discord.com/invite/NnXSESxWpA" className="auth-modal-footer-link">
<a href="https://discord.com/invite/NnXSESxWpA" className="auth-modal-footer-link" target="_blank" rel="noopener noreferrer">
<svg
width="20"
height="20"
Expand All @@ -154,7 +153,7 @@ const AuthModal: React.FC<AuthModalProps> = ({
</svg>
</a>
|
<a href="https://github.com/pad-ws/pad.ws" className="auth-modal-footer-link">
<a href="https://github.com/pad-ws/pad.ws" className="auth-modal-footer-link" target="_blank" rel="noopener noreferrer">
<svg
xmlns="http://www.w3.org/2000/svg"
width="20"
Expand All @@ -171,10 +170,15 @@ const AuthModal: React.FC<AuthModalProps> = ({
</svg>
</a>
|
<a href="mailto:contact@pad.ws" className="auth-modal-footer-link">
<a href="mailto:contact@pad.ws" className="auth-modal-footer-link" target="_blank" rel="noopener noreferrer">
<Mail size={20} />
</a>
</div>

{/* Warning message */}
<div className="auth-modal-warning">
{warningText}
</div>
</div>
</div>
</div>
Expand Down