Skip to content

Commit

Permalink
Show fewer random images
Browse files Browse the repository at this point in the history
Replace images whose subjects are obscured by homepage search form's
position. Issue #27
  • Loading branch information
CodeWritingCow committed Apr 13, 2018
1 parent 1209b5e commit bd68b6e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 3 additions & 4 deletions public/assets/javascript/randomImg.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
const imgCount = 6;
const imgCount = 5;
const dir = '/public/assets/img/';
const randomCount = Math.round(Math.random() * (imgCount - 1)) + 1;
const images = new Array;
images[1] = { "img": "michael-browning-14090-unsplash-1024x683.jpg", "alt": "Men working in kitchen. Photo by Michael Browning on Unsplash."};
images[2] = { "img": "michael-browning-14092-unsplash-1024x683.jpg", "alt": "Person, table, night and mercantile establishment. Photo by Michael Browning on Unsplash."};
images[2] = { "img": "roman-arkhipov-123618-unsplash-1024x683.jpg", "alt": "Food cart in New York at night. Photo by Roman Arkhipov on Unsplash."};
images[3] = { "img": "joanna-boj-17158-unsplash-1024x683.jpg", "alt": "Cook in a cafe. Photo by Joanna Boj on Unsplash."};
images[4] = { "img": "making-waffles-cutting-them-into-pieces-picjumbo-com-1024x683.jpg", "alt": "Making waffles cutting them into pieces. Photo by picjumbo.com."};
images[5] = { "img": "clem-onojeghuo-97089-unsplash-1024x683.jpg", "alt": "Asian Street food: Letchworth Garden City, United Kingdom. Photo by Clem Onojeghuo on Unsplash."};
images[6] = { "img": "woman-holding-an-ice-cream-picjumbo-com-1024x683.jpg", "alt": "Woman holding an ice cream. Photo by picjumbo.com."};
images[5] = { "img": "woman-holding-an-ice-cream-picjumbo-com-1024x683.jpg", "alt": "Woman holding an ice cream. Photo by picjumbo.com."};

const randomImg = dir + images[randomCount].img;
const randomImgAlt = images[randomCount].alt;
Expand Down

0 comments on commit bd68b6e

Please sign in to comment.