Skip to content

Commit 1040794

Browse files
style: auth modal improvements (#20)
* fix: update AuthModal links to open in new tab - Added target="_blank" and rel="noopener noreferrer" attributes to footer links in AuthModal for improved security and user experience. * refactor: move AuthModal to ui directory and update import path in AuthGate - Moved AuthModal component to the ui directory for better organization. - Updated the import path in AuthGate to reflect the new location of AuthModal. * style: update AuthModal styles and content - Added a fade-in slide-up animation for the favicon with a delay. - Updated the modal description to include highlighted text. - Reintroduced a warning message section in the modal. - Removed the beta text from the modal title to reduce redudancy. * fix: update warning text in AuthModal to emphasize data backup - Changed the warning message in AuthModal from "We can't guarantee data integrity!" to "Make backups!" to better inform users about data safety during the beta phase. Co-authored-by: Nerdic <nerdic@nerdictranslator.com> --------- Co-authored-by: Nerdic <nerdic@nerdictranslator.com>
1 parent 65efb3e commit 1040794

File tree

3 files changed

+47
-59
lines changed

3 files changed

+47
-59
lines changed

src/frontend/src/AuthGate.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import React, { useEffect, useRef, useState } from "react";
22
import { useAuthCheck } from "./api/hooks";
3-
import AuthModal from "./auth/AuthModal";
3+
import AuthModal from "./ui/AuthModal";
44

55
/**
66
* If unauthenticated, it shows the AuthModal as an overlay, but still renders the app behind it.

src/frontend/src/styles/AuthModal.scss

Lines changed: 35 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/* Auth Modal Styles */
22
.auth-modal-overlay {
3-
position: fixed;
3+
position: absolute;
44
inset: 0;
55
z-index: 50;
66
display: flex;
@@ -21,9 +21,8 @@
2121
.auth-modal-backdrop {
2222
position: absolute;
2323
inset: 0;
24-
background-color: rgba(0, 0, 0, 0.1);
25-
backdrop-filter: blur(0.8px);
26-
z-index: 0;
24+
background-color: rgba(0, 0, 0, 0.2);
25+
z-index: -1;
2726
}
2827

2928
/* Modal container with animation */
@@ -43,13 +42,28 @@
4342
/* Favicon behind modal, relative to wrapper */
4443
.auth-modal-favicon {
4544
position: absolute;
46-
top: -13%;
45+
top: -11.5%;
4746
left: 8%;
4847
width: 65px;
4948
height: 65px;
5049
z-index: 0; /* Behind modal */
5150
pointer-events: none;
5251
user-select: none;
52+
opacity: 0;
53+
animation: fadeInSlideUp 0.3s ease-out forwards;
54+
animation-delay: 1s; /* Delay appearance by 1 second */
55+
}
56+
57+
/* Animation for favicon to slide up and fade in */
58+
@keyframes fadeInSlideUp {
59+
from {
60+
opacity: 0;
61+
transform: translateY(5px);
62+
}
63+
to {
64+
opacity: 1;
65+
transform: translateY(0);
66+
}
5367
}
5468

5569
/* Modal content */
@@ -59,7 +73,7 @@
5973
padding: 20px;
6074
margin: 12px;
6175
padding-top: 0px;
62-
padding-bottom: 5px;
76+
padding-bottom: 0px;
6377
}
6478

6579
/* Modal title container */
@@ -92,17 +106,6 @@
92106
color: #fa8933;
93107
}
94108

95-
/* Beta text */
96-
.beta-text {
97-
position: absolute;
98-
color: #555;
99-
font-weight: normal;
100-
font-size: 18px;
101-
display: inline-block;
102-
top: 5%;
103-
right: -3%;
104-
}
105-
106109
/* Modal description */
107110
.auth-modal-description {
108111
margin-top: 35px;
@@ -112,6 +115,12 @@
112115
line-height: 1.5;
113116
text-align: center;
114117
white-space: pre-line;
118+
max-width: 270px;
119+
120+
.highlight {
121+
color: #cfcfcf;
122+
font-weight: bold;
123+
}
115124
}
116125

