Posts Tagged ‘Web 2.0’

The Definitive Modal Layer

For the last couple of years we’ve been using modal layers where it made sense, basically most places where we would’ve used pop-ups in the old days, i.e. modal layer is to Web 2.0 what the pop-up was previously. But all the while I never felt like I was able able to lock down any solid way of doing this. Every time the issue came up I’d re-visit the functionality, never overjoyed with my latest implementation, so I never came up with a final solution. Depending on the website I was working with and the libraries they were already using I’d sometimes use Prototype or YUI, or if it was a good fit I’d implement a pre-built lightbox gallery, or even just code up something quick and simple from scratch.

And it’s not just me, I’ve noticed throughout the web bad implementations of this technology. I won’t get specific with names but I’ve seen some funky stuff even on well-known popular sites when it comes to the modal layer. Typical issues I’ll see is where the grayed out background doesn’t fill the whole screen, or it fills too much of the screen and triggers scrollbars, or if the page is really long you can still scroll and the modal layer isn’t sticky and you can lose where it’s at.

So the solution sort of hit me when I was having trouble graying out the background – when calculating the width some browsers include the vertical scrollbar in the result where as other browsers don’t, so in some cases it was overflowing and actualy creating a horizontal scrollbar.  This is not surprising as we have made a career out of fighting the various browser discrepancies and it would be normal to have multiple javascript conditions to query the user agent and modify the width accordingly.  But as I started to write those conditionals I watched my nice simple code quickly get complex and it suddenly hit me – why have the horizontal scrollbar at all?  Really it was that simple.  Good UI design dictates that if the modal content is bigger than the screen space available then a modal box is not the right approach, at which point the content does in fact require its own page (or dare I say a popup), or in cases where it is acceptable for the modal content to be bigger than the screen space available then the modal box itself should have the scrollbars.  So why even have it?  There’s no reason, and I would even go as far as saying that if there is no reason for having it then it is better UI design to actually remove it.

Okay so here’s the code, I used jQuery but it would be simple to convert it to any library or even make it stand alone:

//Create Modal Layer
modalLayer = document.createElement("div");
modalLayer.setAttribute("id","modalLayer");
var cssObj = {
	'background' : 'url(img/gray_opacity_80_percent.png)',
	'height' : '100%',
	'width' : '100%',
	'margin' : '0 auto',
	'padding-top' : '25px',
	'text-align' : 'center',
	'position' : 'absolute',
	'top' : '0px',
	'left' : '0px',
	'z-index' : '1000',
	'display' : 'none'
}
$(modalLayer).css(cssObj);
modalLayer.innerHTML="<div id='modalBox'>Modal Content</div>";
$("#page").after(modalLayer); //insert after a valid page object

function showModalLayer(){
	$('body').css('overflow','hidden'); //disable browser scrollbars
	$("#modalLayer").css("top",$('body').scrollTop()); //move modal layer to scroll position
	$("#modalLayer").css("display","block"); //display modal layer
}

function hideModalLayer(){
	$('body').css("overflow","visible"); //enable browser scrollbars
	$("#modalLayer").css("display","none"); //hide modal layer
}

An example of where I’ve used this code is on the CCS donation page, but it’s not that great of an example because the page content isn’t long enough to trigger scrollbars.

Friday, October 16th, 2009

Running jQuery alongside MooTools

For my latest project I was given the fun task of having to build a microsite modal layer for a third party website that I had no access to, not even to a dev environment.  I figured the best way to do it would be to do everything in a JS file that would inject all the html and such, so there’d no need for the mess of sending over instructions to add multiple chunks of html/css/js into various spots on the page, just the one JS call.  And jQuery was perfect for this, so I set on my merry way and coded the whole thing into a nice neat JS file, had it all working great locally, and sent it over to the clients hosting company with the simple instructions of just calling in the two JS files (the jQuery JS file and the one I’d written) into their page.  Of course rookie mistake number one – they were already using MooTools in their site, and the syntax of the jQuery and MooTools libraries totally clash.

I have no problem using MooTools and it wasn’t a lot of code so I downloaded the latest version and adjusted the syntax to match that of the MooTools library.  Of course that was rookie mistake number two – when I was done and it was all working again I remembered to check their version and it was then that I realized that they are using a fairly old version of MooTools, and the syntax was all different and I couldn’t find decent documentation to switch it out.  Of course I probably could’ve worked it out but my code was going backwards – I was all proud of my nice clean jQuery, and then it became MooTools which was okay, but now it was some funky old version of MooTools.  So I decided to switch gears and figure out how to run the two alongside eachother.

