Sunday, 8 June 2014

Embedding A Slideshow

I have embedded a few slideshows into my website so I thought I would explain how I went about it. I used an already existing slideshow from a tutorial online, which used jQuery.

First off, I placed a file named 'responsiveslides.min.js' into the same folder as my HTML files. This is what enables the Javascript to work to make the site responsive.

The next piece of code was to be placed at the bottom of the <body> section of my HTML. This was unusual to me as I would have put a script in the <head> tags, but it was specifically instructed to place it at the bottom.

<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>
<script src="responsiveslides.min.js"></script>
<script>
  $(function() {
   $(".rslides").responsiveSlides({
  auto: true,             // Boolean: Animate automatically, true or false
  speed: 500,            // Integer: Speed of the transition, in milliseconds
  timeout: 4000,          // Integer: Time between slide transitions, in milliseconds
  pager: false,           // Boolean: Show pager, true or false
  nav: false,             // Boolean: Show navigation, true or false
  random: false,          // Boolean: Randomize the order of the slides, true or false
  pause: false,           // Boolean: Pause on hover, true or false
  pauseControls: true,    // Boolean: Pause when hovering controls, true or false
  prevText: "",   // String: Text for the "previous" button
  nextText: "",       // String: Text for the "next" button
  maxwidth: "",           // Integer: Max-width of the slideshow, in pixels
  navContainer: "",       // Selector: Where controls should be appended to, default is after the 'ul'
  manualControls: "",     // Selector: Declare custom pager navigation
  namespace: "rslides",   // String: Change the default namespace used
  before: function(){},   // Function: Before callback
  after: function(){}     // Function: After callback
});
  });
</script>

In this script I can go in and make changes on what I want to appear. In bold above you can see the 'nav' feature. If I want navigation buttons to appear on the Slideshow I can change it to "true" instead of "false" and they will appear.

In the area I want the slideshow to appear, I put this:

<div class="container">
<ul class="rslides">
  <li><img src="images/ash_1.jpg" alt=""></li>
  <li><img src="images/ash_2.jpg" alt=""></li>
  <li><img src="images/ash_3.jpg" alt=""></li>
<li><img src="images/ash_4.jpg" alt=""></li>
<li><img src="images/ash_5.jpg" alt=""></li>
<li><img src="images/ash_6.jpg" alt=""></li>
</ul>
</div>

This seems extremely simple, almost too simple to me. In bold above you can see "class="rslides". This relates to the next code, placed in the CSS, which tells the browser how to display that Class, as well as the script in the bottom of the body.

.rslides {
  position: relative;
  list-style: none;
  overflow: hidden;
  width: 100%;
  padding: 0;
  display: block;
  margin-right: auto;
  margin-left: auto;
  text-align: center;
  }

.rslides li {
  -webkit-backface-visibility: hidden;
  position: absolute;
  display: none;
  width: 100%;
  left: 0;
  top: 0;
  margin-right: auto;
  margin-left: auto;
  }

.rslides li:first-child {
  position: relative;
  display: block;
  float: left;
margin-right: auto;
  margin-left: auto;
  }

.rslides img {
  display: block;
  height: auto;
  float: left;
  width: 100%;
  border: 0;
margin-right: auto;
  margin-left: auto;
  }

In order to make sure my slideshow displays properly I had to make sure all of my images were the same dimensions (also, to make them smaller sizes and so they load quicker, exported and compressed for the web), and that they were in the 'images' folder, reference in the src code in the HTML.

Saturday, 31 May 2014

Embedding Videos

There are several videos in my iBook so I want to ensure that they're on my website too.

Initially, I tried to embed the videos into my site using the i-frame embed code that is supplied by YouTube. I followed this tutorial:


The problem that I had, though, was that it did not allow the videos to be Responsive. From here I decided to download the video so I had the physical file, place it into a "videos' folder in my source files and then use the <embed> tags in my code. By doing this I could then tag the embedded video to display at 100% and then place it within the skeleton framework, and I also had the ability to make a lot more adjustments than what I could with just the i-frame code. 

Example code of one of my embedded videos:

<div class="twelve columns video">
<video width="100%" controls> <source src="video/Geography_Lesson_ What_is_a_Volcano.mp4" type="video/mp4">
</video>
</div>

Thursday, 29 May 2014

Changed Navigation Layout

I have made the decision to change the main Navigation layout that displays when the site is being viewed from iPad landscape and up. I decided to do this due to the graphical style of my site - there are little 'real' images and my initial design focused on having a large slideshow that ran to the fold of the page. When I created this it did not look right, so I have adjusted the navigation so it appears as the following:


iPad Portrait

I have stuck with my previous decided navigation for the mobile version

Sunday, 25 May 2014

A Small Adjustment

A quick update on a small change I've made.

I've added in the 'titles' for each colour section on each of the pages. These were initially designed to look like this.
And that's fine, I've stuck with that design and I like it. When I added the graphics to the HTML and had a look at the end result, though, I noticed an issue. There was a bit of a clash with the layout.

Considering the pages on my website are going to be reasonably long, it's important for the user to be able to easily find out where they are on it. Hence the titles for each chapter that split it up and make each chapter further distinguishable (despite the obvious changes in colour...). To add to the ease of getting to places on the site I've also added a fixed home button, which displays in the top left hand corner no matter how far you are down the page. These are both good additions to the navigation of the page but they display on the page together like this...
They clash. It's okay that the home button sits above it - that's what I want it to do - but them being one on top of the other makes one less readable, doing nothing for my goal of creating a good and easy experience for the user. So, I've switched the subtitles to the other side.
Much better.

How is this aspect responsive? 
When the width of the site goes beneath 769px, this style of subtitle will disappear and text subtitles will replace it.

Above 960px
769px to 960px
470px to 769px
470px and below