Skip to content

Commit f456b98

Browse files
committed
create new apex banner with animations v2
1 parent 00a3d10 commit f456b98

File tree

4 files changed

+101
-73
lines changed

4 files changed

+101
-73
lines changed

@theme/components/Navbar/Navbar.tsx

Lines changed: 33 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,33 @@ const alertBanner = {
1414
message: "XRP Ledger Apex 2025 | June 10-12",
1515
button: "GET TICKETS",
1616
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_gettickets",
17+
date: "JUNE 10-12",
1718
};
18-
19+
export function AlertBanner({ message, button, link, show }) {
20+
const { useTranslate } = useThemeHooks();
21+
const { translate } = useTranslate();
22+
if (show) {
23+
return (
24+
<a
25+
href={link}
26+
target="_blank"
27+
className="top-banner fixed-top web-banner"
28+
rel="noopener noreferrer"
29+
aria-label="Get Tickets for XRP Ledger Apex 2025 Event"
30+
>
31+
<div className="banner-event-details">
32+
<div className="event-info">XRPL APEX 2025</div>
33+
<div className="event-date">JUNE 10-12</div>
34+
</div>
35+
<div className="banner-button">
36+
<div className="button-text">GET TICKETS</div>
37+
<img className="button-icon" src={arrowUpRight} alt="Get Tickets Icon" />
38+
</div>
39+
</a>
40+
);
41+
}
42+
return null;
43+
}
1944
export function Navbar(props) {
2045
// const [isOpen, setIsOpen] = useMobileMenu(false);
2146
const themeConfig = useThemeConfig();
@@ -49,6 +74,7 @@ export function Navbar(props) {
4974
}
5075
});
5176

