Skip to content

Commit b818b8e

Browse files
committed
feat: add loading state UI for map workspace
- Introduced a new loading component in index.css for a visually appealing loading experience. - Updated MapPage to display the loading state with a styled loader, including a title and subtitle for better user feedback during data preparation.
1 parent 2facbb0 commit b818b8e

2 files changed

Lines changed: 132 additions & 1 deletion

File tree

src/index.css

Lines changed: 118 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1121,6 +1121,124 @@ a:hover {
11211121
font-size: 13px;
11221122
}
11231123

1124+
.main-page-loader {
1125+
position: fixed;
1126+
inset: 0;
1127+
z-index: 2500;
1128+
display: flex;
1129+
align-items: center;
1130+
justify-content: center;
1131+
background:
1132+
radial-gradient(circle at 15% 20%, rgba(255, 255, 255, 0.09), transparent 36%),
1133+
radial-gradient(circle at 82% 80%, rgba(255, 255, 255, 0.06), transparent 40%),
1134+
linear-gradient(160deg, #0a0a0b 0%, #111214 48%, #090a0c 100%);
1135+
overflow: hidden;
1136+
}
1137+
1138+
.main-page-loader::before {
1139+
content: "";
1140+
position: absolute;
1141+
inset: 0;
1142+
background:
1143+
linear-gradient(to right, rgba(255, 255, 255, 0.035) 1px, transparent 1px),
1144+
linear-gradient(to bottom, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
1145+
background-size: 44px 44px;
1146+
mask-image: radial-gradient(circle at center, black 35%, transparent 90%);
1147+
opacity: 0.35;
1148+
pointer-events: none;
1149+
}
1150+
1151+
.main-page-loader-panel {
1152+
position: relative;
1153+
width: min(460px, 92vw);
1154+
padding: 30px 28px;
1155+
border-radius: 18px;
1156+
border: 1px solid rgba(255, 255, 255, 0.16);
1157+
background: rgba(19, 20, 24, 0.66);
1158+
backdrop-filter: blur(18px);
1159+
-webkit-backdrop-filter: blur(18px);
1160+
box-shadow:
1161+
0 18px 48px rgba(0, 0, 0, 0.42),
1162+
inset 0 1px 0 rgba(255, 255, 255, 0.08);
1163+
display: flex;
1164+
flex-direction: column;
1165+
align-items: center;
1166+
text-align: center;
1167+
}
1168+
1169+
.main-page-loader-orbit {
1170+
position: relative;
1171+
width: 74px;
1172+
height: 74px;
1173+
margin-bottom: 14px;
1174+
border-radius: 999px;
1175+
border: 2px solid rgba(255, 255, 255, 0.12);
1176+
animation: loader-rotate 1.6s linear infinite;
1177+
}
1178+
1179+
.main-page-loader-orbit::before {
1180+
content: "";
1181+
position: absolute;
1182+
border-radius: 999px;
1183+
}
1184+
1185+
.main-page-loader-orbit::before {
1186+
inset: 8px;
1187+
border: 2px solid rgba(255, 255, 255, 0.82);
1188+
border-top-color: transparent;
1189+
border-left-color: transparent;
1190+
opacity: 0.9;
1191+
}
1192+
1193+
.main-page-loader-core {
1194+
position: absolute;
1195+
inset: 21px;
1196+
border-radius: 999px;
1197+
background: radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0.07) 70%);
1198+
border: 1px solid rgba(255, 255, 255, 0.32);
1199+
box-shadow:
1200+
0 0 22px rgba(255, 255, 255, 0.2),
1201+
inset 0 0 10px rgba(255, 255, 255, 0.1);
1202+
display: flex;
1203+
align-items: center;
1204+
justify-content: center;
1205+
}
1206+
1207+
.main-page-loader-logo {
1208+
width: 28px;
1209+
height: 28px;
1210+
object-fit: contain;
1211+
filter: grayscale(1) contrast(1.1) brightness(1.08) drop-shadow(0 0 6px rgba(255, 255, 255, 0.35));
1212+
animation: loader-logo-counter-rotate 1.6s linear infinite;
1213+
}
1214+
1215+
.main-page-loader-title {
1216+
margin: 0;
1217+
font-size: 26px;
1218+
line-height: 1.2;
1219+
color: rgba(255, 255, 255, 0.96);
1220+
font-weight: 700;
1221+
}
1222+
1223+
.main-page-loader-subtitle {
1224+
margin: 8px 0 0;
1225+
font-size: 14px;
1226+
line-height: 1.45;
1227+
color: rgba(255, 255, 255, 0.68);
1228+
}
1229+
1230+
@keyframes loader-rotate {
1231+
to {
1232+
transform: rotate(360deg);
1233+
}
1234+
}
1235+
1236+
@keyframes loader-logo-counter-rotate {
1237+
to {
1238+
transform: rotate(-360deg);
1239+
}
1240+
}
1241+
11241242
@media (max-width: 900px) {
11251243
.memorial-toolbar {
11261244
width: min(84vw, 560px);

src/pages/MapPage/index.tsx

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ const APP_BASE_URL = import.meta.env.BASE_URL.endsWith("/")
1818
? import.meta.env.BASE_URL
1919
: `${import.meta.env.BASE_URL}/`;
2020
const DEFAULT_PINK_LINE_URL = `${APP_BASE_URL}line-layer/pink-line-wgs84.geojson`;
21+
const FAVICON_URL = `${APP_BASE_URL}favicon.ico`;
2122

2223
type ActiveProject = "pink" | "memorial";
2324
type SubmitScope = "pink" | "memorial" | "everything";
@@ -334,7 +335,19 @@ const MapPage = () => {
334335
};
335336

336337
if (isBootstrapping) {
337-
return <div style={{ padding: "24px" }}>Loading unified workspace...</div>;
338+
return (
339+
<div className="main-page-loader" role="status" aria-live="polite" aria-label="Loading map workspace">
340+
<div className="main-page-loader-panel">
341+
<div className="main-page-loader-orbit" aria-hidden="true">
342+
<span className="main-page-loader-core">
343+
<img src={FAVICON_URL} alt="" className="main-page-loader-logo" />
344+
</span>
345+
</div>
346+
<h1 className="main-page-loader-title">טוען את סביבת המפה</h1>
347+
<p className="main-page-loader-subtitle">מכין את שכבות הנתונים והכלים שלך...</p>
348+
</div>
349+
</div>
350+
);
338351
}
339352

340353
if (bootError) {

0 commit comments

Comments
 (0)