Wednesday 11 June 2014

W3 Validation

As the last task, I used the W3 Validator to track down any errors that my HTML may have and correct them. I was shocked to see how many errors appeared when I pasted in my code from one of my pages - around 160. I worked through them, realising that half of my issue was that I'd completely forgotten that duplicating ID's was not idea, and I needed to change them to classes. So, I've been working through this, although it's not going to be possible for me to complete it all before the deadline!

Using TextWranglers 'find all' feature I've been changing errors across multiple .html files at the same time, as a lot of my errors are on every page as my content pages are duplicates of each other with different content on each.

I have managed to get, for example, Chapter Four down to 21 errors. That sounds like a lot, but it started at around 80 odd and I'm finding that by fixing some of the errors it ruins the functionality of the website and breaks things (such as the navigation). I understand that 21 is rather high, but if I had more time I would go through, 'break' the site by changing all of the errors and then work to fix it without producing so many errors! I've gone through and changed a lot of the issues as I said, with TextWrangler's 'find all' feature.
Errors in chapter_four.html

The majority of the work to fix a lot of the errors revolved around A: changing all fixable ID's to Class's and B: ensuring all images had "alt" values, so that is what I have done.
Also, there seemed to be a lot of stray </div> tags that were not closing any <div> tags. Some people were having issues with removing these, as it seemed removing them would present more errors but keeping them was an error itself, but I did not have that issue. I have gone through and removed all of these. They are probably down to cutting out/pasting in various code from page to page, stray </div> tags are bound to be dotted all over the place after a while.

Crit and Evaulation

Today I crit my site. I didn't crit my completely finished site as I am still having issues with the responsiveness of the home page. The feedback was good, though.

The main response was that people really liked my graphic style and my chosen colours as they complimented each other well and overall made for a good experience on the site. I was also told that the site really matches my iBook, so I am happy with this as that was one of my main goals and also a requirement of this project.

I also received some useful feedback on how I could improve the site. The four main points I received were:

  • The graphic in the main logo on the 480px + site has changed and they preferred the previous version.
  • The alignment of the text on some pages was a bit dodgy.
  • The sizing of the text on the home page could be looked at.
  • Further implementation of navigation would be useful - e.g. navigation made available when a user is halfway down a page. 
I agree with all of these points. Point 1: The graphic in the 480px + site. I decided to change this as I was having issues on how I could lay out the navigation so that it wouldn't take up the majority of the page. As I decided to drop the main featured slideshow from the home page it meant I could reduce the height of the navigation bar and had to rearrange the navigation buttons. In order to ensure the navigation didn't take up too much of the page, I cut the top of the volcano out of the graphic and stuck with just the outline of the volcano, no eruption. This wasn't the best decision that I made as that graphic was somewhat of a main feature in my iBook and I was hoping to integrate it more-so in the website. If I were to have more time I would find a way to implement it back into either the navigation or have it have a more obvious presence in the site.
 
Points 2 & 3: Text alignment and size issues. These are things that I am making changes to now. I am going to simplify the text throughout the entire site and have the majority of it the same to keep a sense of consistency. At the moment the home page text is actually smaller than the text on the internal pages, so this I need to fix by increasing the size of that text. I agree with the comments on the text alignment as it was not an aspect I took great care over. I am going back and fixing this, although if I were to do this project again I would take more care over it. When I did the magazine project I realised how important the alignment of text was for the experience the user had when interacting with your project, but I have unfortunately let that slide in this project.

Point 4: Further implementation. This is something that I would ideally like to do today, but I am still having issues with the responsiveness of the home page. If I can fix this I will then move onto adding more navigation options. I like the idea of having a floating navigation bar in the top right hand corner, or even a navigation bar attached to the right hand side of the page constantly. 

Overall, I think I've been relatively successful with this project. Its not been my favourite, but not my worst. There have been times where I've been so frustrated (like with the Responsive issues) and times where I've genuinely felt proud of the work I've managed to produce. Its a love-hate relationship.

Throughout this project it was inevitable that I was going to hugely develop my skills in the HTML and CSS areas as we were required to hand-code a lot of the site (with the help of the Skeleton framework). So, I would agree that I have greatly developed my skills in this area. There have been times where I've been totally lost and times where I've surprised myself at how fast I can type out a long list of CSS and there be no problems with it, recalling Tags and immediately understanding what the issue was when I had a problem. I do think I could have branched out and learnt a bit more, though. I uses JavaScript and jQuery, but I would have liked to used them more in order to implement even more interactive elements on my site. The main feature of the iBook was that it was interactive, and I feel that my site does not provide as much as half the amount of interactivity or engagement that the iBook does. 

