Skip to content

Commit

Permalink
Merge pull request #21 from myroslav111/myroslav_branche_12
Browse files Browse the repository at this point in the history
restyle buttons
  • Loading branch information
myroslav111 authored Sep 19, 2022
2 parents 39442ca + 8a8339c commit 621ceb6
Show file tree
Hide file tree
Showing 10 changed files with 144 additions and 70 deletions.
2 changes: 1 addition & 1 deletion src/components/App.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export const App = () => {
<Navigation />
<AnimateRoutes />
{email ? <FooterMobileUser /> : <AuthForm />}
<ToastContainer autoClose={3000} />
<ToastContainer autoClose={1500} />
</div>
);
};
16 changes: 10 additions & 6 deletions src/components/AuthForm/AuthForm.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,18 @@ function AuthForm() {
<>
<FooterContainer>
{/* иконка инфо */}
<HelpCenterIcon
color="secondary"
fontSize="large"
onClick={handleOpenModal}
/>
<div className="footer__icon">
<HelpCenterIcon
color="secondary"
fontSize="large"
onClick={handleOpenModal}
/>
</div>
{/* icon translation link to page*/}
<NavLink to="/translate">
<GTranslateIcon fontSize="large" color="primary" />
<div className="footer__icon">
<GTranslateIcon fontSize="large" color="primary" />
</div>
</NavLink>
{!email ? (
<ButtonGoogleAuth
Expand Down
40 changes: 39 additions & 1 deletion src/components/Card/Card.css
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,49 @@
display: flex;
justify-content: center;
align-items: center;
width: 50px;
/* width: 50px;
height: 50px;
border-radius: 50%;
background-color: white;
cursor: pointer; */

align-self: center;
background-color: #fff;
background-image: none;
background-position: 0 90%;
background-repeat: repeat no-repeat;
background-size: 4px 3px;
border-radius: 15px 225px 255px 15px 15px 255px 225px 15px;
border-style: solid;
border-width: 2px;
box-shadow: rgba(0, 0, 0, 0.2) 15px 28px 25px -18px;
box-sizing: border-box;
color: #41403e;
cursor: pointer;
/* display: inline-block; */
font-family: Neucha, sans-serif;
font-size: 1rem;
line-height: 23px;
outline: none;
padding: 0.75rem;
text-decoration: none;
transition: all 235ms ease-in-out;
border-bottom-left-radius: 15px 255px;
border-bottom-right-radius: 225px 15px;
border-top-left-radius: 255px 15px;
border-top-right-radius: 15px 225px;
user-select: none;
-webkit-user-select: none;
touch-action: manipulation;
}

.paginator__btn:hover {
box-shadow: rgba(0, 0, 0, 0.3) 2px 8px 8px -5px;
transform: translate3d(0, 2px, 0);
}

.paginator__btn:focus {
box-shadow: rgba(0, 0, 0, 0.3) 2px 8px 4px -6px;
}

.description__wrap {
Expand Down
1 change: 0 additions & 1 deletion src/components/DeleteWord/DeleteWord.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ const DeleteWord = ({ onWord, onSetWord, onIndexWord, onUserObj }) => {
onSetWord(
onWord.filter(word => word.idCard !== onWord[+onIndexWord].idCard)
);
console.log(onUserObj);
apiForRegisteredUsers.addWordAuth(onUserObj.id, onUserObj);
} catch (error) {
console.log(error);
Expand Down
45 changes: 45 additions & 0 deletions src/components/FooterMobileUser/FooterMobileUser.css
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,49 @@

.footer__icon {
cursor: pointer;

align-items: center;
appearance: none;
background-color: #fcfcfd;
border-radius: 4px;
border-width: 0;
box-shadow: rgba(45, 35, 66, 0.4) 0 2px 4px,
rgba(45, 35, 66, 0.3) 0 7px 13px -3px, #d6d6e7 0 -3px 0 inset;
box-sizing: border-box;
color: #36395a;
cursor: pointer;
/* display: inline-flex; */
/* justify-content: center; */
display: flex;
justify-content: center;
align-items: center;
line-height: 1;
list-style: none;
overflow: hidden;
position: relative;
text-align: left;
text-decoration: none;
transition: box-shadow 0.15s, transform 0.15s;
user-select: none;
-webkit-user-select: none;
touch-action: manipulation;
white-space: nowrap;
will-change: box-shadow, transform;
font-size: 18px;
}

.footer__icon:focus {
box-shadow: #d6d6e7 0 0 0 1.5px inset, rgba(45, 35, 66, 0.4) 0 2px 4px,
rgba(45, 35, 66, 0.3) 0 7px 13px -3px, #d6d6e7 0 -3px 0 inset;
}

.footer__icon:hover {
box-shadow: rgba(45, 35, 66, 0.4) 0 4px 8px,
rgba(45, 35, 66, 0.3) 0 7px 13px -3px, #d6d6e7 0 -3px 0 inset;
transform: translateY(-2px);
}

.footer__icon:active {
box-shadow: #d6d6e7 0 3px 7px inset;
transform: translateY(2px);
}
61 changes: 31 additions & 30 deletions src/components/FooterMobileUser/FooterMobileUser.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,42 +42,43 @@ const FooterMobileUser = () => {
<>
{email && (
<FooterContainer>
<HelpCenterIcon
className="footer__icon"
color="secondary"
fontSize="large"
onClick={handleOpenModal}
/>
<div className="footer__icon">
<HelpCenterIcon
color="secondary"
fontSize="large"
onClick={handleOpenModal}
/>
</div>
{/* icon translation link to page*/}
<NavLink to="/translate">
<GTranslateIcon fontSize="large" color="primary" />
</NavLink>

<HomeIcon
className="footer__icon"
color="primary"
fontSize="large"
onClick={handleClick}
/>
<div className="footer__icon">
<NavLink to="/translate">
<GTranslateIcon fontSize="large" color="primary" />
</NavLink>
{/* sx={{ fontSize: 30 }} */}
</div>
<div className="footer__icon">
<HomeIcon
// className="footer__icon"
color="primary"
fontSize="large"
onClick={handleClick}
/>
</div>
<Popper id={id} open={openPoper} anchorEl={anchorEl}>
<Box sx={{ border: 1, p: 1, bgcolor: 'background.paper' }}>
поки-що в розробці
</Box>
</Popper>

<TopicIcon
className="footer__icon"
color="success"
fontSize="large"
onClick={handleClick}
/>

<ExitToAppIcon
className="footer__icon"
sx={{ color: red[500] }}
fontSize="large"
onClick={handleExitFromAccount}
/>
<div className="footer__icon">
<TopicIcon color="success" fontSize="large" onClick={handleClick} />
</div>
<div className="footer__icon">
<ExitToAppIcon
sx={{ color: red[500] }}
fontSize="large"
onClick={handleExitFromAccount}
/>
</div>
</FooterContainer>
)}
<ModalInfo onOpen={isOpen} onSetOpen={setIsOpen} />
Expand Down
28 changes: 4 additions & 24 deletions src/components/Form/Form.css
Original file line number Diff line number Diff line change
Expand Up @@ -20,30 +20,10 @@
padding-left: 10px;
}

.button__add {
background: none;
color: inherit;
border: none;
padding: 0;
font: inherit;
cursor: pointer;
outline: inherit;
width: 60px;
height: 60px;
border-radius: 50%;
cursor: pointer;
color: #f57c00;
display: flex;
justify-content: center;
align-items: center;
margin-top: 40px;
box-shadow: rgba(0, 0, 0, 0.17) 0px -23px 25px 0px inset,
rgba(0, 0, 0, 0.15) 0px -36px 30px 0px inset,
rgba(0, 0, 0, 0.1) 0px -79px 40px 0px inset, rgba(0, 0, 0, 0.06) 0px 2px 1px,
rgba(0, 0, 0, 0.09) 0px 4px 2px, rgba(0, 0, 0, 0.09) 0px 8px 4px,
rgba(0, 0, 0, 0) 0px 16px 8px, rgba(0, 0, 0, 0) 0px 32px 16px;
}

label {
font-size: 26px;
}

.paginator__btn.btn {
margin-top: 40px;
}
4 changes: 3 additions & 1 deletion src/components/Form/Form.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ function Form() {
const handleSubmitNewWord = async () => {
if (!en || !ru) return toast.warn('🦄 Ви повинні додати слово.');
setIsSuccess(true);

let idCard = nanoid();
if (!email) {
apiForUnregisteredUsers.addWord({ en, ru });
Expand Down Expand Up @@ -80,9 +81,10 @@ function Form() {
</label>

<button
disabled={isSuccess}
onClick={handleSubmitNewWord}
type="submit"
className="button__add"
className="paginator__btn btn"
>
{!isSuccess ? (
<AddCircleOutlineIcon />
Expand Down
6 changes: 6 additions & 0 deletions src/components/Navigation/Navigation.css
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,9 @@
color: green;
transform: scale(1.3);
}

.icon-link {
box-shadow: rgba(0, 0, 0, 0.4) 0px 2px 4px,
rgba(0, 0, 0, 0.3) 0px 7px 13px -3px, rgba(0, 0, 0, 0.2) 0px -3px 0px inset;
border-radius: 50%;
}
11 changes: 5 additions & 6 deletions src/components/Navigation/Navigation.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,10 @@ import LibraryAddIcon from '@mui/icons-material/LibraryAdd';
import 'animate.css';
import './Navigation.css';


const Navigation = () => {
const [name] = useState(localStorage.getItem('name') || '');
const [image] = useState(localStorage.getItem('profilePic') || '');


return (
<div className="header">
<div className="header__wrap">
Expand All @@ -29,7 +27,9 @@ const Navigation = () => {
alignItems: 'center',
}}
>
<Avatar alt={name} src={image} />
<div className="icon-link">
<Avatar alt={name} src={image} />
</div>
<span className="name">{name}</span>
</Stack>
<NavLink to="/cards" className="link ">
Expand All @@ -38,7 +38,6 @@ const Navigation = () => {
</div>
</div>
);
}

};

export default Navigation;
export default Navigation;

0 comments on commit 621ceb6

Please sign in to comment.