Fix translatability of community events carousel

This commit is contained in:
mDuo13
2023-12-08 15:14:43 -08:00
parent d234faf883
commit 1e6c237e40
2 changed files with 40 additions and 88 deletions

View File

@@ -1,50 +1,3 @@
const events = [
{
name: "XRPL Grants Info Session: Decentralized Exchange (DEX) Focused",
description:
"Watch the recorded information session and Q&A on applying to XRPL Grants Wave 7. This session will provide a general overview of the XRPL Grants application for Wave 7, with a focus on Decentralized Exchange (DEX) projects.",
type: "info-session",
link: "https://www.youtube.com/watch?v=BbGu0QC5WEE",
location: "Virtual - Zoom",
date: "September 06, 2023",
image: "InfoSessions.png",
end_date: "September 06, 2023",
},
{
name: "APEX 2024: The XRPL Developer Summit",
description:
"Apex XRPL Developer Summit is the annual event where developers, contributors, and thought leaders come together to learn, build, share, network, and celebrate all things XRP Ledger.",
type: "conference",
link: "http://apexdevsummit.com",
location: "Amsterdam",
date: "June 11 - 13, 2024",
image: "Conference.png",
end_date: "June 13, 2024",
},
{
name: "XRPL Developers Reddit AMA: Real World Assets",
description:
"Join us for a live chat on Reddit and learn more about how developers are building real world assets with confidence on the XRP Ledger.",
type: "ama",
link: "https://xrplresources.org/rwa-ama?utm_source=web&utm_medium=web&utm_campaign=bwc",
location: "Virtual - Reddit",
date: "October 17, 2023",
image: "AMAs.png",
end_date: "October 17, 2023",
},
{
name: "New Horizon: Innovate Without Limits: New Horizons Await",
description:
"Join us to kickstart the ecosystem of the upcoming EVM-compatible chain, opening new possibilities for developers to explore the limitless potential of our platform.",
type: "hackathon",
link: "https://newhorizon.devpost.com/",
location: "Virtual",
date: "October 19, 2023 - December 22, 2023",
image: "Hackathons.png",
end_date: "December 22, 2023",
},
];
let currentIndex = 1;
let isFirstLoad = true; // Add a flag to determine if it's the initial load
@@ -71,7 +24,7 @@ function updateCarousel() {
document.getElementById("prev-btn").style.opacity = 0.5;
leftImage.style.visibility = "hidden";
}
centerImage.src = `assets/img/events/${events[currentIndex].image}`;
centerImage.onclick = function() { // Add an onclick event to the main image
window.open(events[currentIndex].link, '_blank'); // Open a new tab with the event link

View File

@@ -75,7 +75,7 @@
<a href="https://learn.xrpl.org/course/deep-dive-into-xrpl-defi/" target="_blank" class="text-external-link"><span class="external-link-contribute"></span></a>
</td>
</tr>
</table>
</section>
@@ -139,9 +139,9 @@
<span class="surround-gradient">$</span>
13
<span class="surround-gradient">M+</span>
</div>
</div>
<div class=" ml-8 stat-separator"></div>
</div>
<div class="stat">
@@ -210,7 +210,7 @@
<a class="com-card-link" target="_blank" href="the-rippled-server.html">{% trans %}The Rippled Server{% endtrans %}</a>
<a class="com-card-link" href="run-rippled-as-a-validator.html" target="_blank">{% trans %}Join UNL{% endtrans %} </a>
<a class="com-card-link" target="_blank" href="install-rippled.html">{% trans %}Install & Configure {% endtrans %}</a>
<a class="com-card-link" target="_blank" href="troubleshoot-the-rippled-server.html">{% trans %}Troubleshooting{% endtrans %}</a>
<a class="com-card-link" target="_blank" href="troubleshoot-the-rippled-server.html">{% trans %}Troubleshooting{% endtrans %}</a>
</div>
</div>
</div>
@@ -251,11 +251,9 @@
{% endblock analytics %}
{% block endbody %}
<script type="application/javascript" src="{{currentpage.prefix}}assets/js/contribute-carousel.js"></script>
<script type="text/javascript">
document.addEventListener("DOMContentLoaded", function() {
const events = [
{ "name": _("New Horizon: Innovate Without Limits: New Horizons Await"),
var events = {{[
{ "name": _("New Horizon: Innovate Without Limits: New Horizons Await"),
"description": _("Join our EVM-compatible chain launch for a chance to win $50,000 in prizes! Unleash your creativity in DeFi and NFTs, with judging criteria focused on novelty, impact, and community engagement."),
"type": "hackathon",
"link": "https://newhorizon.devpost.com/",
@@ -266,7 +264,7 @@ const events = [
"start_date": "October 19, 2023"
},
{
"name":_("XRPL Community Report Launch Party"),
"name":_("XRPL Community Report Launch Party"),
"description": _("Celebrate the XRPL Community Report launch at 7pm! Join blockchain enthusiasts, connect with experts, and discover opportunities in the XRP Ledger ecosystem. Limited space available, so register now for a night of celebration and networking!"),
"type": "meetup",
"link": "https://www.eventbrite.fr/e/billets-xrpl-community-report-launch-party-753788370307",
@@ -277,7 +275,7 @@ const events = [
"start_date": "November 28, 2023"
},
{
"name": _("XRPL Toronto Meetup Community - Celebrate with Us!"),
"name": _("XRPL Toronto Meetup Community - Celebrate with Us!"),
"description": _("To connect the blockchain community, showcase campus ambassador projects, and celebrate the year's progress with a holiday theme."),
"type": "meetup",
"link": "https://www.meetup.com/xrpl-toronto-community-meetup/events/294766059",
@@ -288,43 +286,43 @@ const events = [
"start_date": "December 7, 2023"
},
{
name: _("XRPL Grants Info Session: Decentralized Exchange (DEX) Focused"),
description:
"name": _("XRPL Grants Info Session: Decentralized Exchange (DEX) Focused"),
"description":
_("Watch the recorded information session and Q&A on applying to XRPL Grants Wave 7. This session will provide a general overview of the XRPL Grants application for Wave 7, with a focus on Decentralized Exchange (DEX) projects."),
type: "info-session",
link: "https://www.youtube.com/watch?v=BbGu0QC5WEE",
location: _("Virtual - Zoom"),
date: "September 06, 2023",
image: "InfoSessions.png",
end_date: "September 06, 2023",
start_date: "September 06, 2023",
"type": "info-session",
"link": "https://www.youtube.com/watch?v=BbGu0QC5WEE",
"location": _("Virtual - Zoom"),
"date": "September 06, 2023",
"image": "InfoSessions.png",
"end_date": "September 06, 2023",
"start_date": "September 06, 2023",
},
{
name: _("APEX 2024: The XRPL Developer Summit"),
description:
"name": _("APEX 2024: The XRPL Developer Summit"),
"description":
_("Apex XRPL Developer Summit is the annual event where developers, contributors, and thought leaders come together to learn, build, share, network, and celebrate all things XRP Ledger."),
type: "conference",
link: "http://apexdevsummit.com",
location: _("Amsterdam"),
date: "June 11 - 13, 2024",
image: "Conference.png",
end_date: "June 13, 2024",
start_date: "June 11, 2024",
"type": "conference",
"link": "http://apexdevsummit.com",
"location": _("Amsterdam"),
"date": "June 11 - 13, 2024",
"image": "Conference.png",
"end_date": "June 13, 2024",
"start_date": "June 11, 2024",
},
{
name: _("XRPL Developers Reddit AMA: Real World Assets"),
description:
"name": _("XRPL Developers Reddit AMA: Real World Assets"),
"description":
_("Join us for a live chat on Reddit and learn more about how developers are building real world assets with confidence on the XRP Ledger."),
type: "ama",
link: "https://xrplresources.org/rwa-ama?utm_source=web&utm_medium=web&utm_campaign=bwc",
location:_("Virtual - Reddit"),
date: "October 17, 2023",
image: "AMAs.png",
end_date: "October 17, 2023",
start_date: "October 17, 2023",
"type": "ama",
"link": "https://xrplresources.org/rwa-ama?utm_source=web&utm_medium=web&utm_campaign=bwc",
"location":_("Virtual - Reddit"),
"date": "October 17, 2023",
"image": "AMAs.png",
"end_date": "October 17, 2023",
"start_date": "October 17, 2023",
},
];
]}};
$(document).ready(() => {
// Function to convert string date to Date object
const parseDate = (dateString) => {
const [monthDay, year] = dateString.split(", ");
@@ -362,10 +360,11 @@ const parseDate = (dateString) => {
document.getElementById('location-tag').textContent = closestEvent.location;
} else {
console.log('No upcoming events found. Hiding upcoming events section');
document.getElementById('upcoming-events-section').style = 'display:none'
document.getElementById('upcoming-events-section').style = 'display:none'
}
});
</script>
<script type="application/javascript" src="{{currentpage.prefix}}assets/js/contribute-carousel.js"></script>
<script src="//embed.typeform.com/next/embed.js"></script>
{% endblock %}