Skip to content

Commit 7ed4370

Browse files
committed
Tweaker animasjon
1 parent ace9453 commit 7ed4370

File tree

2 files changed

+34
-22
lines changed

2 files changed

+34
-22
lines changed

src/components/left-section/search/search-input/search-settings/SearchSettings.module.css

+23-12
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
.container {
2-
width: 100%;
3-
}
1+
@value transitionDuration: 200ms;
42

53
.topRow {
64
display: flex;
@@ -9,14 +7,33 @@
97
margin-bottom: 0.25rem;
108
}
119

12-
.toggle > span {
10+
.topRight {
11+
display: flex;
12+
align-items: center;
13+
gap: 0.25rem;
14+
}
15+
16+
.reset > span {
1317
display: flex;
1418
align-items: center;
1519
gap: 0.25rem;
1620
}
1721

22+
.help {
23+
opacity: 0;
24+
visibility: hidden;
25+
transition-property: opacity, visibility;
26+
transition-timing-function: ease-in;
27+
transition-duration: transitionDuration;
28+
29+
&.open {
30+
opacity: 1;
31+
visibility: visible;
32+
}
33+
}
34+
1835
.icon {
19-
transition: transform 200ms ease-out;
36+
transition: transform ease-out transitionDuration;
2037

2138
&.open {
2239
transform: rotateX(180deg);
@@ -28,7 +45,7 @@
2845
visibility: hidden;
2946
overflow: hidden;
3047

31-
transition-duration: 200ms;
48+
transition-duration: transitionDuration;
3249
transition-timing-function: ease-out;
3350
transition-property: visibility, max-height, padding, overflow;
3451

@@ -57,10 +74,4 @@
5774
.searchFields {
5875
display: flex;
5976
align-items: center;
60-
}
61-
62-
.topRight {
63-
display: flex;
64-
align-items: center;
65-
gap: 0.25rem;
6677
}

src/components/left-section/search/search-input/search-settings/SearchSettings.tsx

+11-10
Original file line numberDiff line numberDiff line change
@@ -18,22 +18,23 @@ export const SearchSettings = () => {
1818
const { sort, type, isCustom } = searchParams;
1919

2020
return (
21-
<div className={style.container}>
21+
<>
2222
<div className={style.topRow}>
2323
<Label size={'small'}>{'Søk'}</Label>
2424
<div className={style.topRight}>
25-
{searchSettingsIsOpen && (
26-
<HelpText title={'Tips!'}>
27-
{
28-
'Du kan avgrense søket til enkelte hovedkategorier med sjekkboksene til venstre i menyen.'
29-
}
30-
</HelpText>
31-
)}
25+
<HelpText
26+
title={'Tips!'}
27+
className={classNames(style.help, searchSettingsIsOpen && style.open)}
28+
>
29+
{
30+
'Du kan avgrense søket til enkelte hovedkategorier med sjekkboksene til venstre i menyen.'
31+
}
32+
</HelpText>
3233
{isCustom && (
3334
<Button
3435
size={'xsmall'}
3536
variant={'tertiary'}
36-
className={style.toggle}
37+
className={style.reset}
3738
onClick={resetSearchSettings}
3839
>
3940
{'Nullstill'}
@@ -77,6 +78,6 @@ export const SearchSettings = () => {
7778
</RadioGroup>
7879
</div>
7980
</div>
80-
</div>
81+
</>
8182
);
8283
};

0 commit comments

Comments
 (0)