Time Management. My Time Management has been okay. For the most part I have stuck to my schedule and I will be able to hand in. I do not think I factored in a large enough time for me to fix problems, though, as because I have had so many issues with the Responsiveness the home page I am having to leave out an entire Chapter. This is not ideal and greatly reduces the content on the site, but I would rather spend the last few hours trying as hard as possible to fix problems and have a site that is successfully responsive - the main aim of the brief. 

Tuesday 10 June 2014

Problems Making The Home Page Responsive.

Well, this has been fun. I am currently really struggling with making my home page responsive. The only versions that it displays as it should is the full size, 960px + version and the smallest mobile version.

Mobile 
960px + (desktop)

When I try to view the page at any point above 480px and below 960px, this is how it appears:
Not cool.

At the moment I am in the layout.css trying to figure out why these issues are happening. For some reason, telling the browser to hide e.g. the brown navigation ribbons between 480 and 960 makes them disappear above 960 too, even though I have specified that they be shown when the screen is about 960. 

What is making the task more complicated and stressful is that I want to switch out the images being displayed when the screen gets smaller. This means that when the screen is at 960 and above they are hidden and then anything below they should be shown (and the originals to be hidden). This has worked well on other pages but for some reason this just is not working on this page.

The only reasons I can think of why this isn't working is 1. I have a lot of margin-top margin-bottom settings which changes the position of an image on the page. This could be why (like above) the images are merging in together when the page gets smaller and the Skeleton Framework starts to stack and rearrange. The other issue could be that there's a major confusion in the layout.css for the media queries which tell the browser what to display and how to display it at each resolution. 

I will update when I (or if...) I have a solution.

Monday 9 June 2014

Accessibility

I have gone through and added "alt" (alternative) tags to my images so that if they cannot be loaded or a description of them is required, it is possible. Below are three examples, but I have done this as much as possible across the site.



I've also taken other provisions to ensure that my site is accessible. Any text that I have on the site can be read clearly due to the high contrast between the text and the background (e.g. white against a deep green/deep red) and the colours in general on the site are high contrasting, but not too much so.

