Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rotating event banner #2061

Merged
merged 3 commits into from
May 15, 2024
Merged

Rotating event banner #2061

merged 3 commits into from
May 15, 2024

Conversation

Yndira-E
Copy link
Contributor

Description

This PR adds a rotating banner feature to the website. Multiple events or announcements can now be displayed at the top of the website, rotating every few seconds. The events data is pulled from a YAML file and the rotation functionality is implemented in JavaScript.

Related Issue(s)

#1968

Checklist

  • I have read the contribution guidelines
  • I have considered the performance impact of these changes
  • Suitable unit/system level tests have been added and they pass
  • Documentation has been updated

@Yndira-E Yndira-E linked an issue May 14, 2024 that may be closed by this pull request
@Yndira-E Yndira-E marked this pull request as ready for review May 14, 2024 16:03
@Yndira-E Yndira-E requested a review from ZJvandeWeg as a code owner May 14, 2024 16:03
- type: "Webinar"
title: "Deploy FlowFuse on Industrial IoT with NCD.io"
buttonText: "Learn more"
link: "/webinars/2024/deploy-flowfuse-on-industrial-iot-with-ncd-io/"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we should add two timestamps. Not before, that is from what point we can show the banner, and and expire. That saves a bunch of hassle each month

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great idea ZJ, thanks! I've included an expiration date field. Since we won't be adding events or announcements before the URL is created, I believe it's sufficient for the banner to start showing when the info it's added or updated. The crucial aspect is setting when it will disappear. WDYT?

src/_includes/components/events-banner.njk Show resolved Hide resolved
setTimeout(function() {
changeContainerColor(banners[currentBanner]);
}, 500); // wait for the slideDown animation to finish
}, 7000);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

7 seconds isn't a lot imo, do we want to push this back?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've changed it to 10s

@Yndira-E Yndira-E requested a review from ZJvandeWeg May 15, 2024 12:54
@@ -6,6 +6,7 @@ on:
- main
schedule:
- cron: "30 9 * * *"
- cron: "5 16 * * 3,4"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why the last 3,4?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wednesday and Thursdays, the possible days for webinars

title: "Deploy FlowFuse on Industrial IoT with NCD.io"
buttonText: "Learn more"
link: "/webinars/2024/deploy-flowfuse-on-industrial-iot-with-ncd-io/"
expire: "2024-05-29T16:00:00Z"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TY! <3


For example, `expire: "2024-05-29T15:00:00Z"` means that the event will stop being displayed on the banner at 16:00 UTC on May 29, 2024.

Please note that the website is built once a day at 9:30 AM UTC, and also on Wednesdays and Thursdays at 16:05 UTC. This means that if an event expires at some point during the day, it will still be displayed until the next time the website is built.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd just rebuild it every day at 16:00. This contains a bit too much business logic now tied to webinars.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the only stuff i can complain about, so I'll merge as is @Yndira-E

@ZJvandeWeg ZJvandeWeg enabled auto-merge May 15, 2024 13:59
@ZJvandeWeg ZJvandeWeg merged commit 4f06e80 into main May 15, 2024
5 checks passed
@ZJvandeWeg ZJvandeWeg deleted the 1968-rotating-event-banner branch May 15, 2024 14:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Rotating event banner
2 participants