@comicrelief/component-library 8.44.3 → 8.45.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/Atoms/Checkbox/Checkbox.test.js +0 -4
- package/dist/components/Atoms/ErrorText/__snapshots__/ErrorText.test.js.snap +0 -2
- package/dist/components/Atoms/Input/input.test.js +0 -2
- package/dist/components/Atoms/RadioButton/RadioButton.test.js +0 -4
- package/dist/components/Atoms/Select/__snapshots__/Select.test.js.snap +0 -1
- package/dist/components/Atoms/SocialIcons/Icon/Icon.js +39 -14
- package/dist/components/Atoms/SocialIcons/SocialIcons.js +91 -22
- package/dist/components/Atoms/SocialIcons/Utils/Icons.js +26 -7
- package/dist/components/Atoms/SocialIcons/Utils/Links.js +10 -0
- package/dist/components/Atoms/SocialIcons/__snapshots__/SocialIcons.test.js.snap +63 -48
- package/{src/components/Atoms/SocialIcons/assets → dist/components/Atoms/SocialIcons/assets/circled}/facebook.svg +1 -1
- package/{src/components/Atoms/SocialIcons/assets → dist/components/Atoms/SocialIcons/assets/circled}/twitter.svg +1 -1
- package/dist/components/Atoms/SocialIcons/assets/{youtube.svg → circled/youtube.svg} +1 -1
- package/dist/components/Atoms/SocialIcons/assets/standard/facebook.svg +3 -0
- package/dist/components/Atoms/SocialIcons/assets/standard/instagram.svg +3 -0
- package/dist/components/Atoms/SocialIcons/assets/standard/tiktok.svg +3 -0
- package/dist/components/Atoms/SocialIcons/assets/standard/x.svg +3 -0
- package/dist/components/Atoms/SocialIcons/assets/standard/youtube.svg +3 -0
- package/dist/components/Atoms/Text/Text.js +28 -28
- package/dist/components/Atoms/Text/Text.md +8 -8
- package/dist/components/Atoms/Text/__snapshots__/Text.test.js.snap +0 -9
- package/dist/components/Atoms/TextArea/TextArea.test.js +0 -1
- package/dist/components/Atoms/TextInputWithDropdown/__snapshots__/TextInputWithDropdown.test.js.snap +0 -7
- package/dist/components/Molecules/Accordion/__snapshots__/Accordion.test.js.snap +0 -4
- package/dist/components/Molecules/ArticleTeaser/ArticleTeaser.test.js +0 -10
- package/dist/components/Molecules/Banner/__snapshots__/Banner.test.js.snap +0 -2
- package/dist/components/Molecules/Descriptor/Descriptor.test.js +0 -13
- package/dist/components/Molecules/EmailSignUp/EmailSignUp.js +38 -0
- package/dist/components/Molecules/EmailSignUp/EmailSignUp.style.js +113 -0
- package/dist/components/Molecules/InfoBanner/__snapshots__/InfoBanner.test.js.snap +0 -24
- package/dist/components/Molecules/LogoLinked/LogoLinked.js +6 -6
- package/dist/components/Molecules/PartnerLink/PartnerLink.test.js +0 -2
- package/dist/components/Molecules/Promo/__snapshots__/Promo.test.js.snap +0 -8
- package/dist/components/Molecules/SchoolLookup/__snapshots__/SchoolLookup.test.js.snap +0 -1
- package/dist/components/Molecules/SearchInput/SearchInput.test.js +0 -1
- package/dist/components/Molecules/SearchResult/__snapshots__/SearchResult.test.js.snap +0 -18
- package/dist/components/Molecules/SingleMessage/__snapshots__/SingleMessage.test.js.snap +0 -14
- package/dist/components/Molecules/SingleMessageDS/__snapshots__/SingleMessageDs.test.js.snap +0 -4
- package/dist/components/Molecules/Typeahead/__snapshots__/Typeahead.test.js.snap +0 -1
- package/dist/components/Organisms/CookieBanner/CookieBanner.test.js +0 -2
- package/dist/components/Organisms/Donate/__snapshots__/Donate.test.js.snap +0 -35
- package/dist/components/Organisms/EmailSignUp/__snapshots__/EmailSignUp.test.js.snap +0 -8
- package/dist/components/Organisms/Footer/Footer.md +12 -11
- package/dist/components/Organisms/Footer/FundraisingRegulatorLogo/FundraisingRegulatorLogo.js +36 -16
- package/dist/components/Organisms/Footer/Nav/Nav.style.js +8 -8
- package/dist/components/Organisms/Footer/__snapshots__/Footer.test.js.snap +188 -241
- package/dist/components/Organisms/FooterNew/FooterNew.js +136 -0
- package/dist/components/Organisms/FooterNew/FooterNew.md +47 -0
- package/dist/components/Organisms/FooterNew/FooterNew.style.js +312 -0
- package/dist/components/Organisms/FooterNew/FooterNew.test.js +20 -0
- package/dist/components/Organisms/FooterNew/Nav/PrimaryNav.js +32 -0
- package/dist/components/Organisms/FooterNew/Nav/SecondaryNav.js +32 -0
- package/dist/components/Organisms/FooterNew/__snapshots__/FooterNew.test.js.snap +1490 -0
- package/dist/components/Organisms/FooterNew/dev-data/data.js +106 -0
- package/dist/components/Organisms/Membership/Membership.test.js +0 -12
- package/dist/components/Organisms/WYMDCarousel/__snapshots__/WYMDCarousel.test.js.snap +0 -3
- package/dist/index.js +20 -0
- package/dist/theme/crTheme/colors.js +12 -7
- package/dist/theme/shared/animations.js +46 -0
- package/package.json +1 -1
- package/src/components/Atoms/Checkbox/Checkbox.test.js +0 -4
- package/src/components/Atoms/ErrorText/__snapshots__/ErrorText.test.js.snap +0 -2
- package/src/components/Atoms/Input/input.test.js +0 -2
- package/src/components/Atoms/RadioButton/RadioButton.test.js +0 -4
- package/src/components/Atoms/Select/__snapshots__/Select.test.js.snap +0 -1
- package/src/components/Atoms/SocialIcons/Icon/Icon.js +47 -11
- package/src/components/Atoms/SocialIcons/SocialIcons.js +99 -25
- package/src/components/Atoms/SocialIcons/Utils/Icons.js +29 -10
- package/src/components/Atoms/SocialIcons/Utils/Links.js +10 -0
- package/src/components/Atoms/SocialIcons/__snapshots__/SocialIcons.test.js.snap +63 -48
- package/{dist/components/Atoms/SocialIcons/assets → src/components/Atoms/SocialIcons/assets/circled}/facebook.svg +1 -1
- package/{dist/components/Atoms/SocialIcons/assets → src/components/Atoms/SocialIcons/assets/circled}/twitter.svg +1 -1
- package/src/components/Atoms/SocialIcons/assets/{youtube.svg → circled/youtube.svg} +1 -1
- package/src/components/Atoms/SocialIcons/assets/standard/facebook.svg +3 -0
- package/src/components/Atoms/SocialIcons/assets/standard/instagram.svg +3 -0
- package/src/components/Atoms/SocialIcons/assets/standard/tiktok.svg +3 -0
- package/src/components/Atoms/SocialIcons/assets/standard/x.svg +3 -0
- package/src/components/Atoms/SocialIcons/assets/standard/youtube.svg +3 -0
- package/src/components/Atoms/Text/Text.js +19 -19
- package/src/components/Atoms/Text/Text.md +8 -8
- package/src/components/Atoms/Text/__snapshots__/Text.test.js.snap +0 -9
- package/src/components/Atoms/TextArea/TextArea.test.js +0 -1
- package/src/components/Atoms/TextInputWithDropdown/__snapshots__/TextInputWithDropdown.test.js.snap +0 -7
- package/src/components/Molecules/Accordion/__snapshots__/Accordion.test.js.snap +0 -4
- package/src/components/Molecules/ArticleTeaser/ArticleTeaser.test.js +0 -10
- package/src/components/Molecules/Banner/__snapshots__/Banner.test.js.snap +0 -2
- package/src/components/Molecules/Descriptor/Descriptor.test.js +0 -13
- package/src/components/Molecules/EmailSignUp/EmailSignUp.js +55 -0
- package/src/components/Molecules/EmailSignUp/EmailSignUp.style.js +107 -0
- package/src/components/Molecules/InfoBanner/__snapshots__/InfoBanner.test.js.snap +0 -24
- package/src/components/Molecules/LogoLinked/LogoLinked.js +5 -14
- package/src/components/Molecules/PartnerLink/PartnerLink.test.js +0 -2
- package/src/components/Molecules/Promo/__snapshots__/Promo.test.js.snap +0 -8
- package/src/components/Molecules/SchoolLookup/__snapshots__/SchoolLookup.test.js.snap +0 -1
- package/src/components/Molecules/SearchInput/SearchInput.test.js +0 -1
- package/src/components/Molecules/SearchResult/__snapshots__/SearchResult.test.js.snap +0 -18
- package/src/components/Molecules/SingleMessage/__snapshots__/SingleMessage.test.js.snap +0 -14
- package/src/components/Molecules/SingleMessageDS/__snapshots__/SingleMessageDs.test.js.snap +0 -4
- package/src/components/Molecules/Typeahead/__snapshots__/Typeahead.test.js.snap +0 -1
- package/src/components/Organisms/CookieBanner/CookieBanner.test.js +0 -2
- package/src/components/Organisms/Donate/__snapshots__/Donate.test.js.snap +0 -35
- package/src/components/Organisms/EmailSignUp/__snapshots__/EmailSignUp.test.js.snap +0 -8
- package/src/components/Organisms/Footer/Footer.md +12 -11
- package/src/components/Organisms/Footer/FundraisingRegulatorLogo/FundraisingRegulatorLogo.js +14 -3
- package/src/components/Organisms/Footer/Nav/Nav.style.js +8 -8
- package/src/components/Organisms/Footer/__snapshots__/Footer.test.js.snap +188 -241
- package/src/components/Organisms/FooterNew/FooterNew.js +211 -0
- package/src/components/Organisms/FooterNew/FooterNew.md +47 -0
- package/src/components/Organisms/FooterNew/FooterNew.style.js +294 -0
- package/src/components/Organisms/FooterNew/FooterNew.test.js +24 -0
- package/src/components/Organisms/FooterNew/Nav/PrimaryNav.js +54 -0
- package/src/components/Organisms/FooterNew/Nav/SecondaryNav.js +54 -0
- package/src/components/Organisms/FooterNew/__snapshots__/FooterNew.test.js.snap +1490 -0
- package/src/components/Organisms/FooterNew/dev-data/data.js +123 -0
- package/src/components/Organisms/Membership/Membership.test.js +0 -12
- package/src/components/Organisms/WYMDCarousel/__snapshots__/WYMDCarousel.test.js.snap +0 -3
- package/src/index.js +2 -0
- package/src/theme/crTheme/colors.js +13 -7
- package/src/theme/shared/animations.js +60 -0
- /package/dist/components/Atoms/SocialIcons/assets/{X-white-Subtract.svg → circled/X-white-Subtract.svg} +0 -0
- /package/dist/components/Atoms/SocialIcons/assets/{instagram.svg → circled/instagram.svg} +0 -0
- /package/src/components/Atoms/SocialIcons/assets/{X-white-Subtract.svg → circled/X-white-Subtract.svg} +0 -0
- /package/src/components/Atoms/SocialIcons/assets/{instagram.svg → circled/instagram.svg} +0 -0
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
export const primaryLinksList = [
|
|
2
|
+
{
|
|
3
|
+
title: 'Contact us',
|
|
4
|
+
path: 'contact-us',
|
|
5
|
+
internal: {
|
|
6
|
+
type: 'ContentfulPageLandingPage'
|
|
7
|
+
}
|
|
8
|
+
},
|
|
9
|
+
{
|
|
10
|
+
title: 'Update your preferences',
|
|
11
|
+
path: 'https://www.comicrelief.com/update-your-preferences',
|
|
12
|
+
internal: {
|
|
13
|
+
type: 'ContentfulPageLandingPage'
|
|
14
|
+
}
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
title: 'Your Gift Aid',
|
|
18
|
+
path: 'https://giftaid.comicrelief.com/update',
|
|
19
|
+
internal: {
|
|
20
|
+
type: 'ContentfulPageLandingPage'
|
|
21
|
+
}
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
title: 'Reporting complaints and concerns',
|
|
25
|
+
path: 'https://www.comicrelief.com/reporting-complaints',
|
|
26
|
+
internal: {
|
|
27
|
+
type: 'ContentfulPageLandingPage'
|
|
28
|
+
}
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
title: 'FAQs',
|
|
32
|
+
path: 'https://www.comicrelief.com/frequently-asked-questions',
|
|
33
|
+
internal: {
|
|
34
|
+
type: 'ContentfulPageLandingPage'
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
];
|
|
38
|
+
|
|
39
|
+
export const secondaryLinksList = [
|
|
40
|
+
{
|
|
41
|
+
title: 'Terms of use',
|
|
42
|
+
path: 'https://www.comicrelief.com/terms-of-use',
|
|
43
|
+
internal: {
|
|
44
|
+
type: 'ContentfulPageLandingPage'
|
|
45
|
+
}
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
title: 'Privacy notice',
|
|
49
|
+
path: 'https://www.comicrelief.com/privacy-notice',
|
|
50
|
+
internal: {
|
|
51
|
+
type: 'ContentfulPageLandingPage'
|
|
52
|
+
}
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
title: 'Cookies',
|
|
56
|
+
path: 'https://www.comicrelief.com/cookies',
|
|
57
|
+
internal: {
|
|
58
|
+
type: 'ContentfulPageLandingPage'
|
|
59
|
+
}
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
title: 'Text to donate terms',
|
|
63
|
+
path: 'https://www.comicrelief.com/text-to-donate-terms',
|
|
64
|
+
internal: {
|
|
65
|
+
type: 'ContentfulPageLandingPage'
|
|
66
|
+
}
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
title: 'Prize draw terms',
|
|
70
|
+
path: 'https://www.comicrelief.com/prize-draw-terms',
|
|
71
|
+
internal: {
|
|
72
|
+
type: 'ContentfulPageLandingPage'
|
|
73
|
+
}
|
|
74
|
+
},
|
|
75
|
+
{
|
|
76
|
+
title: 'Modern Slavery and Human Trafficking Statement',
|
|
77
|
+
path: 'https://www.comicrelief.com/modern-slavery-statement',
|
|
78
|
+
internal: {
|
|
79
|
+
type: 'ContentfulPageLandingPage'
|
|
80
|
+
}
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
title: 'Positive Practices',
|
|
84
|
+
path: 'https://www.comicrelief.com/positive-practices',
|
|
85
|
+
internal: {
|
|
86
|
+
type: 'ContentfulPageLandingPage'
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
];
|
|
90
|
+
|
|
91
|
+
export const testPrimaryLinksList = [
|
|
92
|
+
{
|
|
93
|
+
title: 'Contact us',
|
|
94
|
+
path: 'contact-us',
|
|
95
|
+
internal: {
|
|
96
|
+
type: 'ContentfulPageLandingPage'
|
|
97
|
+
}
|
|
98
|
+
},
|
|
99
|
+
{
|
|
100
|
+
title: 'FAQs',
|
|
101
|
+
path: 'https://www.comicrelief.com/frequently-asked-questions',
|
|
102
|
+
internal: {
|
|
103
|
+
type: 'ContentfulPageLandingPage'
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
];
|
|
107
|
+
|
|
108
|
+
export const testSecondaryLinksList = [
|
|
109
|
+
{
|
|
110
|
+
title: 'Terms of use',
|
|
111
|
+
path: 'https://www.comicrelief.com/terms-of-use',
|
|
112
|
+
internal: {
|
|
113
|
+
type: 'ContentfulPageLandingPage'
|
|
114
|
+
}
|
|
115
|
+
},
|
|
116
|
+
{
|
|
117
|
+
title: 'Privacy notice',
|
|
118
|
+
path: 'https://www.comicrelief.com/privacy-notice',
|
|
119
|
+
internal: {
|
|
120
|
+
type: 'ContentfulPageLandingPage'
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
];
|
|
@@ -597,15 +597,11 @@ it('renders correctly', () => {
|
|
|
597
597
|
>
|
|
598
598
|
<h2
|
|
599
599
|
className="c6"
|
|
600
|
-
color="inherit"
|
|
601
|
-
size="l"
|
|
602
600
|
>
|
|
603
601
|
Help someone like Jordan see a better tomorrow
|
|
604
602
|
</h2>
|
|
605
603
|
<p
|
|
606
604
|
className="c7"
|
|
607
|
-
color="inherit"
|
|
608
|
-
size="s"
|
|
609
605
|
>
|
|
610
606
|
Jordan was close to suicide - which is now the biggest killer of men under 45 in the UK. Join now and help save lives.
|
|
611
607
|
</p>
|
|
@@ -625,8 +621,6 @@ it('renders correctly', () => {
|
|
|
625
621
|
>
|
|
626
622
|
<h3
|
|
627
623
|
className="c12"
|
|
628
|
-
color="inherit"
|
|
629
|
-
size="s"
|
|
630
624
|
>
|
|
631
625
|
Choose your monthly donation
|
|
632
626
|
</h3>
|
|
@@ -640,7 +634,6 @@ it('renders correctly', () => {
|
|
|
640
634
|
>
|
|
641
635
|
<span
|
|
642
636
|
className="c16 c17"
|
|
643
|
-
color="inherit"
|
|
644
637
|
dangerouslySetInnerHTML={
|
|
645
638
|
Object {
|
|
646
639
|
"__html": "",
|
|
@@ -677,7 +670,6 @@ it('renders correctly', () => {
|
|
|
677
670
|
>
|
|
678
671
|
<span
|
|
679
672
|
className="c16 c17"
|
|
680
|
-
color="inherit"
|
|
681
673
|
dangerouslySetInnerHTML={
|
|
682
674
|
Object {
|
|
683
675
|
"__html": "",
|
|
@@ -714,7 +706,6 @@ it('renders correctly', () => {
|
|
|
714
706
|
>
|
|
715
707
|
<span
|
|
716
708
|
className="c16 c17"
|
|
717
|
-
color="inherit"
|
|
718
709
|
dangerouslySetInnerHTML={
|
|
719
710
|
Object {
|
|
720
711
|
"__html": "",
|
|
@@ -751,8 +742,6 @@ it('renders correctly', () => {
|
|
|
751
742
|
>
|
|
752
743
|
<span
|
|
753
744
|
className="c23 c24"
|
|
754
|
-
color="inherit"
|
|
755
|
-
size="s"
|
|
756
745
|
>
|
|
757
746
|
Other amount
|
|
758
747
|
</span>
|
|
@@ -762,7 +751,6 @@ it('renders correctly', () => {
|
|
|
762
751
|
>
|
|
763
752
|
<span
|
|
764
753
|
className="c16 c17"
|
|
765
|
-
color="inherit"
|
|
766
754
|
dangerouslySetInnerHTML={
|
|
767
755
|
Object {
|
|
768
756
|
"__html": "£",
|
|
@@ -734,19 +734,16 @@ exports[`renders correctly:
|
|
|
734
734
|
>
|
|
735
735
|
<p
|
|
736
736
|
className="c1 c2"
|
|
737
|
-
color="inherit"
|
|
738
737
|
>
|
|
739
738
|
Over the past two years, we’ve supported
|
|
740
739
|
</p>
|
|
741
740
|
<h1
|
|
742
741
|
className="c3 c4"
|
|
743
|
-
color="red"
|
|
744
742
|
>
|
|
745
743
|
11.7 million people
|
|
746
744
|
</h1>
|
|
747
745
|
<p
|
|
748
746
|
className="c5 c6"
|
|
749
|
-
color="inherit"
|
|
750
747
|
>
|
|
751
748
|
including...
|
|
752
749
|
</p>
|
package/src/index.js
CHANGED
|
@@ -9,6 +9,7 @@ export { default as allowListed } from './utils/allowListed';
|
|
|
9
9
|
export { default as spacing } from './theme/shared/spacing';
|
|
10
10
|
export { default as allBreakpoints } from './theme/shared/allBreakpoints';
|
|
11
11
|
export { default as containers } from './theme/shared/containers';
|
|
12
|
+
export { logoRotateAnimation, springScaleAnimation } from './theme/shared/animations';
|
|
12
13
|
|
|
13
14
|
/* Atoms */
|
|
14
15
|
export { default as Text } from './components/Atoms/Text/Text';
|
|
@@ -46,6 +47,7 @@ export { default as Donate } from './components/Organisms/Donate/Donate';
|
|
|
46
47
|
export { default as DoubleCopy } from './components/Molecules/DoubleCopy/DoubleCopy';
|
|
47
48
|
export { default as PartnerLink } from './components/Molecules/PartnerLink/PartnerLink';
|
|
48
49
|
export { default as Footer } from './components/Organisms/Footer/Footer';
|
|
50
|
+
export { default as FooterNew } from './components/Organisms/FooterNew/FooterNew';
|
|
49
51
|
export { default as SearchResult } from './components/Molecules/SearchResult/SearchResult';
|
|
50
52
|
export { default as SearchInput } from './components/Molecules/SearchInput/SearchInput';
|
|
51
53
|
export { default as ShareButton } from './components/Molecules/ShareButton/ShareButton';
|
|
@@ -30,17 +30,23 @@ const colors = {
|
|
|
30
30
|
grey_extra_light: '#f0f0f0',
|
|
31
31
|
grey_for_forms: '#666',
|
|
32
32
|
grey_label: '#5C5C5E',
|
|
33
|
-
|
|
34
|
-
|
|
33
|
+
|
|
34
|
+
grey_1: '#FFFFFF',
|
|
35
35
|
grey_light: '#F4F3F5',
|
|
36
|
-
// grey_2
|
|
37
36
|
grey_medium: '#E1E2E3',
|
|
38
|
-
|
|
37
|
+
grey_2: '#E1E2E3',
|
|
38
|
+
// TODO: 'grey' is actually 'grey_3'. It is referenced in many places.
|
|
39
|
+
// We need to rename it to 'grey_3' across all references.
|
|
40
|
+
// Until then, we need to keep both names for backwards compatibility.
|
|
41
|
+
// Same story with 'grey_medium' - it should be grey_2, and
|
|
42
|
+
// grey_dark, should be grey_4.
|
|
43
|
+
// For the time being we need both of each. I will provision a separate PR.
|
|
39
44
|
grey: '#969598',
|
|
40
|
-
|
|
41
|
-
grey_4: '#6E6E6E',
|
|
42
|
-
// grey_5
|
|
45
|
+
grey_3: '#969598',
|
|
43
46
|
grey_dark: '#222222',
|
|
47
|
+
grey_4: '#222222',
|
|
48
|
+
grey_4_hover: '#3A3A3A',
|
|
49
|
+
grey_5: '#18181A',
|
|
44
50
|
|
|
45
51
|
/* GENERAL COLOURS */
|
|
46
52
|
blue: '#0565D1',
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { css } from 'styled-components';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Logo rotation animation on hover
|
|
5
|
+
* Applies a rotation transition that rotates the logo (or whatever else)
|
|
6
|
+
* -14deg on hover/focus
|
|
7
|
+
* @param {boolean} animateRotate - Whether to enable the rotation animation
|
|
8
|
+
* @returns {css} template literal for the animation
|
|
9
|
+
*/
|
|
10
|
+
const logoRotateAnimation = animateRotate => {
|
|
11
|
+
if (!animateRotate) {
|
|
12
|
+
return css``;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
return css`
|
|
16
|
+
img {
|
|
17
|
+
transition: transform 0.6s cubic-bezier(0.41, 1.64, 0.41, 0.8);
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
&:hover,
|
|
21
|
+
&:focus {
|
|
22
|
+
img {
|
|
23
|
+
transform: rotate(-14deg);
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
`;
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Spring scale animation on hover
|
|
31
|
+
* Applies a smooth spring-like scale transition that expands the element on hover/focus
|
|
32
|
+
* @param {boolean} animateScale - Whether to enable the scale animation
|
|
33
|
+
* @param {number} scaleFactor - Scale factor to apply on hover (default 8%)
|
|
34
|
+
* @param {number} bounceIntensity - Intensity of the springy bounce effect (0-3, default: 1)
|
|
35
|
+
* @returns {css} template literal for the animation
|
|
36
|
+
*/
|
|
37
|
+
const springScaleAnimation = (animateScale, scaleFactor = 1.08, bounceIntensity = 1) => {
|
|
38
|
+
if (!animateScale) {
|
|
39
|
+
return css``;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
// More negative pull-back and higher overshoot = more bounce
|
|
43
|
+
// Default intensity (1) gives: cubic-bezier(0.68, -0.85, 0.265, 1.95)
|
|
44
|
+
// Higher intensity = more pronounced bounce effect
|
|
45
|
+
const pullBack = -0.55 - (bounceIntensity * 0.3);
|
|
46
|
+
const overshoot = 1.55 + (bounceIntensity * 0.4);
|
|
47
|
+
const duration = 0.2 + (bounceIntensity * 0.1);
|
|
48
|
+
|
|
49
|
+
return css`
|
|
50
|
+
transition: transform ${duration}s cubic-bezier(0.68, ${pullBack}, 0.265, ${overshoot});
|
|
51
|
+
transform-origin: center;
|
|
52
|
+
|
|
53
|
+
&:hover,
|
|
54
|
+
&:focus {
|
|
55
|
+
transform: scale(${scaleFactor});
|
|
56
|
+
}
|
|
57
|
+
`;
|
|
58
|
+
};
|
|
59
|
+
|
|
60
|
+
export { logoRotateAnimation, springScaleAnimation };
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|