Skip to content

Commit b7d1378

Browse files
authored
Merge pull request #29 from keepsimpleio/dev
Chore: Longevity Minor Improvements
2 parents 790d0f1 + ae04fb1 commit b7d1378

15 files changed

Lines changed: 101 additions & 57 deletions

File tree

Binary file not shown.
7.37 KB
Loading
8.77 KB
Loading
Binary file not shown.

src/components/Navbar/Navbar.tsx

Lines changed: 33 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ const Navbar: FC<NavbarProps> = ({ handleToggleSidebar, handleClick }) => {
5959
logo: isDarkTheme ? <ToolsIcon /> : <ToolsDarkIcon />,
6060
target: '',
6161
id: 'tools',
62+
activeMatch: '/tools/longevity-protocol',
6263
},
6364
{
6465
name: articles,
@@ -81,31 +82,38 @@ const Navbar: FC<NavbarProps> = ({ handleToggleSidebar, handleClick }) => {
8182
[styles.authorized]: !!accountData,
8283
})}
8384
>
84-
{routes.map(({ name, path, target, logo, id }, index) => (
85-
<a
86-
key={index}
87-
href={path}
88-
target={target}
89-
onClick={e => {
90-
if (target === '_blank') return;
91-
e.preventDefault();
92-
if (isSmallScreen) handleToggleSidebar();
93-
handleClick(e, path);
94-
}}
95-
className={cn(styles.url, {
96-
[styles.active]:
97-
path === '/'
98-
? router.asPath === '/'
99-
: router.asPath.startsWith(path),
100-
[styles.uxcoreIcon]: id === 'uxcore',
101-
[styles.companyManagementIcon]: id === 'companyManagement',
102-
[styles.articlesIcon]: id === 'articles',
103-
[styles.ruUrl]: locale === 'ru',
104-
})}
105-
>
106-
{logo} {name}
107-
</a>
108-
))}
85+
{routes.map(({ name, path, target, logo, id, activeMatch }, index) => {
86+
const match = activeMatch ?? path;
87+
88+
const isActive =
89+
match === '/'
90+
? router.asPath === '/'
91+
: router.asPath.startsWith(match);
92+
93+
return (
94+
<a
95+
key={index}
96+
href={path}
97+
target={target}
98+
onClick={e => {
99+
if (target === '_blank') return;
100+
e.preventDefault();
101+
if (isSmallScreen) handleToggleSidebar();
102+
handleClick(e, path);
103+
}}
104+
className={cn(styles.url, {
105+
[styles.active]: isActive,
106+
[styles.uxcoreIcon]: id === 'uxcore',
107+
[styles.companyManagementIcon]: id === 'companyManagement',
108+
[styles.articlesIcon]: id === 'articles',
109+
[styles.ruUrl]: locale === 'ru',
110+
})}
111+
>
112+
{logo} {name}
113+
</a>
114+
);
115+
})}
116+
109117
<a
110118
href={'/contributors'}
111119
onClick={e => {

src/components/longevity/LongevitySubSection/LongevitySubSection.module.scss

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,10 @@
5858
}
5959
}
6060

61+
.habitTooltip {
62+
animation: pulse-shadow-animation 2s infinite;
63+
}
64+
6165
.dateTxt {
6266
cursor: default;
6367

@@ -187,3 +191,15 @@
187191
justify-content: space-between;
188192
}
189193
}
194+
195+
@keyframes pulse-shadow-animation {
196+
0% {
197+
filter: drop-shadow(0px 0px 18px rgba(53, 35, 13, 0.2));
198+
}
199+
70% {
200+
filter: drop-shadow(0px 0px 18px rgba(255, 0, 0, 0.8));
201+
}
202+
100% {
203+
filter: drop-shadow(0px 0px 18px rgba(53, 35, 13, 0.2));
204+
}
205+
}

src/components/longevity/LongevitySubSection/LongevitySubSection.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ const LongevitySubSection: FC<LongevitySubSectionProps> = ({
7171
id={title}
7272
place={'bottom'}
7373
className={cn(styles.tooltip, {})}
74+
clickable
7475
>
7576
<WhyDoThisTooltip
7677
whatDamagesText={whatDamages}

src/components/longevity/Navigation/Navigation.module.scss

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
.subItem {
1212
background-image: url('/keepsimple_/assets/longevity/nav-bg.svg');
1313
background-repeat: no-repeat;
14-
background-size: contain;
14+
background-size: cover;
1515
width: 222px;
1616
height: 49px;
1717
text-align: center;
@@ -50,7 +50,7 @@
5050
text-decoration: none;
5151
cursor: pointer;
5252
background-image: url('/keepsimple_/assets/longevity/nav-hover-bg.png');
53-
53+
background-size: cover;
5454
.subLink,
5555
.link {
5656
color: #fff;
@@ -64,6 +64,7 @@
6464

6565
&:hover {
6666
cursor: pointer;
67+
6768
background-image: url('/keepsimple_/assets/longevity/nav-hover-bg.png');
6869
}
6970
}

src/components/longevity/Navigation/Navigation.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ const Navigation: FC = () => {
104104
width={1140}
105105
height={83}
106106
className={cn(styles.curtains, {
107-
[styles.curtainsOpen]: router.pathname.includes('habits'),
107+
[styles.curtainsOpen]: !router.asPath.includes('about-project'),
108108
})}
109109
/>
110110
<ul className={styles.subUl}>

src/components/longevity/ShinyStars/ShinyStars.module.scss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77

88
.starImg {
99
display: block;
10+
cursor: pointer;
1011
}
1112

1213
@keyframes fadeInAndOut {

0 commit comments

Comments
 (0)