As you can see from this screen cap (of my favourite part of my site!) all of the colours contrast each other well and most importantly, the text is readable. It is 'real' text (it's not an image) which helps if a user requires the computer to read out the text due to an impairment.

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

Saturday 24 May 2014

Navigation Issues

It was my aim when starting to build my website that I would build the frame of the entire site first and would then start to bring in content. This gives me a frame that I can reuse easily and quickly for every page. I'm at that point now, so I'm just going back and looking at the content within my iBook and finalising how I can divide it all up/what pages I need etc.

In my iBook (what this website is based off) I have 4 chapters. Within each of those there are sections , and within those are pages (describing each section). My original plan for this site involved creating 11 pages (a page per section). However, on my home page I planned on having the main navigation links (under the main logo) not to link to any internal pages but to link to different places on the same page. This has left me with an issue that's been at the back of my mind the entire time I've been building this site - how do people link to the internal pages? Initially the plan was to have links within the text on the home page that links to them. However, I want to make the website as easy to use as possible, so why would I introduce another step in a users journey to finding the information they need?

Ideally, the links at the top of the page in the main navigation should link to the equivalent chapter pages within the website as that's generally what a user expects to happen when they click to them. To me it seems unnatural for them to attempt to navigate to information and for them to essentially only be taken half way there.

I do not want to introduce drop down menus into my navigation, it just does not seem necessary. Besides, I already have a nicely designed way of arranging information on the page - the 'tabbed', different coloured sections on the page.

I have spoken with a few peers about this and how they think I should arrange information and the general consensus seems to be reduce the amount of pages. There are already several pages within each section that I have merged together simply because standing on their own does not really equate to enough information on one page.

Plan:
-  Main navigation links (below logo) will link to each chapter page.
-  Each chapter page (e.g. "What is a Volcano?") will be split up in similar fashion to the home page, with each section being a different colour.
-  The sections on the home page will contain a summary of each question answered in that chapter, as well as images and some "did you know" facts. There will be links here to navigate to the internal pages too.
-  The sections on the home page will not be 'required reading' but it shall be made clear that they are there (they are tucked beneath the fold of the page so aren't necessarily immediately obvious). They should be thought of as 'teasers' as to what can be discovered within the website. They will also contain links to certain pages and areas within those pages.

Friday 23 May 2014

The Frame: It's Finally Finished!

I've finished the frame of the site. It's now just a case of putting in the content. You'll see that I haven't put in the image slideshow yet - that's something I'm going to come back to! This is the frame that shall be used for the whole site.
Building this has been a lot more difficult than I anticipated! But, I've learnt a lot and it was good for me to do this now and get the hard part over with. 

Thursday 22 May 2014

Todays Progress: Internal Links, Content Spaces and Making My Life Easier

Today has been another good day of developments on my site. Mainly I've been working on creating the colour content sections that appear below the main, central banner.
I had a few issues when creating this.

I keep forgetting to close the <div> tags.
No doubt, one of the most common issues I've had with simply building this site in general is my habit of making typing errors, constantly. For this, though, I've found Google Chrome's Developer Options very useful.

When trying to create an entirely new container (below my existing one) to start framing out each content section I was having problems with it actually appearing where it was supposed to, and myself and several classmates just could not work it out. All of my tags were correct, I'd used the correct CSS where applicable, my 'classes' seemed okay and the HTML (for the new container) was entirely correct too. This was frustrating and I honestly thought it was just a case of the browser/html file itself getting confused and "perhaps if I just leave it, it will work itself out!".

I opened up the Chrome Developer options to view the code from a different perspective and use their 'find' options to hover over my site.

Thinking I'd be greeted with two containers in the code - my existing container and the new ones I was trying to create, I instead saw this:
Just one container.

Turns out I'd forgot to end 5 <div> tags. Therefore I hadn't actually closed my previous container and was just adding things inside it and not realised.
As you can see in the code above, none of those <div> tags I had opened for each Box (e.g. 'box four') did I actually close. Smart. 

Closing all of the tags fixed my problem, resulting in a new separate container and completely solving my problem.

Solving this has allowed me to create the 4 content sections on my one long home page. I am yet to add the 'arrows' that divide each section, but have inserted the two columns I need in each (as defined in my plan) and inserted some text just to pad it out and get the gist of where all my content will be.

Once I'd done this, I started to add the internal links. The idea is that the user clicks on the links in the navigation bar at the top and is skipped to the appropriate area on the page. This was a lot simpler than I anticipated. All I did was give each section (chapter 1: yellow etc) an ID (which they had already) and each button in the navigation put that id for the href="ID". This does not include any animation (e.g.  a smooth scroll) so for now this is a quick fix that works. I'd like to look into implementing a more slick, smooth motion. 

Making My Life Easier
Even though it's just a small point, I just wanted to mention what I've been doing in my code to ensure that I don't get lost in it. I am in no way an expert when it comes to HTML/any web language, so this has helped to make sure everything is spelled out to me and I know where I am - comments. 

<!--- <insert comment here> -->

I've used comments everywhere in my code to create little headings and subheadings that divide it all up into specific sections. This way, if I need to change something in the navigation bar I do not need to read all of the code to try and find it, I just have to look for the comment. Something small, and certainly not a new discovery (and not even the most appropriate use of the feature), but it's helped me hugely.

(comments in green)

Wednesday 21 May 2014

Media Queries and Design Adjustments

Tonight I started working on Media Queries.

Even though we are required to use the Skeleton Framework for our website, a large proportion on whether or not our site is responsive is dependant on 'media queries'. I've never, ever worked with them before, but I got a general gist of the idea of them in class through listening to other people.

I understood that in a way it is applying CSS to certain elements at certain points depending on the size of the page. In the basic index.html we were given to work off of a layout.css file was attached, with the following in:

/* Smaller than standard 960 (devices and browsers) */
@media only screen and (max-width: 959px) {}

/* Tablet Portrait size to standard 960 (devices and browsers) */
@media only screen and (min-width: 768px) and (max-width: 959px) {}

/* All Mobile Sizes (devices and browser) */
@media only screen and (max-width: 767px) {}

/* Mobile Landscape Size to Tablet Portrait (devices and browsers) */
@media only screen and (min-width: 480px) and (max-width: 767px) {}

/* Mobile Portrait Size to Mobile Landscape Size (devices and browsers) */
@media only screen and (max-width: 479px) {}

From what I understood from here I gathered that within each { } I would put the information for how I'd like an element to display at each point. To gain a further understanding I watched this video:

To explain my new-found understanding!

@media only screen and (min-width: 480px) and (max-width: 767px) {}

'only screen': 'screen' is a media type. Other media types include: print, handheld devices, TV's and projectors. My code defines that this media query is only for screens.

min-width/max-width: This is a media-feature. It does not have to be a 'max' height or width, it can simply be width or height, as well as elements such as colour. 

max - upperbound
min - lower bound

{} : This is where you write your CSS that defines what each element should display like (or if they display at all) at each breakpoint.

Breakpoint: Where a new style kicks in. 

Getting to grips with this inspired me to do something a bit more complex for my site. I started to consider how I could simply my design for when it hit the mobile version - the smallest width. Looking at my existing design, I noticed how cluttered it was. Quite a prominent aspect of the desktop version is the slideshow just under the navigation bar. It is not an element of my site that is 100% necessary - it's there partly for aesthetic benefits. Because of this I came to the conclusion that for the mobile version of the site it was disposable. Removing this slideshow allowed me to trim the length of the (already rather long) central banner. 
Left: Original Banner
Right: New Banner

Implementing this has made me make use of what's now a very useful selection of code:

display: none;
Tells the browser not to display an element (if the page is at a certain size)

display: inherit !important;
Tells the browser to 'inherit' this element and display it. I used this to essentially exchange out the original banner with the new banner.

Combining this with my navigation for the mobile device, my site now displays like this (on mobile). 

You can also see above that I've made the decision to change the colour of my home button to a grey that fits in with the colour scheme (the same grey was used in my iBook). 

I decided to change the colour from red to grey as my chosen red was the exact same red that is featured very heavily in the main, central banner. As you can see above, I have coded the media queries to position the home button halfway over the top of banner when in the mobile state, so having the button and the banner the same colour just did not look good.

New Buttons:
I've kept the same principle of having an over (left) and up (right) state to give a little boost to the users experience.

Monday 19 May 2014

Navigation Adjustments

Now I'm back from Barcelona I've hit it hard on the physical development of my site, and the first task to accomplish was creating the navigation system. This has to be robust and work efficiently and it's something that in my case can, if I'm not careful, become very complex. 

This was my initial proposed Navigation bar.
Where it says "option 1" "option 2" etc is each of the buttons that would be used for the navigation of the site. They do not have drop-down menus attached to them but will link to the appropriate area of the page that speaks about that category (they will have appropriate names).

2 issues:

1: The central banner is very reliant on size and proportion, and very little room is left for slightly longer Chapter names for each button. On the mobile version of the site these buttons will appear tiny, too. 

2: I had zero clue on how I would build this. I had designed in (purely for aesthetic reason) a dark grey 'ribbon' that runs behind them all, and I'd no idea on how to execute this. The design was more complex than necessary.

I referred back to some original designs and saw a sketch I had made where there were two rows of buttons with two buttons on each. I liked this as it allowed me to have a bit more room to include a longer title for each chapter but didn't mean that the navigation bar took up too much space. A major worry of mine was having to stack each navigation button one on top of the other. The central banner already meets the fold of the page and is very long, the last thing I wanted was to make it even longer.
You can see how I have changed the navigation bar above. This is not a final design (I haven't added any text at all) and I am still trying to finalise the actual style of it. I'm considering removing the 'backs' of the ribbons as they are so tricky to line up with the central ribbon itself. 

As I said above, I was reluctant to change the navigation boxes so that they stacked one on top of the other. Considering the mobile site, though, the buttons are going to need to be as big and as clear and easy to use as possible. If you consider the size of an iPhone screen, the buttons above (2 on one row) are not really quite big enough to enable easy use. The design of the mobile version of the navigation bar has allowed the buttons to stack one on top of the other to ensure ease of use. The buttons still have an 'over' state of changing to yellow. (Whilst on mobile, this does not apply, it's essentially a 'down' state).

Thursday 15 May 2014

Barcelona: Travelling, Hunting for Food and OFFF Day 1

We're in Barcelona! We're here visiting the OFFF Festival for Graphic Design and arrived on Tuesday, but heres a summary of what we've got up to so far!

Tuesday 13th May
On Tuesday we all met at Gatwick Airport and got on the 11am flight straight to Barcelona! The flight was quick and easy, although the trip over wasn't exactly free of complications. All of us took pictures and videos on the way, which we want to feature in a short little film about the trip.
Once we'd checked into the hotel (which is really nice, despite the slightly dodgy WiFi) all of us students decided to go on a search for food in the evening. Well, that was interesting. We walked...and we walked...and we walked for what felt like miles. We got lost. Thinking about it, though, it was probably one of the best ways we could have introduced ourselves to the city. After walking for around 1.5 hours we came across the Hard Rock Cafe (at about 9pm) and thought "great! We'll eat here!", thinking it would be a brilliant experience. We were told to come back in an hour and a half, so we did, and then waited another 30 minutes inside. 11pm. None of us thought to check the menu and look at the prices until this point. €28 for a burger?! No thanks. McDonalds it was.

Quick point: To defend our complete lack of common sense and us not even bothering to check the menu prices of one of the most popular restaurant/brands in the world (Hard Rock) - We are a group of designers! We walked in and were all amazed at the decor of the place! Who's going to check the menu when you're in such an awesomely designed place?!
Despite this, we had a brilliant time together and 'wandering' around Barcelona -  what an experience!

Wednesday 14th May
The plans for Wednesday involved the beach, a cable car across the city, picking up our tickets for OFFF, a wander through Las Ramblas & Barcelona old town and a meal together. All of this went well, here are a few pictures of the day.
Thursday 15th May
Today was Day 1 of OFFF! Aside from the immensely uncomfortable chairs in the main room I had a brilliant time. I sat through the talks of Lorem Ipsum, Laurent Paul Robert and Seb Lester.

I, and pretty much the entire group, was amazed by Seb Lester. He's a typographer who is from Lewes (!!), right next to our college. In particular his calligraphy was brilliant and it was so interesting to hear about the success he has had in the typography field. As well as that, he came across as a lovely, genuine person who absolutely adores the work he does and I left feeling very inspired (and wishing I had just half the talent he does when it comes down to typography...). Seb was definitely my favourite speaker from the day; I now follow him on Instagram and Twitter.

Overall, a great first day at OFFF. I bought some playing cards, each of which in the 54 card set has been individually designed by 54 different artists. I collect playing cards as well. 
After OFFF, we took a trip to the Cathedral. Wow. Absolutely beautiful. It was inspiring to see a building so intricately designed - "crafted". In particular I loved the stained class windows and the colours that it casted throughout the building. 

Sunday 11 May 2014

Using JavaScript To Create Buttons

I wanted to make a quick blog post on how I've used JavaScript to create the rollover effects for the buttons in my navigation. The very first button I tried to create for my website was the home button. This is because logically, it comes first (it's in the top left). If you remember from my previous post about my home button I've decided to go with the following style for it.
This required me to have a rollover effect applied, so that when a mouse hit the 'up' image it swapped to the over image. I was having a lot of trouble with it - an unexpected, discouraging amount of trouble considering it was the very first thing I attempted. That was until I saw the following video, shared with me by a friend.
I followed this video to a tee, and it worked.

Following this video has given me a better understanding of how I can use JavaScript as before I'd never used it and never really understood what it was for. I've learnt how I can put code into the <head> of the document as a <script> which can then be referenced in the <body>. This is the code that I put into the <head> of my websites HTML.

<head>
<script type="text/javascript">
<!-- Home Button -->

function imgOver(id) {
document.getElementById(id).src="./graphics/home_grey_over.png";
}
function imgOut(id) {
document.getElementById(id).src="./graphics/home_grey_up.png";
}

</script>
</head>

The only "issue" with this technique is that I have to think of a unique way of saying 'over' and 'out; each time I use it for a different button. You can see in the example above I have 'imgOver' and 'imgOut'. If I wanted to use this again for another button I'd have to copy and paste the code over, change the src images and use alternative words - like 'imgOn' and 'imgOff'.

The above code is what goes in the <head> section of my html. There is another part that must go in the <body> section:

<div class="one-third column">
<a href="index.html" onmouseover="imgOver('homeButton');" onmouseout="imgOut('homeButton');">
<img src="graphics/home_grey_up.png" width="85px" height="auto" alt="home" id="homeButton" /> 
</a>
</div>

There are certain parts of this code that I can explain to show how it links with the script in the <head> and creates a image swap link.

a href: the link that the button leads to. In this case it is a home button, so it's destination is 'index.html' - the name of the home page.
onmouseover="imgOver": the words 'onmouseover' are recognised as a command, with 'imgOver' being in the script in the <head>. When a mouse is over the image, the browser should refer to the 'imgOver' code in the <head> which tells it which image to display/swap to.
onmouseout="imgOut": when the mouse is not over/on the image, the browser should display the image that is referred to under the 'imgOut' command in the script.

All of this code has resulted in creating a home button that has a rollover/image swap effect that also works as a link. I'll be using this for every image button that I create.

Friday 9 May 2014

Building a Website: What do I already know?

As I'm going to be 'hand-coding' an entire website out of HTML/CSS/other various web languages - well, with help from the Skeleton Framework - I figured I'd write out everything that I already know about building websites. This gives me a good idea of where I'm already at and I can identify areas which are going to be 'easy' (I use that term loosely...) for me to build and areas where I'm going to have to delve into some research.

These are also things that I've picked up in our classes at University.

3 basic categories to web pages:
- Structure (HTML etc)
- Style (CSS, CSS3 etc. CSS effects what your content "looks like")
- Interactivity(CSS, jQuery)

Elements
<p) opening tag
</p> closing tag

Anything that has a 'tag' is an element, of which there are only two types.

Type 1: Block Level Element
Aside from 'anchor', 'image' and 'span', every element is a block level element, that is transparent and invisible on it's own.

  • 100% width
    • Full width of the page or the full width of what it's inside
    • Always 100% wide, even if you define the pixels to be shown (e.g. 300px). This means it always owns the entire width of the page and the height that is explicitly defined by the content. As a result, Block Level elements stack and cannot generally be placed side by side.
  • 0 height
    • Cannot be seen, is invisible
    • It's height is defined by its content

You can add margins, padding, borders etc*

Type 2: Inline Elements
Inline images sit next to each other until you run out of space, and then will move to the next line. You cannot give inline elements padding, margin or a border.

*Margins, Padding & Borders

Padding: If you put text inside a box and you don't want it to hit the edges, you put padding to stop it doing so.
Border: The space around the padding
Margin: Empty space to give breathing room.
When adding padding etc you are increasing the defined width of the element. If you have coded the element to be 200px but then add padding etc, the element side increases. A tool such as BorderBox can help with this - includes the padding and the border in the overall size, leaves the Margin as additional.  

A HTML Page
Everything in a HTML page is wrapped in opening and closing <html> </html> tags. Within that there is;
<head>
</head>
<body>
</body>

Everything in a HTML page is wrapped in opening and closing <html> </html> tags.
Within that there is;
<head>
<link-to-css> (this then links the browser to the appropriate CSS stylesheets)
</head> (the browser leaves the 'head' with all the information required to read the rest of the document)
<body>
<insert-content-here>
</body>
Elements naturally want to get to point 0, 0 - the top left hand corner, as long as nothing is in the way. But as they stack, they will appear one by one in the order that they read in the code. This can come in handy as if you want your elements to appear in a certain order, you just code them in that order.

Wednesday 7 May 2014

Making Some Changes

There was one particular change that I wanted to make in my design as well as an additional one suggested in the pitch I did yesterday. These were the design of the home button and the direction/shape of the arrows that divide each 'section' on the main home page.

Home Button
I want to feature the home button separate from the main central ribbon, but have it float just like the navigation bar does and have it 'stick' to the top of the page. My initial design of it was pretty boring and not interesting.
There's not really much well considered design that comes into that...so I decided to do a bit more work on it so it doesn't look like so much of an after thought. 
All of these match the design style of my website, and enable me to have the ribbon coming out of the edge of the page, making them a good design to make 'sticky' at the top of the page. 

I am leaning more towards the 3rd, right hand side version. I like how the I've made the corner flick up, and as I'm writing this it's given me an idea!
Have the corner flick up as the mouse hovers over it. I don't really like the idea of having a change of colour in it's 'down' state, so I'm thinking of keeping the over state for the down state too. 

I've also now decided to move the home button to the top left of the screen rather than the top right, as it feels like a more natural place for it to sit. 
Page Dividers
A suggestion in my pitch was to change the direction or shape of the page dividers - which happen to be in likeness to an arrow. The design of these was not initially meant to represent arrows, but they are obviously in a similar shape to them.. The worry was that the fact that they are pointing upwards counteracts my want to provoke the users scrolling down the page, so the suggestion was to turn the arrows around or change the shape.

The first change was the shape.  In these examples I have changed the shape to match the outline of the volcano that is featured in the logo.

In this example I have changed the arrows to point down. I do not like it!
I do not like it as it seems to protrude a lot into the section rather than out of it. A point made my tutor has made me lean back towards my initial design of having the arrows point up. It makes each section appear like a tab in a folder and is something that is quite prominent on the web today.