Skip to content
This repository has been archived by the owner on Mar 7, 2023. It is now read-only.

Added JS to randomize the homepage's splash image #115

Merged
merged 4 commits into from
Oct 27, 2018

Conversation

jtcchan
Copy link
Contributor

@jtcchan jtcchan commented Oct 25, 2018

Hi @swcurran, I've just wrapped up this request and ran a few quick tests. Give it a try in local development and let me know what you think (remember to use bundle exec jekyll serve --baseurl "" to start your local development servers). If you're running into issues starting up Jekyll, you may need to accept and merge from #113 first.

Some notes:

  • I've removed v1.md to v5.md in favour of a single page: _pages/home.md. The settings for hero images now lives in _data/hero.yml. Each image requires a url to load the image, and a class to apply the correct CSS styles. If you add new images, you can reuse these classes, but I've only wrote 4 variations thus far and any future change will likely need new CSS classes (found under _sass/minimal-mistakes/_pages.scss) unless the dimensions for the new image work out to be the same for what we already have.
  • The JS to pick a random splash lives in /assets/js/random-hero-splash.js. I've written this file to read from _data/hero.yml so that if you add or remove new images in the YAML file, the script will work as intended (e.g. if you decide to pick between 3 random images or 10)

Hope that covers it. Let me know if you have any questions!

@jtcchan jtcchan requested a review from swcurran October 25, 2018 09:56
@swcurran swcurran merged commit ea37c33 into redesign Oct 27, 2018
Copy link
Contributor

@swcurran swcurran left a comment

Choose a reason for hiding this comment

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

Tested out and happy with it. Removed Mary and her Services Card image and verified operation. Good stuff.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants