This page is a very simple usage of a bootstrap carousel that loads photos dynamically from a list of urls. As the user navigates the carousel a pointer keeps track of the location in the list. If the user clicks on the right arrow, the pointer will increment. Otherwise, the pointer will decrement. A button is also available to random update the photo and location in the list where the pointer is pointing.
-
Create a vendor directory and but two subdirs in it, One for Bootstrap and the other for jquery.
$ mkdir -p vendor/bootstrap vendor/jquery
-
Populate those vendor directory from npm's
dist
directory or however you perfer. Just be aware of path changes if you use something else and update them inindex.html
. -
Make a directory to store photos or links to photos locally on the webserver
$ ln -s ~/Photos photos
-
Populate a file called
purls.js
which contains an array of urls referring to the files in thephotos/
directory you just made.var purls = [ "/photos/img1.jpg", ... ];
-
Push to a webserver or start one locally. I use one I wrote that include SSL and basic auth:
$ sfs -u -d . &
-
Visit the page in your browser and see something like this: