Skip to content

Commit 232860e

Browse files
authored
Merge pull request #3001 from XRPLF/apex-banner-2025-v2
Apex banner 2025 v2
2 parents d2d0d39 + f2f4375 commit 232860e

File tree

9 files changed

+193
-1024
lines changed

9 files changed

+193
-1024
lines changed

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ yarn-error.log
77
/.idea
88
*.iml
99
.venv/
10-
1110
_code-samples/*/js/package-lock.json
1211

1312
# PHP

@theme/components/Navbar/Navbar.tsx

Lines changed: 50 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,63 @@
11
import * as React from "react";
2-
import styled from "styled-components";
32
import { useThemeConfig, useThemeHooks } from "@redocly/theme/core/hooks";
43
import { LanguagePicker } from "@redocly/theme/components/LanguagePicker/LanguagePicker";
54
import { slugify } from "../../helpers";
65
import { Link } from "@redocly/theme/components/Link/Link";
76
import { ColorModeSwitcher } from "@redocly/theme/components/ColorModeSwitcher/ColorModeSwitcher";
87
import { AlgoliaSearch } from "./AlgoliaSearch";
8+
import arrowUpRight from "../../../static/img/icons/arrow-up-right-custom.svg";
99

1010
// @ts-ignore
1111

1212
const alertBanner = {
13-
show: false,
14-
message: "XRP Ledger Apex is back in Amsterdam",
15-
button: "Register Now",
16-
link: "https://www.xrpledgerapex.com/?utm_source=email&utm_medium=email_marketing&utm_campaign=EVENTS_XRPL_Apex_2024_Q2&utm_term=events_page_cta_button",
13+
show: true,
14+
message: "XRP LEDGER APEX 2025",
15+
button: "GET TICKETS",
16+
link: "https://www.xrpledgerapex.com/?utm_source=xrplwebsite&utm_medium=direct&utm_campaign=xrpl-event-ho-xrplapex-glb-2025-q1_xrplwebsite_ari_arp_bf_rsvp&utm_content=cta_btn_english_pencilbanner",
17+
date: "JUNE 10-12",
1718
};
19+
export function AlertBanner({ message, date, button, link, show }) {
20+
const { useTranslate } = useThemeHooks();
21+
const { translate } = useTranslate();
22+
const bannerRef = React.useRef(null);
23+
24+
React.useEffect(() => {
25+
const banner = bannerRef.current;
26+
if (!banner) return;
27+
const handleMouseEnter = () => {
28+
banner.classList.add('has-hover');
29+
};
30+
// Attach the event listener
31+
banner.addEventListener('mouseenter', handleMouseEnter);
32+
// Clean up the event listener on unmount
33+
return () => {
34+
banner.removeEventListener('mouseenter', handleMouseEnter);
35+
};
36+
}, []);
1837

38+
if (show) {
39+
return (
40+
<a
41+
href={link}
42+
target="_blank"
43+
ref={bannerRef}
44+
className="top-banner fixed-top web-banner"
45+
rel="noopener noreferrer"
46+
aria-label="Get Tickets for XRP Ledger Apex 2025 Event"
47+
>
48+
<div className="banner-event-details">
49+
<div className="event-info">{translate(message)}</div>
50+
<div className="event-date">{translate(date)}</div>
51+
</div>
52+
<div className="banner-button">
53+
<div className="button-text">{translate(button)}</div>
54+
<img className="button-icon" src={arrowUpRight} alt="Get Tickets Icon" />
55+
</div>
56+
</a>
57+
);
58+
}
59+
return null;
60+
}
1961
export function Navbar(props) {
2062
// const [isOpen, setIsOpen] = useMobileMenu(false);
2163
const themeConfig = useThemeConfig();
@@ -49,6 +91,7 @@ export function Navbar(props) {
4991
}
5092
});
5193

94+
5295
React.useEffect(() => {
5396
// Turns out jQuery is necessary for firing events on Bootstrap v4
5497
// dropdowns. These events set classes so that the search bar and other
@@ -86,12 +129,7 @@ export function Navbar(props) {
86129

87130
return (
88131
<>
89-
<AlertBanner
90-
show={alertBanner.show}
91-
message={alertBanner.message}
92-
button={alertBanner.button}
93-
link={alertBanner.link}
94-
/>
132+
<AlertBanner {...alertBanner} />
95133
<NavWrapper belowAlertBanner={alertBanner.show}>
96134
<LogoBlock to={href} img={logo} alt={altText} />
97135
<NavControls>
@@ -120,30 +158,6 @@ export function Navbar(props) {
120158
);
121159
}
122160

123-
const StyledColorModeSwitcher = styled(ColorModeSwitcher)`
124-
padding: 10px;
125-
`;
126-
127-
export function AlertBanner({ message, button, link, show }) {
128-
if (show) {
129-
return (
130-
<div className="top-banner fixed-top">
131-
<div className="inner-apex">
132-
<span>
133-
<p className="mb-0 apex-banner-text">{message}</p>
134-
</span>
135-
<span>
136-
<Link to={link} target="_blank" className="apex-btn">
137-
{button}
138-
</Link>
139-
</span>
140-
</div>
141-
</div>
142-
);
143-
}
144-
return null;
145-
}
146-
147161
export function TopNavCollapsible({ children }) {
148162
return (
149163
<div
@@ -268,7 +282,7 @@ export function NavWrapper(props) {
268282
return (
269283
<nav
270284
className="top-nav navbar navbar-expand-lg navbar-dark fixed-top"
271-
style={props.belowAlertBanner ? { marginTop: "46px" } : {}}
285+
style={props.belowAlertBanner ? { marginTop: "52px" } : {}}
272286
>
273287
{props.children}
274288
</nav>

static/css/devportal2024-v1.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

static/img/backgrounds/bg-apex-banner-md.svg

Lines changed: 0 additions & 306 deletions
This file was deleted.

static/img/backgrounds/bg-apex-banner-sm.svg

Lines changed: 0 additions & 306 deletions
This file was deleted.

static/img/backgrounds/bg-apex-banner.svg

Lines changed: 0 additions & 306 deletions
This file was deleted.
Lines changed: 3 additions & 0 deletions
Loading

styles/_top-banner.scss

Lines changed: 138 additions & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -1,85 +1,156 @@
1-
.top-banner {
1+
.web-banner {
2+
text-decoration: none;
23
display: flex;
3-
align-items: center;
4-
justify-content: center;
5-
height: 46px;
6-
background: url(../img/backgrounds/bg-apex-banner.svg);
7-
background-position: center !important;
8-
background-size: cover;
9-
background-color: $blue-purple-500;
10-
color: $white;
4+
justify-content: space-between;
5+
height: $banner-height;
6+
background: #D919FF !important;
7+
padding: 7px 35px;
8+
font-family: "Work Sans";
9+
z-index: 9999;
10+
cursor: pointer;
11+
12+
&:hover {
13+
text-decoration: none;
14+
color: $white;
15+
.button-icon{
16+
animation: iconJitter 0.7s cubic-bezier(0.16, 1, 0.3, 1) forwards;
17+
transition: transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
18+
}
19+
}
20+
color: $white !important;
21+
text-align: center;
22+
font-family: "Work Sans";
23+
font-size: 26px; // Further scaled down from 28px
24+
font-style: normal;
25+
font-weight: 600;
26+
letter-spacing: -0.32px;
27+
// Pseudo-element for the fill animation
28+
&::after {
29+
content: "";
30+
position: absolute;
31+
top: 0;
32+
left: 0;
33+
width: 100%; // Full width so that we can scale it
34+
height: 100%;
35+
background-color: #7919FF;
36+
z-index: 0;
37+
transform: scaleX(0); // Start scaled down to 0
38+
transform-origin: left; // Scale from the left edge
39+
transition: transform 0.7s cubic-bezier(0.7, 0, 0.84, 0);
40+
will-change: transform; // Hint for smoother animations
41+
}
1142

12-
.inner-apex {
43+
// On hover, scale to full width
44+
&:hover::after {
45+
transform: scaleX(1);
46+
transition: transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
47+
}
48+
// Ensure direct children are above the pseudo-element
49+
> * {
50+
position: relative;
51+
z-index: 1;
52+
}
53+
@media (max-width: 768px) {
54+
font-size: 18px;
55+
padding: 11px 35px;
56+
.banner-button{
57+
gap: 11px !important;
58+
}
59+
.button-text{
60+
margin-bottom: 4px;
61+
}
62+
}
63+
@media (max-width: 564px) {
64+
font-size: 15px;
65+
padding: 9px 40px;
66+
.button-text{
67+
margin-bottom: 0px;
68+
}
69+
.banner-event-details{
70+
gap: 0px !important;
71+
flex-direction: column;
72+
text-align: left;
73+
line-height: 21px;
74+
.event-date{
75+
position: relative;
76+
top: -5px;
77+
}
78+
}
79+
.banner-button{
80+
align-self: baseline;
81+
gap: 8px !important;
82+
margin-top: -2px !important;
83+
padding-top: 0px !important;
84+
}
85+
}
86+
.banner-button{
1387
display: flex;
14-
justify-content: center;
1588
align-items: center;
16-
17-
}
18-
19-
.apex-banner-text {
20-
color: #FFF;
21-
font-family: "Work Sans";
22-
font-size: 20px;
23-
font-style: normal;
24-
font-weight: 600;
25-
line-height: 24px;
89+
gap: 14.5px;
90+
padding-top: 1px;
91+
img{
92+
width: 24.5px;
93+
height: 33.7px;
94+
@media (max-width: 768px) {
95+
width: 15.5px;
96+
height: 17px;
97+
margin-top: 4px;
98+
}
99+
@media (max-width: 564px) {
100+
width: 14.5px;
101+
height: 13.85px;
102+
}
103+
}
26104
}
27105

28-
.apex-btn {
29-
margin-left: 16px;
30-
color: var(--Gray-100, #000) !important;
31-
font-family: "Work Sans";
32-
font-size: 16px;
33-
font-style: normal;
106+
.banner-event-details {
34107
display: flex;
35-
justify-content: center;
36-
font-weight: 600;
37-
align-items: center;
38-
line-height: 100%;
39-
letter-spacing: -0.16px;
40-
padding: 2px 4px;
41-
border-radius: 100px !important;
42-
background: #18FF83 !important;
43-
text-decoration: none !important;
44-
width: 135px;
45-
height: 28px;
108+
gap: 32px;
46109
}
47110

48-
@media (max-width: 1024px) {
49-
background: url(../img/backgrounds/bg-apex-banner-md.svg);
50111

51-
.apex-banner-text {
52-
font-size: 18px;
53-
}
112+
.button-icon {
113+
transform-style: preserve-3d;
114+
aspect-ratio: 0.71;
115+
object-fit: contain;
116+
animation: none;
117+
transform: rotateZ(0deg);
118+
transition: transform 0.7s cubic-bezier(0.16, 1, 0.3, 1); // Adjust duration as needed
119+
align-self: stretch;
120+
margin: auto 0;
121+
transform-style: preserve-3d;
122+
}
54123

55-
.apex-btn {
56-
width: 122px;
57-
height: 26px;
58-
font-size: 14px;
59-
letter-spacing: -0.14px;
124+
@keyframes iconJitter {
125+
from {
126+
transform: translate3d(0, 0, 0) scale3d(1, 1, 1) rotateZ(0deg) skew(0deg, 0deg);
127+
}
128+
to {
129+
transform: translate3d(0, 0, 0) scale3d(1, 1, 1) rotateZ(45deg) skew(0deg, 0deg);
60130
}
61131
}
62132

63-
@media (max-width: 535px) {
64-
background: url(../img/backgrounds/bg-apex-banner-sm.svg);
133+
}
65134

66-
.apex-btn {
67-
margin-left: 0;
68-
width: 85px;
69-
height: 16px;
70-
font-size: 10px;
71-
line-height: 100%;
72-
letter-spacing: -0.1px;
73-
}
74-
75-
.apex-banner-text {
76-
font-size: 12px;
77-
line-height: 12px;
78-
}
135+
.web-banner a {
136+
text-decoration: none;
137+
}
79138

80-
.inner-apex {
81-
flex-direction: column;
82-
gap: 8px;
83-
}
139+
.button-icon {
140+
animation: iconJitter 0.7s ease-in-out;
141+
animation-iteration-count: 1;
142+
transition: transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
143+
}
144+
@keyframes iconReturn {
145+
from {
146+
transform: translate3d(0, 0, 0) scale3d(1, 1, 1) rotateZ(45deg) skew(0deg, 0deg);
147+
}
148+
to {
149+
transform: translate3d(0, 0, 0) scale3d(1, 1, 1) rotateZ(0deg) skew(0deg, 0deg);
84150
}
151+
}
152+
/* After the banner has been hovered once, on unhover run the reverse animation */
153+
.web-banner.has-hover:not(:hover) .button-icon {
154+
animation: iconReturn 0.7s ease-in-out forwards;
155+
transition: transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
85156
}

styles/_top-nav.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/* Top navigation ----------------------------------------------------------- */
22
$nav-height: 80px;
3-
$banner-height: 0; // Apex 2024 banner was 46px. 0 for no pencil banner.
3+
$banner-height: 52px; // Apex 2025 banner is 52px. 0 for no pencil banner.
44

55
[data-component-name="layouts/RootLayout"] {
66
padding-top: $nav-height + $banner-height;

0 commit comments

Comments
 (0)