From 0ff090e689902553cf02440c1813a11256f2b78c Mon Sep 17 00:00:00 2001 From: fet1sov Date: Tue, 9 Apr 2024 01:54:05 +0500 Subject: [PATCH] UserMenu: Added profile menu Added profile menu Added avatars for profiles --- .gitignore | 3 +- _styles/_css/index.css | 1 - _styles/_css/styles.css | 54 +++++++++++++++++++++++++++ _styles/_icons/door.svg | 1 + data/locales/en-US.json | 5 ++- data/locales/ru-RU.json | 5 ++- frontend/components/elems/header.php | 9 +++++ index.php | 7 +++- routes/api/api.ctrl.php | 8 ++++ uploads/avatars/no_avatar.png | Bin 0 -> 7352 bytes 10 files changed, 88 insertions(+), 5 deletions(-) create mode 100644 _styles/_icons/door.svg create mode 100644 uploads/avatars/no_avatar.png diff --git a/.gitignore b/.gitignore index 532e0d7..8653ece 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ # Ignoring all uploads on the website -uploads/* \ No newline at end of file +uploads/avatars/*.png +!uploads/avatars/no_avatar.png \ No newline at end of file diff --git a/_styles/_css/index.css b/_styles/_css/index.css index ba80f89..0963db9 100644 --- a/_styles/_css/index.css +++ b/_styles/_css/index.css @@ -30,7 +30,6 @@ div.description-block h2 { .offer-block div h2{ margin-right: 50px; - } @media (max-width: 600px) { diff --git a/_styles/_css/styles.css b/_styles/_css/styles.css index 359d271..7488cfc 100644 --- a/_styles/_css/styles.css +++ b/_styles/_css/styles.css @@ -43,6 +43,7 @@ section { display: flex; + justify-content: center; align-items: center; height: 100vh; @@ -221,6 +222,59 @@ div.profile-block { display: flex; flex-direction: row; align-items: center; + + position: relative; +} + +div.user-menu { + display: none; + top: 40px; + + border-radius: 0px 0px 10px 10px; + padding: 10px; + -webkit-box-shadow: 0px 11px 26px 0px rgba(0,0,0,0.28); + -moz-box-shadow: 0px 11px 26px 0px rgba(0,0,0,0.28); + box-shadow: 0px 11px 26px 0px rgba(0,0,0,0.28); +} + +div.profile-block:hover div.user-menu { + display: flex; + + position: absolute; +} + +div.user-menu ul { + padding: 0; +} + +div.user-menu ul li { + display: flex; + justify-content: center; + align-items: center; + text-align: center; +} + +div.user-menu svg { + width: 24px; + height: 24px; + + margin-right: 5px; +} + +div.user-menu a { + text-align: center; +} + +div.user-menu .logout:hover svg path, +div.user-menu .logout:hover a { + fill: var(--primary-color-02); + color: var(--primary-color-02); +} + +div.user-menu .logout svg path, +div.user-menu .logout a { + fill: var(--primary-color-01); + color: var(--primary-color-01); } @media (width <= 1024px) { diff --git a/_styles/_icons/door.svg b/_styles/_icons/door.svg new file mode 100644 index 0000000..8aca737 --- /dev/null +++ b/_styles/_icons/door.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/data/locales/en-US.json b/data/locales/en-US.json index 3a1a194..0f72e12 100644 --- a/data/locales/en-US.json +++ b/data/locales/en-US.json @@ -29,6 +29,9 @@ "secondaryDescription": "Let's create your success together and take your business to new heights. Trust us your advertising.", "aboutusBlockName": "What we offer", - "formBlockName": "Still not sure? Contact us" + "formBlockName": "Still not sure?
Contact us" + }, + "userMenu": { + "logout": "Log out" } } \ No newline at end of file diff --git a/data/locales/ru-RU.json b/data/locales/ru-RU.json index e21c750..06e1e75 100644 --- a/data/locales/ru-RU.json +++ b/data/locales/ru-RU.json @@ -29,6 +29,9 @@ "secondaryDescription": "Давайте вместе создадим катализатор для вашего успеха и приведем ваш бизнес к новым высотам. Доверьте нам свою рекламу.", "aboutusBlockName": "Что мы предлагаем", - "formBlockName": "Всё ещё не уверены? Свяжитесь с нами" + "formBlockName": "Всё ещё не уверены?
Свяжитесь с нами" + }, + "userMenu": { + "logout": "Выйти" } } \ No newline at end of file diff --git a/frontend/components/elems/header.php b/frontend/components/elems/header.php index 85715bd..a437ec8 100644 --- a/frontend/components/elems/header.php +++ b/frontend/components/elems/header.php @@ -18,6 +18,15 @@
getId(); ?>"> getUsername(); ?> + +
+
    +
  • + + +
  • +
+
diff --git a/index.php b/index.php index 981adf6..78e11fa 100644 --- a/index.php +++ b/index.php @@ -20,4 +20,9 @@ /* * User routes */ -$router->add("/user", "routes/user/user.ctrl.php"); \ No newline at end of file +$router->add("/user", "routes/user/user.ctrl.php"); + +/* +* API routes +*/ +$router->add("/api/{category}", "routes/api/api.ctrl.php"); \ No newline at end of file diff --git a/routes/api/api.ctrl.php b/routes/api/api.ctrl.php index a4abe2d..23169fb 100644 --- a/routes/api/api.ctrl.php +++ b/routes/api/api.ctrl.php @@ -1,2 +1,10 @@ =j`mb{|51Zccl{%5vQRp zT+KYlem~zea7u?!i@Foc%4jh6_wUM8`jrE^dwYYXei?7@(q(FSdb0cbR-z}mjK=t` z#qz5ITU*;JKPYsPIM7>J6Fymjiqnx3MnWg4K^YkTNVEWS`KxHrqi^FXf0f#MdX(Fr zogeJ{+Q__bbg#SQV)yV#}4G%_@C$PEa6 zk3Crr=>>>7ji}*s*bM9iPySq<|78~Li8*6>M8j*wxk~2iY^wt8ZxKbEXyAA9e2nD< z$#zap{Wr9rFLDy(siQrTgKdDb)6>({`ApbrQ>-GtAkWzLYHw^!LA2^na&1LgGY5rH zVyoG^3&H|KAAmlleC7r?0mVv3HJrl(;??(|zQXpQg(v|5cs$eLM2WW8gEd#sR5P3_ z@znHaI2oOeS%d;iOI{rd+y6GjGK34K9Nc|+{B7lsxvI4`VfOoYfh8V(*I%uUL|f1;F_Lm<_k};nZyyduK%UPb_Y>EZZ0TwEZ z3+l;+o4v2$9Xcu3pDT>T=u@{%v4T!^l|J`MpEoHLkCpitCe!}NC5nm%ULJ3Zqz)wW zG?3RgwAca>!09)xfP zPocU79|$9FJiyY6kB^UAwty`EI0*w;(9t(s_qK5TB`9jLqT<3al;ie--S%T(qkH1b zu%oqTVsC!X3=yk2&|->@)9En`C*IF+o-9*uz!+PE+UK2A0qsyp*rgj7)(Wq+>M%OX zwSI!IDy3X+SC-yt#H_ooc`?=6MAbO_$hy|`bdXI^t@8Pkh;AXzRcYL$VoyOtEvn;c zJ^x_PXD@s#mP$XO=pPy`Eoc%6yc`aMNFqx^s6dBJnTfpCWM-BOZ{HyC#mesll@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