77+
5278
React.useEffect(() => {
5379
// Turns out jQuery is necessary for firing events on Bootstrap v4
5480
// dropdowns. These events set classes so that the search bar and other
@@ -86,12 +112,7 @@ export function Navbar(props) {
86112

87113
return (
88114
<>
89-
<AlertBanner
90-
show={alertBanner.show}
91-
message={alertBanner.message}
92-
button={alertBanner.button}
93-
link={alertBanner.link}
94-
/>
115+
<AlertBanner {...alertBanner} />
95116
<NavWrapper belowAlertBanner={alertBanner.show}>
96117
<LogoBlock to={href} img={logo} alt={altText} />
97118
<NavControls>
@@ -120,30 +141,14 @@ export function Navbar(props) {
120141
);
121142
}
122143

123-
export function AlertBanner({ message, button, link, show }) {
144+
export function XrplApexEvent({ message, button, link, show, date }) {
124145
const { useTranslate } = useThemeHooks();
125146
const { translate } = useTranslate();
126147
if (show) {
127148
return (
128-
<a
129-
href={link}
130-
target="_blank"
131-
className="top-banner fixed-top web-banner"
132-
rel="noopener noreferrer"
133-
aria-label="Get Tickets for XRP Ledger Apex 2025 Event"
134-
>
135-
<div className="banner-content">
136-
<div className="event-info">{translate(message)}</div>
137-
<div className="ticket-button">
138-
<span className="button-text">{translate(button)}</span>
139-
<img
140-
src={arrowUpRight}
141-
alt="Get Tickets Icon"
142-
className="button-icon"
143-
/>
144-
</div>
145-
</div>
146-
</a>
149+
<div className="xrpl-apex-event">
150+
151+
</div>
147152
);
148153
}
149154
return null;
@@ -273,7 +278,7 @@ export function NavWrapper(props) {
273278
return (
274279
<nav
275280
className="top-nav navbar navbar-expand-lg navbar-dark fixed-top"
276-
style={props.belowAlertBanner ? { marginTop: "46px" } : {}}
281+
style={props.belowAlertBanner ? { marginTop: "52px" } : {}}
277282
>
278283
{props.children}
279284
</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.

styles/_pages.scss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737
object-fit: cover;
3838
content: url("../img/home-hero.svg");
3939
margin-bottom: 24px;
40+
margin-top: 24px;
4041
@media (min-width: 992px) {
4142
min-height: 470px;
4243
}

styles/_top-banner.scss

Lines changed: 66 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -1,52 +1,75 @@
11
.web-banner {
22
text-decoration: none;
33
display: flex;
4-
align-items: center;
5-
justify-content: center;
6-
height: 46px;
7-
color: $white;
8-
background: var(--XRPL-Secondary-Blue-Purple, #7919FF);
9-
padding: 7px 70px;
4+
justify-content: space-between;
5+
height: 52px;
6+
background: #D919FF !important;
7+
padding: 7px 35px;
8+
font-family: "Work Sans";
109
z-index: 9999;
1110
cursor: pointer;
1211
&:hover {
1312
text-decoration: none;
14-
background: var(--XRPL-Blue-Purple-700, #4A00B2);
15-
.button-icon {
16-
animation: iconJitter 0.7s ease forwards;
13+
color: $white;
14+
.button-icon{
15+
animation: iconJitter 1.65s ease-in-out forwards;
1716
}
1817
}
18+
color: $white !important;
19+
text-align: center;
20+
font-family: "Work Sans";
21+
font-size: 26px; // Further scaled down from 28px
22+
font-style: normal;
23+
font-weight: 600;
24+
letter-spacing: -0.32px;
25+
// Pseudo-element for the fill animation
26+
&::after {
27+
content: "";
28+
position: absolute;
29+
top: 0;
30+
left: 0;
31+
width: 0%;
32+
height: 100%;
33+
background-color: #7919FF;
34+
z-index: 0;
35+
transition: width 2s ease-out;
36+
}
37+
38+
// On hover, expand the pseudo-element to cover the full width
39+
&:hover::after {
40+
width: 100%;
41+
}
42+
43+
// Ensure direct children are above the pseudo-element
44+
> * {
45+
position: relative;
46+
z-index: 1;
47+
}
48+
1949
@media (max-width: 991px) {
2050
padding: 0 20px;
2151
}
22-
23-
.banner-content {
52+
.banner-button{
2453
display: flex;
2554
align-items: center;
26-
gap: 24px;
27-
justify-content: flex-start;
28-
flex-wrap: nowrap;
29-
30-
@media (max-width: 524px) {
31-
gap: 8px;
32-
}
33-
34-
@media (max-width: 991px) {
35-
max-width: 100%;
55+
gap: 14.5px;
56+
img{
57+
width: 24.5px;
58+
height: 33.7px;
3659
}
3760
}
38-
3961
.event-info {
40-
color: #fff;
41-
font: 500 18px/1 Work Sans, -apple-system, Roboto, Helvetica, sans-serif;
42-
align-self: stretch;
43-
margin: auto 0;
4462

4563
@media (max-width: 524px) {
46-
font-size: 12px;
64+
font-size: 15px;
4765
}
4866
}
4967

68+
.banner-event-details {
69+
display: flex;
70+
gap: 32px;
71+
}
72+
5073
.ticket-button {
5174
border: 1px solid var(--XRPL-Primary-White, #fff);
5275
display: flex;
@@ -59,37 +82,29 @@
5982
text-align: center;
6083
letter-spacing: -0.16px;
6184
padding: 8px 16px;
62-
font: 600 18px/1 Work Sans Apex, -apple-system, Roboto, Helvetica, sans-serif;
85+
font: 600 15px/1 Work Sans ;
6386
cursor: pointer;
6487
white-space: nowrap;
6588
text-decoration: none;
6689
transform-origin: center;
6790
transition: background-color 0.3s ease, color 0.3s ease;
6891

6992
@media (max-width: 524px) {
70-
font: 600 12px/1 Work Sans Apex, -apple-system, Roboto, Helvetica, sans-serif;
93+
font: 600 9px/1 Work Sans ;
7194
width: 117px;
7295
height: 27px;
7396
padding: 6px 12px;
7497
}
7598
}
7699

77-
.button-text {
78-
align-self: stretch;
79-
margin: auto 0;
80-
font-size: 16px;
81-
@media (max-width: 524px) {
82-
font-size: 12px;
83-
}
84-
}
85-
86100
.button-icon {
87101
aspect-ratio: 0.71;
88102
object-fit: contain;
89-
width: 13.8px;
103+
width: 12.5px; // Scaled down from 13.8px
104+
animation: none;
90105

91106
@media (max-width: 524px) {
92-
width: 10px;
107+
width: 9px; // Scaled down from 10px
93108
}
94109

95110
align-self: stretch;
@@ -119,9 +134,16 @@
119134

120135
.web-banner a {
121136
text-decoration: none;
122-
background-color: var(--XRPL-Secondary-Blue-Purple, #7919FF);
137+
// background-color: var(--XRPL-Secondary-Blue-Purple, #7919FF);
123138
}
124-
// to avoid a focus outline causing the background to turn white
125-
.web-banner:focus, .web-banner:active {
126-
background-color: var(--XRPL-Secondary-Blue-Purple, #7919FF) !important;
139+
140+
// // to avoid a focus outline causing the background to turn white
141+
// .web-banner:focus,
142+
// .web-banner:active {
143+
// background-color: var(--XRPL-Secondary-Blue-Purple, #7919FF) !important;
144+
// }
145+
146+
.button-icon {
147+
animation: iconJitter 1s ease-in-out;
148+
animation-iteration-count: 1;
127149
}

0 commit comments

Comments
 (0)