117126
/* Sign-in buttons container */
@@ -176,6 +185,15 @@
176185
color: #a0a0a0;
177186
}
178187

188+
/* Warning message */
189+
.auth-modal-warning {
190+
margin-top: 15px;
191+
text-align: center;
192+
color: #606060bd;
193+
font-size: 12px;
194+
font-weight: 400;
195+
}
196+
179197
/* Animation keyframes */
180198
@keyframes fadeIn {
181199
from {
@@ -216,38 +234,4 @@
216234
align-items: center;
217235
justify-content: center;
218236
}
219-
.auth-modal-favicon {
220-
width: 70px;
221-
height: 70px;
222-
top: 50%;
223-
left: 50%;
224-
transform: translate(-50%, -50%);
225-
padding: 0;
226-
border-radius: 12px;
227-
}
228-
.auth-modal-content {
229-
width: 100%;
230-
max-width: 500px;
231-
padding: 20px;
232-
margin: 12px;
233-
height: auto;
234-
display: block;
235-
}
236-
.auth-modal-title-container {
237-
position: relative;
238-
display: flex;
239-
align-items: center;
240-
justify-content: center;
241-
margin: 0;
242-
gap: 0.5rem;
243-
}
244-
.beta-text {
245-
position: absolute;
246-
color: #555;
247-
font-weight: normal;
248-
font-size: 18px;
249-
display: inline-block;
250-
top: 10%;
251-
right: 15%;
252-
}
253237
}
Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,14 @@ import ReactDOM from "react-dom";
33
import { capture } from "../utils/posthog";
44
import { Mail } from "lucide-react";
55
import { queryClient } from "../api/queryClient";
6-
import "../styles/AuthModal.scss";
76

87
interface AuthModalProps {
9-
description?: string;
8+
description?: React.ReactNode;
109
}
1110

1211
const AuthModal: React.FC<AuthModalProps> = ({
13-
description = "A free whiteboard IDE in your browser.",
12+
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>!</>,
13+
warningText = "🚧 This is a beta. Make backups! 🚧",
1414
}) => {
1515
const [isMounted, setIsMounted] = useState(false);
1616

@@ -63,7 +63,6 @@ const AuthModal: React.FC<AuthModalProps> = ({
6363
<div className="auth-modal-content">
6464
<div id="modal-title" className="auth-modal-title-container">
6565
<h2 className="auth-modal-title">pad<span className="auth-modal-title-dot">.ws</span></h2>
66-
<span className="beta-text">(beta)</span>
6766
</div>
6867
<div className="auth-modal-separator" />
6968

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

140139
{/* Footer */}
141140
<div className="auth-modal-footer">
142-
<a href="https://discord.com/invite/NnXSESxWpA" className="auth-modal-footer-link">
141+
<a href="https://discord.com/invite/NnXSESxWpA" className="auth-modal-footer-link" target="_blank" rel="noopener noreferrer">
143142
<svg
144143
width="20"
145144
height="20"
@@ -154,7 +153,7 @@ const AuthModal: React.FC<AuthModalProps> = ({
154153
</svg>
155154
</a>
156155
|
157-
<a href="https://github.com/pad-ws/pad.ws" className="auth-modal-footer-link">
156+
<a href="https://github.com/pad-ws/pad.ws" className="auth-modal-footer-link" target="_blank" rel="noopener noreferrer">
158157
<svg
159158
xmlns="http://www.w3.org/2000/svg"
160159
width="20"
@@ -171,10 +170,15 @@ const AuthModal: React.FC<AuthModalProps> = ({
171170
</svg>
172171
</a>
173172
|
174-
<a href="mailto:contact@pad.ws" className="auth-modal-footer-link">
173+
<a href="mailto:contact@pad.ws" className="auth-modal-footer-link" target="_blank" rel="noopener noreferrer">
175174
<Mail size={20} />
176175
</a>
177176
</div>
177+
178+
{/* Warning message */}
179+
<div className="auth-modal-warning">
180+
{warningText}
181+
</div>
178182
</div>
179183
</div>
180184
</div>

0 commit comments

Comments
 (0)