It didn’t take me long, jQuery is badass and they’ve thought of everything, there is a built-in way to run it alongside other libraries that use the same $() syntax (Prototype is another library that I can think of as well as MooTools that has this same syntax).  So consider the following:

<html>
  <head>
    <script src="mootools.js"></script>
    <script src="jquery.js"></script>
    <script>
      //mootools document ready function
      window.addEvent('domready',function() {
        //disable classic jQuery
        jQuery.noConflict();

        //do something with jQuery
        alert(jQuery(document).height());

        //do something with MooTools
        alert($(document).getSize().y);
      }
     </script>
  </head>
  <body></body>
</html>

As you can see once you run jQuery.noConflict() you can still use $() for MooTools but for jQuery you use jQuery() instead. Pretty cool huh?

That’s basically it but there are a couple more tricks. For example if you load in the jQuery library before the MooTools library apparently there’s no need to call the jQuery.noConflict() method. And also you could assign jQuery.noConflict() to a short variable name for less code. Read more here.

Tuesday, September 1st, 2009

Video Slideshows With Animoto

Researching for a client recently I came across a neat little service called Animoto. The problem we had was needing a photo gallery that lives on a single page. Not a huge problem in itself and any of these would work, or numerous others I’ve worked with or built over the years. But the issue here is the CMS we have to work with doesn’t have the ability to upload media, this has to be done separately via FTP, so it’s a messy process and not ideal to leave in the hands of the account team. So I figured the best option would be to find some third party service that we could embed, the files would live on a remote host and eliminate the need to upload files to our server. So naturally I thought Flash would be a good fit for this and pretty quickly found myself at Animoto.

Dubbed “The end of slideshows” Animoto is a very tidy web application that instantly creates fun little video slideshows of a photo gallery. It is very clean and easy-to-use, comprising of two simple steps – upload images and pick a background song (you can pick from a simple selection of provided songs or upload your own), and a then just wait out a few minutes of rendering time. Within minutes I’d created a neat little video slideshow of my boy, shown above. It’s free to create a short 30 second video (12-15 photos recommended), and $3 to create a full length video or $30 for an unlimited amount for a full year and for $5 per video you can download it DVD quality. There’s also a professional license for $249 per year which gives you everything included at no extra charge as well as allowing a call-to-action button, white labeling the video, free commercially licensed music, and of course all the videos you make are approved for commercial use.

And once you’ve created the video it’s available to post to any social media (using Clearspring) or embed in your blog. And you can create a remix, which can be a one-click automatic process, or you can edit the remix – revolving images, adding text, spotlighting, as well as adding or deleting images. This is the one-click remix I made of the above video:

It wasn’t the ideal product for us to use for this particular project, but I was very impressed with the concept and the execution and it’s something I will be keeping in mind for the future. For personal use I think I could have a lot of fun with it – converting family photo albums, and work party or street barbecue photo mashups, and the fact it comes as an iPhone app and I can instantly create the videos from my photo reel on-the-go, as well I have all the ones I’ve previously created with me at all times, is pretty awesome.

Thursday, June 18th, 2009

Flash Windowless Mode (wmode)

Just over a year ago when we were done ideating the “nextgen” Ford vehicles site and moved into prototyping and early production I put this document together. Disabling wmode had long been the practice of my company and being on the team charged with developing the next generation site we felt that enabling it was a compulsory step to stay competitive with our websites moving forward. It stemmed from a discussion with our multimedia team, I can’t remember now the exact words they used but according to them the whole idea of wmode was a bad hack by the Flash development team many years ago and it was the industry practice to never used it. Until then the Ford site had been a pure Flash site so the issue had never seriously arisen, but our whole strategy moving forward was for the site to be pure HTML (with Flash nuggets) so it was imperative that the we enabled wmode moving forward. My aim was to prove that the idea of wmode being bad was ancient and that it was now the common practice to enable it, which I think I did quite nicely and it hasn’t ever come up again.

I wonder what experiences others have regarding this? Was it your practice to not enable it and you now do? Or maybe you still don’t? Or maybe you never did?

Next Gen and Flash Windowless Mode

What is Windowless Mode?

Windowless Mode (WMODE) enables control over Flash applications within a webpage. It is necessary to enable WMODE to allow JavaScript and CSS to fully control the layout and functionality of a webpage that includes a Flash app. Its main benefits include:

· Stacking – allow the flash object to go on top of some elements but underneath others

· Transparency – show content beneath the flash object

The default WMODE is Window. When a Flash app is in its default mode it actually doesn’t belong to the browser, even though it appears to. It is most efficient for Flash to draw this way and this is the fastest, most efficient rendering mode. The other two are:

· Opaque: Enables stacking

· Transparent: Enables stacking and transparency, is the most processor intense

Examples:

Disabled

http://www.communitymx.com/content/source/E5141/wmodenone.htm

Opaque

http://www.communitymx.com/content/source/E5141/wmodeopaque.htm

Transparent

http://www.communitymx.com/content/source/E5141/wmodetrans.htm

Who has WMODE enabled?

Sample of Alexa.com top 50 ranking sites that have WMODE enabled:

http://www.yahoo.com/ – Transparent

http://espn.go.com/ – Opaque

http://www.cnn.com/ – Transparent

http://www.flickr.com/ – Opaque

http://www.weather.com/ – Opaque

http://dashboard.aim.com/aim – Opaque

http://www.nytimes.com/ – Opaque

https://www.bankofamerica.com/index.jsp – Transparent

http://www.nba.com/playoffs2008/index.html – Transparent

http://www.bbc.co.uk/?ok – Transparent

http://www.cnet.com/ – Transparent

http://www.netflix.com/ – Transparent

http://www.adobe.com/ – Transparent

http://abc.go.com/ – Transparent

Sample of competitor sites:-

http://www.toyota.com/ – Transparent

http://www.chevrolet.com/ – Transparent

http://www.chrysler.com/en/ – Transparent

http://www.audiusa.com/audi/us/en2.html – Opaque

http://www.gm.com/shop/ – Transparent

http://www.hyundaiusa.com/index.aspx – Transparent

http://www.jeep.com/en/ – Transparent

http://www.dodge.com/en/ – Transparent

http://www.bmwusa.com/Default.aspx – Transparent

http://www.ferraristore.com/ – Transparent

http://www.saturn.com/saturn/SaturnIndex.jsp – Transparent

http://www.miniusa.com/#/MINIUSA.COM-m – Transparent

http://automobiles.honda.com/ – Opaque

http://www.mazdausa.com/MusaWeb/displayHomepage.action?bhcp=1 – Transparent

http://www.gmperformanceparts.com/ – Transparent

Known issues

In IE frame count stays current but interval count lags behind:

http://justin.everett-church.com/wmode/

- Only affects user experience if flash requires a high refresh rate, such as games

- Avoid WMODE for these apps

Animation slow and jumpy with slow processors:

- Our sites currently already experience this with the full flash framework without WMODE enabled, though an html version is available

- HTML site will provide more seamless experience with only Flash apps being affected

- Capture slow experience and offer alternative content?

In Firefox text entry fields do not function correctly with international keyboards:

http://www.5etdemi.com/blog/archives/2005/06/firefox-wmodetransparent-is-completely-screwy-and-breaks-textfields/

- Only applies to user input

- Barely applies to sites built to only serve North America

- Make sure input is captured outside of Flash

- Disable WMODE for flash modules requiring input

- Hacks can be applied to the flash is necessary

Mac Firefox Flash disappears when using translucent overlays:

http://www.hedgerwow.com/360/bugs/opacity-disable-flash-on-mac-firefox.html

- Avoid translucent overlays with Flash

- If absolutely necessary use base 64 encoding for translucent image

Screen Readers cannot see Flash when WMODE is enabled:

http://dynamicflash.com/2006/10/flash-accessibility-and-wmode/

- Use html instead of flash for blocks of text

- Make text contained within Flash available outside of Flash

- Current site lacks accessibility and HTML/CSS layout will go a long way to improve this

Supported Browsers and Platforms

All our supported browsers and platforms allow WMODE to be enabled.

Conclusion

It is important to enable WMODE for modern web page design and functionality. We must embrace WMODE to remain competitive. There are negative issues surrounding WMODE but they can be eliminated by being aware of these issues at design and development stage as the majority of our Flash needs are not CPU intensive. The users negatively impacted by WMODE are a tiny minority. Only enable WMODE when necessary, using opaque setting over transparent when possible. If a Flash app is severely affected by WMODE find a seamless way to serve it with WMODE disabled.

Sources

http://www.communitymx.com/content/article.cfm?cid=e5141

Tuesday, May 19th, 2009

Web Color Schemes using Colorschemedesigner.com

Unfortunately I can’t design. I can art direct websites to a certain extent, being that I have the web experience, taste level, and eye for detail that my opinion is always welcomed by my creative colleagues. But give me a blank canvas to work with and I am stuck. Even when it’s something as simple as personalizing colors for my Twitter homepage I don’t have the confidence to hand-pick a palette myself from scratch. Luckily I work alongside some of the top creative talents in the industry and am spoiled for choice when it comes to picking a designer for my work. But I can’t really afford to pay a designer for every random niggle I produce, and I only want to call in favors with my designer friends for things that really matter, and besides there’s some stuff that I just want to look at it and know I did it for myself. And that’s where I found myself today when I decided it was time I personalized my Twitter homepage.

So to personalize the homepage I decided I was going to disable the background image and just pick a color scheme, there’s 5 colors to pick in all – from background to sidebar to link color. When I’m picking a color palette I usually turn to the web for help and always come across some tool or other that is of some help in the moment, but I’ve never come across anything really that’s been worth remembering. Today was different, I came across colorschemedesigner.com and was instantly inspired by what it had to offer. To start with you enter your base color or hand-pick it from a hue chart, and from there you can make certain adjustments, from secondary hues to saturation/brightness and contrast, helping to move the color scheme in the direction you are looking for. There’s various models too, from Mono through to Accented Analogic, and once you’re closing in on your palette your can overlay the color grid with text and even have a light or dark web page preview. You can even go as far as to simulate what it would look like for people suffering from various types of color blindness, which is all very interesting. And once you’re done you can export your palette in various ways such as HTML+CSS or ACO (Photoshop palette). It’s the complete package for a novice with simple needs such as myself who finds Photoshop quite daunting, and I’m not even sure if Photoshop offers the kind of aid this application does, I’d be interested to know how useful it would be to a professional designer.

Analogic Model with text

Light page preview

HTML+CSS Palette export

In the end I went with quite a simple schema for my Twitter homepage, it may be boring to some but I think it’s very clean and easy on the eye. The light blue Twitter logo will always appear on the page so I incorporated the color into my palette. To be fair to myself I think that designers don’t just have their own training and experience to fall back on, they also have their arsenal of tools as well as other designers work they look to for inspiration. Just like when I turn to code samples and confer with fellow industry professionals when I’m looking for inspiration with coding. So when I lean on a tool such as colorschemedesigner.com it is not cheating in any way, it’s merely inspiration to help me design something for myself.

Thursday, March 19th, 2009

Make your own magazine – Issuu.com

Every now and again I run across a site/web app/web service that gets me really excited and restores my faith in the power of the web and the power of the people that make the web – the users and the developers. And today that site is Issuu.com. In a nutshell it is the YouTube of magazines. Any budding publisher can now make their work instantly available to the world, and the rest of us can spend our time enjoying the creative work offered. And just like YouTube the magazines you create are embeddable into your website (it does look like embedding a magazine is locked down to just the publisher as you can only assign one domain per account), here’s an example (click “Read Winds&Sails.pdf now” to launch embedded magazine).

I haven’t done more than explore a little so I can only report back that for a user the magazine interface is a pleasure to interact with and makes the magazines look really good. The site itself is very clean so I imagine that the admin interface for publishing is quite tidy and intuitive, for example publishing a magazine is as simple as uploading a pdf. A lot of the magazines look very professional, like as if they are actually primarily physically published and distributed, though I haven’t come across anything I recognize as mainstream. There are even comics too! One tiny issue I do have is that it seems there is not a good way to print a magazine out all at once, you have to do it on a page by page basis (maybe there’s a good reason, and there is a premium service that might addresses this), and I know that we have to save the trees and all that, and I am married to my computer and the web, but I am still that guy that likes to print stuff out and take it down to the cafeteria and kick back and read it old school style, get away from my laptop every now and again (I always recycle I promise).

So that’s that, Issuu.com, I think it’s great. Not the first attempt at an online magazine service I’m sure, but by far the best I’ve ever come across, on a par with YouTube or Hulu for its medium. Go take a look and have some fun, and if you come across anything really worth reading make sure you let me know!

Wednesday, March 11th, 2009