adds animated loader

This commit is contained in:
bhushan6
2023-08-15 02:01:01 +05:30
parent 6c85e117c0
commit 7a049228ba
5 changed files with 30 additions and 13 deletions
+22
View File
@@ -11,3 +11,25 @@ canvas {
width: 100vw;
height: 100vh;
}
@keyframes spin {
from {
transform: rotate(0deg);
}
to {
transform: rotate(360deg);
}
}
.spinner {
border-radius: 50%;
animation-name: spin;
animation-iteration-count: infinite;
animation-timing-function: linear;
margin: 0px 8px;
width: 18px;
height: 18px;
border: 3px solid white;
border-top-color: transparent;
animation-duration: 1s;
}
+1 -1
View File
@@ -20,7 +20,7 @@ const Lobby = ({ roomId }) => {
}, [enterRoom, leaveRoom, roomId]);
if (status !== CONNECTED) {
return <Loader />;
return <Loader status={status} />;
}
return <LegoRoom />;
-10
View File
@@ -49,16 +49,6 @@ export const Scene = () => {
// useAnchorShorcuts(anchorX, anchorZ, set);
// const setSelection = useStore(state => state.setSelectedBricks)
// function undoAddedBrick() {
// setSelection({}); // this should unselect the bricks but Doesn't work for now because of undo is button within leva
// setBricks((prevBricks) => {
// prevBricks.pop();
// return [...prevBricks];
// });
// }
const addBrick = (e) => {
e.stopPropagation();
+6 -2
View File
@@ -1,4 +1,7 @@
export const Loader = () => {
/* eslint-disable no-unused-vars */
/* eslint-disable react/prop-types */
export const Loader = ({ status }) => {
return (
<div
style={{
@@ -14,7 +17,8 @@ export const Loader = () => {
alignItems: "center",
}}
>
Loading...
Loading
<span className="spinner spinnerQuarter"></span>
</div>
);
};
+1
View File
@@ -101,6 +101,7 @@
.PopoverContent {
background-color: white;
border-radius: 4px;
margin-bottom: 4px;
}
.NoOfOthers {