4 May 2016

Which Waste Item are You? - Adventures in Javascript

I'm really interested in the 'quiz trend'. I remember being 12 and taking a number of quizes that would purportedly tell me "Which character from your favourite TV show are you?" or "What percent elf are you?" or "What were you in your past life?". Buzzfeed is now king of the quizzes. You can find out basically anything about yourself in the buzzfeed quiz section.

Sidenote: I read a theory somewhere that this obsession with quizzes is to do with population growth. Ie. Back when you were the only baker in the village you knew who you were and how you were different to everyone else. Now you have to differ yourself from the rest of the planet by placing yourself into the middle of a venn-diagram that you make smaller and smaller through quizzes.


Sidenote 2: I'm Saturn.

So - I thought the TaxPayers' Alliance could really benefit from one of these. Because everyone likes personality quizzes. So here it is!

This was a lot of fun to puzzle through! It took me a couple of days to write the content, figure out the personalities and what 'IT waste' should have in its wallet. Then I added the images and css because that's the fun part.
// Onclick disable future clicks and increment variables
  $('input').click(function() {
    if ($(this).parents('label').siblings('label').hasClass('finished')) {
    } else {
      $(this).parents('label').siblings('label').addClass('finished').css({'opacity':'0.6', 'cursor':'default'});
      if ($(this).hasClass('alpha')) {
        answersArray[0]++;
      } else if ($(this).hasClass('bravo')) {
        answersArray[1]++;
      } else if ($(this).hasClass('charlie')) {
        answersArray[2]++;
      } else if ($(this).hasClass('delta')) {
        answersArray[3]++;
      } else if ($(this).hasClass('echo')) {
        answersArray[4]++;
      } else if ($(this).hasClass('foxtrot')) {
        answersArray[5]++;
      }; 
      total ++;
    };

That was the fairly straightforward part. The rest is guessable but it took me a while to puzzle-through. I tried a few different solutions before deciding to use an array. If you pick the answer that corresponds to Personality 1 that will increment array value 1. At the end of the questions the position of the highest value in the array is returned and matched to a Personality Index.

So at the end of the questions you may have returned: 3 'Personality 1' answers; 2 'Personality 2' answers; 1 'Personality 3' answers.
In that case the array will be [3,2,1] and the index number returned will be 0. This is then re-matched to 'Personality 1' and that will be your result.

Pretty simple. But what about when the array is [2,2,2]?

I looked at how Buzzfeed did their quizzes and realised that when there was a clash Buzzfeed was just choosing the one at the end of the array whereas I wanted the choice to be randomised between the clashes.

After much experimenting the way I solved this is rather long-winded.

//Figure out personality index
  var finalResult = function() {
    
    //Give the position of the number in the array that has the greatest value
    var finalAnswer = answersArray.indexOf(Math.max.apply(Math,answersArray));
    var finalAnswerValue = answersArray[finalAnswer];
    var compareArray = []; 
    
    
    //Push the index of items in answersArray that == the maximum points number
    for (var i = 0; i < answersArray.length; i++) {
      if (finalAnswerValue == answersArray[i]) {
        compareArray.push(i);
      }
    }
    
    // If there is nothing in the compare array go with the original answer if not select a random value from the compareArray
    if (compareArray.length === 0) {
      personalityIndex = finalAnswer;
    } else {
      personalityIndex = compareArray[Math.floor(Math.random() * compareArray.length)];
    }
  };
After searching for the highest number in the array and pushing that to a variable.
Another function then searches the array again for that value. The index number of that value is then pushed to a new array. If the new array only has 1 value in it then that 1 value is used as ther personality. If not then a random value is then selected from the new array!

26 April 2016

Business in Japan - Cultural Lessons

The March edition of More Magazine had an interesting feature on 'high status' vs 'low status' etiquette in an office environment. Most of it I'd heard before (give and receive a business card with two hands, always allow someone to introduce you etc) but I found this set of diagrams interesting:


It shows where to stand / sit in different situations. The high-status position is marked with a (1), number (2) is second-highest-status etc.

In summary the person furthest away from the entrance (入口 / 出口) is highest in status and the person furthest away is lowest. If you're ever attending a meeting in Japan remembering that will probably be enough but here are some other nuances:

  • In the top left diagram position number 5 is furthest away from the table as well as closest to the entrance.
  • In the top middle diagram position number 4 is closest to the lift/elevator buttons.
  • In the diagram on the right position number 4 is riding in the front of the taxi with the driver. As people drive on the left in Japan person 1 would either get into the taxi first or have their own door to enter with.


And that's about it. I haven't bothered translating all of it as it's mostly about entrances and exits but I hope that was useful to you!

10 April 2016

Email redesign

Our weekly email was not displaying well across email clients - so I decided to redesign the whole email template. I've been doing research on layouts for a few months at that point - when I got an email that I thought was clear I would sketch a quick boxy-wireframe of the email message and stick it in a folder.

But when I finally got the go ahead on the redesign it turned out other people really liked the current design so all my plans were foiled.

I read a lot of documentation about designing for email (mostly using the Litmus Blog) and relearnt html tables. In the end it was really satisfying looking at all the nested tables - in the end even with our reasonably simple template we ended up with 13 tables. And then I transferred my template to MailChimp. It's actually easy to make an area editable in MailChimp - you just wrap the bit you want to be editible in a
. There are other things you have to do which MailChimp have listed.


My first design. Different tables are highlighted in different colours
I did miss a few things. That's my fault because I did a lot of research on what's popular in email design and the problems that our users were having but when I decided to remake the current template rather than design a new one I didn't spend enough time looking at the old templates. For example I used #color1 rather than #color2 for the links which I had to go back and fix.

But the new template seems to be working. All the images that were reused (such as the header and social links) have been updated and resized, everything is nested properly and W3 compliant. The colour palette was reduced so everything looks a lot more simple now. More importantly I stripped out lines and lines of header css and moved them inline. The only css in the head now is the link color, image display and some @media queries (which mobiles apparently read but desktop clients don't).

Here's the head of the old template -  see the full email

Here's the head of the new template -  see the full email

To be honest it's a lot more blocky now - I can't really explain it but I assume it's because the width is very fixed. There was also a lot of white space at the bottom of the email so I moved things around to get rid of that scrolling space that I don't think anybody was scrolling through - it was pretty obvious that the email had finished by then so items like our social links and the 'donate' button weren't getting seen.

Designing for email was pretty fun in the end! Once I got into the nested tables drama I found it really satisfying. I didn't have to use a clearfix anywhere! But unfortunately that's the end of that project and now I'm back to working with floats....


2 April 2016

Wireframing is fun!

Even though I haven't done any real training on it I really like wireframing. I liked reading through Google's Material Design principles and figuring out which user interactions would make the most sense.

I wireframe things for fun all the time - it helps me think about the composition and the parts of what I'm doing - but this was my first time using an editor to make it look neat.

I used NinjaMock because I'd heard of it before and it's free for personal use. It took a little getting used to though. At one point I lost all my work because I wanted to add my own assets and then found out you needed an account to add your own assets. But once I was faced with a blank screen again it was very easy to recreate what I had before now that I knew where to go for what I wanted (only having 3 views helps).

I think there was a way to show the interactions using NinjaMock but that was beyond what I needed - I just wanted to show people something that wasn't my notebook.

Original thought process and sketching

View 0 - Home screen

View 1 - Slightly different from the way I sketched it because I talked through the data-structure with the data architect

View 2 - I'm a little worried I'll create something that doesn't work but has really awesome animations



23 March 2016

Basics of social media

Koro Sensei isn't around right now - so you have to learn from me!
I helped put together a presentation introducing other campaign groups to social media. I've removed all TaxPayers' Alliance stats and replaced them with my own, as well as cut down on the number of slides - deleting half of the example slides and the 'how to access these tools' slides.
If you can't see the deck below you can find my SlideShare here. This is the first time I've used SlideShare so let me know if I've done something odd.

9 November 2015

Redcar doesn’t want to lose jobs - but neither does China

Blog for The TaxPayers' Alliance! I've copied the first part here but you can find the full blog here and it was also published in the Yorkshire post here!

------------------------------------

First Redcar and then Tata Steel announced further job cuts in the steel industry. Exactly what is going on and is there a case for the government to intervene using taxpayer cash to prop up the current price of steel or bail out the suffering plants to protect British jobs?

The Steel Industry in the UK

A large motivating factor in the outcry is that the jobs under threat are of national historic importance to the country. During the industrial revolution producing steel was of national importance in order to grow the railways, build machinery and expand.

By 1870 Britain produced 60 times more steel than it had in 1800 and in 1875 Britain produced 40 per cent of the world’s steel. But by 1896, only 20 years later, Britain’s share in the world steel market dropped to 20 per cent. The industrial expansion slowed and so did production of steel.

Then in the post war period the steel industry went through a lot of uncertainty as successive governments nationalised, privatised and re-nationalised the industry. Conflicted objectives and a lack of innovation meant the industry wasn’t free to develop and grow as it liked due to the uncertain climate.

Steel production volume continued to fall and so did exports. Currently Germany ranks 7th in the world for total output, making it the biggest producer in the EU, with Britain ranking as 18th.


2 July 2015

Writing a blog post


So, here's another very quick guide that I wrote for the TPA to accompany my SEO one. Again, I'm not actually an expert by any stretch of the imagination so if you actually want to learn about these things I suggest you use Google. However, here's some basic things that you should keep in mind when writing a blog.


Hey guys, a lot of you seem unsure about how to write a blog? Or your blogs seem more like essays than blogs so here are some general things to keep in mind

Writing a blog with Yui from K-On!


Audience and purpose: Always keep your audience in mind. How much do they know about the subject? If you're unsure, assume an intelligent reader with no prior knowledge of the subject at hand. That means explaining any acronyms, using shorter, clearer sentences and telling a story rather than presenting an argument.

Tone: Conversational and simple. As if you were explaining a concept to a friend of a friend.

Content: Again, keep it simple but interesting. Don't get bogged down by the nuances of the story. Link to a source on another site if you need to. As a guideline length should be around 500 -750 words.

Images: Only use them if they contribute something to the experience of the reader rather than from decoration. In this case centre them on a new line rather than wrapping the text around the image. Make sure you give a detailed descriptions in the image tag.

Example: I quite like Mana's blogs Manchester's £3.5 million black blob of glass and Taxpayers to pay hundreds... so Councillors can learn how to run the Council.