Unilever has completed LYNX Men In Progress, a series of nine films designed to challenge perceptions of the modern man and celebrate masculinity. To create the campaign Dark Energy met with 70 men across eight locations in the UK to hear their stories and views on different aspects of masculinity. Key influencers are also featured in the nine videos, including musician Tom Odell, super heavyweight world champion Anthony Joshua, rugby league player Keegan Hirst, former Celtic footballer Bobby Petta and transgender blogger Jamie Raines. Hosted on Lynx’s Youtube and social media channels, the videos explore societal topics such as ‘masculinity’, ‘body image’ and ‘relationships’ and will go live at the relevant key moments for men. David Titman, marketing manager for Lynx, said: “‘Men In Progress’ was created to highlight what it means to be a guy living in the UK in 2016 and is designed to challenge labels that prevent men from expressing themselves.” he final instalment of David Stoddart’s Men In Progress series for Lynx is here. This episode is titled “Boys Don’t Cry” and it’s a bit of an emotional one.
1. Like Father Like Son
2. Motivation
3. Proud To Be
4. Masculinity
5. Body Image
6. Nicknames
7. Relationships
8. Becoming a Man
9. Boys Don’t Cry
LYNX Men in Progress Credits
The LYNX Men in Progress campaign was developed at TMW Unlimited by creative director Jeff Bowerman, agency producer Tracy Woodford, planner Simon Butcher, account director Kathryn Bryan and account manager Ben Good.
Most WordPress themes show user Gravatars in the comment threads. It’s a way of showing an image with the user, as associated by the email address used. It’s a nice touch, and almost an expected design pattern these days.
Every one of those gravatars is an individual HTTP request though, like any other image. A comment thread with 50 comments means 50 HTTP requests, and they aren’t always particularly tiny files. Yeesh.
Let’s lazy load them.
The Concept
Lazy loading is the idea that you don’t even request the image at all (no HTTP request) unless the image is visible. Meaning that, through JavaScript, we’ve determined the image is visible.
Lazy loading means not loading those two images that are outside the browser window, until they become inside the browser window.
In order to stop those HTTP requests for not-yet-seen images, we need to get our hands directly on the markup. If there is an <img src=""> in the HTML, there is essentially no way to stop the browser from downloading that image as soon as it possibly can, seen or unseen. So, we need to remove that src, and put it back when we’re ready.
Woah, There
It’s worth a pause here because we’ve entered some murky territory.
By removing the src of these images, and only ever putting it back with JavaScript, we’ve decided that we’re willing to ship slightly invalid HTML and rely 100% on a script downloading and executing for these images to ever be seen.
I’m OK with that. Mostly because gravatars are just an enhancement anyway. It ain’t no big deal if they never show up. I’m not a hardliner most JavaScript debates, but this seems like a particularly clear case where we can lean on JavaScript without worry.
Altering the HTML
This is the change we’d be making:
<!-- Normal image. No beating the browser preloader. -->
<img src="https://gravatar.whatever..." alt="" />
<!-- Let's change to this, which won't download anything. -->
<img data-src="https://gravatar.whatever..." alt="" />
Although a missing src on the <img> is technically invalid HTML. It almost certainly doesn’t really matter in that it won’t affect how anything works. If the invalid HTML bugs, you could always toss a super minimal blank GIF data URL in there, like:
Using width and height attributes is probably a good idea too, to maintain layout and avoid reflow if and when the images to load.
Altering the HTML… in WordPress
But how do you change the HTML that WordPress spits out as part of a comment thread? Comments are slightly unusual in WordPress in that WordPress core gives you the HTML, it isn’t part of your theme like most of the other HTML is.
Likely, in your `comments.php` file, you’ll see this function:
<?php wp_list_comments(); ?>
Which spits out a pile of <li>’s with your entire comment thread. Not a lot of opportunity there to be fiddling with the output of images. Except, we can! We can list a callback function in there:
That’s very simplified, but you can see what we’ve done. We replaced the src with the blank GIF, we’ve added a class name we’ll ultimately use in JavaScript to do the lazy loading, we’ve added a data-src to the actual gravatar, and we’re using width and height attributes for placeholding. Here’s my actual complete callback live right now on CSS-Tricks.
If we shipped this right now, sans any JavaScript work, we’d still have a perfectly functional comment thread, just with images that never load.
Now We’re Ready to Lazyload
The hard part is over. We’re perfectly set up to do lazyloading now. If we were to write a script, it would be like:
Figure out the visible area of the browser window
Figure out the position on the page of every image with class .lazyload-gravatar
If any of those images are in the visible area, flop out the src with the value from data-src
If the visible area of the browser window changes in any way, re-evaluate the above
We could set about writing that ourselves. And we could do it! But, and I’m sure you’re not surprised here, it’s a bit tricky and nuanced. Cross-browser concerns, performance concerns, does-it-work-on-mobile concerns, to name a few. This is the kind of thing I’m happy to lean on other’s work for, rather than roll myself.
Again, no surprise, there are loads of options to pick from. In my case, I’m happily using jQuery on CSS-Tricks, and I picked a jQuery-based on that looked pretty good to me:
The API is as simple as can be. After bundled up the lib with the rest of the libs I’m using, I just call:
$('.lazyload-gravatar').Lazy();
Look how nicely it works!
That’s an awful lot of saved HTTP requests and awful good for performance.
Makes you wish web standards and browsers would get together on this and make it a native feature.
Welcome to our Design in 60 Seconds series, in which you can
learn a new design skill, feature, or technique in just a minute!
Design in 60 Seconds: Infographics
Infographics connect you to the world by allowing you to share interesting facts and information with beautiful visuals. Engage your readers and expand your reach across social media with exciting designs.
In this quick video, learn more about infographics and how to customize a simple template from Envato Market. Check out the infographics used in this video from GraphicRiver.
Depending on the template you download, you’ll need to use either Photoshop or Illustrator to edit the designs. Here we’ll be using Photoshop. Start by adjusting the titles, numbers, and all your important information with the Type Tool (T).
Move on to customizing the colors. Use the Selection Tool (A) to select one of the shapes and adjust the Color Fill.
Lastly, switch up the layout and organization by selecting each Layer Group to move the elements around with the Move Tool (V).
Want to see this in action? Check out the video above to see this lesson at work! Or enlist the help of a design professional from Envato Studio for all your infographic needs.
A Bit More Detail
Want to learn more about design and Adobe Photoshop’s vast tools and settings? Check out these tutorials below:
This is part of a series of quick video tutorials on
Envato Tuts+ in which we introduce a range of subjects, all in 60
seconds—just enough to whet your appetite. Let us know in the comments
what you thought of this video and what else you’d like to see explained
in 60 seconds!