Skip directly to content

Smashing Magazine

Subscribe to Smashing Magazine feed
For Professional Web Designers and Developers 2014-04-12T11:14:11Z
Updated: 48 min 3 sec ago

Why You Should Get Excited About Emotional Branding

Fri, 04/11/2014 - 10:47

  

Globalization, low-cost technologies and saturated markets are making products and services interchangeable and barely distinguishable. As a result, today’s brands must go beyond face value and tap into consumers’ deepest subconscious emotions to win the marketplace.

The Role Of Brands Is Changing

In recent decades, the economic base has shifted from production to consumption, from needs to wants, from objective to subjective. We’re moving away from the functional and technical characteristics of the industrial era, into a time when consumers are making buying decisions based on how they feel about a company and its offer.

BusinessWeek captured the evolution of branding back in 2001:

“A strong brand acts as an ambassador when companies enter new markets or offer new products. It also shapes corporate strategy, helping to define which initiatives fit within the brand concept and which do not. That’s why the companies that once measured their worth strictly in terms of tangibles such as factories, inventory and cash have realized that a vibrant brand, with its implicit promise of quality, is an equally important asset.”

I’d take it a step further and suggest that the brand is not just an important part of the business — it is the business. As Dale Carnegie says:

“When dealing with people, let us remember we are not dealing with creatures of logic. We are dealing with creatures of emotion.”

It’s Time To Get Emotional

In a borderless world where people are increasingly doing their research and purchases online (75% of Americans admit to doing so while on the toilet), companies that don’t take their branding seriously face imminent demise.

Enter emotional branding. It’s a highly effective way to cause reaction, sentiments and moods, ultimately forming experience, connection and loyalty with a company or product on an irrational level. That’s the ironic part: Most people don’t believe they can be emotionally influenced by a brand. Why? Because that’s their rational mind at work. People make decisions emotionally and then rationalize them logically. Therefore, emotional branding affects people at a hidden, subconscious level. And that’s what makes it so incredibly powerful.

Neuroscientists have recently made great strides in understanding how the human mind works. In his book Emotional Design: Why We Love (or Hate) Everyday Things, cognitive scientist Donald Norman explains how emotions guide us:

“Emotions are inseparable from and a necessary part of cognition. Everything we do, everything we think is tinged with emotion, much of it subconscious. In turn, our emotions change the way we think, and serve as constant guides to appropriate behavior, steering us away from the bad, guiding us toward the good.”

Emotions help us to rapidly choose between good and bad and to navigate in a world filled with harsh noise and unlimited options. This concept has been reinforced by multiple studies, including ones conducted by neuroscientist Antonio Damasio, who examined people who are healthy in every way except for brain injuries that have impaired their emotional systems. Due to their lack of emotional senses, these subjects could not make basic decisions on where to live, what to eat and what products they need.


Recognize your emotions at play. Rice or potatoes? Saturday or Sunday? Say hello or smile? Gray or blue? The Rolling Stones or The Beatles? Crest or Colgate? Both choices are equally valid. It just feels good or feels right — and that’s an expression of emotion.

Emotions are a necessary part of life, affecting how you feel, how you behave and how you think. Therefore, brands that effectively engage consumers in a personal dialogue on their needs are able to evoke and influence persuasive feelings such as love, attachment and happiness.

Creativity Is Critical

What does that mean to marketers? Good ideas are increasingly vital to businesses. And that’s good news for creative professionals and agencies.

A Wall Street Journal article titled “So Long, Supply and Demand” reports:

“Creativity is overtaking capital as the principal elixir of growth. And creativity, although precious, shares few of the constraints that limit the range and availability of capital and physical goods. In this new business atmosphere, ideas are money. Ideas are, in fact, a new kind of currency altogether — one that is more powerful than money. One single idea — especially if it involves a great brand concept — can change a company’s entire future.”

As Napoleon Hill says:

“First comes thought; then organization of that thought, into ideas and plans; then transformation of those plans into reality. The beginning, as you will observe, is in your imagination.”

Emotional Branding In Action

Let’s look at some examples of branding and campaigns that go for the heart and, in some cases, hit the mark.

WestJet Christmas Miracle

WestJet Airlines pulled on heartstrings this past holiday season with a video of Santa distributing Christmas gifts to 250 unsuspecting passengers. The Canadian airline expected around 800,000 views but blew their competitors’ campaigns out of the air with more than 35 million views.


How the WestJetters helped Santa spread some Christmas magic to their guests. (Watch on Youtube)

Coca-Cola Security Cameras

While surveillance cameras are known for catching burglaries and brawls, a Coca-Cola ad released during the latest Super Bowl encourages us to look at life differently by sharing happy, moving moments captured on security cameras. You’ll witness people sneaking kisses, dancing and random acts of kindness.


All the small acts of kindness, bravery and love that take place around us, recorded by security cameras. (Watch on Youtube)

Homeless Veteran Time-Lapse Transformation

Degage Ministries, a charity that works with veterans, launched a video showing a homeless US Army veteran, Jim Wolf, getting a haircut and new clothes as part of an effort to transform his life. Degage Ministries told Webcopyplus that Wolf has completed rehab and is turning his life around, and that the video has so far raised more than $125,000, along with increased awareness of and compassion for veterans across the country.


A video of a homeless veteran named Jim, who volunteered to go through a physical transformation in September 2013. (Watch on Youtube)

Creating Emotional Connection

While neuroscientists have only recently made significant strides in understanding how we process information and make decisions, humans have been using a powerful communication tactic for thousands of years: storytelling. It’s a highly effective method to get messages to stick and to get people to care, act and buy.

The stories that truly engage and are shared across the Web are typically personal and contain some aspect of usefulness, sweetness, humor, inspiration or shock. Also, the brand has to be seen as authentic, not manufactured, or else credibility and loyalty will be damaged.

I discussed the Coca-Cola video with Kevin McLeod, founder and CEO of Yardstick Services, who suggests that most brands merely try to connect the emotions of a real moment in life to their brand.

“The Coke video is full of wonderful clips of people doing things that make us all feel good. I’m not going to lie, it got my attention and is very memorable. At the same time, I’m intelligent enough to see what Coke is doing. With the exception of the last clip, none of the “good things” in the video are related to Coca-Cola.

The ad primes us by making us feel good and then drops the brand at the end so that we connect those emotions to the Coke brand. It’s very shrewd. Part of me thinks it’s brilliant. The other part of me thinks it’s overly manipulative and beguiles a product that can’t stand on its own merits, of which caramel-colored, carbonated sugar water has few.”

McLeod puts forth sharp views about Coke merely stamping its brand on a video compilation, which could very well have been IBM, Starbucks or virtually any other company. However, while he consciously found the video to manufacture emotions, he still enjoyed it, stating that it makes us all — including him — “feel good.” So, despite McLeod’s skepticism and resistance, it still made an emotional connection with him. There’s the desired association: Coke = feeling good.


Folks make decisions emotionally and then rationalize them logically, therefore, emotional branding affects people at a hidden, subconscious level.

To get the most success in creating an emotional connection with people, stories should explore both brand mystique and brand experience, and the actual product or service should be integrated. A brilliant example is The Lego Movie, released by Warner Bros earlier this year. The Lego brand delivered a masterful story, using its products as the stars. The brand got families and kids around the globe to shovel out well over $200 million for what could be the ultimate toy commercial.

Designers, developers, copywriters and marketers in general should take a page from moviemakers, including the late writer, director and producer Sidney Lumet. He gave the following advice on making movies: “What is the movie about? What did you see? What was your intention? Ideally, if we do this well, what do you hope the audience will feel, think, sense? In what mood do you want them to leave the theater?” The same could be asked when you’re developing a brand story: What do you want the audience to feel?

Even product placement, where everything from sneakers to cars gets flashed on the screen, has evolved into “branded entertainment.” Now, products are worked into scripts, sometimes with actual roles. A well-known example is in the film Cast Away, in which Wilson, a volleyball named after the brand, serves as Tom Hanks’ personified friend and sole companion for four years on a deserted island. When Wilson gets swept away into the ocean and slowly disappears, sad music ensues, and many moviegoers shed tears over… well, a volleyball.

Making Brands Emotional

Connecting people to products and services is not an easy task. It takes careful consideration and planning. US marketing agency JB Chicago found success sparking an emotional connection for Vitalicious, its client in the pizza industry. Its VitaPizza product had fewer calories than any competitor’s, however, its message was getting lost among millions of other messages. Explains Steve Gaither, President of JB Chicago:

We needed to bring that differentiation front and center, letting the target audience, women 25-plus interested in healthy living, know they can eat the pizza they love and miss without consuming tons of calories.

A relationship concept was formed, and a campaign was soon launched with the following key messages: “You used to love pizza. And then the love affair ended. You’ve changed. And, thankfully, pizza has too! Now you and your pizza can be together again.” The agency then tested different ads, each centered on one of the following themes:

  • sweepstakes,
  • 190 calories,
  • gluten-free/natural,
  • “You and pizza. Reunited. Reunited and it tastes so good.”

The brand idea outperformed the other ads by a margin of three to one. Bringing a story into the equation resonated with the target audience.

Gaither also shared insight on a current story-building project for StudyStars, an online tutoring company whose brand wasn’t gaining traction. JB Chicago overhauled the brand and created a story to demonstrate that StudyStars is a skills-based tutoring system with a deep, fundamental approach to learning, one that ultimately delivers better outcomes.

“We needed to find and build camp at a place where skills-based tutoring intersects with the unmet needs of the buyer. We needed a powerful brand idea that enables us to claim and defend that space. And we needed to express that idea in a manner that is believable and differentiated.”

Seeking a concept that would look, feel, speak and behave differently, JB Chicago crafted the brand idea “Master the Fundamentals.” It suggests that learning is like anything else: You have to walk before you can run, or else you will fall. So, the agency is setting up a campaign, including a video, to show that students who fall behind in school due to weak learning of the fundamentals don’t just fall behind in the classroom — their struggles affect every other aspect of their lives.

Here’s a snippet of the drafted script:

Title: Pauline’s Story

We see a beautiful little girl in a classroom. Pauline. She is 8 years old. We can also see that she’s a little lost.

A quick shot of the teacher at the chalkboard, teaching simple multiplication, like 9 × 6. Back to Pauline. She’s not getting it.

We see Pauline again at age 12, again in class. She is looking at a math quiz. It’s been graded. She got a D.

There’s a sign hanging from her neck. The sign says “I never learned multiplication.”

We see Pauline again, now at 15. She is home. Her parents are screaming at each other about her poor academic performance. The sign around her neck is still there. “I never learned multiplication.”

We see a young waitress in a dreary coffee shop. It takes us a few seconds to realize that it’s Pauline, age 18. She is tallying a customer’s check.

A close shot of the check. Pauline is trying to calculate the tax. She can’t do it, so she consults a cheat sheet posted nearby. She’s still wearing the sign. “I never learned multiplication.”

She figures the tax out and brings the check over to an attractive collegiate-looking couple, who thank her and head for the door. She watches them leave.

Their life is everything hers is not. Their future is everything hers will never be. Slate (text) states StudyStars’ case, and the video ends with an invitation to visit studystars.com.

JB Chicago created a story that draws us in and links to emotions — possibly hope, fear, promise, hope, security and other feelings — according to the person’s mindset, experience, circumstance and other factors. The key is that it gets to our hearts.

Emotional Triggers

Different visitors connect to and invest in products and services for different reasons. To help you strike an emotional chord with your audience, veteran marketer Barry Feig has carved out 16 hot buttons in Hot Button Marketing: Push the Emotional Buttons That Get People to Buy:

  • Desire for control
  • I’m better than you
  • Excitement of discovery
  • Revaluing
  • Family values
  • Desire to belong
  • Fun is its own reward
  • Poverty of time
  • Desire to get the best
  • Self-achievement
  • Sex, love, romance
  • Nurturing response
  • Reinventing oneself
  • Make me smarter
  • Power, dominance and influence
  • Wish-fulfillment
How Does It Make You Feel?

As emotional aspects of brands increasingly become major drivers of choice, it would be wise for designers, content writers and other marketers to peel back customers’ deep emotional layers to identify and understand the motivations behind their behavior.

So, the next time you ask someone to review your design or content, maybe don’t ask, “What do you think?” Instead, the smarter question might be:

“How does it make you feel?”

(al, il)

© Rick Sloboda for Smashing Magazine, 2014.

A Guide To Validating Product Ideas With Quick And Simple Experiments

Thu, 04/10/2014 - 13:32

  

You probably know by now that you should speak with customers and test your idea before building a product. What you probably don’t know is that you might be making some of the most common mistakes when running your experiments.

Mistakes include testing the wrong aspect of your business, asking the wrong questions and neglecting to define a criterion for success. This article is your guide to designing quick, effective, low-cost experiments.

A Product With No Users After 180 Days

Four years ago, I had a great idea. What if there was a more visual way to learn about our world? Instead of typing search queries into a text field, what if we could share visual queries with our social network and get information about what we’re looking at? It could change the way people search! I went out, found my technical cofounder, and we started building a photo Q&A app. Being a designer, I naturally thought that the branding and user experience would make the product successful.

Six months later, after rigorous usability testing and refinement of the experience, we launched. Everyone flocked to the app and it blew up overnight. Just kidding. No one cared. It was that devastating moment after a great unveiling when all you hear are crickets chirping.

Confused and frustrated, I went back to the drawing board to determine why this was. My cofounder and I parted ways, and, left without technical expertise, I decided to step out and do some research by interviewing potential users of the app. After a few interviews, the root cause of the failed launched finally dawned on me. My beautifully designed solution did not solve a real human need. It took five days of interviews before I finally accepted this truth and slowly let go.

The good news for you is that you don’t need to go through the same pain and waste of time. I recently started working on another startup idea. This time, I followed a structured process to identify key risks and integrate customer feedback early on.

A Product With 16 Paying Customers After 24 Hours

I work with many entrepreneurs to help them build their companies, and they always ask me for feedback on the user experience of their Web and mobile apps. They express frustration with finding UX talent and want some quick advice on their products in the meantime. This happens so frequently that I decided to learn more about their difficulties and see what might solve their problems.

I specified what I was trying to learn by forming a hypothesis:

“Bootstrapped startup founders have trouble getting UX feedback because they have no reliable sources to turn to.”

To test this, I set a minimum criterion for what I would accept as validation to further explore this opportunity. I had enough confidence that this was a big problem to set a criterion as high as 6 out of 10. This means that 6 out of the 10 people I interviewed needed to indicate that this was a big enough problem in order for me to proceed.

By stating my beliefs up front, I held myself accountable to the results and reduced the influence of any retroactive biases. I knew that if these entrepreneurs already had reliable sources to turn to for UX feedback and that they were happy with them, then generating demand for an alternative solution would be much harder.


Design of my first experiment on the Experiment Board. (Large preview)

In three hours of interviews, I was able to validate the pain point and the need for a better alternative. (You can watch a video walkthrough of my findings.) My next step was to test the riskiest assumption related to the solution that would solve this problem. Would they pay for an online service to get feedback from UX designers?

Instead of building a functioning marketplace with designer portfolios and payment functionality, or even wireframing anything, I simply set up a landing page with a price tag in the call to action to test whether visitors were willing to pay. This is called a pitch experiment. You can use QuickMVP to set up this kind of test.


Test if customers will pay for the service. (Large preview)

Behind the landing page, I attached a form to gather information on what they needed help with. Within a few hours, 10 people had paid for the service, asking for UX feedback on their websites. Having validated the demand, I needed to fulfill my promise by delivering the service to the people who had paid.


Did not build any functionality; just a form to collect information. (Large preview)

Because this market is two-sided — with entrepreneurs and designers — I tested the demand side first to see whether the solution provided enough value to elicit payment. Then, I tested the supply side to learn what kind of work designers were looking for and whether they were willing to consult virtually.


Test the second side of the market: the supply side. (Large preview)

To my surprise, the UX designers I spoke with had established clientele and were very picky about new clients, let alone wanting to consult with random startups online. But they all mentioned that they had been eager to take on any work when they were first starting out and looking for clients. So, I switched my focus to UX designers who are not yet established and are open to honing their skills by giving feedback online.

Armed with these insights, I iterated on my landing page to accommodate both sides of the market and proceeded to fulfill the demands of the customers I had accumulated. No wireframes. No code. Just a landing page and two forms!


A landing page that tests both sides of the market, simultaneously. (Large preview)


Interest in this service can also be measured by their willingness to fill out the form. (Large preview)

To simulate the back-end functionality, I emailed the requests to the UX designers, who would then respond with their feedback, which I would email back to the startup founders. Each transaction would take five minutes, and I did this over and over again with each customer until I could no longer handle the demand.

Do things that don’t scale in order to acquire your earliest customers and to identify business risks that you might overlook when implementing the technical aspects. This is called a concierge experiment. Once the manual labor has scaled to its limit, then write the code to open the bottleneck. Through this process, I was able to collect feedback on use cases, user expectations and ideas for improvements. This focused approach allowed for more informed iterations in a shorter span of time, without getting lost in wireframing much of the application up front.

Today, BetterUX.it is a service through which startup founders connect with UX designers for feedback on their websites and apps, and designers get paid for their expertise and feedback.

How To Create A Product That People Want

What did I do differently? The structured process of testing my assumptions saved me time and confirmed that each part of my work was actually creating value for end users. Below is a breakdown of the steps I took, so that you can do the same.
Should You Build Your Idea?

My first mistake with my first startup was assuming that others had the same problem that I experienced. This is a common assumption that many gloss over. Build products that scratch your own itch, right? But many entrepreneurs realize too late that the problems they’re trying to solve are not painful enough to sustain a business.

As product people, we often have many ideas bubbling in our heads. Before getting too excited, test them and decide which one is the most viable to pursue.

Design An Effective Experiment

To get started, break down your idea into testable elements. An effective experiment must clearly define these four elements:

  1. hypothesis,
  2. riskiest assumption,
  3. method,
  4. minimum criterion for success.

At Lean Startup Machine, we’ve created a tool called an Experiment Board, which enables us to easily turn crazy ideas into effective experiments in a few minutes. As you go along, use the board as a framework to design your experiment and track progress. Refer to the templates provided on the board to quickly formulate your hypothesis, riskiest assumption, method and success criterion. You can also watch my video tutorial for more information on designing effective experiments.

Construct a Hypothesis

Every experiment starts with a hypothesis. Start by forming a customer-problem hypothesis. Once it is validated, you can go on to form a problem-solution hypothesis.

  1. Define your customer.
    Which customer segment experiences the most pain? They are your early adopters, and you should target them first. These are the people who have the problem you’re solving for, and they know they have the problem and are trying to solve it themselves and are dying for a better way! Most people have trouble identifying these customers. If you do, too, then just segment your potential customer base by level of pain and differentiating characteristics, such as lifestyle and environmental factors. Being specific will reduce the time it takes to run through experiment cycles; once you’ve tested against that one segment and found that the problem doesn’t resonate with them, you can quickly pivot to test another customer segment. In the long run, having a clear idea of who you’re building for will help you maintain a laser focus on what to prioritize and what to dismiss as noise.
  2. Define the problem.
    What problem do you believe you are solving for? Phrase it from your customer’s perspective. Too often, people phrase this from the perspective of their own lofty vision (“The Web needs to be more human”) or from a business point of view (“Customers don’t use our service enough”). Also, avoid being too broad (“People don’t recycle”). These mistakes will make your hypothesis hard to test with a specific customer, and you’ll find yourself testing for a sentiment or an opinion in interviews, rather than a solvable problem. If you have trouble, phrase the problem as if your friend was describing it you.
  3. Form a hypothesis.
    Brainstorm on a few customers and problems to consider all the possibilities. Then, combine the customer and problem that you want to focus on with this sentence: “I believe customer x has a problem achieving goal y.” You have just formed a testable hypothesis!
Identify Your Riskiest Assumption

Now that you have formed a customer-problem hypothesis, poke some holes and extract the riskiest assumption to be tested. Start by brainstorming on a few core assumptions. These are the assumptions that are central to the viability of your hypothesis or business. Think of an assumption as the behavior, mentality or action that needs to be true in order to validate the hypothesis.

Ask your team members, boss or friends to suggest any assumptions that you may have overlooked. After listing a few, identify the riskiest one. This is the core assumption that you are most uncertain about and have the least amount of data on. Testing the riskiest assumption first will speed up the experiment cycle. If the riskiest assumption is invalidated, then the hypothesis will be invalid, and you will have saved your company from going down the wrong path.

Choose a Method

After identifying the most critical aspect of your idea to test, determine how to test it. You could conduct three kinds of experiments before getting into wireframes. It’s best to start by gathering information firsthand through exploration. But you could choose a different method depending on your level of certainty and the data.

  1. Exploration
    Conduct qualitative interviews to verify and deepen your understanding of the problem. Even though you experience the problem yourself, you don’t know how big it is or who else has it. By conducting exploratory interviews first, you might realize that the opportunity isn’t as big as you had thought or that a bigger problem could be solved instead.
  2. Pitch
    Make sure the solution would actually provide value by selling the concept to customers before building the product. This will measure their level of determination to solve the problem for themselves. A potential customer not taking a certain action to use your service, like paying a small deposit or submitting an email address, indicates that the problem is not painful enough or that you haven’t found the right solution.
  3. Concierge
    Personally deliver the service to customers to test how satisfied they are with your solution. Did your value proposition meet their expectations? What was useful for them? What could have been done better? How likely are they to return or recommend the service to a friend? These are all insights you can discover in this step.
Set a Minimum Criterion for Success

Before running the experiment, decide up front what result will constitute success and what result will constitute failure. The minimum criterion for success is the weakest outcome you will accept to continue allocating resources and pursuing the solution. Factors like budget, opportunity cost, size of market, level of demand and business metrics all play into it.

The criterion is usually expressed as a fraction:

“I expect x number of people out of the y number of people in the experiment to exhibit behavior z.”

I like to set the criterion according to how big I think the problem is for that customer segment, and then determine how much revenue it would have to generate in order for me to keep working on it. At this point, statistical significance is not important; if your target customer segment is very specific, then testing with 10 of them is enough to start seeing a pattern.

Once you have validated the hypothesis with a small sample of the customer segment, then you can scale up the experiments to test with larger sample sizes or with other segments.

Run the Experiment

Once you have defined these elements, you are ready to run the experiment! Have team members look at your Experiment Board and confirm whether they agree with what you’re testing. This will hold you and the team accountable to the results, so that there are no subjective arguments afterwards.

Analyze the Results and Decide on Next Steps

After gathering data from your target customers, document the results and your learning on the Experiment Board. Did the results meet your criterion for success? If so, then your hypothesis was valid, and you can move forward to test the next risk with the product. If not, then you need to form a new hypothesis based on your learning to get closer to something that holds true. Track your progress over time on the Experiment Board to get a holistic picture of your validated learning and to continually make informed decisions.

Test and repeat. You’re on your way to creating a great product that people want!

(al, il)

© Grace Ng for Smashing Magazine, 2014.

Building The Web App For Unicef’s Tap Campaign: A Case Study

Wed, 04/09/2014 - 10:12

  

Since a smartphone landed in almost everyone’s pocket, developers have been faced with the question of whether to go with a mobile website or a native app.

Native applications offer the smoothest and most feature-rich user experience in almost every case. They have direct access to the GPU, making layer compositions and pixel movements buttery-smooth. They provide native UI frameworks that end users are familiar with, and they take care of the low-level aspects of UI development that developers don’t have time to deal with.

When eschewing an app in favor of a mobile website, developers often sacrifice user experience, deep native integration and a complex UI in favor of SEO and accessibility. But now that JavaScript rendering engines are improving immensely and GPU-accelerated canvas and CSS animations are becoming widely supported, we can start to consider mobile websites a primary use case.

Unicef’s latest campaign, Tap, presented us with the challenge of combining the accessibility of a mobile website with the native capabilities, UI and overall experience that someone would expect of a native app. Our friends at Droga5 came to us with a brief to create a mobile experience that tracks how long a user avoids using their phone.


Unicef’s 2014 Tap campaign presented the challenge of combining the accessibility of a mobile website with the smooth user experience of a native app.

For every 10 minutes that a user gives up their phone, a sponsor would donate a day’s worth of water to children in the developing world. While the user patiently waits, they are presented with real-time and location-based statistics of other users who are sacrificing their precious phone time.

We’ll discuss a few of the biggest challenges here: detecting user activity, achieving performant animations, and building an API integrated with Google Analytics.

Detecting User Activity

Detecting user activity through a mobile browser was an interesting challenge and involved a lot of research, testing and normalization across all types of phones. The slightest differences and inaccuracies between phones became suddenly apparent. To explain the process, we’ll break it down into three categories: user movement, user exiting, and device-sleep prevention.

User Movement

One core piece of functionality is detecting any movement by the user. Fortunately, most mobile browsers today have access to the built-in gyroscope and accelerometer via JavaScript’s DeviceOrientation event. The unfortunate exception is devices running Android 2.3 (Gingerbread), which at the time of writing has roughly a 20% market share. In the end, the project was not worth abandoning due to one version of Android, so we pushed on. This decision proved to be even better than we thought because most devices that run version 2.3 are old, which means less memory, a slower CPU and aging hardware.

To detect movement, we first have to detect an “idle” position. We instruct the user to set their phone down, while we check the readings on the x and y axis. We start a timer with a setInterval, and if that position’s values remain within a 6° range for a few seconds, then we save those values as the device’s idle position. (If the user moves, then we restart the timer again until the phone does not move for a few seconds.) From there, we listen for the DeviceOrientation event and compare the new position’s values to the idle values. If there is a difference, then we fire off a custom user_move event.

The concept was simple to implement, but we found that most devices fluctuate by a couple of degrees when lying still. The sensitivity to movement is quite high, so we first had to determine a threshold above which we could be confident that the user has intentionally moved their device. After some trial and error, we decided on a 12° range of difference (+ and -) from the idle position, on both the x and y axis. If any movement occurs outside of that range, we assume it to be deliberate. Thus, users can bump their phone slightly with no consequence.

this.devOrientHandlerProxy = $.proxy(this.devOrientHandler, this); window.addEventListener('deviceorientation', this.devOrientHandlerProxy, false); MovementDetector.prototype.devOrientHandler = function(event) { var curr_x = Math.floor(event.beta); var curr_y = Math.floor(event.gamma); var curr_z = Math.floor(event.alpha); var didMove = this.calcMovement(curr_x, curr_y, curr_z, this.movement_threshold); if(didMove) { this.announceMovement(); } } MovementDetector.prototype.calcMovement = function(new_x, new_y, new_z, threshold) { var x_diff = Math.abs(this.x_idle_pos - new_x); var y_diff = Math.abs(this.y_idle_pos - new_y); var z_diff = Math.abs(this.z_idle_pos - new_z); z_diff = z_diff > 180 ? 360 - z_diff : z_diff; return x_diff > threshold || y_diff > threshold || z_diff > threshold; }

As you can see in the first four lines of the calcMovement method, we are obtaining the difference between the idle position and the new position. Because the difference in values could be negative, we make sure to get the absolute value (Math.abs(val)). You’ll notice that the z_diff formula is a bit different. Because the value for z_diff is between 0 and 359, we have to take the absolute difference and then check to see whether the difference is above 130; if so, then we need to subtract that difference from 360.

This gives us the shortest distance between the two points. For example, if the device moves from 359 to 10, then the shortest distance would be 11. Finally, we check to see whether any of those three values (x_diff, y_diff, or z_diff) are greater than the threshold; if so, then we announce a user_move event.


Movement detection on iOS and Android (Samsung Galaxy S3 and HTC One). (View large version)

We had to test extensively across both Android and iOS devices. iOS was straightforward, whereas we found subtle differences between Android versions and manufacturers, especially with the stock browser. Certain devices would jump dramatically between values on the z-axis. Thus, we decided not to consider any movement on the z-axis in our detection — meaning that users could slide a phone laterally on a tabletop with no consequence.

User Exiting

Another action that we wanted to detect was the user exiting the browser, to signal their intention to end the experience. We had to listen for a couple of events via the PageHide and PageVisibility API. (PageHide or PageVisibility is available in Android only in later versions — in the stock browser in version 4.3+, and in Chrome 4+. iOS 6 has PageHide, and iOS 7 has PageVisibility.)

We knew we couldn’t detect across the board, but we felt that implementing it for browsers that support it would be worthwhile. The following matrix shows which mobile browsers support PageHide and PageVisibility:

Devices PageHide event PageVisibility API iOS 6.0 Safari ✔ ✖ iOS 7.0 Safari ✔ ✔ iOS 6.0 Chrome ✖ ✖ iOS 7.0 Chrome ✖ ✔ Android 2.3 — 4.2 stock browser ✖ ✖ Android 4.3 stock browser ✔ ✖ Android 4.4 stock browser ✔ ✔ Android 4.0+ Chrome ✔ ✔ Sleep Prevention

Keeping the device awake was the final core piece of functionality that we needed to detect user activity. This was crucial because the idea of the campaign is for users to stay away for as long as they possibly can. By default, all phones enter sleep mode after a few minutes. Some phones can be manually set to never sleep, or the user could keep it plugged in, but we could not rely on either of those options.

We had to think of interesting workarounds. iOS and Android had to be treated differently.

For iOS 6 devices, we make use of HTML5 audio and load a silent MP3 file asynchronously that loops endlessly during game play. We simply added the loop attribute, set to true, to our <source> element. For Android devices, we piggyback on what we do for iOS 6. However, Android’s display turns off after a few minutes even when an audio file is playing. Fortunately, unlike iOS, Android allows for inline video.

So, we run the same createMedia loop method shown above, but this time loading a 10-minute silent video with the <video> element, placed outside of the viewport. We found that the loop attribute doesn’t always work with inline video across Android devices, so we use HTML5’s media ended event instead. By looping a hidden video, we are able to keep Android devices from going to sleep.

Here is some sample code:

//for iOS 6 var media_type = 'audio'; var media_file = 'silence.mp3'; //for Android var media_type = 'video'; var media_file = 'silence.mp4'; ExampleClass.prototype.createMediaLoop = function(media_type, media_file) { this.mediaEl = document.createElement(media_type); this.mediaEl.className = 'mediaLoop'; this.mediaEl.setAttribute('preload', 'auto'); var mediaSource = document.createElement('source'); mediaSource.src = media_file; switch(media_type) { case 'audio': //create an audio element in iOS 6 //and play a silent MP3 file this.mediaEl.loop = true; mediaSource.setAttribute('type', 'audio/mpeg'); break; case 'video': //create a video element for Android devices //and play a silent video file mediaSource.setAttribute('type', 'video/mp4'); var _self = this; this.mediaEl.addEventListener('ended', function() { _self.mediaEl.currentTime = 0; _self.mediaEl.play(); }, false); break; } this.mediaEl.appendChild(mediaSource); document.body.appendChild(this.mediaEl); this.mediaEl.volume = 0; this.start(); }

iOS 7 is much easier. Thanks to a UI update in the browser, the address bar always remains on screen, unlike in iOS 6. So, we call an update to the browser’s URL, running the method every 20 seconds, thus preventing sleep mode.

setInterval(function(){ window.location.href = 'tap.unicefusa.org'; setTimeout(function(){ window.stop(); },0); }, 2e4);

We cannot use this method for iOS 6 because the user would notice the address bar slide into the view and then slide back out.

Animations

Animations are important in reinforcing the theme of water and making the experience fun. Whether we were creating a water-ripple effect, bubbles or waves, we isolated each animation and programmed different approaches to achieve the best result. Knowing that we had to do this for a slew of browsers by various manufacturers, we took the following into consideration:

  • Performance
    Do frames get dropped when testing against supported devices? How does GPU rendering compare to CPU rendering?
  • Value added
    How much does the animation really add to the experience? Could we conceivably drop it?
  • Loading size
    How much does the animation add to the website’s overall load? Does it require a library?
  • Compatibility with iOS 6+ and Android 4+
    Does it require complex fallbacks?
Bubbles

Let’s first look at bubbles, which animate from bottom to top. The design called for floating bubbles, whose size, focus and opacity would provide a sense of depth within the environment. We decided to test a few approaches, but these are the main two we were curious about:

  • Animating DOM elements using hardware-accelerated CSS 3-D transforms (transform: translate3d(x, y, z));
  • Rendering all circles on a 2-D canvas element.

Note: Animating via the top/left properties is not an option due to the lack of subpixel rendering and the long time to paint each frame. Paul Irish has written more about this.


We tested several approaches to find the best method to animate the bubbles. (View demo)

We pulled off the canvas method by creating two transparent canvases: one on top of the content and one below. We create our bubbles as objects with randomized properties in memory (diameter, speed, opacity, etc.). At each frame, we clear the canvas via context.clearRect(0, 0, width, height);, and then draw each bubble to the screen. To create a floating, bubble-like movement, we need to change each bubble’s x and y values in each frame. For the y-axis, we subtract a constant value in each frame: b.y = b.y - b.speed;.

In this case, we determine a unique speed for each bubble using (Math.random() / 2) + 0.1). For the x-axis, we need a smooth repetitive oscillation, which we can achieve by taking the sine value of its frame count: b.x = b.startX + Math.sin(count / b.amplitude) * 50;. You can view the extracted code and the demo.

The DOM-based implementation using CSS 3-D transforms follows a very similar method. The only big differences are that we dynamically create and insert DIV elements at the beginning and, using Modernizr, apply vendor-prefixed translate3d(x, y, z) properties on each animation frame. You can view the extracted code and the demo.

To optimize performance, we considered a canvas implementation because GPU acceleration has been enabled for the browsers we support (iOS 5 with its Nitro JavaScript, and Chrome for Android 4+); however, we noticed severe issues with aliasing and the frame rate on Android devices.


Timeline profiles using the canvas element and CSS 3-D transforms (View large version)

We also did some performance profiling in Chrome’s emulation mode on the desktop (better methods exist for doing more granular remote testing on a mobile device). The difference in results between the two was still interesting: A GPU-accelerated 2-D canvas showed better performance than GPU-accelerated CSS transforms, especially with a higher number of DOM elements, due to the rendering time for each one and the recalculation of styles.


After carefully considering several techniques, we went with CSS 3-D transforms to animate the bubbles. (View large version)

In the end, we used CSS 3-D transforms. We only need to animate 16 bubbles at a time, and the CPU and GPU on supported devices collectively seem to handle the overhead just fine. The performance and anti-aliasing issues with canvas rendering on old Android devices were the determining factors. At the time of writing and in this particular case, canvas wasn’t an option for us, but browser vendors certainly are not ignoring it, and the latest rendering engines of mobile browsers have seen massive improvements.

Waves

We use wave animations throughout both the mobile and desktop experience — specifically, as a design detail to reinforce the water theme and as a transition to wash away old content and bring in new content. As with the bubbles, we explored using both canvas and CSS-based animations. And likewise, CSS animations were the way to go. A wave PNG costs us only 7 KB, and we get much better performance from mobile browsers across the board.


As with bubbles, we explored using both canvas and CSS-based animations. (View demo)

Our isolated demo of the desktop implementation (which is similar to mobile) is really quite simple. Each wave is a background image set with background-repeat:repeat-x and a looping keyframe animation that moves left with linear easing. We make the speed of the waves in front slightly faster and the waves in the back slower to simulate depth. You can view the code, which uses Sass and Compass.

We also tried a very different vanilla JavaScript approach by creating a wave oscillation. We used a wave oscillator algorithm created by Ken Fyrstenberg Nilsen, adjusting it to suit our needs. You can view this demo, too.


We abandoned the oscillation effect because of poor performance on old Android devices.

The effect turned out to be really nice and organic, but the performance was lacking on old Android devices, so we abandoned the approach altogether.

API

During gameplay, we wanted to provide some insightful facts and location-based statistics, as well as encourage users to keep playing. We used several APIs, combining them with scores from our database.

The back end is run off of the Laravel PHP framework and a few APIs. For location-based statistics, we could have asked the user for their location via HTML5 geolocation, but we wanted a more seamless experience and didn’t want to interrupt the user with a confirmation dialog box. We don’t need a precise location, so we opted for MaxMind’s GeoIP2 service. This service gives us enough data to get the user’s rough location, which we can combine with other services and data.

We also want people to know that they are a part of a bigger community, so we wanted to provide statistics based on website analytics. The obvious choice was to use Google Analytics’ new API, as well as its newer Real Time Reporting API.

Because we have access to different kinds of data, we are able to display facts that are relevant to the user. For example, a user in the US would get a statistic on how their state compares to other states in the country, according to Google Analytics. By using Google’s Real Time Reporting API, we see how many active users are on the website, and we display that to the user, illustrating other people’s participation. In our PHP code, we use Google Analytics for Laravel 4 which works great and handles a lot of code, making it much easier to get data back from Google Analytics’ API.

$ga_realtime_metric = 'ga:activeVisitors'; $ga_service = Analytics::getService(); $optParams = array('dimensions' => $this->ga_dimensions, 'sort' => '-'. $this->ga_realtime_metric); $results = $ga_service->data_realtime->get([google profile id], $ga_realtime_metric, $optParams);

We also use GeoIP2’s service to record people’s times, to display the score of a particular city or state.

To prepare for spikes in traffic, to stay within each API’s rate limit (Google Analytics’ limit is 50,000 requests per project per day) and to optimize speed, we cache some data at 10-minute intervals. We cache certain other data, such as GeoIP2’s, even longer (every five days) because it doesn’t change that often.

Due to the ever-growing number of scores, the queries to retrieve certain statistics would take longer than is acceptable for each user. So, we set up a couple of CRON jobs to set these queries to run every 10 minutes, caching the updated statistics on the server.

When a user hits the website, an AJAX call to the server asks for the cached data, which is returned to the browser in a big JSON response. This increases loading times considerably and keeps us within the rate limit for each API that we use.

Conclusion

As mobile browsers continue to improve, offering new features and enhancing performance, new opportunities like this will arise. It’s always important to question whether you should build a native app or a Web app, and keep in mind the pros and cons of each, especially because the differences in their capabilities are narrowing rapidly.

Developing our Tap app for the Web not only was more affordable (with two Web developers working on a single code base, as opposed to a developer for each platform), but made it more accessible and easily shareable. We’ll never know, but we’re confident that we would not have reached 3.7 million website visits in the first month had we gone the native route. About 18% of those visits came from Safari in-app browsers — meaning that people had clicked on a link in their Facebook or Twitter feed and were taken directly into the experience. A native app would have seriously hampered that ability to share the experience or message quickly.

We hope this article has been helpful in illustrating both the thought process of Web versus native and the technical hurdles involved in building Tap. The project was really fun and challenging, it was for a good cause, and it introduced a unique mechanism for donating, one that we hope to see propagate and manifested in new and creative ways.

Further Ressources

(al, il, ml)

© Nick Jonas und Francis Villanueva for Smashing Magazine, 2014.

How To Build A Ruby Gem With Bundler, Test-Driven Development, Travis CI And Coveralls, Oh My!

Tue, 04/08/2014 - 09:39

  

Ruby is a great language. It was designed to foster happiness and productivity in developers, all the while providing tools that are effective and yet focused on simplicity. One of the tools available to the Rubyist is the RubyGems package manager. It enables us both to include “gems” (i.e. packaged code) that we can reuse in our own applications and to package our own code as a gem to share with the Ruby community. We’ll be focusing on the latter in this article.

I’ve written an open-source gem named Sinderella (available on GitHub), and in this article I’ll go through all of the steps I took to write the code (including the test-driven development process) and how I prepared it for release as a gem via RubyGems. I’ll also show you how to set up your tests to run through a continuous integration (CI) server using the popular Travis CI service.

In case you’re unfamiliar with CI, it refers to the process of merging code with a central repository, with the aim of preventing integration problems down the road in a project’s life cycle. (If you use a version control system such as git and a decentralized code repository such as GitHub, then you might already be familiar with these concepts.)

Finally, I’ll show you how to use Coveralls to measure the code coverage of your tests and to obtain a statistical history of your commits.


Image credit: The Ruby and Bundler logos, along with the Travis CI mascot.

What We’ll Cover What Does Sinderella Do?

As described in the README on GitHub, Sinderella allows the author to “pass a code block to transform a data object for a specific period of time.” So, if we provide data like the following…

{ :key => 'value' }

… then we could, for example, convert it to the following for a set period of time:

{ :key => 'VALUE' }

Once the time period has expired, the data is returned to its normal state.

Sinderella is made up of two files: the main application and a data store that holds the original and transformed data.

Later in this article, I’ll describe my development process for creating the gem, and we’ll review some of the techniques required to produce a robust and stable gem.

What We Won’t Cover

To be clear, this article is focused on creating a Ruby gem using Bundler and on following best practices, such as test-driven development and CI.

We won’t cover how to write Ruby code or how we developed the Sinderella gem. Nor will we cover how to write RSpec tests (although we will demonstrate how to set up RSpec). RSpec is a detail of implementation and can be swapped out for any testing library that you deem appropriate.

Additional Requirements

To get started, you’ll need to register for accounts with the following services:

Registering for these services is free. Travis CI is free for all open-source projects (which this will be). You may pay for a Pro account, which allows you to set up CI for your private code repositories, but that’s not needed for what we’ll be doing here.

You’ll also need to be comfortable working in the command line. You don’t have to be a Unix shell scripting wizard, but I’ll be working here exclusively in a shell environment (specifically, using the Terminal on Mac OS X) to do everything, including running shell commands, opening multiplexers (such as tmux) and editing code (with Vim).

Which Version Of Ruby To Use

Ruby has many different flavors:

  • Ruby (also known as Matz’s Ruby Interpreter) is the original language, written in C.
  • Rubinius is an implementation of Ruby that is written mainly with Ruby.
  • JRuby is an implementation of Ruby built on top of the Java Virtual Machine (JVM), with Java.

I deliberately used JRuby to implement Sinderella because part of the gem’s code relies on “threads,” and MRI doesn’t provide true threading.

JRuby provides a native thread implementation because it is built on top of the JVM. But really, using any of the above variations would have been fine.

Unfortunately, though, it’s not all clear sailing with JRuby. Quite a few gems still use C extensions (i.e. code written in C that Ruby can import). At the moment, you can enable a flag in JRuby that allows it to use C extensions, but doing so is merely a temporary solution because this option is expected to be removed from JRuby in future releases.

This could be an issue, for example, if you’re using Pry (a replacement for Ruby’s irb REPL). Pry works fine with JRuby, but you wouldn’t be able to take advantage of the equally amazing pry-plus extension, which offers many extra debugging capabilities, because some of its dependencies rely on C extensions.

I’ve worked around this limitation somewhat by using pry-nav. It’s not as good and can be a little buggy in places when used under JRuby, but it gets the job done.

Bundler

To help us create the gem, we’ll use the popular Bundler gem.

Bundler is primarily designed to help you manage a project’s dependencies. If you’ve not used it before, then don’t worry because we’ll be taking advantage of a lesser known feature anyway, which is its ability to generate a gem boilerplate. (It also provides some other tools that will help us manage our gem’s packaging, which I’ll get into in more detail later on.)

Let’s begin by installing Bundler:

gem install bundler

Once Bundler is installed, we can use it to create our gem. But before doing that, let’s review some other dependencies that we’ll need.

Dependencies

Developing the Sinderella gem requires five dependencies. Four are needed during the development process and won’t be needed in production. The fifth is a “hard” dependency, meaning that it is needed for the Sinderella gem to function properly.

Of these dependencies, Crimp and RSpec are specific to Sinderella. So, when developing your own gem, you would likely replace them with other gems.

RubyGems

We need to install RubyGems in order to take advantage of the package manager and its built-in gem commands (which Bundler will wrap with its own enhancements).

RSpec

RSpec is a testing framework for the Ruby programming language. We’ll cover this in more detail later on in the article.

When building your own gem, you might want to swap RSpec for a different testing tool. Another popular option is Cucumber.

Guard

Guard is a command-line tool that responds to events. We’ll be using it to more easily write code for test-driven development. It works by monitoring files that you tell it to watch and then, when it notices changes to those files, triggering some command that you specify based on the type of file that was changed.

This comes in really handy when you’re running tests in a multiplexer such as tmux or when using a terminal such as iTerm2 (which supports multiple terminal windows being open at once), because while you’re editing the code in one terminal, you can get instant feedback to breaking tests as you work on the code. This is known as a tight feedback loop (more on this later).

Pry

Pry is a replacement REPL for Ruby’s standard irb. It offers everything the standard irb does but with a lot of additional features. It’s useful for testing code to see how it works and whether the Ruby interpreter fails to run it. It’s also useful for debugging code when something doesn’t work the way you expect.

It didn’t have much of a presence in the development of Sinderella, but it is such an important tool that I felt it deserved more than a cursory mention. For example, if you’re unsure of how a particular Ruby feature works, you could test drive it in Pry.

If you want to learn more about how to use it, then watch the screencast on Pry’s home page.

Crimp

Crimp is a gem released by the BBC that allows you to convert a piece of data into a MD5 hash.

Generating A Boilerplate

OK, now we’ve finally gotten to the point where we can generate the set-up files that will configure our gem file.

As mentioned, Bundler has the tools to generate the foundation of a gem so that we don’t have to type it all out by hand.

Now, open up the terminal and run the following command:

bundle gem sinderella

When that command is run, the following is generated:

❯ bundle gem sinderella create sinderella/Gemfile create sinderella/Rakefile create sinderella/LICENSE.txt create sinderella/README.md create sinderella/.gitignore create sinderella/sinderella.gemspec create sinderella/lib/sinderella.rb create sinderella/lib/sinderella/version.rb Initializing git repo in /path/to/Sinderella

Let’s take a moment to review what we have.

Folder Structure

Bundler has automatically created a lib directory for us, which holds a single Ruby file named after our project. The name of the directory is extracted from the name provided via the bundle gem command.

Be aware that if you specify a hyphen (-) in the gem’s name, then Bundler will create a deeper folder structure by using the hyphen as a delimiter. For example, if your command looks like bundle gem foo-bar, then the following directory structure would be created:

├── lib │   └── foo │   ├── bar │   │   ├── bar.rb │   │   └── version.rb │   └── bar.rb

This is actually quite useful when you’re producing multiple gems that are all namespaced under a single project. For a real-world example of this, look at BBC News’ GitHub repository, which has multiple open-source gems published under the namespace alephant.

gemspec

The gemspec file is used to define the particular configuration of your gem. If you weren’t using Bundler, then you would need to manually create this file (according to RubyGems’ documentation).

Below is what Bundler generates for us:

# coding: utf-8 lib = File.expand_path('../lib', __FILE__) $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib) require 'sinderella/version' Gem::Specification.new do |spec| spec.name = "sinderella" spec.version = Sinderella::VERSION spec.authors = ["Integralist"] spec.email = ["mark.mcdx@gmail.com"] spec.summary = %q{TODO: Write a short summary. Required.} spec.description = %q{TODO: Write a longer description. Optional.} spec.homepage = "" spec.license = "MIT" spec.files = `git ls-files -z`.split("\x0") spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) } spec.test_files = spec.files.grep(%r{^(test|spec|features)/}) spec.require_paths = ["lib"] spec.add_development_dependency "bundler", "~> 1.5" spec.add_development_dependency "rake" end

As you’ll see later, this is a basic outline of the final gemspec file that we’ll need to create. We’ll end up adding to this file some of the other dependencies that our gem will need to run (both development and production dependencies).

For now, note the following details:

  • $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
    This adds the lib directory to Ruby’s load path, which makes require’ing files elsewhere in the code a little cleaner.
  • require 'sinderella/version'
    This loads in a version.rb file, which was generated when Bundler constructed our boilerplate. This file serves as a way to implement semantic versioning in our gem releases. Every time we release the gem, we’ll need to update the version number; then, when we run the particular Bundler command to release the gem, it will automatically pull in the updated value to our gemspec file.
  • Gem::Specification.new do |spec|
    Here, we define a new specification and include properties such as the name of the gem, the version number (see the previous point), a list of the authors of the gem and a contact email address. We can also include some descriptive text about the gem.
  • Next, we define the files to include in the gem. Any executable files found are injected dynamically into the file by looping through a bin directory (if one is found). We also dynamically inject a list of test files (which we’ll see later on when we create a spec folder to hold the tests that will ensure that the gem works as expected).
  • Finally, we define the dependencies, including both runtime and development dependencies. At the moment, there is only the latter, but soon enough we’ll have one runtime dependency to add.

The RubyGems guides has full details on the specification. You could configure a whole host of settings, but Bundler helps us by defining the essential ones.

Gemfile

In a typical Ruby project, you’ll find that the Gemfile is filled with a list of dependencies, which Bundler then collates and installs for you. In this instance, because we’re generating a gem and not writing a standard application, our Gemfile will actually be pretty bare, made up of two lines: one to tell Bundler where to source the gems from, and the other to inform Bundler that the dependencies are listed in the gemspec file instead.

Rakefile

Again, in a typical Ruby application, a Rakefile will contain many different tasks (written in Ruby) that you can execute via the command line. In this case, a one-line Rakefile has been provided that loads bundler/gem_tasks. That in turn loads additional rake commands that Bundler adds to make it easier to build and deploy your gem. We’ll see how to use these commands later.

LICENSE.txt

Because we’re releasing code that could potentially be used by other developers, Bundler generates an MIT licence by default and dynamically injects the current year and your user name into it.

Feel free to either delete it or replace it with another license if the MIT one doesn’t fit your needs, although it’s pretty standard and relevant to most projects.

README

Lastly, Bundler has taken the tediousness out of generating a README file. It includes TODO messages wherever relevant, so that you know what needs to be manually added before the gem can be built (such as a description of the gem and a code example that shows how you expect the gem to be used). It also automatically generates installation instructions and a section on how other developers can fork your code and contribute new features and bug fixes.

One other benefit of Bundler is that it delivers a consistent code base across all gems you create. All gems will have the same structure, and the consistency across content such as the README file will make it easier for users who integrate more than one of your gems to understand them.

Test-Driven Development

Test-driven development (TDD) is the process of building code on top of supporting tests. Sinderella was developed using its principles.

The guiding steps are “red, green, refactor,” and TDD fundamentally breaks down as the following:

  1. Write a test.
  2. Run the test and watch it fail (because there is no code yet for it to pass).
  3. Write the least amount of code to pass the test (literally, hack it together).
  4. Refactor the code so that it’s cleaner and better written.
  5. If the test has failed through refactoring, then start the red, green, refactoring process again.

This is sometimes referred to as a tight feedback loop: getting quick or instant feedback on whether code is working.

By writing the tests first, you ensure that every line of code exists for a reason. This is an incredibly powerful principle and one you should recall when caught in a debate over whether TDD “sucks” or “takes too long.”

Starting a project with tests can feel daunting. But in addition to ensuring that every line of code exists for a reason, it provides an opportunity for you to properly design the APIs.

RSpec

As for writing tests for Sinderella, I chose to use RSpec, which is described thus on its website:

RSpec is a testing tool for the Ruby programming language. Born under the banner of behaviour-driven development, it is designed to make test-driven development a productive and enjoyable experience

In order to use RSpec in our gem, we’ll need to update the gemspec file to include more dependencies:

spec.add_development_dependency "rspec" spec.add_development_dependency "rspec-nc" spec.add_development_dependency "guard" spec.add_development_dependency "guard-rspec" spec.add_development_dependency "pry" spec.add_development_dependency "pry-remote" spec.add_development_dependency "pry-nav"

As you can see, we’ve added RSpec to our list of dependencies, but we’ve also included rspec-nc, which provides native notifications on Mac OS X (rspec-nc is a nicety and not essential to produce the gem). Having notifications at the operating-system level can be quite handy, allowing you to do other things (perhaps check email) while tests run in the background.

We’ve also added (as you would expect) guard as a dependency, as well as guard-rspec, which Guard will need in order to understand how to handle RSpec-specific requests. This suite of Pry tools will debug any problems we come across and will be useful for any gems you develop in future.

RSpec Rake Tasks

Now that we’ve updated gemspec to include RSpec as a dependency, we’ll need to add an RSpec-related Rake task to our Rakefile, which will enable us (manually) or Guard to execute the task and run the RSpec test suite:

require 'rspec/core/rake_task' require 'bundler/gem_tasks' # Default directory to look in is `/specs` # Run with `rake spec` RSpec::Core::RakeTask.new(:spec) do |task| task.rspec_opts = ['--color', '--format', 'nested'] end task :default => :spec

In the updated version of Rakefile above, we are loading an additional file that is packaged with RSpec (require 'rspec/core/rake_task'). This new file adds some RSpec-related modules and classes for us to use.

Once this code has loaded, we create a new instance of the RakeTask class (created when we loaded rspec/core/rake_task) and pass it a code block to execute. The code block we pass will define the options for our RSpec test suite.

Spec Files

Now that the majority of the RSpec test suite configuration is in place, the last thing we need to do is add a test file.

Let’s create a spec directory and, inside that, create sinderella_spec.rb:

require 'spec_helper' describe Sinderella do it 'does stuff' do pending # no code yet end end

You’ll see that we’ve included a temporary specification that states that the code “does stuff.” When the test suite is run, then this test will not cause any errors, even though no code has been implemented yet, because we have marked the test as “pending” (an RSpec-specific command). At this point, we’re only interested in getting a barebones set-up in place; we’ll flesh out the tests soon enough.

You may have noticed that we’re also loading another file, named spec_helper.rb. This type of file is typical in an RSpec suite and is used to load any dependencies or libraries that are required for the tests to run. The content of the spec helper file will look like this:

require 'pry' require 'Sinderella'

All we’ve done here is load Pry (in case we need it for debugging) and the main Sinderella gem code (because this is what we want to test).

Guard And tmux

At this point, we’ve gone over the set-up and preparation of RSpec and Rake (to get our testing framework in place). We also know what Guard is and how it helps us to test the code. Now, let’s go ahead and add a Guardfile to the root directory, with the following contents:

guard 'rspec' do # watch /lib/ files watch(%r{^lib/(.+)\.rb$}) do |m| "spec/#{m[1]}_spec.rb" end # watch /spec/ files watch(%r{^spec/(.+)\.rb$}) do |m| "spec/#{m[1]}.rb" end end

This file tells Guard that we’re using RSpec to run our tests. It also defines which directories to watch for changes and what to do when it notices changes. In this case, we’re using regular expressions to match any files in the lib or spec directory and to execute the relevant RSpec command that runs our tests (or to run one specific test).

We’ll see in a minute how to actually run Guard. For now, let’s see how tmux fits this workflow.

tmux

Some developers prefer to have separate applications open (for example, a code editor such as Sublime Text and a terminal application to run tests). I prefer to use tmux to have multiple terminal shells open on one screen and to have Vim open on another screen to edit code. Thus, I can edit code and get visual feedback from the terminal about the state of the tests all on one screen. You don’t need to follow the exact same approach. As mentioned, there are other ways to get feedback, but I have found tmux and Vim to be the most suitable.

So, we have two tmux panes open, one in which Vim is running, and the other in which a terminal runs the command bundle exec guard (this is how we actually run Guard).

That command will return something like the following back to the terminal:

❯ bundle exec guard 09:53:55 - INFO - Guard is using Tmux to send notifications. 09:53:55 - INFO - Guard is using TerminalTitle to send notifications. 09:53:55 - INFO - Guard::RSpec is running 09:53:55 - INFO - Guard is now watching at '/path/to/Sinderella' From: /path/to/Sinderella/sinderella.gemspec @ line 1 : => 1: # coding: utf-8 2: lib = File.expand_path('../lib', __FILE__) 3: $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib) 4: require 'sinderella/version' 5: 6: Gem::Specification.new do |spec|

From this point on, you can press the Return key to run all tests at once, which will display the following message in the terminal:

09:57:41 - INFO - Run all 09:57:41 - INFO - Running all specs

This will be followed by the number of passed and failed tests and any errors that have occurred.

Continuous Integration With Travis CI

As mentioned at the beginning, continuous integration (CI) is the process of merging code with a central repository in order to prevent integration problems down the road in a project’s life cycle.

We’ll use the free Travis CI service (which you should have signed up for by now).

Upon first viewing your “Accounts” page in Travis CI, you’ll be presented with a complete list of all of your public GitHub repositories, from which you can select ones for Travis CI to monitor. Then, any time you push a commit to GitHub, Travis CI will run your tests.

Once you have selected repositories, you’ll be redirected to a GitHub “hooks” page, where you can confirm and authorize the configuration.

The Travis CI page for the Sinderella gem is where you can view the entire build history, including both passed and failed tests.

.travis.yml

To complete the configuration, we need to add a .travis.yml file. If you’ve enabled your repository from your Travis CI account and you don’t have a .travis.yml file, then Travis CI will throw an error and complain that you need one. Let’s look at the one we’ve set up for Sinderella:

language: ruby cache: bundler rvm: - jruby - 2.0.0 script: 'bundle exec rake' notifications: email: recipients: - my@email.com on_failure: change on_success: never

Let’s go through each property to understand what it does:

  • language: ruby
    Here, we’re telling Travis CI that the language in which we’re writing tests is Ruby.
  • cache: bundler
    This tells Travis CI that we want it to cache the gems we’ve specified. (Running Bundler can be a slow process, and if your gems are unlikely to change often, then you don’t want to keep running bundle install every time you push a commit, because we want our tests to run as quickly as possible.)
  • rvm:
    This specifies the different Ruby versions and engines that we want our tests to run against (in this case, JRuby and MRI 2.0.0).
  • script: 'bundle exec rake'
    This gives Travis CI the command it requires to run the tests.
  • notifications:
    This indicates how we want Travis CI to notify us. Here, we’re specifying an email address to receive the notifications. We’re also specifying that an email should be sent only if a failure has occurred (there’s no point in getting thousands of emails telling us that nothing is wrong).
Preventing a Test Run

If you’re committing a change that doesn’t affect your code or tests, then you don’t want to waste time watching those non-breaking changes trigger a test run on Travis CI (no matter how fasts the tests are).

The easiest way to avoid this is to add [ci skip] anywhere in your commit message. Travis CI will see this and then happily ignore the commit.

Code Coverage And Statistics With Coveralls.io

One last service we’ll use is Coveralls, which you should have already registered for.

Coveralls works with your continuous integration server to give you test coverage history and statistics. Free for open source, pro accounts for private repos.

When you log into Coveralls for the first time, it will ask you to select repositories to monitor. It works like Travis CI, listing all of your repositories for you to enable and disable access. (You can also click a button to resynchronize the repository list, in case you’ve added a repository since last syncing).

To set up Coveralls, we need to add a file that tells Coverall what to do. For our project, we need to add a file to the root directory named .coveralls.yml, in which we’ll include a single line of configuration:

service_name: travis-ci

This tells Coveralls that we’re using Travis CI as our CI server. (If you’ve signed up for a Pro account, then use travis-pro instead.)

We also need to add the Coveralls gem to our gemspec:

spec.add_development_dependency "coveralls"

Finally, we need to include Coveralls’ code in our spec_helper.rb file:

require 'coveralls' Coveralls.wear! require 'pry' require 'sinderella'

Notice that we have to load the code before the Sinderella code. If you load Coveralls after the application’s code has loaded, then it wouldn’t be able to hook into the application properly.

Let’s return to our TDD process.

Skeleton Specification

When following TDD, I prefer to create a skeleton of a test suite, so that I have some idea of the type of API to develop. Let’s change the contents of the sinderella_spec.rb file to have a few empty tests:

require 'spec_helper' describe Sinderella do let(:data) {{ :key => 'value' }} let(:till_midnight) { 0 } describe '.transforms(data, till_midnight)' do it 'returns a hash of the passed data' do pending end it 'stores original and transformed data' do pending end it 'restores the data to its original state after set time' do pending end end describe '.get(id)' do context 'before midnight (before time expired)' do it 'returns transformed data' do pending end end context 'past midnight (after time expired)' do it 'returns original data' do pending end end end describe '.midnight(id)' do it 'restores the data to its original state' do pending end end end

Notice the pending command, which is provided by RSpec and allows the tests to run without throwing an error. (The suite will highlight pending tests that still need to be implemented so that you don’t forget about them.)

You could also use the fail command, but pending is recommended for unimplemented tests, particularly before you’ve written the code to execute them. Relish demonstrates some examples.

From here on, I follow the full TDD process and write the code from the outside in: red, green, refactor.

For the first test I wrote for Sinderella, I realized that my code needs a way to create an MD5 hash from a data object, and that’s when I reached for the BBC News’ gem, Crimp. Thus, I had to update the gemspec file to include a new runtime dependency: spec.add_runtime_dependency "crimp".

I won’t go step by step into how I TDD’ed the code because it isn’t relevant to this article. We’re focusing more on the principles of creating a gem, not on details of implementation. But you can get all of the gruesome details from the public list of commits in Sinderella’s GitHub repository.

Also, you might not even be interested in the RSpec testing framework and might be planning on using a different framework to write your gem. That’s fine. Anyway, what follows is the full Sinderella specification file (as of February 2014):

sinderella_spec.rb require 'spec_helper' describe Sinderella do let(:data) {{ :key => 'value' }} let(:till_midnight) { 0 } def create_new_instance @id = subject.transforms(data, till_midnight) do |data| data.each do |key, value| data.tap { |d| d[key].upcase! } end end end describe '.transforms(data, till_midnight)' do it 'returns a MD5 hash of the provided data' do create_new_instance expect(@id).to be_a String expect(@id).to eq '24e73d3a4f027ff81ed4f32c8a9b8713' end end describe '.get(id)' do context 'before midnight (before time expired)' do it 'returns the transformed data' do Sinderella.stub(:check) create_new_instance expect(subject.get(@id)).to eq({ :key => 'VALUE' }) end end context 'past midnight (after time expired)' do it 'returns the original data' do create_new_instance Sinderella.reset_data_at @id expect(subject.get(@id)).to eq({ :key => 'value' }) end end end describe '.midnight(id)' do context 'before midnight (before time expired)' do it 'restores the data to its original state' do Sinderella.stub(:check) create_new_instance subject.midnight(@id) expect(subject.get(@id)).to eq({ :key => 'value' }) end end end end data_store_spec.rb require 'spec_helper' describe DataStore do let(:instance) { DataStore.instance } let(:original) { 'bar' } let(:transformed) { 'BAR' } before(:each) do instance.set({ :id => 'foo', :original => original, :transformed => transformed }) end describe 'set(data)' do it 'stores original and transformed data' do expect(instance.get('foo')[:original]).to eq(original) expect(instance.get('foo')[:transformed]).to eq(transformed) end end describe 'get(id)' do it 'returns data object' do expect(instance.get('foo')).to be_a Hash expect(instance.get('foo').key?(:original)).to be true expect(instance.get('foo').key?(:transformed)).to be true end end describe 'reset(id)' do it 'replaces the transformed data with original data' do instance.reset('foo') foo = instance.get('foo') expect(foo[:original]).to eq(foo[:transformed]) end end end Passing Specification

Here is the output of our passed test suite:

❯ rake spec /path/to/.rubies/jruby-1.7.9/bin/jruby -S rspec ./spec/data_store_spec.rb ./spec/sinderella_spec.rb --color --format nested DataStore set(data) stores original and transformed data get(id) returns data object reset(id) replaces the transformed data with original data Sinderella .transforms(data, till_midnight) returns a MD5 hash of the provided data .get(id) before midnight (before time expired) returns the transformed data past midnight (after time expired) returns the original data .midnight(id) before midnight (before time expired) restores the data to its original state Finished in 0.053 seconds 7 examples, 0 failures Design Patterns

According to Wikipedia:

A design pattern in architecture and computer science is a formal way of documenting a solution to a design problem in a particular field of expertise.

Many design patterns exist, one of which in particular is usually frowned on, the Singleton pattern.

I won’t debate the merits or problems of the Singleton design pattern, but I opted to use it in Sinderella to implement the DataStore class (which is the object that stores the original and transformed data), because what would be the point of having multiple instances of DataStore if the data is expected to be shared from a single access point?

Luckily, Ruby makes it really easy to create a Singleton. Just add include Singleton in your class definition.

Once you’ve done that, you will be able to access a single instance of your class only via an instance property — for example, MyClass.instance.some_method().

We saw the specification (or test file) for DataStore in the previous section. Below is the full implementation of DataStore:

require 'singleton' class DataStore include Singleton def set(data) hash_data = { :original => data[:original], :transformed => data[:transformed] } container.store(data[:id], hash_data) end def get(id) container.fetch(id) end def reset(id) original = container.fetch(id)[:original] hash_data = { :original => original, :transformed => original } container.store(id, hash_data) end private def container @store ||= Hash.new end end Badges

You might have seen some nice green badges in your favorite GitHub repository, indicating whether the tests associated with the code passed or not. Adding these to the README is straightforward enough:

[![Build Status](https://travis-ci.org/Integralist/Sinderella.png?branch=master)](https://travis-ci.org/Integralist/Sinderella) [![Gem Version](https://badge.fury.io/rb/sinderella.png)](http://badge.fury.io/rb/sinderella) [![Coverage Status](https://coveralls.io/repos/Integralist/Sinderella/badge.png)](https://coveralls.io/r/Integralist/Sinderella)

The first badge is provided by Travis CI, which you can read more about in the documentation.

The second is provided by RubyGems. You’ll notice on your gem’s page a “badge” link, which provides the required code and format (in this case, in Markdown format).

The third is provided by Coveralls. When you visit your repository page in the Coveralls application, you’ll see a link to “Get badge URLS”; from there, you can select the relevant format.

REPL-Driven Development

Tests and TDD are a critical part of the development process but won’t eliminate all bugs by themselves. This is where a tool such as Pry can help you to figure out how a piece of code works and the path that the code takes during a conditioned execution.

To use Pry, enter the pry command in the terminal. As long as Pry is installed and available from that directory, you’ll be dropped into a Pry session. To view all available commands, run the help command.

Testing a Local Gem Build

If you want to run the gem outside of the test suite, then you’ll want to use Pry. To do this, we’ll need to build the gem locally and then install that local build.

To build the gem, run the following command from your gem’s root directory: gem build sinderella.gemspec. This will generate a physical .gem file.

Once the gem is built and a .gem file has been created, you can install it from the local file with the following command: gem install ./sinderella-0.0.1.gem.

Notice that the built gem file includes the version number, so that you know you’re installing the right one (in case you’ve built multiple versions of the gem).

After installing the local version of the gem, you can open a Pry session and load the gem with require 'sinderella' and continue to execute your own Ruby code within Pry to test the gem as needed.

Releasing Your Gem

Once our gem has passed all of our tests and we’ve built and run it locally, we can look to release the gem to the Ruby community by pushing it to the RubyGems server.

To release our gem, we’ll use the Rake commands provided by Bundler. To view what commands are available, run rake --task. You’ll see something similar to the following output:

rake build # Build sinderella-0.0.1.gem into the pkg directory rake install # Build and install sinderella-0.0.1.gem into system gems rake release # Create tag v0.0.1 and build and push sinderella-0.0.1.gem t... rake spec # Run RSpec code examples
  • rake build
    This first task does something similar to gem build sinderella.gemspec but placing the gem in a pkg (package) directory.
  • rake install
    The second task does the same as gem install ./sinderella-0.0.1.gem but saves us the extra typing.
  • rake release
    The third task is what we’re most interested at this point. It creates a tag in git, indicating the relevant version number, pulled from the version.rb file that Bundler created for us. It then builds the gem and pushes it to RubyGems.
  • rake spec
    The fourth task runs the tests using the test runner (in this case, RSpec), as defined and configured in the main Rakefile.

To release our gem, we’ll first need to make sure that the version number in the version.rb file is correct. If it is, then we’ll commit those changes and run the rake release task, which should give the following output:

❯ rake release sinderella 0.0.1 built to pkg/sinderella-0.0.1.gem. Tagged v0.0.1. Pushed git commits and tags. Pushed sinderella 0.0.1 to rubygems.org.

Now we can view the details of the gem at https://rubygems.org/gems/sinderella, and other users may access our gem in their own code simply by including require 'sinderella'.

Conclusion

Thanks to the use of Bundler, the process of creating a gem boilerplate is made a lot simpler. And thanks to the principles of TDD and REPL-driven development, we know that we have a well-tested piece of code that can be reliably shared with the Ruby community.

(al, il)

© Mark McDonnell for Smashing Magazine, 2014.

Involving Clients In Your Mobile Workflow

Mon, 04/07/2014 - 10:12

  

A lot of mobile-minded talented folks across the globe produce great work, but yet sometimes you still hear many of them complain about their relationships with their clients. They often mention feeling isolated and not truly understanding what the client really needed.

This lack of personal interaction often leads to misunderstanding, as well as less awareness of and appreciation for all your hard work. While involving clients in your mobile workflow can be challenging, really working together will make a big difference. In this article, I’ll share some important things I’ve learned about involving clients in my mobile workflow. Let’s dive into some tips and tricks that I use every day.

Work Out Your Manifesto

Projects don’t happen overnight. It usually takes a few meetings to get to know the client and to discuss collaboration. Your company’s business strategists and account managers invest a lot of time and energy in this process. While they will often seem to distance themselves from your daily work, speaking with them is a real window of opportunity. These “suits” are the first ones to meet potential clients, and they convey your company’s vision, portfolio and creative approach. They can be a great help in nurturing a more involved relationship.

A great way to approach this internal conversation is to work out a manifesto, a summary of your creative vision and beliefs. Get together with your team and discuss your existing workflow and how it could further support what you really stand for as a team. Ask the team lead to help you work it out and make the message tangible. Do this simply by making a presentation to your colleagues. But why stop there? You could design posters, flyers, even stickers for your team so that they can help you spread the word.


“Design is not an afterthought,” from Little Miss Robot’s manifesto. (Large version)

We were getting really frustrated with clients asking us to define or optimize their mobile experience, when in fact they just wanted us to make things “prettier.” The slide above helps our client service directors to detect how potential clients really think about design. If we see that they don’t value our vision or approach, then we respectfully decline to work with them. Involvement starts with finding clients who want you to work with them, instead of for them.

Don’t Miss The Kick-Off

A kick-off meeting is the perfect opportunity to raise awareness of and appreciation for your mobile workflow. Learn as much as possible about the client, and find out how they would like you to help their business. Do this simply by asking about their vision, strategy and goals. Also great is to ask what inspires them and to get insight into their competitive research and analysis. From the minute you show true interest in their business, you are changing the way they look at you. By immediately working with them, you become their partner, instead of just someone who designs and codes.

A kick-off meeting is also a great time to double-check that you are on the same page. Sometimes we forget that our creative jargon might confuse clients. Big Spaceship points this out in its inspiring manual (PDF):

“We act like humans, we talk like humans, and we think like humans. And we call out anyone who does the opposite.”

In the last two years, I’ve learned that clients find it very hip to focus on responsive design, even if they don’t clearly understand it. Too often, it leads to a discussion on size and dimensions, when the conversation should be conceptual and strategic. Reserve some time in your kick-off meeting to explain what “responsive” means and why you believe in its value. Educate the client and steer the conversation towards what is really needed to make the project better. And if you notice that a certain topic needs more time and attention, host a mini-workshop to talk it through.

Dealing With Isolation

I don’t understand why some account and project managers try to keep their team away from the client as much as possible. Granted, it makes perfect sense that they manage the client, oversee the scope, deadlines and budget, and handle the communication and next steps. But when the work is in progress, keeping the team isolated doesn’t add any value. If this happens to you, explain to the manager that getting direct feedback from the client will help you fine-tune the product better and more quickly — a win-win for everyone.

At Little Miss Robot, we try to hold half of our meetings in our studio. Clients find it inspiring to be in this creative environment — especially because it is where their own product is being developed. In long-term projects, we also ask the client to designate a space at their office for our team to work on the project. When developing Radio+, we worked at the client’s headquarters twice a week. Anyone could hop in and out of the space and have informal conversations about the work. Not only did it create a great atmosphere, but we also received the most valuable feedback during these times. Highly recommended!


The Radio+ room, a shared workspace. (Large version)

Seeing Things

A typical project starts by the team exploring or defining what they will create. A lot of teams rely on textual aids, such as functional requirements. While these documents contain a lot of detail, I always end up having to address misinterpretations. The worst part is that these “minor” misunderstandings always pop up during the production stage, resulting in increased time and expenses. Have you noticed on these occasions that the client says they “saw” things a bit differently? This is why I recommend using text documents to scope features and using visual resources to describe them. Mind maps, wireframes, storyboards and paper prototypes are my personal favorites.


The wireframe for the Radio+ mobile website. (Large version)

I always encourage clients to get involved in generating these visual resources. Having them by your side during a brainstorm or a UX workshop is really helpful. While they wouldn’t consider themselves designers, I’m always challenged and inspired by their thinking and how they see things.

Feeling The Progress

Throughout the mobile development process, you will probably invite the client to several meetings to discuss the status of the project and to demo the product. Make sure you have something tangible to talk about. If a meeting is just about process, time or budget, then let the project manager handle it. Build momentum when meeting in person, and show your work in progress on real devices! Of course, you could print out the design or demo the application on a big screen, but the client should be able to feel the progress in their hands, too. Feeling a product grow in your hands is a much more powerful and engaging experience!

Some great tools exist to share designs across devices. We use AppTaster to share mockups, Dropbox to share designs and TestFlight to distribute apps to clients. If we are building a mobile website, then we just host it on the client’s servers internally, which allows them to view the latest version whenever they want.


Over-the-air beta testing for TestFlight. (Large version)

Happy Ending

Involving clients in your mobile workflow is the key to better understanding their problems, goals and strategies. You’ll also raise more awareness of and appreciation for your work, thus reducing negative energy and making discussions more positive and constructive. However big or small your team or client, it all starts with a desire to be involved. These take-aways can help you with that:

  1. Create a manifesto that explains what your team stands for.
  2. Hold a kick-off meeting to ask the client about their vision, strategy and goals.
  3. Use both your and their offices to meet.
  4. Scope features in text documents, and describe them in visual documents.
  5. Take advantage of third-party tools to share your work in progress on real devices.

Last but not least, read Jeremy Girard’s article on how to wrap up a project and follow up afterwards. This is critical to building and maintaining a long-term relationship. Most importantly, it will lead to future business because the client will already know and value your work.

Please feel free to share your experiences and thoughts in the comments below. I’m already looking forward to reading them.

(al, ml)

© Thomas Joos for Smashing Magazine, 2014.

Interview With Khajag Apelian: &#8220;Type Design Is Not Only About Drawing Letters&#8221;

Fri, 04/04/2014 - 09:31

  

Having started his career studying under some of the best typographic minds in the world, Khajag Apelian not only is a talented type and graphic designer, unsurprisingly, but also counts Disney as a client, as well as a number of local and not-for-profit organizations throughout the Middle East.

Even more impressive is Khajag’s willingness to take on work that most people would find too challenging. Designing a quality typeface is a daunting task when it’s only in the Latin alphabet. Khajag goes deeper still, having designed a Latin-Armenian dual-script typeface in four weights, named “Arek”, as well as an Arabic adaptation of Typotheque’s Fedra Display.

Given his experience in working between languages, it’s only logical that Khajag’s studio maajoun was chosen by the well-known and beloved Disney to adapt its logos for films such as Planes and Aladdin into Arabic, keeping the visual feel of the originals intact.

Q: Could you please start by telling us more about some of the typefaces you’ve designed?

Khajag: Well, I’ve only designed one retail font, and that is Arek. It started as my final-year project in the Type and Media program at KABK (Royal Academy of Art, the Hague). Arek was my first original typeface, and it was in Armenian, which is why it is very dear to me. I later developed a Latin counterpart in order to make it available through Rosetta, a multi-script type foundry.

Another font I designed is Nuqat, with René Knip and Jeroen van Erp. Nuqat was part of the “Typographic Matchmaking in the City” project, initiated by the Khatt Foundation between 2008 and 2010. In this project, five teams were commissioned to explore bilingual type for usage in public spaces.


Arek is a dual-script Latin-Armenian typeface family in four weights, with matching cursive styles. (Large preview)

I’ve also worked on developing the Arabic companion of Fedra Display by Typotheque. The font is not released yet but will be soon, hopefully in the coming year, so keep an eye on Typotheque if you’re interested.

Q: How did you start designing type?

Khajag: We had a foundational course in type design at Notre Dame University in Lebanon (NDU) during my bachelor’s degree. Actually, it was more like a project within a course, where we were asked to design an “experimental Arabic typeface” — something that was quite basic and that didn’t really involve type design, which I later realized when I entered the Type and Media program. So, that was the first project I worked on that could be considered close to designing type. The outcome is nothing to be proud of, but the process was a lot of fun.

Then, I started to work more and more with letters, although I never knew I could develop this interest, let alone study it later on. I only found out about the program at KABK during my final year at the university, when NDU graduate Pascal Zoghbi came to the school to present his Type and Media thesis project. That did it for me — two years later, I was there!


Typographic Matchmaking 2.0 parts 1-3. (Watch on YouTube)

Q: Tell us about the course at KABK. Did you focus only on designing Latin typefaces, or were you able to develop your skill in designing Arabic faces, too?

Khajag: The year at KABK was one of the best times I’ve had. It was intense, rich, fun and fast. It’s incredible how much you develop when surrounded by teachers who are considered to be the top of the typographic world and classmates who were selected from different places around the world, each bringing their own knowledge and experience to the table.

During the first semester, we tackled the basics of type design in calligraphy classes, practicing and exercising the principles of Latin type. We mostly learned the fundamentals of contrast, letter structure and spacing. This continued over the year through sketching exercises, designing type for different media and screens, and historical revivals.


A couple of type-drawing exercises on TypeCooker. (Image source)

Adapting these principles to the specifics of other scripts, like Arabic and Armenian, had to come from a more personal learning effort. But despite their modest knowledge of these scripts, the instructors are capable of guiding you through your final project. At the time, I decided to go with Armenian for my final project, but others have worked with other scripts, and the results have been strong and impressive.

Q: How do you keep the spirit of a typeface intact when moving from one language to another? Is it easier to maintain this feel when designing the Latin counterpart of an Armenian typeface, as you did with Arek, or when moving from Latin to Arabic, as you’re doing with Fedra Display?

Khajag: I think each project presents its own challenges to translating a certain spirit in different scripts. In the case of Arek, I started designing the Armenian without thinking about designing a Latin counterpart to it. So, my focus was entirely on one script. The process involved a lot of investigation of old Armenian manuscripts, from which my observations and findings were translated into the typeface. This naturally created a very strong spirit that I had to retain when I moved to designing the Latin counterpart.

Armenian and Latin letter proportions and constructions have certain similarities, which helped with the initial drawing of the Latin letters. I later had to reconsider some details, like the x-height, the serifs and the terminals, in order to achieve the ideal visual harmony.


This Arabic adaptation of Fedra Display. (Large preview)

In the case of Fedra Display Arabic, the spirit of the typeface was already there. The challenge was to translate the extreme weights of Fedra Sans Display to the existing Fedra Arabic. The Latin font is designed for headlines and optimized for a compact setting. These were important to retain when designing the Arabic counterpart. I experimented a lot with the weight distribution of the letterforms, something that is an established practice in the Latin script but not in the Arabic.

I had to find the right width and the maximum height of the letterforms in order to achieve similar blackness while maintaining the same optical size. Whereas, for the hairline, it was necessary to keep the compact feature of the Latin without undermining the Arabic script. A set of ligatures was designed to further enhance the narrowness of the font.

Q: Do you design only Arabic typefaces? If so, is there a particular reason for that?

Khajag: Besides Arek and a few other small projects I’ve been involved in, I mostly work with Arabic. The first direct reason is where I live, of course. Most of the time, clients in the region need to communicate in two languages, and that’s usually Arabic and English, or Arabic and French. The other reason is the number of Arabic fonts available compared to Latin fonts. Usually, when looking to communicate in English, I can find a way to do it through existing Latin fonts, but that’s not always the case with Arabic.

Although, I have to admit that a lot of good Arabic type is emerging in the design world nowadays. Still, there aren’t that many Arabic typefaces, and with time the good ones become overused and everyone’s designs start to look similar. This is why I look to differentiate my work through type. I do not always design complete functional typefaces; rather, I often develop “incomplete” fonts that I can use to write a word or a sentence for a poster or a book cover, and different lettering pieces here and there.


The identity poster and catalogue for “Miniatures: A Month for Syria” event, organized by SHAMS. (Large preview)

Q: Do you prefer to design Arabic typefaces that hold true to the calligraphic origins of the script, or is it more interesting to depart from those origins somewhat, as you did with Nuqat?

Khajag: I think Nuqat is quite an extreme case of departing from calligraphy. I consider it an experiment rather than a functional typeface. In any case, I don’t think I have a particular preference for typefaces to design. I am very much intrigued by the process, and in both cases there are some quite interesting challenges to tackle. A big responsibility comes with designing a typeface that must remain true to its calligraphic origins, something that comes with a lot of history and that has reached a level of perfection. And when you depart from that, you go through an abstraction process that can also be a fun exercise.


Nuqat is a display typeface designed by Khajag Apelian and René Knip for the “Typographic Matchmaking in the City” project, initiated by the Khatt Foundation. (Large preview)

Q: Where does your love of typography and graphic design come from?

Khajag: Like most teenagers about to start university, I was confused about my subject of study. At the time, I was part of a dance troupe with a friend who used to be a graphic designer. I liked her quite a bit and thought I could enroll in graphic design to be “cool” like her! I didn’t know what graphic design was about at the time. And so I enrolled. The foundation year was all about color theory, shapes and composition. It wasn’t until the second year or so that I started to realize what design was really about. Luckily, I loved it.

Later on, I took courses with Yara Khoury, and thanks to her I really got to appreciate typography. Yara was heavily influenced by different European schools that put typography on a pedestal, and she managed to transfer that to me and to other students. At NDU, we were exposed to the work of various designers from the Bauhaus and Swiss schools, and we were trained to capture the details and understand the function of type within graphic design. I was particularly fascinated by how one can go all the way from designing something that goes unnoticed by the reader to something that is very present and expressive, all just with type.

Q: Did you enjoy the visual departure from the Arabic culture you were surrounded by and brought up in, into the Modernist European one you were learning about? Did you ever find the aesthetic difference between the two difficult to navigate?

Khajag: Very much, actually. It wasn’t difficult to navigate per se, but rather overwhelming, maybe? Everything in the Netherlands is designed, and many of those things are featured in books as exemplary design. I had always been exposed to this through books and the Internet, but actually being immersed in it was another experience. One funny incident was when I spotted a police car for the first time, knowing it was branded by Studio Dumbar. I was so excited, I almost wanted to take a picture with them.

Q: How did you start off in the design industry? Could you also describe your role at your current company?

Khajag: My first job as a designer was in branding with Landor Associates in Dubai. I worked there for around a year, before going to the Netherlands for my master’s. After graduation, I extended my visa for a year and worked freelance with several Dutch design studios on projects that involved designing with Arabic. My work partner, Lara, was also living and working in the Netherlands at the time, and both of our visas were about to expire. Right before coming back to Beirut, we worked together on a cultural project with Mediamatic. We got comfortable working together and thought, Why not start a studio when we get back to Beirut? And so we did.


Book cover design and guidelines for Hachette Antoine, a regional publishing house that maajoun has been working with for over three years (Large preview)

When we started, we were highly inspired by Dutch business models, such as Mediamatic and O.K. Parking, which often initiate their own cultural or educational projects and events, sometimes funded through their commercial practice. This business model was somewhat new to us at the time. Things have changed since then, and many design agencies nowadays have their own cultural or educational projects, sometimes referred to as “R&D” or “corporate social responsibility”. Far from being a corporate strategy, we like to think of our side projects as a channel to exchange knowledge with other designers in our area.

Our commercial practice, on the other hand, is focused on editorial design, lettering and type design. Our studio is rather small (most of the time, only the two of us), which means we both have to do a bit of everything, even accounting!

Q: What have been your biggest achievements till now?

Khajag: I consider maajoun to be one of my biggest achievements to date. I love what we do. When you work on fun projects in university (whether cultural or experimental), everyone tries to make you feel like you should enjoy it as much as you can because you won’t get to do much of it in the “real world.” That’s not true. At maajoun, we work on interesting projects, we take the time to experiment, and we have fun!

Publishing Arek with Rosetta would be another big achievement. Arek is the first typeface that I seriously developed, and I am really happy it is out there and available to the public.


Maajoun’s submission to GrAphorisms, a project initiated by SHS Publishing (Large preview)

Q: You’ve done some work on Arabic versions of logos for several Disney films. Are you able to share with us what that process has been like?

Khajag: Arabic logo adaptation is becoming more and more common in the Middle East and North Africa, whose markets big international brands are trying to reach. Disney is no exception. We were asked to design the Arabic versions of the logos for several Disney films, including Aladdin, The Lion King and Beauty and the Beast.

We usually start by analyzing the original logo, its visual characteristics and some distinctive shapes; most importantly, we try to extract some cultural references from the lettering technique used in the logo, whether it has a 1960s retro feel or some elegance in a classical serif. We then try to translate these both visually and conceptually to the Arabic. This helps us to create a logo that works well visually with its Latin counterpart, without compromising the essence of the Arabic script.


Maajoun’s adaptation of Disney logos to Arabic script (Large preview)


The Arabic adaptation for Disney’s Tangled (Large preview)

Q: Is there a way for readers to know what conferences you’ll be speaking at or attending, or workshops you’ll be organizing?

Khajag: Kristyan Sarkis, Lara and I decided a few months ago to start a series of Arabic lettering workshops, which we’ll try to carry to different cities every now and then. We started during Beirut’s Design Week in June 2013 and had another session in July. We are having another one around May in Beirut, so those who are interested can stay tuned to our Facebook page.

Also, the Khatt Foundation usually organizes a workshop on Arabic type design at Tashkeel in Dubai. I usually take part in this. It’s an intensive nine-day workshop. The first three days concentrate on Arabic calligraphy and lettering, while the next six days are on Arabic type design. I also usually announce these things through Twitter (@debakir and @maajoun) or through maajoun’s page on Facebook.

Q: What advice would you give to young readers out there who are interested in becoming a type designer?

Khajag: Go for it! But know that type design is not only about drawing letters. It involves research and a lot of technical work.

Related Resources

(il, al)

© Alexander Charchar for Smashing Magazine, 2014.

Frizz-Free JavaScript With ConditionerJS

Thu, 04/03/2014 - 10:30

  

Setting up JavaScript-based functionality to work across multiple devices can be tricky. When is the right time to load which script? Do your media queries matches tests, your geolocation popups tests and your viewport orientation tests provide the best possible results for your website? ConditionerJS will help you combine all of this contextual information to pinpoint the right moment to load the functionality you need.

Before we jump into the ConditionerJS demo, let’s quickly take a look at the Web and how it’s changing, because it’s this change that drove the development of ConditionerJS in the first place. In the meantime, think of it as a shampoo but also as an orchestra conductor; instead of giving cues to musicians, ConditionerJS tells your JavaScript when to act up and when to tune down a bit.


As you can clearly see, applying conditioner to guinea pigs results in very smooth fur. Take a moment and imagine what this could mean for your codebase.

The Origin Of ConditionerJS

You know, obviously, that the way we access the Web has changed a lot in the last couple of years. We no longer rely solely on our desktop computers to navigate the Web. Rather, we use a wide and quickly growing array of devices to get our daily dose of information. With the device landscape going all fuzzy, the time of building fixed width desktop sites has definitely come to an end. The fixed canvas is breaking apart around us and needs to be replaced with something flexible — maybe even something organic.

What’s a Web Developer to Do?

Interestingly enough, most of the time, our content already is flexible. The styles, visuals and interaction patterns classically are rigid and are what create challenging to downright impossible situations. Turns out HTML (the contents container) has always been perfectly suited for a broad device landscape; the way we present it is what’s causing us headaches.

We should be striving to present our content, cross-device, in the best possible way. But let’s be honest, this “best possible way” is not three-width based static views, one for each familiar device group. That’s just a knee-jerk reaction, where we try to hang on to our old habits.

The device landscape is too broad and is changing too fast to be captured in groups. Right this moment people are making phone calls holding tablets to their heads while others are playing Grand Theft Auto on their phones until their fingers bleed. There’s phones that are tablets and tablets that are phones, there’s no way to determine where a phone ends a tablet starts and what device might fall in between, so let’s not even try.


Grouping devices is like grouping guinea pigs; while it’s certainly possible, eventually you will run into trouble.

To determine the perfect presentation and interaction patterns for each device, we need more granularity than device groups can give us. We can achieve a sufficient level of detail by looking at contextual information and measuring how it changes over time.

Context On The Web

The Free Dictionary defines “context” as follows:

“The circumstances in which an event occurs; a setting.”

The user’s context contains information about the environment in which that user is interacting with your functionality. Unlike feature detection, context is not static. You could be rotating your device right now, which would change the context in which you’re reading this article.

Measuring context is not only about testing hardware features and changes (such as viewport size and connection speed). Context can (and is) also influenced by the user’s actions. For instance, by now you’ve scrolled down this article a bit and might have moved your mouse a few pixels. This tells us something about the way you are interacting with the page. Collecting and combining all of this information will create a detailed picture of the context in which you’re currently reading this content.

Correctly measuring and responding to changes in context will enable us to present the right content in the right way at the right moment.

Note: If you’re interested in a more detailed analysis of context, I advise you to read Designing With Context by Cennydd Bowles.

Where And How To Measure Changes In Context

Measuring changes in context can easily be done by adding various tests to your JavaScript modules. You could, for example, listen to the resize and scroll events on the window or, a bit more advanced, watch for media query changes.

Let’s set up a small Google Maps module together. Because the map will feature urban areas and contain a lot of information, it should render only on viewports wider than 700 pixels. On smaller screens, we’ll show a link to Google Maps. We’ll write a bit of code to measure the window’s width to determine whether the window is wide enough to activate the map; if not, then no map. Perfect! What’s for dinner?

Don’t order that pizza just yet!

Your client has just called and would like to duplicate the map on another page. On this page, the map will show a less crowded area of the planet and so could still be rendered on viewports narrower than 700 pixels.

You could add another test to the map module, perhaps basing your measurement of width on some className? But what happens if a third condition is introduced, and a fourth. No pizza for you any time soon.

Clearly, measuring the available screen space is not this module’s main concern; the module should instead mostly be blowing the user’s mind with fantastic interaction patterns and dazzling maps.

This is where Conditioner comes into play. ConditionerJS will keep an eye on context-related parameters (such as window width) so that you can keep all of those measurements out of your modules. Specify the environment-related conditions for your module, and Conditioner will load your module once these conditions have been met. This separation of concerns will make your modules more flexible, reusable and maintainable — all favorable characteristics of code.

Setting Up A Conditioner Module

We’ll start with an HTML snippet to illustrate how a typical module would be loaded using Conditioner. Next, we’ll look at what’s happening under the hood.

<a href="http://maps.google.com/?ll=51.741,3.822" data-module="ui/Map" data-conditions="media:{(min-width:30em)} and element:{seen}"> … </a> Codepen Example #1

We’re binding our map module using data attributes instead of classes, which makes it easier to spot where each module will be loaded. Also, binding functionality becomes a breeze. In the previous example, the map would load only if the media query (min-width:30em) is matched and the anchor tag has been seen by the user. Fantastic! How does this black magic work? Time to pop open the hood.

See the Pen ConditionerJS – Binding and Loading a Map Module by Rik Schennink (@rikschennink) on CodePen.

A Rundown of Conditioner’s Inner Workings

The following is a rundown of what happens when the DOM has finished loading. Don’t worry — it ain’t rocket surgery.

  1. Conditioner first queries the DOM for nodes that have the data-module attribute. A simple querySelectorAll does the trick.
  2. For each match, it tests whether the conditions set in the data-conditions attribute have been met. In the case of our map, it will test whether the media query has been matched and whether the element has scrolled into view (i.e. is seen by the user). Actually, this part could be considered rocket surgery.
  3. If the conditions are met, then Conditioner will fetch the referenced module using RequireJS; that would be the ui/Map module. We use RequireJS because writing our own module loader would be madness — I’ve tried.
  4. Once the module has loaded, Conditioner initializes the module at the given location in the DOM. Depending on the type of module, Conditioner will call the constructor or a predefined load method.
  5. Presto! Your module takes it from there and starts up its map routine thingies.

After the initial page setup has been done, Conditioner does not stop measuring conditions. If they don’t match at first but are matched later on, perhaps the user decides to resize the window, Conditioner will still load the module. Also, if conditions suddenly become unsuitable the module will automatically be unloaded. This dynamic loading and unloading of modules will turn your static Web page into a living, growing, adaptable organism.

Available Tests And How To Use These In Expressions

Conditioner comes with basic set of tests that are all modules in themselves.

  • “media” query and supported
  • “element” min-width, max-width and seen
  • “window” min-width and max-width
  • “pointer” available

You could also write your own tests, doing all sorts of interesting stuff. For example, you could use this cookie consent test to load certain functionality only if the user has allowed you to write cookies. Also, what about unloading hefty modules if the battery falls below a certain level. Both possible. You could combine all of these tests in Conditioner’s expression language. You’ve seen this in the map tests, where we combined the seen test with the media test.

media:{(min-width:30em)} and element:{seen}

Combine parenthesis with the logical operators and, or and not to quickly create complex but still human-readable conditions.

Passing Configuration Options To Your Modules

To make your modules more flexible and suitable for different projects, allow for the configuration of specific parts of your modules — think of an API key for your Google Maps service, or stuff like button labels and URLs.


Configuring guinea pig facial expression using configuration objects.

Conditioner gives you two ways to pass configuration options to your modules: page- and node-level options. On initialization of your module, it will automatically merge these two option levels and pass the resulting configuration to your module.

Setting Default Module Options

Defining a base options property on your module and setting the default options object are a good start, as in the following example. This way, some sort of default configuration is always available.

// Map module (based on AMD module pattern) define(function(){ // constructor // element: the node that the module is attached to // options: the merged options object var exports = function Map(element,options) { } // default options exports.options = { zoom:5, key:null } return exports; });

By default, the map is set to zoom level 5 and has no API key. An API key is not something you’d want as a default setting because it’s kinda personal.

Defining Page-Wide Module Options

Page-level options are useful for overriding options for all modules on a page. This is useful for something like locale-related settings. You could define page-level options using the setOptions method that is available on the conditioner object, or you could pass them directly to the init method.

// Set default module options conditioner.setOptions({ modules:{ 'ui/Map':{ options:{ zoom:10, key:'012345ABCDEF' } } } }); // Initialize Conditioner conditioner.init();

In this case, we’ve set a default API key and increased the default zoom level to 10 for all maps on the page.

Overriding Options for a Particular Node

To alter options for one particular node on the page, use node-level options.

<a href="http://maps.google.com/?ll=51.741,3.822" data-module="ui/Map" data-options='{"zoom":15}'> … </a> Codepen Example #2

For this single map, the zoom level will end up as 15. The API key will remain 012345ABCDEF because that’s what we set it to in the page-level options.

See the Pen ConditionerJS – Loading the Map Module and Passing Options by Rik Schennink (@rikschennink) on CodePen.

Note that the options are in JSON string format; therefore, the double quotes on the data-options attribute have been replaced by single quotes. Of course, you could also use double quotes and escape the double quotes in the JSON string.

Optimizing Your Build To Maximize Performance

As we discussed earlier, Conditioner relies on RequireJS to load modules. With your modules carefully divided into various JavaScript files, one file per module, Conditioner can now load each of your modules separately. This means that your modules will be sent over the line and parsed only once they’re required to be shown to the user.

To maximize performance (and minimize HTTP requests), merge core modules together into one package using the RequireJS Optimizer. The resulting minimized core package can then be dynamically enhanced with modules based on the state of the user’s active context.

Carefully balance what is contained in the core package and what’s loaded dynamically. Most of the time, you won’t want to include the more exotic modules or the very context-specific modules in your core package.


Try to keep your request count to a minimum — your users are known to be impatient.

Keep in mind that the more modules you activate on page load, the greater the impact on the CPU and the longer the page will take to appear. On the other hand, loading scripts conditionally will increase the CPU load needed to measure context and will add additional requests; also, this could affect page-redrawing cycles later on. There’s no silver bullet here; you’ll have to determine the best approach for each website.

The Future Of Conditioner

A lot more functionality is contained in the library than we’ve discussed so far. Going into detail would require more in-depth code samples, but because the API is still changing, the samples would not stay up to date for long. Therefore, the focus of this article has been on the concept of the framework and its basic implementation.

I’m looking for people to critically comment on the concept, to test Conditioner‘s performance and, of course, to contribute, so that we can build something together that will take the Web further!

(al, ml, il)

© Rik Schennink for Smashing Magazine, 2014.

Freebie: Flat Icon Set (60 Icons, PNG, SVG, EPS, PSD, AI)

Tue, 04/01/2014 - 14:43

  

Crafted with great attention to detail, today’s icon set is extremely easy to use and will most probably be the next ultimate resource for any of your design projects. This set of round icons was thoroughly designed by the creative team at Roundicons and has been released exclusively for Smashing Magazine and its readers.

This freebie contains 60 icons that have been designed in both round and flat styles, and can be used for free without any restrictions and serve various design purposes. Feel free to modify the size, color or shape of the icons, and use the icons in your commercial as well as your personal projects. No attribution is required, however, reselling of bundles or individual pictograms is not allowed.


The colors have been chosen with care to ensure maximum harmony when multiple icons are used on the same page, and can also be used in your mobile applications as well as in templates and themes. (Large preview)


The icons come in various file formats, which makes them very easy to use. Also, each icon is a flat illustration that can either be used in its circular container or as a standalone illustration. (Large preview)


A preview of each icon included in the icon set, with and without rounded containers. (Large preview)

Download The Icon Set For Free! Insights From The Designers:

“Ever since the launch of our first 1000 flat icons, we received great feedback which encouraged us to further refine the icons, add more features, provide more formats and most importantly, produce many new icons. It is a true challenge attempting to cover all subjects and actions while trying to keep the illustrations simple enough to work as “icons” — a challenge we love!

We’ve received requests for over 800 different icons and have now successfully produced 500 of them for our first update. New ideas keep arising, so bear with us and stay tuned!”

Thank you, dear Roundicons team, for this fantastic icon set! We sincerely appreciate your time and efforts!

(il)

© The Smashing Editorial for Smashing Magazine, 2014.

Desktop Wallpaper Calendars: April 2014

Mon, 03/31/2014 - 14:43

  

We always try our best to challenge your artistic abilities and produce some interesting, beautiful and creative artwork. And as designers we usually turn to different sources of inspiration. As a matter of fact, we’ve discovered the best one—desktop wallpapers that are a little more distinctive than the usual crowd. This creativity mission has been going on for six years now, and we are very thankful to all designers who have contributed and are still diligently contributing each month.

This post features free desktop wallpapers created by artists across the globe for April 2014. Both versions with a calendar and without a calendar can be downloaded for free. It’s time to freshen up your wallpaper!

Please note that:

  • All images can be clicked on and lead to the preview of the wallpaper,
  • You can feature your work in our magazine by taking part in our Desktop Wallpaper Calendars series. We are regularly looking for creative designers and artists to be featured on Smashing Magazine. Are you one of them?
Easter

Designed by Aleksandra Kucher from Ukraine.

Sweet April Showers Do Bring May Flowers

“Discover the seasonal fruits and vegetables in April: artichoke and beans walking in the rain!” — Designed by Vitaminas Design from Spain.

Good Day

“Some pretty flowers and spring time always make for a good day.” — Designed by Amalia Van Bloom from the United States.

Have A Smashing Easter!

“Easter is the only time of the year when it’s perfectly safe to put all your eggs in one basket… even the craziest ones” — Designed by Marielle Perikly Kokosidou from Greece.

Happy Easter

“Easter Bunny is kind of confused. He was very surprised when silly chicks popped out of these colorful eggs! Happy Easter from Lights.com team.” — Designed by Lights.com team from Brooklyn, NY.

Relax!

“…and enjoy your Easter holidays with some good chocolate.” — Designed by Ricardo Gimenes from Brazil.

April Cosmos

“I was inspired by a non-fiction book The Living Cosmos written by University of Arizona professor of astronomy Chris Impey. It’s a research of scientists trying to address the questions we ask about nature. Is there life in the universe beyond the Earth?” — Designed by Paul Ranosa from the Philippines.

April Fool’s Day

“April Fool’s Day is harmless fun and a great way to get a new month kick started. The spring colors welcome the new season, while the pranks steal the stage. Our favorite is the Whoopie Cushion. It gets a laugh every time.” — Designed by Clarity Creative Group from Orlando, FL.

The Pablo Neruda’ s Spring

“I love this phrase that is referred to when we have a dream, nothing can stop us.” — Designed by Verónica Valenzuela from Spain.

Dark Pastel

“A combination of gloomy spring showers and Easter.” — Designed by Matt Noa from the United States.

Earth Day!

Designed by Brandi Redd from the United States.

Flying On A Rainy day!

“April is the month of spring or autumn depending where you live on the globe! It’s also the second rainiest month of the year. I was inspired by one simple motif to illustrate rain, birds and flowers. So either you witness rainy days or colorful ones … Enjoy April!” — Designed by Rana Kadry from Egypt.

April Showers

“April showers bring May flowers.” — Designed by Travis Bellinghausen from the United States.

Cleanse

Designed by Dylan Baumann from the United States.

Ipoh Hor Fun

“Missing my hometown’s delicious “Kai See Hor Fun” (in Cantonese), that literally translates to “Shredded Chicken Flat Rice Noodles”. It is served in a clear chicken and prawn soup with chicken shreds, prawns, spring onions and noodles.” — Designed by Lew Su Ann from Brunei.

Two Mountains

“This wallpaper was created to remind you to climb your mountain of challenges each day.” — Designed by Randal Baker Jr. from Evansville, Indiana.

April X Tribeca Film Festival

“With April comes spring, flowers and a fresh breathe of warmth and creativity. April also brings one of the most creative and innovative events of the year, the Tribeca Film Festival.” — Designed by Zack Aronson from New York, US.

Moon Mozzarella

“Well, I was walking down the street one evening and the moon was shining brightly. I wondered what sort of cheese the moon could be made of and the first thing that came to mind was mozzarella! I also enjoy eating mozzarella.” — Designed by Christie Hill from South Africa.

Red April

“My plant that keeps me company everyday on by desk in the studio and from time to time gives me inspiration.” — Designed by Alexandru Nastase from Romania.

A Little Drop Of Rain

“April is a month associated with rainy days. I enjoy photographing how the weather can change the perspective of everyday things. On this rainy day, I captured the rain drops as they clung to my blue and pink polka dot umbrella.” — Designed by Claire Scoufis from Tampa, FL.

The Collection Of Birds

“The collection of birds are my travels. At each destination I buy a wood, bronze, stone bird, anything the local bazaars sell. I have all gathered at a modest vitrine in my house. I have so much loved my collection, that, after taking pictures of them I then designed each one, then created a wallpaper and overdressed a wall of my living room. Now my thought is making them as a desktop wallpaper and give them to you as a gift” — Designed by Natasha Kamou from Greece.

Not To Be A Patient In Love

“Have patience in love, not to be a patient.” — Designed by Zanetine Web Design from India.

Join In Next Month!

Please note that we respect and carefully consider the ideas and motivation behind each and every artist’s work. This is why we give all artists the full freedom to explore their creativity and express emotions and experience throughout their works. This is also why the themes of the wallpapers weren’t anyhow influenced by us, but rather designed from scratch by the artists themselves.

A big thank you to all designers for their participation. Join in next month!

What’s Your Favorite?

What’s your favorite theme or wallpaper for this month? Please let us know in the comment section below.

(il)

© The Smashing Editorial for Smashing Magazine, 2014.

The Mystery Is Resolved: A Story Of Muffin Crumbs, Shady Characters And Invisible Letters

Mon, 03/31/2014 - 12:12

  

We’ve all been there, haven’t we? You find yourself in a coffee shop abroad, sipping cappuccino and chomping a muffin as you realize that your laptop’s battery charge is just about to crush your creative session to dust. Well, perhaps you’ve got your power adapter with you but, of course, it isn’t the right one for foreign power sockets.

So you end up looking around and chatting up with strangers asking for help. Some are more responsive than others, and before you know it, you don’t just have a full battery, but you’ve made a couple of new, surprisingly interesting acquaintances.

As it turns out, forgetting your power adapter is not only a great way to meet fantastic people but also a great strategy to come up with original ideas. In fact, this is exactly how the idea for the new Smashing Riddle was born—in a coffee shop in Zürich, Switzerland—and yes, it was indeed that cinnamon muffin that made all the difference in the end.

Letters Scattered All Over The Place, Like Muffin Crumbs

Animations have a way of drawing attention to themselves. So it’s understandable that a vibrant animated GIF might raise some interest, questions, or perhaps the reasonable concern of friendly strangers. Desperately looking for a charger, I sparked a number of awkward conversations with surprisingly unsurprised, friendly strangers around me.

In the end, as the charger issue was successfully resolved, I found myself sitting behind a large wooden desk, immersed in a profound discussion with a charming, smart math student from Switzerland, and an eager, seasoned engineer from Turkey. It was a fast-paced, inspiring discussion about life stories, experiences, biggest failures and creative endeavours.


This is how it all started. The letters scattered all over the GIFs were inspired by muffin crumbs scattered all over a plate. Image source: jentilley

As the conversation continued—still sipping those Zürich cappucinos—I caught glimpses of one of the older animated GIFs looping on my screen, and before I knew it, the conversation was all about mysteries, riddles and mischievous animated GIFs. During an intensive, unscheduled, battery-recharge brainstorming session, we came up with a number of interesting ideas, all thoroughly written down, tagged and ready for use. One of the ideas was to play with the letters and the way they would be displayed.

You see, at SmashingMag, we cherish the idea of lasting traditions—be it monthly desktop wallpapers, editorial newsletters or those weird mystery riddles. So in the spirit of tradition, the riddle obviously had to be based on animated GIFs, but we wanted to do something entirely different from changing file names or guessing Twitter handles.

Originally, before my trip to Zürich, we had thought about using a number of invisible semi-transparent “layers” hidden in animated GIFs (erm, hey, we actually should do it for the next one!), and later on we spent quite some time prototyping the “reflection” idea in which a hidden message would be revealed once an actual mirror was placed up against the screen. The latter proved to be quite difficult later on in implementation, especially due to the wide diversity of screens out there.

During the brainstorming session, we came up with an idea to do something along the lines of Scrabble, so the readers would derive clues from a number of GIFs and construct a secret keyword out of the letters discovered in those GIFs. And what if letters were scattered all across the GIFs very much like the crumbs of the muffin were scattered all across my plate? Some letters could be hidden, others would be clearly visible, and all of them would be turned, or flipped, or rotated, or skewed for confusion—very much in the spirit of the “reflection” idea we had in the beginning. That’s one of the ideas I brought back to the office after my trip to Zürich.

A New Mystery, A New Design Challenge

Our previous mysteries required a lot of tinkering and experimentation but, frankly, quite a bit of luck as well. The most important bit was to come up with the right approach. For the new riddle, we wanted to keep things a bit simpler and apparently easier to draw in as many readers as possible without the riddle becoming too annoying after the first few tries.

Of course, the riddle shouldn’t be too easy either, so instead of hiding letters of one single word in GIFs, we felt that hiding parts of a sentence might work a bit better. We needed a twist though, something that would make the riddle a bit more interesting and cause one or two “Aha!” moments. We thought about using lowercase symbols to introduce more confusion but ‘i’ and ‘l’ might look too similar in a small resolution, so instead we looked specifically for letters that could be confusing and decided to rotate them or skew them until they actually become confusing. It wasn’t the only twist though, as you’ll see later in the article—a few fine adjustments and twists were added during the test phase later on.


Whenever a new mystery is created, the first thing we do is set up the scene for the riddle. Our dear animator Guillaume knows exactly how to create just the right atmosphere. An early draft. Large view.

So when Paul Boag’s new book was about to be published, we jumped right into the idea, came up with a sentence and scattered parts of that sentence across three animated GIFs. Each GIF contained a few scattered letters (all uppercase) that readers were supposed to use to build words. Once you put the words from all the GIFs together, you’d be able to create a sentence—and, of course, no letters should be left unused. So once the sentence is constructed, it had to be tweeted @smashingmag using the hashtag #smashing. Of course, we’d also hidden a few clues in the image captions under each animation and in the corresponding file names.

Easy-peasy? Well, let’s see how it works, and what hidden clues those weird animations contain. (But seriously, who would put skewed letters on the floor and walls anyway, right?)

1. “Change”: Get Out Of That Desk Already

You know it, and we know it: nothing is more frustrating than stubborn management. Usually, changing workflows, processes and culture seems to be impossible, but perhaps something can be done about it after all. At least if you trust the hint provided for the very first animated GIF.


Nothing is more frustrating than stubborn management. Perhaps it’s just about time to do something about it. Three words, one of them on the floor. Large preview.

Well, if you are playing Scrabble or any other word-building game, the first thing you have to do is gather everything you’ve gotc. So alright, we have to find three words in the GIF. Let’s collect the letters first, starting from the left-bottom corner:

TCRIEZDOU

Alright. Well, we are smart, so why don’t we just use an online anagram solver to make the sense of these letters? We don’t want to do it manually, right? Hmmmm. No result. It doesn’t make sense. That’s weird. There must be a trap. Perhaps we are missing something: we could argue about “O”, if it’s actually the letter ‘O’ or the digit ’0′, but apparently we can rule out digits since all characters are supposed to be uppercase letters. But wait a second: if you rotate “Z” through 90 degrees, you end up with an “N”, right? So perhaps the combination is different:

TCRIENDOU

Ah, that’s better. Looks more like English. We’d better watch out for those traps. Okay, if we play around with it, we can figure out that the word hidden here is… NORDIC TEU, erm, TCRIONDUCE, er… aha! INTRODUCE! Nailed it.

Okay, it wasn’t too hard. So what about the two missing words? Same game, same rules. Let’s collect the letters first:

INTRODUCE HCANEGDATIGIL-=

Mmm. Wait, wait. Only letters are allowed, so the yellow sticky notes with an equals sign and the dash are probably another trap since only uppercase letters have to be considered. We can remove them:

INTRODUCE HCANEGDATIGIL

Okay, it smells… easy. Probably the best way to avoid mistakes in discovering the words is to move letters around until they start making sense, probably with CMD+X and CMD+V. Right, right. The shiny new book on the table can’t just sit there on its own—what’s the title again? Digital Adaptation. Ah wait; wouldn’t “DIGITAL” fit nicely here, and in fact, the letters are right there, aren’t they?

INTRODUCE DIGITAL HCANEG

Well, it’s time to do something about that frustration, right? Probably just the right time for a… change?

INTRODUCE DIGITAL CHANGE

Bingo! Well, at this point we know that every animated GIF contains a couple of words, but it looks like they might be connected on their own as well. We might try to distribute the letters in an other way, but this solution does look quite fitting. Okay, let’s hope for the best and move to the next one.

2. “Convincing”: They Listen But Don’t Move

Well, perhaps you still have the enthusiasm to convince your colleagues about a more pragmatic, effective workflow. But is it really usually colleagues who need this kind of convincing?


It’s difficult to convince them, though. But if not you, who else will help the company and bring it on the right path? Three words. Large preview.

Oh well, at least it looks like those people in the meeting are paying attention to what that guy is so passionately explaining. Alright, three words. Again, let’s collect the letters scattered over the table first, and we should keep the variations in mind as well: “M” could be a “W” and “Z” could be an “N”, and “L” in left upper corner looks surprisingly similar to a skewed “J” (by design or by mistake?). So we’ve got:

AHP[L/J]EEA[M/W][Z/N]ETG[N/Z]

Oh wait, there is another one, in the upper left corner under the plant! Is it “M” or “W”? Let’s consider both options. Okay, that’s freaky:

AHP[L/J]EEA[M/W][Z/N]ETG[N/Z][M/W]

That’s quite a few combinations. We must be smarter about this. Let’s look at the image caption. The caption talks about “convincing them”, but what does it refer to? Ah, stubborn management from the first GIF. Perhaps the guy in the GIF is trying to convince… managers?

MANAGE HP[L/J]EET[N/Z][M/W]

Umm… almost. So we have neither “R” nor “S” here, so what else could it be? Ah! Perhaps management?

MANAGEMENT HP[L/J]E

Nice! Well, there aren’t many four-letter-words with “H”, “P” and “J”, so we probably should stick with the “L”. Could it be… HPLE, or to be more precise, HELP. Well, it sounds about right, especially since “help” is also mentioned in the image caption to that GIF.

MANAGEMENT HELP

Good, good, it wasn’t too difficult after all. Let’s proceed with the last one.

3. “Difference”: It’s Going To Be Just Fine

Alright, we know how it works by now. Look closely everywhere on the image and gather all the letters first: that means looking on the carpet, under the chair and under the plant. And then double-check everything to make sure that we don’t miss anything. Also, we know that we can’t trust the colours and the position of letters, they didn’t help us in the past but instead confused (and annoyed) us a bit.


In fact, you’ve got nothing to lose. And who knows, in the end, it might turn out even better than you expected. Four words. The letters on the floor belong together, in one word. Large preview.

We know that the words on the floor belong together, in one word. Let’s start with them:

ARE

Oh well, there aren’t too many options here: it could be either “ERA” or “ARE”. Could it be that easy? Well, let’s keep it this way for now, and gather all the other letters, from the left to the right:

HEFRE[M/W]KCTDE[N/Z]FIEEA

And we have something that appears to be a blank piece of paper. What’s that thing now? An invisible character? Or a sign that a character is hidden? Or an empty space? Also, could something be hidden under the book, or behind the picture, or on the other side of the chair? OK, OK, let’s not get paranoid here. Deep breath. So we’ve got three words to figure out here.

Well, it might take a while, so let’s watch out for clues. The guy in the chair seems to have it all figured out. Perhaps we should check the larger preview of the image. Oh snap, its file name is… difference.gif. Is it… could it be…?

DIFFERENCE H[M/W]KTEEA

OK, this sounds about right. The combination of available unused letters doesn’t leave that many options: WEH KTEA, MATE HKE… Hmmm. Well, since the character in the chair is victorious, and it’s all about difference, perhaps he… made it?

DIFFERENCE MAKE HTE

Better! We’re almost there:

[ERA/ARE] DIFFERENCE MAKE THE

Phew, now, that was quite a journey! But wait a second! That guy passing by, giving a thumbs-up to the character in the chair… Doesn’t it look like an “L”? The image caption says that the words on the floor belong together, but it doesn’t say that they build up an entire word. Well, if we added “L” to [ERA/ARE]… Oh:

REAL

“REAL”! So perhaps it’s about making a real difference in the end. OK, let’s keep it in mind for now.

Yes, of course, there might be many solutions and we would accept all of them if all letters were used, but after 45 minutes of collaborative brainstorming we discovered that it was highly unlikely that you could construct an entirely different, perfectly meaningful sentence by using all letters scattered across the GIFs, leaving no letters unused. Now it’s time to bring all these words together and try to construct something more or less meaningful out of it.

“Solution”: Making Sense Of It All INTRODUCE DIGITAL CHANGE MANAGEMENT HELP DIFFERENCE MAKE THE [ERA/ARE/REAL]

Okay, well, it doesn’t look too scary! It’s probably as easy as something along the lines of “Help the management introduce digital change: make real difference.” In fact, yes, we would accept all solutions which include “ERA” and “ARE”, but a sentence shouldn’t be just a loose pile of unconnected words. These are all the options which you could build out of this mess of letters:


Livia Labate is one of the solvers of the riddle. Yep, it was a bit of work indeed.

  • Help the management introduce digital change: make real difference.
  • Help management make the difference. Introduce digital. Change era.
  • Digital era: introduce change, help management, make the difference.
  • Manage digital era change, introduce the plan, make the difference.

So here we are. A little journey from muffin crumbs to letters scattered all over the place, shady characters and a few invisible characters. Time to reveal and reward the winners.

Winners!

It’s showtime! Surprisingly to us, the riddle didn’t take much less time to resolve than the previous ones. First place was earned by the person who was quickest and the closest to solving the riddle, i.e. have found all the right words in the riddle and leaving no letters unused. Please notice that since nobody discovered the “REAL” bit, we had to relax the rules a little. We raffled the other prizes across the first people who tweeted a correct sentence, and tried our best to exclude copycats. The winners can select any prize of their choice (be it a bag, a Smashing Library account, printed books or anything else). And they all get the Smashing Cody Stress-Relief Ball, too. All winners have been contacted.

The first perfectly correct sentence with no letters left unused was tweeted by Dorin Moise from Brussels, Belgium, one hour and five minutes after the mystery went live, with: “there, make a difference: help management introduce digital change.” It’s not 100% correct since “REA” were supposed to be in one word, but all later submissions were tweeted later. Congratulations, Dorin! You just won a roundtrip to our lovely hometown Freiburg for the Smashing Conference Freiburg, a stay in a fancy hotel and a few Smashing Books. Yaaay!

And here are the other winners:

  • Paul Rose (1h 2min): “Make a difference, help management introduce digital change.”
  • Braunson Yager (1h 17min): “Help management make the difference, introduce the digital era.”
  • Charlie Park: “Introduce a digital era; help management make the change.”
  • Livia Labate (Washington DC, USA): “Help management introduce digital change: make a difference there!”
  • Eva Kavaliotou: “Help management make the difference. Introduce digital. Change era.”
  • Ed Hicks: “Digital era: introduce change, convince management, help make the difference.”
  • Andreas Busschop: “Make difference. Help introduce the digital management era.”

Congratulations! And thanks to everyone who participated! We hope we didn’t waste too much of your productive work time (and didn’t cause too many headaches either).

Behind The Scenes


Guillaume Kurdjian is a 22-year-old freelance illustrator and animator from Nantes, France. Guillaume likes to experiment with stuff on his computer and climb trees.

Just like the last two times, we worked with talented Guillaume Kurdjian on a series of animated GIFs for the riddle. This time the discussion thread was a bit shorter, and after thorough conversations and prototypes, we ended up with quite a number of different GIFs, drafts, and ideas that were thrown away, as well as the ones that made it to the final stage.

All designs were a series of iterations to make the overall riddle not necessarily perfect, but just right. So a big “thank you!” to Guillaume for following through and being so enthusiastic and kind about all the changes made.


Ah, it is a great feeling to solve that damn riddle, isn’t it? Well, you don’t really make the difference, but it’s pretty, pretty good nevertheless. Large view.

As it always is with a public hashtag, it can be quite difficult to separate between the “real” tweets and copies of the tweets. We didn’t choose the hashtag #smashing by accident since it is a quite “messy” hashtag on Twitter, but it wasn’t good enough since we saw lots of weird activities going on, with people reusing tweets 1:1 which we of course didn’t accept. We did look very closely at the dates and profile and activities of every winner to prevent copycats from winning. (We probably will go with #cats next time or even better—will challenge you to construct the “right” hashtag on your own).


Poor frames on the wall must have quite a number of finger prints now; we’ll have to bring the room in order later. And yes, apparently those yellow stick-it notes were quite confusing indeed! Large view.

The first GIF wasn’t really a problem for anyone. However, for some weird reason the word “convincing” started to pop up in tweets, although the letter “V” didn’t make its public appearance anywhere—in neither of all those GIFs. Quite a number of readers discovered “game plan” in the second GIF and was confused about the number of words that would be hidden in the second GIF if “game plan” actually was hidden there.


Wordsmith encountered server hiccups 30 minutes after the riddle went live, but of course we don’t take any responsibility for it.

The truth is that “game plan” wasn’t the part of our initial plan, so we take no responsibility for massive headaches or confusion caused—sorry about that!. Also, apparently Wordsmith encountered server hiccups 30 minutes after the riddle went live, but of course we don’t take any responsibility for it either.


Are we waiting for round 4 already?

So this is it! It was quite a journey, but we hope it was worth it. We are really sorry about all the unproductive hours that you spent solving the riddle. Well, kind of. Now, are you ready for the next round? ;-) Stay tuned!

© Vitaly Friedman for Smashing Magazine, 2014.

Design Principles: Visual Perception And The Principles Of Gestalt

Fri, 03/28/2014 - 16:51

  

This article is part of a new series about design principles that can serve both as a refresher for seasoned designers and reference for newcomers to the industry. Hopefully the content covered here isn’t too obvious and self-explanatory, and it’s always great to have a nice quick refresher every now and again, isn’t it? — Ed.

In 1910, psychologist Max Wertheimer had an insight when he observed a series of lights flashing on and off at a railroad crossing. It was similar to how the lights encircling a movie theater marquee flash on and off.

To the observer, it appears as if a single light moves around the marquee, traveling from bulb to bulb, when in reality it’s a series of bulbs turning on and off and the lights don’t move it all.

This observation led to a set of descriptive principles about how we visually perceive objects. These principles sit at the heart of nearly everything we do graphically as designers.

This is the start of a series of posts about design principles. It begins with these principles of gestalt, because many of the design principles we follow arise out of gestalt theory. In this post, I’ll walk you through a little bit of theory and offer some basic definitions of gestalt principles.

Future posts in this series will consider aspects of design like space, balance and visual hierarchy. In upcoming posts, I’ll point out which gestalt principles influence the aspects of design being discussed, and I’ll offer more practical uses and examples of how the gestalt principles are used in Web design.

The Key Ideas Behind Gestalt Theory

“The whole is other than the sum of the parts”
— Kurt Koffka

The quote above is gestalt in a nutshell. When human beings see a group of objects, we perceive their entirety before we see the individual objects. We see the whole as more than the sum of the parts, and even when the parts are entirely separate entities, we’ll look to group them as some whole.

There are several key ideas behind gestalt:

Emergence (the whole is identified before the parts)

Emergence is the process of forming complex patterns from simple rules. When attempting to identify an object, we first seek to identify its outline. We then match this outline pattern against shapes and objects we already know to find a match. Only after the whole emerges through this outline pattern matching, do we start to identify the parts that make up the whole.

When designing, keep in mind that people will identify elements first by their general form. A simple well defined object will communicate more quickly than a detailed object with a hard to recognize contour.

Reification (our mind fills in the gaps)

Reification is an aspect of perception in which the object as perceived contains more spatial information than what is actually present. As we attempt to match what we see to the familiar patterns we have stored in memory, there isn’t always an exact match. Instead we find a near match and then fill in the gaps of what we think we should see.

Reification suggests that we don’t need to present the complete outline in order of viewers to see it. We can leave out parts of the outline as long as we provide enough of it to allow for a close enough pattern match. You can see examples of this a little further down under the principle of closure.

Multi-stability (The mind seeks to avoid uncertainty)

Multi-stability is the tendency of ambiguous perceptual experiences to move unstably back and forth between alternative interpretations. Some objects can be perceived in more than one way. An example from below in the section of figure/ground is one you’ve likely seen before. The image can be seen as either two faces in profile or as a vase.

You can’t see both at once. Instead you bounce back and forth quickly between the two stable alternatives. One will tend to be your dominant perception and the longer you go without begin able to see the other, the harder it will be to see that other perception.

From a design perspective if you want to change someone’s perception, don’t try to change it all at once. Find a way to get them to see an alternative. Then work to strengthen that alternative view, while weakening the original.

Invariance (We’re good at recognizing similarities and differences)

Invariance is a property of perception in which simple objects are recognized independent of their rotation, translation and scale. Since we often encounter objects from different perspectives, we’ve developed an ability to recognize them despite their different appearance.

Imagine if you could only recognize someone you knew if they stood directly in front of you and faced you, but you couldn’t recognize them once they turned in profile. Despite the different visual perspective we can still recognize people.

You can see these ideas in play in the principles below.

The main idea is that gestalt principles are about perception and what is visually communicated by objects. The principles speak to the core of the visual language within which we work.

Gestalt Principles

Most of the principles are relatively easy to understand. There’s a common theme running through many of them.

“All else being equal, elements that are related by X tend to be grouped perceptually into higher-order units.”
— Stephen Palmer

Many of the principles below will follow this pattern. The principles either define X or the higher order that’s perceived.

Law of Prägnanz (Good Figure, Law of Simplicity)

“People will perceive and interpret ambiguous or complex images as the simplest form(s) possible.”

This is the fundamental principle of gestalt. We prefer things that are simple, clear and ordered. Instinctually these things are safer. They take less time for us to process and present less dangerous surprises.


Law of Prägnanz (Good Figure, Law of Simplicity).

When confronted with complex shapes, we tend to reorganize them into simpler components or into a simpler whole. You’re more likely to see the left image above composed of the simple circle, square and triangle like you see on the right than as the the complex and ambiguous shape the whole forms.

In this case, seeing three distinct objects is simpler than seeing one complex object. In other cases, it’s simpler to see a single object, which brings us to…

Closure

“When seeing a complex arrangement of elements, we tend to look for a single, recognizable pattern.”

As with Prägnanz, closure seeks simplicity. Closure is the opposite of what we saw in the Prägnanz image above where three objects were simpler than one. With closure, we instead combine parts to form a simpler whole. Our eye fills in the missing information to form the complete figure.


Closure.

In the left image above, you should see a white triangle even though the image is actually comprised of three black Pac-Man-like shapes. On the right image, you see a panda even though the figure is several random shapes. Seeing the triangle and panda is simpler than trying to make sense of the individual parts.

Closure can be thought of as the glue holding elements together. It’s about the human tendency to seek and find patterns.

The key to closure is providing enough information so the eye can fill in the rest. If too much is missing, the elements will be seen as separate parts instead of a whole. If too much information is provided, there’s no need for closure to occur.

Symmetry and Order

“People tend to perceive objects as symmetrical shapes that form around their center.”

Symmetry gives us a feeling of solidity and order, which we tend to seek. It’s our nature to impose order on chaos. This principle leads us to want balance in composition, though our compositions don’t need to be perfectly symmetrical to be in balance.


Symmetry and Order.

In the image above, you should see three pairs of opening and closing brackets. The principle of proximity, which we’ll get to later in this post, might suggest we should see something else. That suggests symmetry takes precedence over proximity.

Since our eyes will quickly find symmetry and order, these principles can be used to effectively communicate information quickly.

Figure/Ground

“Elements are perceived as either figure (the element in focus) or ground (the background on which the figure rests).”

Figure/ground refers to the relationship between positive elements and negative space. The idea is that the eye will separate whole figures from their background in order to understand what’s being seen. It’s one of the first things people will do when looking at any composition.


Figure and Ground.

The figure/ground relationship can be either stable or unstable depending on how easy it is to determine which is which. The classic example of where the relationship is unstable is the left image above. You either see a vase or two faces depending on whether you see the black color as figure and the white as ground, or vice versa. That you can easily bounce back and forth between the two perceptions demonstrates the unstable relationship.

The more stable the relationship, the better we can lead our audience to focus on what we want them to see. Two related principles can help us:

  • Area
    The smaller of two overlapping objects is seen as figure. The larger is seen as ground. You can see this in the right image above. The smaller shape is the figure regardless of color.
  • Convexity
    Convex rather than concave patterns tend to be perceived as figures.
Uniform Connectedness

“Elements that are visually connected are perceived as more related than elements with no connection.”

In the image below, lines connect two pairs of elements. This connection leads us to perceive that the connected elements are related to each other in some way.


Uniform Connectedness.

Of all the principles suggesting objects are related, uniform connectedness is the strongest. In the image above, even though we see two squares and two circles, we see the square–circle pairs as more strongly related because they are visually connected.

Notice that the lines don’t need to touch the elements for the connection to be perceived.

Common Regions

“Elements are perceived as part of a group if they are located within the same closed region.”

Another way to show a connection between elements is to enclose them in some way. Everything inside the enclosure is seen as related. Everything outside the encloser is seen as separate. The circles in the image below are all the same, yet we see two distinct groups, with the circles in each enclosure related in some way.


Common Regions.

The typical way to show a common region is to draw a box around the related elements like I’ve done above. Placing the elements on a different background color than their immediate surroundings will also work.

Proximity

“Objects that are closer together are perceived as more related than objects that are further apart.”

Proximity is similar to common regions but uses space as the enclosure. When elements are positioned close to one another, they are seen as part of a group rather than as individual elements. This is especially true when the elements in the group are closer to each other than they are to any elements outside the group.


Proximity.

The objects don’t need to be similar in any other way beyond being grouped near each other in space in order to be seen as having a proximity relationship.

Continuation

“Elements arranged on a line or curve are perceived as more related than elements not on the line or curve.”

It’s instinct to follow a river, a path or a fence line. Once you look or move in a particular direction, you continue to look or move in that direction until you see something significant or you determine there’s nothing significant to see.


Continuation.

Another interpretation of this principle is that we’ll continue our perception of shapes beyond their ending points. In the image above, we see a line and curve crossing instead of four distinct line and curve segments that meet at a single point.

Common Fate (Synchrony)

“Elements that move in the same direction are perceived as more related than elements that are stationary or that move in different directions.”

Regardless of how far apart the elements are placed or how dissimilar they appear, if they are seen as moving or changing together, they’ll be perceived as being related.

The elements don’t need to be moving for the principle of common fate to be present. It’s more that they are seen as having a common destination. For example, if four people are clustered together, but two are observed heading toward the right, they will be seen as having a common fate. Even if two are only looking in the same direction, they’ll be perceived as having a common fate.


Common Fate (Synchrony).

In the image above, the arrows are enough to indicate the elements share a common fate. While movement or change isn’t necessary, both are still a stronger indication of common fate than things like arrows or looking in the same direction which only imply movement.

Parallelism

“Elements that are parallel to each other are seen as more related than elements not parallel to each other.”

This principle is similar to the common fate principle above. Lines are often interpreted as pointing or moving in some direction. Parallel lines are seen as either pointing or moving in the same direction and are thus related.


Parallelism.

It should be noted that for parallelism to be perceived, the lines can also be curves or shapes, though with the latter the shapes should be somewhat line-like in order for them to appear parallel.

Similarity

“Elements that share similar characteristics are perceived as more related than elements that don’t share those characteristics.”

Any number of characteristics can be similar: color, shape, size, texture, etc. When a viewer sees these similar characteristics, they perceive the elements as being related due to the shared characteristics.

In the image below, red circles are seen as related to the other red circles and black circles to black circles due to the similarity in color. Red and black circles are seen as dissimilar to each other even though they’re all circles.


Similarity.

An obvious place to find similarity online is in the color of links. Typically, links within content will be styled the same way, often blue and underlined. This lets the viewer know that the different pieces of text are related. Once one is discovered to be a link, it communicates the others are also links.

Focal Points

“Elements with a point of interest, emphasis or difference will capture and hold the viewer’s attention.”

This principle suggests that our attention will be drawn toward contrast, toward the element that is unlike the others in some way. In the image below, your eye should be drawn to the square. It’s a different shape and color from the other elements. I’ve also given it a drop shadow to further emphasize it.


Focal Points.

The principle of focal points likely arises out of our need to quickly identify the unknown to alert us to potential danger.

The principles of similarity and focal points are connected, and focal points can’t be seen without the presence of similarity among other elements.

Past Experiences

“Elements tend to be perceived according to an observer’s past experience.”

Past experience is perhaps the weakest gestalt principle. In conjunction with any of the other principles, the other principle will dominate over the past experience principle.

Past experience is unique to the individual, so it’s difficult to make assumptions about how it will be perceived. However, there are common experiences we all share. For example, a lot of color meaning arises out of past experience.


Past Experiences.

Having seen traffic lights throughout our lives, we expect red to mean stop and green to mean go. You probably see the image above as a traffic light on its side, because of the three common colors. That’s past experience at work.

Many of our common experiences also tend to be cultural. Color again provides examples. In some countries, white is seen as pure and innocent and black as evil and death. In other countries, these interpretations are reversed. Conventions can arise when the experience is commonly shared, though again it’s important to remember that we don’t all share the same experiences.

Summary

Gestalt principles are important to understand. They sit at the foundation of everything we do visually as designers. They describe how everyone visually perceives objects.

The principles above should be relatively easy to understand. For most of them, the definition and the image are probably all you needed to understand the principle. At the same time, understanding the basic ideas of these principles isn’t the same as understanding how they influence design.

In the coming weeks we’ll look more at how gestalt influences design. We’ll see how symmetry helps us balance a composition and how combining focal points and similarity allows us to create a visual hierarchy in a design.

Before we get to either, though, we’ll take a deeper look at the figure/ground relationship and consider the space in which we place elements. That’s where I’ll pick up the series.

Additional Resources

I especially recommend this 5 part series by Andy Rutledge.

(cp, ml)

© Steven Bradley for Smashing Magazine, 2014.

Smashing Mystery Riddle: Have You Figured It Out Yet?

Thu, 03/27/2014 - 13:00

  

By now, you might actually know how it works. The good ol’ Smashing Mysteries: the door that would never open and the rain that would never stop. Well, the Mystery continues! To celebrate the launch of Paul Boag’s Digital Adaptation book, we’ve prepared a new riddle, and this time it’s a bit different and a bit easier.

How does it work? Below you’ll find three animated GIFs that contain a hidden message. Each GIF contains a few scattered letters (all uppercase) that you can use to build words. Once you put the words from all the GIFs together, you will be able to create a sentence. Please notice that no letters should be left unused. Once you’ve resolved the mystery, please tweet the full sentence @smashingmag using the hashtag #smashing.

Are you ready? Action!

Watch out for the clues in the descriptions under each animation. Remember: the key is to build one meaningful sentence out of the words scattered all across the GIFs.


Nothing is more frustrating than stubborn management. Perhaps it’s just about time to do something about it. 3 words, 1 of them on the floor. Large preview.


It’s difficult to convince them though. But if not you, who else will help the company and bring it on the right path? 3 words. Large preview.


In fact, you’ve got nothing to lose. And who knows, in the end, it might turn out even better than you expected. 4 words. The words on the floor belong together, in one word. Large preview.

What Can You Win?

Among the first readers who tweet the sentence with the hashtag #smashing, we’ll raffle a quite extraordinary, smashing prize (and a couple of other Smashing extras):

Please notice that to avoid spoilers, comments are closed for this post. We will announce the winners late Sunday, 30th of March, 23:59 CET.

Alright. Let’s get to work. Or have you already figured it out? ;-)

© Vitaly Friedman for Smashing Magazine, 2014.

It&#8217;s Time To Step Up, Pal: Meet &#8220;Digital Adaptation&#8221;, Our New Smashing Book

Thu, 03/27/2014 - 12:45

  

Nothing is more frustrating than stubborn management entangled in dated workflows and inefficient processes. That’s why we created Digital Adaptation, a new practical book on how to help senior management understand the Web and adapt the business, culture and workflows accordingly. No fluff, no theory — just techniques and strategies that worked in practice, and showed results. Get the book.


The book will help traditional businesses and organizations to overcome their legacy, and help you plant the seeds of change with very little power. If you do want to finally see changes happening, this is the book to grab.

Written by Paul Boag. Designed and illustrated by Veerle Pieters. 176 pages. The books are shipping now. Get the book now.


A look inside the book. Large preview.

Why This Book Is For You

If you are frustrated by clients, colleagues or management not fully embracing the Web, then Digital Adaptation is just what you need — ideas and concepts you can put in front of people that encourage real change. In the book you will learn to:

  1. Tackle bureaucracy and overcome legacy culture,
  2. Develop a flexible and effective digital strategy,
  3. Use responsibility matrix to minimize delays and costs,
  4. Adopt a digital culture and become digital by default,
  5. Apply techniques from mid-sized and large organizations,
  6. Avoid toxic practices and improve internal processes,
  7. Organize teams and boost their efficiency,
  8. Embrace social media and use them effectively,
  9. Understand the value of digital team and invest in them,
  10. Break down the walls and nourish collaboration, ownership and innovation.


A look inside the book. Large preview.


One of the book’s many illustrations by Veerle Pieters.

Table Of Contents CHAPTER TITLE DETAILS Foreword A Message for Web Professionals

Summary • The foreword introduces the purpose of the book and explains why we decided to choose you as the audience for it. In fact, the book is written primarily for you as web professionals. A book you can quote to senior management and make real, lasting changes in your organization. Your job is to take the concepts covered in this book and put them in front of senior management.

Keywords • audience • strategy • video.

Chapter 1 The Digital Divide

Summary • The core problem with digital, faced by many large organizations, is that they were formed before the web as we know it today existed. Their systems, processes, and (in many cases) people are not configured to support it. In this chapter, Paul discusses warning signs of digital incompatibility in your company, organizational and cultural barriers and changes that the new digital landscape has brought. This is a chapter of how most organizations struggle with their digital strategy and what you have to know to avoid the problems in a long run.

Keywords • pre-web organizations • legacy systems • digital incompatibility • structure • fragmented web presence • culture • customer needs • shifting digital landscape • digital strategy.

Chapter 2 Setting Your Digital Direction

Summary • As Richard Rumelt said, “good strategy works by focusing energy and resources on one or a very few pivotal objectives whose accomplishment will lead to a cascade of favorable outcomes.” In this chapter, you’ll learn how to select the right digital direction and how to deal with prioritization paralysis. Backed up by case studies and real-world examples, you’ll also learn how to form a digital strategy and how to use guiding principles, digital policies, and a responsibility matrix to complement the strategy. The chapter also explains how reorganizing teams and processes will help tackle dated, inefficient departmental structures.

Keywords • business objectives • digital team • defining priorities • problem diagnosis • guiding principles • web steering committees • responsibility assignment matrix • digital policy • remote work.

Chapter 3 Adopting A Digital Culture

Summary • Forming a digital strategy is one thing, but making it work requires changes in the digital culture. This chapter discusses main components of a digital culture, including collaboration, agile development, digital by default, innovation and service-oriented culture. The web can’t be neatly separated from the rest of organization; what’s necessary is a single organizational strategy that is heavily influenced by online. This chapter explains just how such a strategy can be established in practice.

Keywords • Gov.uk redesign • digital by default • aspects of digital • Business Model Canvas • innovation and failure • service culture • user testing • customer engagement.

Chapter 4 Digital Teams: Agents of Change

Summary • There are various ways in which digital teams can be organised, but some approaches are more effective than others. This chapter discusses how to build an effective team and what role it should have, as well as how to find a good digital lead and attract and retain appropriate digital staff. Sometimes the digital team can feel like a Ping-Pong ball that ricochets around the organization—you are never quite sure where it will end up. This chapter explains the place, the position and the working environment of an effective digital team.

Keywords • team structure • roles and responsibilities • digital leads • attracting good staff • light leadership • working environment • skills, not roles • hiring digital workers.

Chapter 5 Digital Demands Another Way Of Working

Summary • There is no shortage of big digital failures, from the London Olympics website to the Healthcare.gov website. The costs are staggering and the impacts devastating. The more complex and ambitious a digital project, the more traditional management approaches will struggle to scale. This chapter explores why digital projects fail and how you can minimize the risk of this happening by identifying and prioritizing user needs and involving the entire digital team in the conversation. Of course, this would work best within an iterative and collaborative context in which failure, prototyping and experimentation are deeply rooted within the digital culture.

Keywords • failures • the boom-bust cycle • usability testing • user needs • prototyping • iterative, incremental process.

Chapter 6 Grassroots Change

Summary • Anybody can instigate change. As somebody working at the grassroots level of your organization’s digital strategy, you are a key catalyst of change. That work begins in your own team. You can plant the seeds of change by establishing good team-working relationships and atmosphere, enforcing good working practices, building bridges with colleagues and educating them, approaching management strategically, and being disruptive. If you don’t take action to change it, nobody else will. But if you do take action, there is a real opportunity to make your work more enjoyable and to have a real impact on your company.

Keywords • down-top change • transforming a team • wartime mentality • work environment • work practices • convincing management • SWOT analysis • disruption.

About The Author

Paul Boag is quite a character. With over 35 articles published on Smashing Magazine, he is not really an author that requires an introduction. Paul has been working on the web since 1994. He is web strategist at Headscape Ltd, a web design agency that he co-founded back in 2002. Paul also produces and hosts the longest-running web design podcast at boagworld.com. He is a regular speaker at conferences and author of Client-Centric Web Design.

Technical Details


Written To Convince Clients and Management

This book will empower you to convince your clients, colleagues and management to introduce changes to the business, culture and organiziation in your company. That’s why we also prepared a few resources for you at the Digital Adaptation website. These include a trailer to introduce management to the themes of the book, video presentation that develops those themes further, Keynote and Powerpoint presentations for you to use, a PDF manifesto and related links and resources.

This should have you covered to step up and make a significant difference in your company. If you do want to finally see change happening, this is the book to grab. Get the book.

Folks Who Have Already Read The Book

We could list some well-known figures in Web design saying nice things about the book, but what about people like you? Here’s what folks who have already read the book are saying:

  • New book by Paul you don't want to miss. “Digital Adaptation” is an absolute bible for Web workers.” — liz coulter-smith
  • There is absolutely no filler, self-promotion, or airy-fairy guff in Digital Adaptation. Everything is simple, practical, and immediately applicable to problem teams and projects.” — Idea15webdesign
  • Management dinosaurs take note: Time for a new approach!” — George DeLair
  • Almost done @boagworld’s new book, Digital Adaptation. I love it, and haven’t read through a book this fast in a long time. Thanks Paul!” — Scott Whitehead
  • 5 of 5 stars to Digital Adaptation by Paul Boag!” — Pete Roessler

© Vitaly Friedman for Smashing Magazine, 2014.

A Modern Designer&#8217;s Canvas

Tue, 03/25/2014 - 10:53

  

When I gave this talk a title, I called it “A Modern Designer’s Canvas,” because originally I was going to talk about the tools and processes that I use when I’m designing. But being a good designer or developer is about so much more than knowing how to use tools. It’s also about the way we approach what we do and our attitude towards it.

I’m going to talk about four lessons that can help us do what we do better. These have been important to me, especially over the last challenging few years, when how we make websites has changed so much. They’re lessons that I learned a long time ago, at art school:

  1. Find a medium that expresses your interests and talents.
  2. Don’t get intoxicated by a process or fall in love with tools.
  3. Challenge what you’re told, including what you’ve heard here at this conference.
  4. Beat your own path, rather than walk someone else’s.

It’s been 30 years, give or take a week or two, since I applied to art school. That was in 1984. It’s funny, thinking back. In ’84, we thought that the British government spying on its own citizens using technology was just going to be dystopian fiction.

What I learned at art school has stayed with me over the 20-something years since I graduated. They were the lessons that helped me get started in this business, which wasn’t even on the horizon in 1984. They’re lessons that helped me adapt so that I could stay in business when the business of making websites changed so dramatically.

They’re lessons that enabled me to take risks with my business, risks such as adopting Web standards and responsive design before many of the people around me at the time did.

Art school taught me a lot, but, honestly, going there was a very humbling experience. I came from a small-town school where I’d always been in the top tier for art. I was one of only two people that year who went on to study art, but when I got to university, I felt like everyone around me was much better than me.


Andrew Clarke speaking at the Smashing Conference, Oxford. (Image credit: Marc Thiele)

I imagine that’s how many people feel when coming to a conference. We’re the “experts” where we work, but at a conference, everyone seems to know more than we do. I feel like that, and I also feel it when I read an article about some new language or about a technique or tool and I think I should learn about it. I doubt I’m the only person who feels this way.

Finding A Medium That Best Expresses Our Interests And Talents

Technology is supposed to make our lives less stressful, but it’s hard to think of another industry where what someone does changes so regularly. I’ll admit that I’m more confused than ever about what I need to learn. It’s hard not to feel stressed by the thought that we have to learn or aspire to be an expert in, well, pretty much everything. Sometimes that stress can turn into mild panic when we feel that everyone else knows something we don’t.

When I started designing websites, I used Frontpage, and then Dreamweaver. One of the biggest changes I made to what I do was at the start of the Web standards movement, when I learned to write HTML and CSS. Many designers did the same, but some people think that’s not enough anymore. Jeff Croft wrote in January:

“What we may not have realized is that once the browsers don’t suck, being an HTML and CSS ‘guru’ isn’t really a very marketable skillset.”

Hardly reassuring.

“Diversify or die,” he says, before pointing out that front-end developers are just as likely to be grilled in a job interview on Backbone.js or AngularJS or Node.js as they are on HTML and CSS.

But does every front-end developer need to learn Backbone or Angular or Node? What about designers like me? I learned to write HTML and CSS because I needed them to express the designs that I made. Code became my medium when designing became more than about making an artist’s impression of a website. HTML and CSS were the first “code” I’d ever worked with.

Some of my more technically inclined friends came to use those same languages after they learned programming. Although we both know HTML and CSS, their working knowledge is very different than mine. They know programming languages. They understand JavaScript. They’re comfortable with the command line. They’re the technically minded people who understand Backbone or Angular or Node.

Me, I couldn’t write a script if my life depended on it. That’s because my mind works in a different way and I have different working knowledge. This comes from my art and design background, so I might not know Backbone, but I’m a devil with a Bezier curve.

Assuming that someone has the same knowledge as you — because they share common languages like HTML and CSS — can leave them baffled. I see these assumptions being made in articles and tutorials time and time again.

I know I don’t have a mind for development, so I never feel under any pressure to learn new development tools or technologies unless they’re directly relevant to the work I’m doing. There’s a very strong likelihood that if you’re a designer, you probably won’t ever need to know how to write a Grunt runner.

Designers might have felt pressure to learn about tools and technologies that have traditionally been the province of those of us who are more technically minded. At the same time, we might still feel pressure to learn about subjects whose roots are in other academic areas — subjects such as information architecture, content strategy, research and maybe even analysis of data. But do we need to be experts in these areas to be good designers?

It’s easy to feel disheartened when you think that simply “designing” isn’t enough, or that making something beautiful is somehow a superficial endeavour. If you feel like that sometimes, I’m with you, but we should always remember that making something beautiful takes knowledge and experience. Understanding proportions and ratios for layout, knowing color principles and “seeing” typography, really seeing it, aren’t things you can learn overnight.

Far from being superficial, “making a website pretty” is a skill that we should be very proud of. It’s also one that’s going to be in demand long after the latest fashionable development framework has been forgotten.

I’m not saying we shouldn’t learn new things or that we should stay in our comfort zone. What matters is finding the right medium to express our ideas and talents. We’ll likely not need to learn everything, but we will need to learn to be great at the things we do.

Jeffrey Zeldman wrote recently:

“[…] now may be the time to up your game as a graphic designer, or experience designer, or front end developer. ‘Diversify or die’ may be overstating things a bit. But ‘follow the path you love’ will always be good advice.”

If you “follow the path you love,” then you’ll find your medium, although it might not be what you expected it to be.

When I went to art school, I thought I was a good painter. That’s because in high school, painting was as much about precision and predictability as it was about creativity. High-school art classes were about learning techniques so that we could reproduce a painting of something that we’d likely painted several times before under exam conditions.

Many people speak today about designing with data, so that we can produce designs that are predictable. A lot of people crave predictability, which sometimes makes them rely on data, rather than their own intuition. Personally, though, I want to see designs that are more inspirational than predictable.

The current trend for “flat” design makes me feel very nostalgic. I painted flat because I loved the hard-edged graphic quality of pop art. I also loved David Hockney’s work, especially his “splash” paintings, but I’d only ever seen them reproduced in books, where they were obviously much smaller. The printing process also flattened them, removing the subtlety and depth, something I didn’t realize until I saw the paintings in galleries.

I discovered upon reaching art school that I was actually a pretty poorer painter than my new peers. Unlike them, everything I painted ended up looking flat, no matter what my subject matter was. It wasn’t just the content I’d chosen — my technique and the way I painted said as much about me as about what I was painting.

We hear a lot today about the benefits of iterating a design; it’s an approach that I recommend to our clients. But, for me, painting wasn’t an iterative process. I couldn’t let a painting develop over time, making my way across the canvas, gradually adding layers of paint. I couldn’t trust in the low fidelity that we see in our gray-box wireframes today. I had neither the faith nor the patience to iterate. I needed to work in high fidelity right from the start. Today, the equivalent would be skipping sketching and diving right into Photoshop to create a high-fidelity design.

Instead, I worked on one part of a painting until it looked finished. Then, I’d move on to the next part. It was like painting by numbers. I kept my eyes so close to the canvas that I couldn’t see what my painting looked like from a distance. I missed seeing the whole because I was focused on the parts. As a result, my paintings appeared not only flat, but disjointed. I’m seeing this in today’s website designs, too.

It took me months of dissatisfaction to realize that painting is as much about temperament as about technique. I realized that I wasn’t suited to painting and that it wasn’t the right medium for me to communicate my ideas. I was fortunate because the degree I was studying was “unstructured,” so after the first few weeks of introduction and becoming acclimatized to our new surroundings, we were left as unsupervised as we wanted to be. There was no timetable, no lectures, no set work — except for a dissertation that I wrote about Batman — no organized trips to the botanical garden to draw exotic plants. We arrived and our tutors said, “Hello.” Three years later, they came back and said, “So, what did you do?”

The lack of structure allowed students to move between disciplines — painting, sculpture, printmaking, photography — whenever we wanted to. This lack of supervision didn’t suit some people. If someone wasn’t highly motivated or didn’t know their path or their medium, then they usually floundered. Some people couldn’t cope at all and so switched to a course that offered more direction. Others left altogether. A few moved into the life-drawing class and never left. They spent three years drawing flabby flesh because they craved the predictability, the reliability that life in the life room gave them. They became incredibly technically proficient — as you might expect — but proficiency doesn’t guarantee good art, nor great design.

Not Getting Drunk On Our Processes Or Falling In Love With Our Tools

In high school, we’re taught that there’s only one right answer to any question. Our entire education system — some might say our entire political system — hangs on the premise that an answer is either right or wrong.

  • Something either is or isn’t.
  • Something either happened or didn’t.
  • Something’s either possible or isn’t.

We need everything to be right, so we try to find the one right way to do it. It’s one of the reasons why we come to conferences. We want to know the right, best way to work with responsive images. We want to know whether Flexbox is what we should be using. We want to discover the best process for designing or developing a website in this modern, responsive era. We want to create systems that make the outcome of design predictable. But:

  • What if there is no right way to work with responsive images?
  • What if Flexbox is useful, sometimes?
  • What if there is no best process for responsive design?
  • What if systems hinder the creative process?

Samantha Warren wrote about style tiles on A List Apart back in 2012:

“Style tiles are the cornerstone of a solid design system that sets client expectations and communicates the visual theme to all the project team members. Designing a system rather than site pages gives your team the tools to create a living, breathing website.”

I’ve been writing about how to avoid setting the wrong expectations for a few years. In particular, I’ve written about how the processes, tools and artefacts that we’ve inappropriately brought with us from historical media to the Web can hinder communication and reinforce the wrong expectations.

Since the earliest days of the Web, designers have been using graphics tools — such as Photoshop, then Fireworks and lately Sketch — to create full-page visuals that are intended to demonstrate how a website will look when it reaches a browser. Designers will often create visuals of dozens of templates or pages. These comps (or PSDs or flat static visuals or high-fidelity design artefacts) not only are used for experimentation and creative expression, but actually become the currency of Web design. Designers exchange them with clients for approval and then for money. Clients and designers exchange them with developers to be used as blueprints for the content, design and functionality of a website, then, finally, as QA tools. But despite their popularity and longevity, they’re terribly ill-suited to all of those roles.


The tools and processes we’ve relied on for years are no longer capable of properly designing today.

Using these static visuals is “bringing a knife to a gun fight.” They can only communicate something that’s superficial, artificial. They’re high-fructose, extra sweet, but even though of little nutritional value, people love them and so want more and more. We designers have largely learned to live with all of the deficiencies of static visuals, and we compensate for them with our familiarity with the tools that we use to make them.

Worse than any deficiency is the frequent absence of communication when we hand a visual to someone and ask them to judge it. Instead of using visuals as aids to communication, we let the visuals speak for us. This happens especially when we email them or upload them to Basecamp, along with some vague request for “thoughts.”

When we hide behind design artefacts in this way, we leave a tremendous amount open to misinterpretation and, because of that, are far more likely to set the wrong expectations. Type rendering will look different on a real device. Fonts won’t be exactly that size on all devices. The layout will be different at various viewport widths.

So, what are our goals when showing a static visual to someone, usually a client? Once we’re past the feedback stages, we’re likely looking for sign-off on a design. We need that approval either to conclude our business or to confirm that a design is ready to move to another phase. Of course, we’re not really asking them to judge the visual at all, are we? In reality, we’re asking them to look beyond the visual and to judge what they extrapolate will be the look of the finished Web page. In effect, what we’re saying is, “Here is a better than artist’s impression.”

For their judgement to be at all meaningful, we therefore need to make the visual to be of the highest fidelity. Ideally, we’d like it to look identical to a screenshot of the finished page. When we’re asking for sign-off, we’re implying that the finished Web page will ultimately be a facsimile of this visual, a carbon copy, a clone. And if that’s not what we’re saying, then what’s the point of asking someone to approve it at all?

Have you ever wondered — responsive websites aside — why so many Web pages are fixed width and centered in the viewport? Do you think it has anything to do with the fact that clients sign off on fixed-width visuals. I’d say one’s a direct result of the other. I’d go further and suggest that asking for approval on visuals should be considered harmful, because we’re reinforcing that outdated notion that a Web page should be a facsimile of a frozen image.

We’ve been suffering from the effects of this notion for years, because when we ask for sign-off on a frozen image, we immediately leave ourselves open to the problems that often come when we later have to implement that design. Think back to the number of times you were forced to explain to a client why Internet Explorer doesn’t render your border-radii, box-shadows, CSS columns or gradients. Think about how many hours you then wasted employing polyfills to prop up an aging browser, just so that it could live up to the promise you made when you sold the visual to the client. To save ourselves from this agony over the years, we’ve designed to the lowest common denominator in our matrix of browser support. We’ve eschewed so many useful CSS properties until the dominance of those legacy browsers faded. My book Hardboiled Web Design was all about how to challenge that unambitious thinking.

One of the things I admire about Samantha Warren’s approach is that she emphasizes communication. Samantha says that style tiles “provide a catalyst for discussions,” and I really appreciate that because what often matters most isn’t the way we design but the ways we communicate it.

I spoke earlier about finding the right medium, and it became very clear to me that high-fidelity visuals, those that represent the future look of complete pages, are rarely the right medium to communicate Web design. When a visual encapsulates everything about a design, instead of helping us to find clarity, it provokes multiple conversations about different topics, all at the same time. We might need to talk about typography. Instead, the client’s eye wanders across the page because they’re distracted by the size of the logo. Other times, we might want to talk about color as part of an interaction vocabulary, but they can’t help noticing an out-of-date product photo. People too easily get distracted and conversations become unfocused when we show the totality of a design too soon.

I’ve been searching for a better medium to communicate my designs, and I’ve found that separating a design into several components is incredibly helpful. I’ve also found since doing so that my conversations about the design have been more focused and productive.

How often have you heard someone say, “I don’t like the design.” Did you dig deeper and find that it wasn’t the details of the design they objected to, or that it wasn’t the typefaces or the way you used color. No? It might have been, “The sidebar should go on the left, not the right.” People often mean to comment on the layout of a design but express their criticism of the design as a whole. They conflate layout with the look and feel and call it “design.” Designers do it, too, because we’re used to making and demonstrating visuals that include all of these things. But now it’s time to discuss non-layout and layout elements of design separately.

This means that the look and feel of individual components and how they are arranged on a grid are now two separate design challenges and that, whereas layout will undoubtably change across screen sizes, the look and feel of a component will almost certainly stay the same.


The devices and screens we design for today are a variety of sizes. (Image credit: Edwin Torres2)

Take away layout and what’s left is what I describe as the “atmosphere” of a design. Atmosphere refers to the feelings that are evoked by color, texture and typography. You might already think of atmosphere in different terms. You might call it “feel,” “mood” or even “visual identity.” However you describe it, the atmosphere of a design doesn’t depend on layout. It’s independent of arrangement and visual placement. It will be seen, or felt, at every screen size and on every device.

The idea of working on components out of context has been gathering pace over the last few years. If it sounds strange, in fact we’ve been abstracting design this way for a long time — for example, when we create mood boards or share cropped Dribbble shots. In his article “Content Choreography,” Trent Walton writes:

“Web designers will have to look beyond the layout in front of them to envision how its elements will reflow & lockup at various widths while maintaining form & hierarchy.”

I like this approach, because separating components from layout can help everyone to focus on the design, while setting no expectations of how the components will be arranged responsively across viewport sizes.

I said earlier that we love to identify patterns and create systems because we crave predictability. That’s why we’re always searching for the “right” process. But while separating components from the layout and designing them independently has improved communication, I know that this approach doesn’t work for everyone and is certainly not right for every project. That’s why I’m wary of defining it as a “process.”

I’m wary because I’ve learned how important it is not to let our processes define what we make. When I read about design process, I’m worried that we’re simply replacing one set of design artefacts with another — in this case, Photoshop visuals for pattern libraries — and that we’re becoming so intoxicated by our processes and falling so deeply in love with our new tools that we’ll again lose sight of what we’re actually making.

Challenging What We’re Told

Back in 2009, I gave a talk titled “Walls Come Tumbling Down,” in which I discussed how important it is to make more time, time to be creative. I suggested then that we should reduce repetition — make fewer high-fidelity visuals — and design systems instead of pages. I should be clear that I was talking about designing a system, not design as a system.

Design-system thinking has taken hold, and it can take several forms, from style guides as a design deliverable to full-blown pattern libraries as design tools, not documentation. There are now some widely cited pattern libraries, including one by Starbucks and one for A List Apart.

One system that’s become synonymous with responsive Web design is Brad Frost’s “atomic design.” Brad wrote about atomic design just last summer:

“Lately I’ve been more interested in what our interfaces are comprised of and how we can construct design systems in a more methodical way.”

He goes on to describe how his system comprises atoms, molecules, organisms, templates and pages, the result of which should be:

“a clear methodology for crafting design systems.[…] Because of this, we can create systems that promote consistency and scalability. And by assembling rather than deconstructing, we’re crafting a system right out of the gate instead of cherry picking patterns after the fact.”

Brad’s inspiration for atomic design was chemistry’s periodic table. I can’t imagine anything less creatively stimulating.

Not everyone’s convinced about abstracting design the atomic design way, though. Mark Boulton wrote of his concerns last year:

“Conformity and efficiency have a price. And that price is design. That price is a feeling of humanity. Of something that’s been created from scratch. What I described is not a design process. It’s manufacturing. It’s a cupcake machine churning out identical cakes with different icing. But they all taste the same.”

It’s important to remember that creativity should never be — by definition, can never be — as predictable as a manufacturing process. We cannot and should not attempt to rationalize creativity by moulding it into a process.

Fletcher Knebel, an American writer born in 1911, said this:

“It is now proved beyond doubt that that smoking is one of the leading causes of statistics.”

Instead of finding more time for research and data gathering, I’d like to use any extra time we have to come up with new, better ideas, because no amount of research is a substitute for a good idea. At least not on its own.

Peter Seibel, one of the designers at Etsy, said this in 2012:

“Science is powerful and it’d be silly to abandon it entirely just because there are ways it can go wrong. And it’d be equally silly to think that science can somehow replace strong, talented product designers. The goal should be to combine the two.”

Perhaps the most important lessons I learned at art school were not to take what we hear or see at face value and to question everything we’re told. Everyone should do that. I want you to always ask, “Can I do it better?” Remember that just because something’s been done doesn’t mean you can’t do it better. There’s really nothing we can’t improve, and we don’t have to improve it for everyone — improving it for ourselves is often more important.

We’re very fortunate in our industry to have the ability and the tools to improve something that someone’s made — be it a small piece of code or a full framework, a tip or a complete workflow. Blogs, RSS and, more recently, Twitter enable us to hear of a new method minutes after it’s been written up. Tools like CodePen and GitHub allow us to fork code and make it our own.

I published my open-source Contract Killer on GitHub, and the best part of doing that wasn’t giving people a chance to use what I made, but giving them an opportunity to add their own insights to make it better. In fact, nothing I’ve shared hasn’t been improved simply from being shared.

But sharing is just a catalyst; developing an idea takes time and patience. I mentioned earlier that at art school I couldn’t let a painting develop over time. I needed to start in high fidelity. My friend Ben, on the other hand, and other painters around me knew how to let a painting develop. Ben started the course by making six giant 6 × 6-foot stretchers. He then spent all three years working on those six paintings.

I saw Ben more often in the pub than in the studio. He’d come to the studio once a week, sometimes twice. Each time he’d add a subtle layer to each painting. Some weeks, he’d wrap a rag in white spirit and take paint off those canvases. I find that fascinating, that we can make something better by taking part of it away, by reducing, simplifying, rather than adding to it.

It took a long time for Ben’s paintings to develop, not just in fidelity but also in the purity of his ideas. I wonder now whether he had a clear idea of how they’d develop or what they’d develop into when he started? I hope he didn’t. I hope that he allowed his ideas to develop as he painted them. It’s a shame I never asked him. Whatever he thought by the end of the course, Ben had six beautifully subtle, exquisitely layered paintings that I could only dream of making.

Asking “Can I do it better?” and challenging an idea or implementation isn’t disrespectful to the idea or to the person who shared it. Seeing an idea of yours being referred to, being improved upon, begin a life of its own is a wonderful feeling. Challenging well is respectful to the idea and to the person who thought of it. Challenging isn’t always easy, particularly if we don’t think of ourselves as equal with the other person. Comparing ourself to others can feel uncomfortable. Always remember, though, that we each contribute from our own perspective, and that perspective is as equally valuable as any other.


As the craft of Web design continues to evolve, we’re recognizing the need to develop thoughtful design systems, rather than creating simple collections of Web pages. (Image credit: Atomic Design)

I work in my own small studio with one other designer. Our ideas on process and workflow are likely very different from those of similar teams working in similar small studios, and different again from those of us who work in large companies and organizations. A different perspective can take an idea in a direction that its originator couldn’t have imagined. An idea can be made immeasurably better simply by being looked at from a different point of view.

Challenging what we’re told, questioning received wisdom will have its consequences, particularly when other people have a vested interest in what we’re challenging. Those consequences might be greater if you work in a large company or organization than in a small company, as I do. I’ve built a business in which challenging convention and pursuing new ideas without many consequences is possible. That’s why my advice to serve a single “universal” style sheet to legacy versions of Internet Explorer across all websites wasn’t just an idea. I’d already tried it on my own clients for months, and not a single person had complained.

Both of my books are about seizing the potential of new techniques and technologies, whether it’s designing in a browser or pushing ahead with cutting-edge, experimental CSS properties. While those ideas are mainstream now, when I wrote them the response was far from complimentary. I think that response came from a reticence to change. It possibly also came from fear, and too often we limit an idea’s potential because we worry about the consequences of failure too early. How many times have you seen a great idea dashed at your place of work when someone said, “We can’t do this because…”

Children challenge ideas all the time. They have a talent for asking questions, for asking “Why?” All. The. Time. (If you have kids, you’ll know that.) They haven’t learned to fear consequences in the same way that adults do because they haven’t been conditioned to think of those consequences.

Rather than dimming the flickering flame of an idea, questioning it helps it to grow. We should ask more questions. We should make asking questions a habit.

  • “Who says we can’t?”
  • “Why can’t we do that?”
  • “Why do we have so many meetings?”
  • “Why do designers and developers work on different teams?”
  • “Why do designers and developers work in separate buildings?”
  • “Why can’t we start writing code until a design has been signed off?”
  • “Why can’t I talk to the client?”
  • “Why can’t we serve just a typography style sheet to legacy browsers?”
  • “Why is this list of questions so long?”

Asking these types of question can stimulate ideas. Always remember that whatever environment you work in, along with any consequences come opportunities, opportunities to create something special.

Beating Our Own Paths, Not Walking Someone Else’s

For 15 years, I worked mainly on my own, and when I look back now, I realize just how much I struggled without having much of the stimulation you get from working with other people. Honestly, I don’t think I could have succeeded were it not for the self-motivation that I learned all those years ago at art school.

Just over a year ago, we hired another designer, and we now work together in my tiny studio three days every week. The transformation has been remarkable. I feel like we have more ideas, better ideas, and we’re now doing our best work together. I feel we’re only just getting started.

People can feel isolated, starved of inspiration, even when working alongside others, if the organization’s structure and environment make it hard to keep ideas flowing. Many organizations classify its people in just the same way that we classify elements when writing HTML:

  • graphic designer
  • user-interface designer
  • user-experience designer
  • digital product designer
  • Web developer
  • front-end developer
  • front-end architect

Of course, what’s written on your business card doesn’t necessarily restrict you from coming up with ideas, but classifications can have consequences on creativity. When you define a role for yourself or are assigned one, at best that role can limit what you do, and at worst it can limit what you aspire to do. Roles and responsibilities can define boundaries. I’ve seen the protection of those boundaries turn into battles over territory.

If you’re a “Web designer,” how would the “UX professionals” you work with feel if you made wireframes? I’ve worked with user-experience designers who are very touchy about designers encroaching on their territory. By the same token, how do we designers react when front-end developers make decisions that affect layout when implementing a design? Do we react negatively? Have you heard a designer say, “But that’s my job.”

When we cross into someone else’s area of expertise, work with their tools, use that new knowledge, take their perspective, we can be inspired to move in a different direction. Stepping into someone else’s shoes not only gives us an appreciation of their work, but inspires us to make our own work better.

Also, grouping people into, for example, a team of user-experience designers, a team of graphic designers and another team of developers can have a tremendous impact not only on the flexibility of a project but on how ideas flow between those teams.

The most successful projects I’ve worked on in recent years have been the ones in which the client, rather than assigning us to specialist teams, created a “project team.” This team would include people from all disciplines — designers, developers, content specialists. We worked alongside each other in a single space and had an open-door policy to encourage everyone in the organization to look at what we were making. This fed us new ideas and, coincidentally, allowed for impromptu user testing and device testing when they brought their phones with them. The best projects for me are always the ones that are filled with questions, because they prompt us to be creative with our answers.

The late Aaron Swartz wrote:

“Be curious. Read widely. Try new things. I think that a lot of what people call intelligence just boils down to curiosity.”

We often lose this trait of curiosity as adults. As well as asking “Why?” we should also perpetually ask “What if?”

This year is the 10th anniversary of my blog and also the 10th anniversary of many groundbreaking articles published on A List Apart. These articles have made it possible for us to make the websites that we make today. Many of the authors of those articles simply asked “What if?”

Take Douglas Bowman, now creative director at Twitter. By 2002, Mark Newhouse had already written about how to turn unordered lists into navigation. We take that for granted today. But those lists still looked boxy then, and people sincerely complained that CSS designs looked “boring.” So Doug asked, “What if I use two background images to make tabs?” and in 2003 he devised “Sliding Doors of CSS.”

Or take Dan Cederholm, cofounder of Dribbble. Ten years ago, no one had solved the problem of how to make the backgrounds of two unequal columns the same height using CSS. A List Apart published Dan’s “Faux Columns,” in which he asked, “What if I cheat and use a repeating background image on the parent container?”

Also in January 2004, Patrick Griffiths asked, “What if I use ems instead of pixels or percentages for layout?” He invented the concept of “elastic design.” Dave Shea, curator of the recently relaunched CSS Zen Garden asked in 2004, again in A List Apart, “What if I put all of my icons into one image?” thus inventing CSS sprites, a technique that’s stood up so well that we use it today.

Those questions, those “What ifs?” sparked ideas that went on to change the way we designed and developed websites for the next 10 years. Being curious works just as well today as it did then for those people who made it possible for us to build websites with HTML and CSS.

  • “What if we use a different design artefact to communicate?”
  • “What if we work in a browser instead of Photoshop?”
  • “What if we designed mobile first?”
Summing Up

Being at art school taught me a lot of things. In fact, I learned more about work and about business and about myself than I did about art. I’ve remembered the lessons that I learned and have tried to apply them in everything I’ve done in the 30 years since then. For over half of that time, I’ve worked for myself, making websites for other people, so the lessons that I learned about staying self-motivated have been invaluable.

Art school taught me the most important lesson in my working life, which is to be adaptable. I’m in a place now that I could not have imagined back then, and in 10 years you’ll be in a place that you can’t imagine now. Finding a medium to express your interests and your talents is vital. When you work by yourself — as I did for a long time — or you feel like you’re on your own, learning where to find inspiration will serve you well, too.

I’ve learned since then that becoming intoxicated by a process and forgetting what really matters — the idea — is too easy. Falling deeply in love with our tools is easy, whether it be a printmaking tool or today’s favorite application or fashionable framework. Used thoughtlessly, any tool or process can become a distraction. I don’t want to forget that lesson.

I also won’t forget the people who have made it possible for me to share what I know. I can’t imagine that people share what they’ve discovered so freely with total strangers in any other industry. That’s what I hope you do: take what you learn here and make something better. Most importantly of all, share what you make so that other people can learn from it. Be generous with your ideas.

Seth Godin said recently:

“The generosity of standing up and speaking comes through. We have to acknowledge to ourselves that this decision to be generous and to stand for the work we do without blaming someone else for it is the element of brand that matters the most as we go forward.”

What is a modern designer’s canvas? It’s not Photoshop or Sketch. It’s not pattern libraries or style guides. It’s not breakpoints or media queries. It’s none of these things. It’s up here. It’s our minds, our ideas. But it’s also out there, in the people we inspire. And that really is the best, most important and longest-lasting work we can do.

(al, ml)

© Andrew Clarke for Smashing Magazine, 2014.

Part 2: Mojo Motors&#8217; Responsive Redesign With Fireworks: Visual Design Stage

Mon, 03/24/2014 - 15:43

  

In the previous article in this series, I discussed our ideation and initial prototyping process. We covered details on how to use Adobe Fireworks to set up a responsive design wireframe, reusable components, prototypes and ways to share designs.

In this article, we’ll share how we used Adobe Fireworks in our iterative visual design process, along with other useful tips.

Why Adobe Fireworks?

Before diving into details, let’s acknowledge that Fireworks became feature-frozen in May 2013 and that some of the visual results discussed in this article could have been achieved using alternative graphics software, such as Photoshop, Illustrator or Sketch. But the hard truth is that Fireworks is still used by many designers and offers a unique workflow and integrated feature set, unmatched by any program available. For a good read on why Fireworks is still relevant, I recommend “The Present and Future of Adobe Fireworks.”

In Search of the Key Design Tool

As discussed in the “Creating Wireframes And Prototypes” section of part 1, our choice of a design tool came down to the following:

  • Speed
    Fireworks proved to be quicker for directly creating and manipulating visual elements on the screen than other tools, like Photoshop and Illustrator. The combination of integrated vector tools and bitmap-editing capabilities in one package, plus pages, states, symbols, styles and extensions, was something unique and worked best for us.
  • File size
    We found that PSD visual design files created in Photoshop for the same screen designs are much larger than those created in Fireworks — sometimes two to five times larger.
  • Team learning curve
    When Gabriel Gross (our visual UI designer) joined the team, we had already created a lot of wireframes in Fireworks. He initially considered just translating those wireframes to Photoshop. Because of the amount of work that would have been required, he decided to try Fireworks on a few screens. About a week later, he suggested working directly from the Fireworks PNG wireframe files, instead of recreating the designs from scratch. From this point forward, we’ve been using the wireframe files as the starting point for visual design screens.
  • Workflow and efficiency
    Reusing wireframes as a staring point really helped us get from wireframes to high-fidelity visuals in record time. We were able to take advantage of the efficiencies built into sharing files and iterating on them together. For a detailed look at a similar workflow, check out “Designing Interactive Products With Fireworks” by Nick Myers of Cooper and “iOS Prototyping With Adobe Fireworks and TAP” by Shlomo Goltz.

Note: Gabriel was also familiar with Adobe Flash and its various features and quirks. The transition to Fireworks was fairly straightforward — the Properties panel that spans the bottom of the screen, navigation of nested symbols, the symbols library and so on are quite similar in Fireworks and Flash.

Exploring Branding and Style

As discussed in the previous article, the design team decided on a pragmatic approach to creating visual elements. We decided early on in the project that we would only do as much visual layout and style exploration as necessary in graphics applications — the rest would be done through an iterative process in the browser. With this in mind, we ditched any elaborate branding exercise needed just for stakeholder buy-in and opted to create style tiles and a revised logo.

So, What Are Style Tiles?

Style tiles are a design document consisting of fonts, colors and interface elements that communicate the essence of the visual brand of a website or application. They help to communicate a proposed common visual language and can be used to discuss style preferences that meet the goals of the stakeholders or client. Samantha Warren explains the workflow pretty well in her article on A List Apart, “Style Tiles and How They Work,” so I won’t go into deeper detail than this:

Websites are so much more than just usable interfaces: they tell a story…

Style tiles are a flexible starting point that define a style to communicate the web in a way that clients understand. A style tile is more refined than a traditional identity mood board and less detailed than a website mockup or comp. When an interior designer redesigns a room they don’t build multiple options of the designs they’re proposing, they bring color swatches, paint chips, and architectural drawings. Style tiles act as paint chips and color swatches for the interface that we can execute on any device or at any dimension. It’s a truly responsive solution to visual design.

To learn more about style tiles, I recommend also visiting Samantha’s website Style Tiles.


An sample style tile from Mojo Motors’ redesign process. (View large version)

Typography and Typecast

Most designers would agree that their favorite graphics application does not provide an accurate preview of how text will appear in the browser. With this in mind, we did as much text layout as was needed in graphics applications and then explored the finer typographical details in the browser. There, we could also accurately evaluate the effect of responsive layouts on the type as we moved through breakpoints.

In working with fonts, we faced the same dilemma explained by the Typecast team:

We discovered that working with system fonts in Fireworks was faster for our designers, but build was slow because our developers had to interpret fonts and classes, resolve inconsistencies and negotiate font compromises with the designers. Plus there was that pesky problem of comp fonts not always resembling site fonts due to the rendering.

And when we moved to designing with web fonts, it was the opposite problem. It was faster for developers because there were fewer negotiations and less guesswork. But designers were wasting valuable project time stepping through a really repetitious process to get the web fonts into their layouts. You know the deal:

Go to URL → Paste copy → Preview → Capture → Import to comp → Resize → Arrange – Repeat40 → Find typos → Pull hair out → Repeat → Show client comp → Get requests to make bigger, smaller, different → Die a little inside → Repeat20

Both approaches had serious drawbacks.

So, to help us compare and narrow down Web fonts for Mojo Motors’ website, we turned to Typecast’s own solution.


Exploring typography in Typecast.

Typecast is a powerful browser-based design tool that makes it easy to experiment and design with the actual Web fonts that you plan to use on your website. The application lets you design visually and builds standards-compliant HTML and CSS in the background. Each Typecast subscription also comes with access to Web fonts from Typekit, Font Deck and Google, as well as a free Fonts.com account. Other features include the ability to create style guides and to share projects. Typecast is really a game-changer, and I highly recommend considering it as part of your responsive design toolkit.

Redesigning Mojo Motors’ Logo

As part of the website redesign, our team was also tasked with rethinking the company’s logo. All of the logo explorations were done in Illustrator, which is better suited to this type of work. Using Illustrator made more sense because it enabled us to create and output both CMYK files for print and RGB files for the screen.


The logo redesign combined elements of the old wordmark, a symbol and a new typeface.


Mojo Motors’ business cards, before and after.

Setting Up The Workspace For Visual Design

The key to using an existing Fireworks wireframe file for visual design work is to set up the application and the files properly. As discussed in the previous article, we did this up front so that we could take advantage of the application’s pixel-precise layout capabilities and increase our overall efficiency throughout the project.

Let’s quickly cover the basics.

Keyboard Shortcuts

One thing that can speed up the completion of tasks in Fireworks is mastering the keyboard shortcuts. For someone transitioning from another Adobe application, Fireworks provides the option to customize the keyboard shortcuts to closely match those of Photoshop, Illustrator or InDesign — or any variation you may need, for that matter. Our team settled on Photoshop’s shortcuts because they were the most familiar.

Changing these settings in Fireworks is easy. In Windows go to Edit → Keyboard Shortcuts, or on a Mac go to Edit → Fireworks → Keyboard Shortcuts. Then, select “Photoshop” or another shortcut set from the “Current Set” dropdown menu, and click “OK.”


Customizing shortcuts in Fireworks.

To customize further, open the “Keyboard Shortcuts” dialog again:

  1. In the “Commands” field, select a specific Fireworks menu command or tool.
  2. Type a new shortcut combo in the “Press Key” field, and click the “Change” button;
  3. When you are done editing the shortcuts, save the shortcut set as a variant of the set you selected previously (e.g. “My_Custom_Set”).

Now you can work faster using the keyboard shortcuts that you are familiar with!

Grids, Guides, Rulers and Tooltips

The great thing about carefully setting our responsive design grids during the process of creating a wireframe is that all of the grids and guides that we needed were already in place for the visual design process. Below are some of the options that we enabled when setting up our initial files.

Rulers are really handy for orienting yourself visually and are required for working with guides on the screen (in the menu, View → Rulers).


Rulers around the canvas.

We set our visible horizontal and vertical background grids to 10 pixels. Grids and of some their options can be accessed by going to View → Grid → Show Grid/Snap to Grid/Edit Grid… or by going to Edit → Preferences → Guides and Grids.


The guides and grids settings in “Preferences”.

This setting works well also because it matches the pixel increment (10 pixels) when objects are moved on the screen (for example, when we nudge an element using the Shift + arrow key shortcut). We often toggle this setting on and off as needed when drawing.


A vertical and horizontal background grid of 10-pixel increments.

We typically add guides to match the responsive grid layers and other objects as needed; guides are then toggled on and off while drawing. Guides in Fireworks are page-specific and don’t automatically appear on all pages unless placed on a master layer.

Here are a few useful tips:

  • Position unlocked guides precisely in Fireworks by clicking on a guide and entering the position directly.
  • Check guide’s spacing by placing your cursor between two guides and holding down the Shift key.
  • If you move a guide while holding down the Shift key, you can also precisely dial in the spacing.


Position guides accurately by double-clicking a guide.


Measure guide spacing by pressing Shift between guides.


Reposition guides visually by holding down Shift while moving a guide.

Guides and their options can be accessed via View → Guides → Show Guides/Lock Guides/Snap to Guides/Clear Guides…. You can also use keyboard shortcuts to speed up these operations.

Note: To do more with guides, I highly recommend the Guides panel extension by Eugene Jude, which enables you to create guides from selections, copy and paste guides, etc.

For an in-depth look at grid and guide workflows, check the “Grids Panel” and the “Guides Panel” sections in Ashish Bogawat’s article “Optimizing the Design Workflow With Fireworks Extensions.” (By the way, a similar panel named GuideGuide has recently become available for Photoshop users as well.)


Guides panel extension.

Smart guides are really helpful and enable you to visually align objects on the screen without having to use the Align panel. Turning these on (by going to View → Smart Guides) will allow you to see the precise adjustments to the location or size of an object when performing a free transform operation.


Smart guides for visual alignment.

Useful tip: If you find yourself creating a lot of responsive design grids, then you might also want to consider the Insert Grids extension by John Dunning.

Color Management, Color Picker and Swatches

Unlike the rest of Adobe’s Creative Suite, Fireworks does not require any particular color management settings for you to get started. The application was designed from the ground up for screen design, and it is set to the RGB color space out of the box.

Note: The Color Palette panel, in addition to the RGB, HSV and HLS color spaces, also shows a CMYK option, but it is not recommended for print work.


Options in the Color Palette panel.

The popup color picker is quite easy to use and is one of the best ways to specify colors for a user interface. It supports RGB and HEX color selection by default, as well as the more flexible RGBa specification that is supported by all modern browsers. Another useful feature is the one-click color copy feature. (As of the time of writing, Sketch is the only other app that has similar RGBa capabilities. Also worth mentioning is that Adobe has just added color-picker options for fills and strokes in Photoshop CS6 and CC.)


Fireworks’s color picker.

To bring in the color palette from our exploration, we saved an RGB .ASE file in Illustrator and imported it into Fireworks with the help of the Swatches panel. Once imported, the color scheme became immediately available in the color picker.


Export the .ASE swatch file from illustrator and import it into Fireworks.

The Color Palette panel is a great alternative to using the Swatches panel or color picker to specify colors. The panel is broken down into “Selector,” “Mixer” and “Blender” tabs.


The ‘Color Palette’ panel.

  • “Selector” tab
    This allows you to choose between different color models and select colors using an Adobe-like color picker, instead of the default color cubes swatches. The available options include HSV, HSL, CMYK and RGB; for most of our redesign work, we used the RGB model.
  • “Mixer” tab
    This is great for recoloring artwork and creating color tints. We relied on this greatly for stretching the range of our color palette. To try two different palettes in your document, follow these steps:
    1. Click “Palette1” on the left of the panel to set the base colors for the first palette.
    2. Click “Palette2” on the right side of the panel, and then select the base colors for the second palette.
    3. To switch back and forth between the two palettes, select the palette to recolor with and then click the “Replace Color” icon.
  • “Blender” tab
    Here, you can create a color gradation series, which is really handy for exploring gradients. All you have to do is this:
    1. Fill the color boxes at the bottom of the panel to select the beginning and ending colors.
    2. Use the “Steps” slider to select the number of steps in the series.
  • Exporting
    Exporting any palette out of this panel requires saving it as an .ACT swatch file, which can be shared with other Fireworks or Photoshop users. Unfortunately, Illustrator cannot open this swatch file format. To share with Illustrator, consider exporting an .ASE file via the Swatches panel, which will work across all Adobe products.

Note: The most recent versions of Fireworks (CS5, CS5.1, CS6) all natively support both .ACT and .ASE swatch formats. Earlier versions of Fireworks (CS4 and older) support only .ACT.

Setting Up The Document For High-Resolution Displays

Another decision we had to make before starting the visual design process was how to set up our files for high pixel-density (or “Retina”) displays. We could approach this in a few ways:

  1. Start with standard-resolution files and scale up for Retina graphics. We opted for this because we were starting from standard-resolution wireframes.
  2. Start with high-resolution files and scale down for non-Retina graphics.

Both conversion methods should be quite seamless and yield the same results. Objects in Fireworks are created as vector shapes by default, and any effects applied will also scale (assuming, of course, that you have not created any shapes using filled selections, which were popular in Photoshop prior to the more robust shape layer option available today). All text objects in Fireworks will scale without problems, too.

Working With Raster Images (Bitmaps)

Any bitmap images can be replaced with a higher-resolution versions. The key is to always start with high-resolution images where needed and scale down. Below are a few other options to consider:

  • Image symbols
    An alternative to replacing your images (and one I highly recommend) is to turn your high-resolution images into symbols (Modify → Symbol → Convert to Symbol, or F8) and scale down their placed instances in the layout. Once you turn a raster image into a symbol, you can scale it down to any size and then back up to the original size as many times as you’d like without any loss in quality. If you choose this method, you won’t have to replace your images!
  • Linked images
    An option I discovered recently is to link images. This requires installing the free Linked Images extension by John Dunning. With this option, your layouts will be refreshed with the high-resolution images upon being scaled up (the images are stored in a folder outside of the Fireworks file). For a detailed overview of this method, please check the “Linked Images” section of “Fireworks Extensions for a Better Design Workflow, Part 2.”

Note: For layout purposes, we used the first option to set image symbols of cars as placeholders. The final car images are generated dynamically on the server and rendered on the live website. We won’t cover this production process in this article.

Hint: A good read on Retina graphics is “Retinafy Your Websites and Apps” by Thomas Fuchs.

Live (Pre)View: Bringing Wireframes To Life Live View, Skala Preview and Xscope

Just as when we were creating the wireframes, we frequently had to check how the mockups looked and scaled on real devices, such as the iPhone and iPad.

For quick previews while designing, we turned again to the LiveView app (check out my previous article for details on our process). Alternatives to LiveView are Skala Preview and Xscope, which provide similar functionality but integrate better with Photoshop. Skala Preview is also compatible with Android devices.

Bringing Wireframes to Life

Once the file was set up, the next step was to add pixel precision to the interface and content. This is also when we applied brand elements such as color, typography, iconography and the logo from our style tiles. Putting the pages for each breakpoint in one working file made it easier to transpose screen elements between mobile, tablet and desktop layouts (see part 1 of this series for details on pages, states and symbols in Fireworks).

Favorite Fireworks Features During The Visual Design Stage

In this next part, we’ll cover some Fireworks features, tools and workflows that really came in handy during the visual design stage.

Properties Panel (Property Inspector Panel)

A lot of great features in Fireworks make creating screen graphics fast and efficient, but the single most powerful UI feature for us was the contextual direct editing of objects, available via the Properties panel (also called the Property Inspector (or PI) panel). This powerful panel changes contextually based on the type of object selected on the canvas.

The Properties panel is normally found at the bottom of the screen when a document is first opened in Fireworks. It allows you to manage all attributes, such as fills, strokes, gradients, patterns, textures, size, position, scale, opacity, blend modes, live filters, text properties, masks (and masks properties), symbols and much more, for any selected object or group of objects.


In these three sample screenshots, you can see how the Properties panel adapts to the type of object selected. (View large version)

Once you understand how the Properties panel works, quickly inspecting and changing the properties of all types of objects with pixel-level precision become really easy. You might also find that making changes is a lot faster than in any other graphics application (including Sketch!).

Gradients

Creating gradients is quite simple and intuitive. Adjusting and changing the fill type can be easily done at any time. Fireworks also offers 12 gradient types out of the box. And the dither option reduces banding when images are exported.

Side note: Starting with CS6, Adobe added some similar features to Photoshop, including the ability to add fills and strokes to shape layers as an alternative to live filters such as gradient overlay effects. Unfortunately, you can’t change the fill type as easily once you have committed to a gradient or any other type. Changing the fill type requires selecting the shape layer with the Path Selection tool, which will reveal your options in the options bar (in CS6) or in the Properties panel (in CC), at which point you can make your changes.

Textures

In addition to applying fills to vector objects in Fireworks, you can add textures to any fill type or stroke. Being able to apply textures to strokes is really useful for simulating CSS border-image effects, which is now supported by most modern browsers. Other features include being able to use your own texture files and specifying the opacity level.


Apply textures with (again!) the mighty Properties panel.

If you plan on using textures a lot, the free Texture Panel extension by Matt Curtis is a good addition to Fireworks. For details on this extension, check out Matt’s article, “Using the Texture Panel in Adobe Fireworks.”


Texture Panel extension.

Fireworks Live Filters and Photoshop Live Effects

Fireworks comes with most of the important non-destructive effects that you will need to bring screen designs to life, and it includes some familiar Photoshop live effects as options. I typically opt for Fireworks’ native filters before considering the Photoshop ones.

Fireworks’s live filters can be applied to any type of object (vector, bitmap, symbol, etc.) non-destructively, and the stacking order of applied live filters may be changed simply by dragging and dropping. Another key feature is the ability to apply multiple filters of the same type to a single object.


Fireworks’ live filters in the Properties panel.

I find the native filters to be quite adequate for most tasks, and I need to switch to Photoshop only for complex compositing, correcting photo colors and creating textures.

Blend Modes

Blend modes in Fireworks are similar to Photoshop’s and Illustrator’s. For a long time, Fireworks was the only Adobe application that allowed you to apply blend modes to multiple selected objects (or layers) at once. (Similar features were introduced to Photoshop in CS6. Illustrator requires the opacity option to be edited in the Appearance or Transparency panel.)


Blend Modes may be modified in the Layers panel (top screenshot) and in the Properties panel (bottom screenshot).

Pasting Attributes

Copying and pasting attributes (using the simple Control/Command + C and Control/Command + Alt + Shift + V shortcuts) between objects is an awesome feature and a huge timesaver, one we often leveraged during the process of going from wireframes to visual comps. Unlike copying and pasting layer styles in Photoshop, Fireworks transfers all attributes — including font type, font size, fill type, stroke type, applied live filters and so on — from one selected object to another.

Pasting attributes can even be done selectively (see the “Paste Selective Attributes” section of “Fireworks Extensions for a Better Design Workflow, Part 2”), which makes the feature even more powerful.

Styles and the Styles Panel

While being able to copy and paste attributes is very useful, using Fireworks’ styles is a lot more efficient and an essential part of creating visual mockups.

Styles in Fireworks are analogous to CSS in Web design. They can be quickly applied to objects on the screen to mock up variations or can be used to apply a final style guide for brand consistency. Whenever a style definition changes, all objects that have the same style are updated automatically.


Apply styles via the Styles panel from the built-in library.


Apply styles via the Properties panel.

Style can be created and managed in both the Styles panel and the Properties panel. As a bonus, Fireworks ships with a large library of premade styles that can be applied very quickly to any mockup. You can also easily create, edit and reuse your own styles.

Rounded Rectangles

Creating (and modifying) rounded rectangles is very easy, and Fireworks is the most flexible here of the three Adobe applications typically used for screen design (the other two being Photoshop and Illustrator). Create one by modifying the roundness of a rectangle shape (i.e. the border-radius of each corner) directly in the Properties panel or by inserting a rounded rectangle auto shape.


You can control the roundness of a rectangle’s corners in one of two ways. (View large version)

My preference is to use the Properties panel because you can specify the roundness in percentages or pixels. But modifying the roundness at any time is easy either way. You can also modify individual corners of a rounded rectangle. When you’re using the Rounded Rectangle auto shape, the roundness can be also controlled with the Auto Shape Properties panel.

(Photoshop CC just added an option to apply rounding to individual corners of a rectangle or to a rounded rectangle shape layer via the Properties panel. This is a welcome change and a great alternative to adding rounded corners as an appearance effect in Illustrator.)

Multi-Border Rectangle Auto Shape

The Multi-Border Rectangle auto shape is an extension by John Dunning that makes it easy to mock up CSS-style borders on vector rectangles. You can specify a different border width and color for each of the four borders of a rectangle, just as you do with CSS for each border of an HTML element. This extension proved very useful during our visual design process.


We used the Multi-Border Rectangle auto shape to add top and bottom borders to rectangles.

Path Panel

Fireworks has an easy to use and robust set of vector-editing tools, with many of the same features found in Illustrator. Most of the tools can be accessed from the Path panel (and a few are in the “Modify” menu). In CS6, some of the basic path tools were added to the Properties panel, for easy access.

Note: There is a more recent version of the Path panel (with many additions and improvements) than the one that ships with Fireworks CS6. (In case you’re wondering, Aaron Beall is the talented developer responsible for the latest versions of the Path panel in Fireworks, including the one in CS6.)


The ‘Path’ panel.

Importing From and Exporting to Illustrator

Fireworks handles .AI files very well, and we used it whenever we had to work with vector art created in Illustrator or in Illustrator-compatible applications. As part of the importing process, you are even presented with a “Vector File Options” window, giving you the option to select a specific Illustrator artboard to import.

We especially took advantage of this workflow with our company’s logo and illustrations throughout the website. Our freelance illustrator worked in Illustrator and imported directly into our Fireworks layouts. For smaller artwork, you could also copy a single object or group of objects in Illustrator and then paste them directly in Fireworks.


The illustration for Mojo Motors’ “Tour” page was created in Illustrator and then imported into Fireworks, with all vectors perfectly preserved and editable. (View large version)

Exporting vector objects to Illustrator for further refinement is as easy as selecting the object (or group of objects) in Fireworks, then going to Edit → Copy as Vectors, and then pasting the vector objects in Illustrator. (Simply copying and pasting objects would put bitmap objects in Illustrator, instead of vectors, so always go to Edit → Copy as Vectors, instead of Edit → Copy.)

To export large artwork in Fireworks, save the entire file as an .AI file and then open that .AI file in Illustrator.

Note: In Illustrator CC, Adobe removed the importing and exporting options described above. If you are using Illustrator CC, you might need to save your files as “Illustrator v. CS6” to take advantage of all of these capabilities, or work in Illustrator CS6 or lower, which supports all of these options out of the box.

Importing From and Exporting to Photoshop

Importing and exporting with Photoshop is a breeze with Fireworks — Fireworks can save to .PSD and also open .PSD files. In both cases, layers and naming conventions will be preserved.

The results will vary according to the options you’ve set during the importing or exporting process and how much editability you would like to retain. My suggestion is to experiment a little to see which settings work best for your purpose.


The Photoshop importing and file-opening dialogs in Fireworks.

Note: As of the time of writing, Photoshop importing and exporting still works well in Photoshop CC and CS6.

Align Panel

If you intend to create pixel-precise layouts, then you cannot do without the Align panel. With it, you can align multiple objects to each other or relative to the canvas. (Adobe Illustrator has a similar feature, and it was just introduced to Photoshop CS6 as well, although its functionality is not as robust.)

Two useful features that are unique to the Align panel in Fireworks are the “Match Size” and “Space Evenly” options.


The ‘Align’ panel.

  • Match size
    This option lets you match the size of the selected object to the height or width (or both — but usually the longer dimension) of another object.
  • Space evenly
    This is different than distribution, enabling you to align objects a fixed distance apart.

The Align panel is invaluable. The only option that I wish Fireworks had adopted from Illustrator is the alignment object reference, which enables you to pick the object to align your selection to.

Symbols

During the visual design process, we continued to look for opportunities to modularize interface components by creating reusable symbols. In some cases, we simply applied visual styles to existing wireframe symbols.

Styled component symbols are very efficient and reduced the time we took to create alternate layouts and iterations. For details on creating symbols, read the section “Creating Reusable Modular Elements” in part 1 of this series.

9-Slice Scaling

The 9-Slice Scaling tool is original to Fireworks and was adopted later by Flash and recently by Illustrator. With it, you can scale objects without distorting protected areas. A popular use of the tool is to protect rounded corners in a symbol when scaled.


Use the 9-Slice guides to preserve rounded corners in a button.

The 9-Slice Scaling tool works on symbols and on both vector and bitmap objects, making it extremely versatile.

Single-Layer Editing

This feature is really geared to designers who are coming to Fireworks from Photoshop and who are used to selecting layers before working on them. I personally prefer the default auto layer selection method in Fireworks because it is faster, especially in files with a ton of layers.


The single-layer editing option in the Layers panel menu.

Conclusion

I was really torn about whether this article would still be relevant in light of the announcement that Fireworks has been feature-frozen. However, as I explored all of the alternative ways to make one’s workflow efficient, I realized that Fireworks is still powerful and will continue to be the best option until Adobe unveils its replacement or until another competitor supports all of its features, including integration with other Adobe products, as Fireworks currently provides. (In my opinion, Photoshop and Illustrator have recently gained some sorely needed features that make the process of designing for screens more efficient, but they’re not there yet.)


Screenshots of Mojo Motors’ website after the redesign (Click each image for a larger version).

Alternatives?

Are there alternatives to Fireworks? Of course.

For example, for teams comfortable stepping outside of the Adobe world, the Mac-only Sketch is a great replacement, and I hope to see it integrate more of the time-saving features offered by Fireworks. Read about some of the benefits of using Sketch for UI design in the following articles:

Sketch doesn’t totally replace Fireworks, but it’s getting pretty close in my opinion. (Craig Erskine, who uses both Sketch and Fireworks, has shared his thoughts on the matter.)

At the other end of the spectrum, I am quite excited about applications such as Macaw, which are embracing a more modern approach to designing for screens with a native desktop application. I recently supported Macaw’s Kickstarter effort and am currently trying out the product with my early-bird license. (The product will launch sometime in March or April 2014.)

Another noteworthy project is Evolve UI, a somewhat secret yet exciting initiative by Tribaloid and one that could shake up our workflow in the next few years. Evolve UI is being developed by Alan Musselman, who worked as Fireworks’ project manager for quite some time, and it is currently in alpha development.

Awards

Last but not least, I’d like to mention that Mojo Motors’ redesigned website received quite a few awards after it launched — namely, the Web Marketing Association’s WebAward for 2013, the Interactive Media Award for 2013 and the Automotive Website Awards’ Rising Star award for 2014. I feel very proud of the work we did on this project. Fireworks was invaluable to our team, minimizing the production work and freeing us to focus on designing a good product for our users.

Note

All of the screenshots of Mojo Motors’ website are from the initial launch state at the end of 2012. Some of the screenshots in this article might not match the current website because pages are frequently optimized according to analytics, user testing and performance.


The 404 page.

Further Reading

Should you want to explore more of Fireworks’ features and options, these resources might be helpful:

What’s Next?

We’ve planned this case study of Mojo Motors to span three articles. Part 1 covered the UX and interaction design stage. Part 2 has covered the visual design stage. Part 3 (currently on the drafting board) will discuss how our team translated the visual design to the front-end iterative development cycle. Stay tuned!

(mb, al, il)

© Olawale Oladunni for Smashing Magazine, 2014.

Taking A Closer Look At Arabic Calligraphy

Thu, 03/20/2014 - 12:29

  

Arabic calligraphy was originally a tool for communication, but with time, it began to be used in architecture, decoration and coin design. Its evolution into these major roles was a reflection of the early Muslims’ need to avoid, as their beliefs required, figures and pictorials that were used as idols before Islam was established in the Arabian Peninsula.

While the Arabic tribes preferred to memorize texts and poetry, the first Muslims tried to document their holy book (Qur’an Kareem) using the scripts that we’ll look at in this article. In order to understand how these scripts developed into the beautiful and complex shapes we know today, we have to understand the history of Arabic calligraphy.

Over the course of their development, the Arabic scripts were created in different periods and locations of the expansive Islamic Empire. There is also a close relationship between each Arabic script and its common usage throughout history. This leads us to the question of why this article is important, especially for non-Arabic speakers, and what information can be gleaned from each script.

Well, understanding the history of each script and how Arabic calligraphy evolved over the history of the Islamic Empire can expand our visual experience beyond the beautiful glyphs and forms. Some scripts reflect the time period in which they developed, such as the Musand script, which emerged at an early stage in the history of Arabic calligraphy. Others provide geographical insight into where the artwork was developed, such as the Maghribi script, which distinguishes the artwork and inscriptions of northwest Africa.

Can different scripts tell us more information, such as the geographical area where each was developed? How much is the local culture affected by each script? We will try to answer these questions, while briefly going through the history and style of each script.

The Early Development Of Arabic Scripts

Digging deep into the history of the Arabian Peninsula and the origin of the Arabic language, archeologists have found inscriptions that show a close relationship between Arabic scripts and some earlier scripts, such as the Canaanite and Aramaic Nabataean alphabets that were found in the north of the Arabian Peninsula. These inscriptions were date to the 14th century BC.


Comparison of the old scripts letters (Image source: Wikipedia)

Arabic Musnad

The first Arabic script, Arabic Musnad, which likely developed from the above-mentioned languages, doesn’t have the cursive aesthetic that most people associate with modern Arabic scripts. Discovered in the south of the Arabian Peninsula, in Yemen, this script reached its final form around 500 BC and was used until the 6th century. It did not look like modern Arabic, as its shapes were very basic and resembled more the Nabataean and Canaanite alphabets than the Arabic shapes.


Arabic Musnad script (Image source: Marie-Lan Nguyen)

Al-Jazm

The first form of an Arabic-like alphabet is known as the Al-Jazm
script
, which was used by northern tribes in the Arabian Peninsula. Many researchers think the roots of this script go back to the Nabatean script, and yet the early Arabic scripts also seem to have been affected by other scripts in the area, such as the Syriac and Persian scripts.

The Al-Jazm script continued to develop until the early Islamic era in Mecca and Medina in the west of the Arabian Peninsula.


Arabic Al-Jazm script (Image source: Saad D. Abulhab)

The Al-Jazm script developed into different styles, such as the Hiri, Anbari, Makki and Madani. During this period, some other scripts developed, such as the Ma’il, which is considered the predecessor of the Kufic script. Other scripts did not make it through the development process, such as the Mukawwar, Mubsoott and Mashq (which you can read more about in “The Development of the Arabic Script: A Brief History” by professor M.J. Alhabeeb of the University of Massachusetts Amherst). Usually, these scripts were used before and during the early days of the Islamic Empire in the Arabian Peninsula.

Kufic Script

Following the Arabic Musnad and Al-Jazm, the Kufic script evolved as the next stage of Arabic calligraphy’s development. Unlike those two old scripts, we can identify known letter shapes in the early development of the Kufic script.

As the Kufic script developed over the 7th century, it played an essential role in documenting the Muslim holy book (Qur’an Kareem). The Kufic script is one of the oldest Arabic scripts that persisted in common use until the 13th century.

Its name refers to the city of Kufa in Iraq, where it first appeared, yet most instances of this script were found nearly a thousand kilometers to the south in Medina in the Arabian Peninsula, where the Prophet Mohammed stayed after moving from Mecca.

In the early stages of its development, the Kufic script did not include the dots that we know from modern Arabic scripts. The letter dots (Nuqat) were added during the later development of this and other scripts. Also, at a later stage, Abul Aswad Al Du’ali (688 CE) and Al Khalil Ibn Ahmed Al Farahidi (786 CE) developed the diacritical marks (Tashkeel) that indicate the vowels of the letters.

If we examine Kufic script inscriptions, we’ll notice particular characteristics, such as the angular shapes and long vertical lines. The script letters used to be wider, which made writing long content more difficult. Still, the script was used for the architectural decoration of buildings, such as mosques, palaces and schools.

These characteristics affected the usability of the script and made it more suitable for architectural and written Islamic titles, instead of long texts.

The Kufic script continued its development through the different dynasties, including the Umayyad (661 – 750 CE) and Abbasid (750 – 1258 CE) dynasties. Below are some examples of Kufic scripts and their different developmental stages:


Kufic script from the 9th – 10th centuries (Image source: Will Schofield)


Kufic script from the Holy Qur’an, 11th century (Image source: Smithsonian’s Museums of Asian Art)


Royal Mosque (Imam Mosque) minaret decorated with square Kufic (Image source: Patrick Ringgenberg)


Islamic Derham from the Abbasid period with Kufic scripts on both sides (Image source: Hussein Alazaat)

While Kufic has been used for a long time and is one of the more common scripts across the Islamic civilization, some versions of it were developed in particular areas, such as Egypt and Iraq. Understanding how the script developed in different areas and being able to identify each variation of it will help us identify the origins of the artifacts where they appear. Variations and developments of the Kufic script include the following:

  • The thick Kufic script
    This is one of the earliest forms of the Kufic script and was used in the early copies of the Holy Qur’an, known as the Uthman Qur’an.
  • Magribi Kufic script
    This script was used in Morocco and includes curves and loops, unlike the original Kufic script.
  • Mashriqi Kufic Script
    The letters in this script are similar to the original Kufic, with a thinner look and decorative lines.
  • Piramouz script
    This script is another version of the Mashriqi script that was developed in Iran.
  • Ghaznavid and Khourasan scripts
    These two other forms of the Kufic script were developed in Iran. These scripts have the same thickness as the original Kufic script, with long vertical lines and decorative ends.
  • Fatimid Kufic
    This form developed in North Africa, especially in Egypt. It was written in thick lines and short curves.
  • Square Kufic
    This form is very noticeable, with its straight letters and no curves at all.

As an Egyptian citizen, resident in Cairo, I enjoy the Fatimid Kufic as part of my daily life because it can be seen in the architectural decorations on the old Islamic buildings. This script was used with decorative motifs in the characters themselves or as a background. The letters are marked with straight lines and angles, with short curves for some letters at the ends of words. One of the leading scholars and an award-winning researcher in the Fatimid Kufic script is Bahia Shehab, Professor of Professional Practice at the American University in Cairo.


The Fatimid Kufic script appears in the architecture of Bab Al Nasr, a gate built by Babr Al-Jamali, a minister of Fatimid Caliphate (909 – 1171 CE), on the northern wall of Fatimid Cairo (Image source: Md iet)


The Fatimid Kufic script appears here on the Sultan Hasan mosque in the Fatimid Cairo. (Image source: Stars in Symmetry)

Abbasid Dynasty

After the Umayyad dynasty came the Abbasid dynasty (750 – 1258 CE), bringing advancements to Arabic calligraphy. During this period, Thuluth and Naskh were developed. The three calligraphers responsible for these developments were Ibn Muqlah, followed by Ibn Al Bawwab (11th century) and Yaqut Al Musta’simi (13th century).

Ibn Muqlah restricted the scripts’ proportions to six cursive styles, including the Thuluth, Naskh and Muhaqqaq. These rules are based on four elements: the rhombic dot, the alif, the circle and the similarity system. These changes helped to develop the Kufic script with the cursive styles shown below.


The rhombic dot as a guide to proportions (Image source: The Metropolitan Museum of Art)


The alif and circles as a guide to proportions (Image source: Fayeq Oweis)


The measurements of the Arabic letters showing similarity, according to Ibn ar-Rawandi, Rahat as-sudur (Image source: Annemarie Schimmel)

Thuluth Script

The name “Thuluth” means one third, which might refer to the size of the pen used to write the script. It is one of the cursive scripts that was commonly used to decorate mosques and different types of texts.

The Thuluth script was first developed in the 11th century during the Abbasid dynasty and was refined by calligrapher Seyh Hamdullah during the Ottoman dynasty. It is the basis of scripts that appear later, such as the Jeli Thuluth, the Naskh and the Muhaqqaq, the last two of which we will cover later in this article.

The Thuluth script is marked by its clear structure and readability, which make it suitable for a number of purposes, even today. The cursive letters and long lines make it easily readable and usable for both titles and long texts.

Therefore, it was used in the Holy Qur’an and in architectural decorations in many regions of the Islamic Empire. Below are some examples of the Thuluth script.


Thuluth script in Sultan Ahmet Mosque in Istanbul, Turkey (Image source: Puccaso)


The exterior decorations of the Taj Mahal in India, written in the Thuluth script (Image source: Habeeb)


A modern instance of the Thuluth script is the flag of the Kingdom of Saudi Arabia (Image source: Wikipedia)

Naskh Script

During the same period, the 10th century, another main script was developed. Used to copy books, especially the Holy Qur’an, Naskh, which means “copy,” was later refined by Islamic calligraphy master Seyh Hamdullah (1436 – 1520) during the Ottoman dynasty.

Known for its readable glyphs, the Naskh was traditionally used for long texts and inscriptions. Its use continues today in the design of printed Arabic books, due to its modern look and cursive letters.


One page from the Holy Qur’an, written in the Naskh script (Image source: US Library of Congress)


Pottery drinking vessel, with Naskh script, from the 13th century CE (Image source: A. Davey)

Safavid Dynasty

After the Abbasid dynasty, the Safavid dynasty (1502 – 1736) was established in Persia and made substantial contributions to Islamic arts and calligraphy. It developed the existing Ta’liq script and produced a more developed version, called Nasta’liq, during the reign of Shah Islma’il and his successor, Shah Tahmasp.

Ta’liq Script

The word Ta’liq means “suspension” and was inspired by the shape of the script’s lines, which look hung together.

Widely used for a variety of purposes, such as messages, books, letters and poems, the Ta’liq script was formed during the 11th century, was refined during the 13th century in Persia and is still used today.

As mentioned, the words appear hung together and connect to each other, and the letters are rounded and have a lot of curves. While this makes it less legible, the script is often written with a large distance between lines to give more space for the eye to identify letters and words.

While the spaces between lines are helpful, they consume the page, which is obviously a disadvantage when space is limited or the text is long.


Example of Ta’liq script (Image source: Wikimedia)

Nasta’liq Script

The Nasta’liq is a refined version of the Ta’liq script, although with elements of Naskh. It developed during the 15th century and continued until the 16th century in Persia and Turkey.

Merging the characteristics of both scripts, such as the short vertical lines of Naskh and the long curved horizontal strokes of Ta’liq, it is still used in Persia, India and Pakistan for writing in Persian, Urdu and Punjabi. In terms of legibility, it’s an improvement on the Ta’liq but harder to read than Naskh.

The letters are a little hooked, similar to those of the Ta’liq script, and vary in thickness. Although the arrangement of letters flows smoothly and in harmony, it is hard to write and is less readable than many other scripts. Both the Ta’liq and Nasta’liq scripts have left their mark on Persian art and architecture, and you can easily identify Persian inscriptions by the type of scripts they’re written in.


Example of Nasta’liq (Image source: Wikipedia)


Decorative paper with Nasta’liq (Image source: Wikipedia)

The Maghribi (North Africa)

Maghrib refers to the west side of North Africa in the Islamic Empire. This area is distinguished by the Maghribi script, used in writings, inscriptions and monuments. The Maghribi script developed during the 10th century and is still used today in Spain and western North Africa, particularly in Morocco, Algeria and Tunisia. In this way, the Maghribi script drifted away from the scripts discussed above that developed in the Middle East and Arabian Peninsula.

The Maghribi script is marked by descending lines written with very large bowls and by letters of a unified thicknesses. The special form of its letters gives it a unique beauty and makes it easy to read, even in long text. Because of its decorative appearance, The Maghribi script is suitable for decorations as well as titles.


Verses from the Holy Qur’an written in the Maghribi script (Image source: US Library of Congress)


Verses from the Holy Qur’an written in the Maghribi script (Image source: Chester Beatty Library)

Ottoman Dynasty

During the Ottoman Empire (1444 – 1923), Arabic calligraphy went through a noticeable evolution, not only because of the development of a new script but also because of the enhancement of existing scripts. Most Arabic scripts reached their final and modern form during the period between the 15th and 19th centuries. The Ottoman reign is considered a remarkable period in the development of Arabic calligraphy, second only to the Abbasid dynasty.

Throughout the four centuries of the Ottoman Empire, many scripts were developed, such as Diwani, Riq’a, Jeli Dewani, Tughra’a and Siyaqat. Many calligraphers contributed to this development of Arabic calligraphy, including Mustafa Halim (died 1964), Nejmiddin Okyay (died 1976) and Hamid Aytac Al-Amadi (died 1982).

We’ll cover two commonly known scripts from this era, the Diwani and Riq’a scripts.

Diwani Script

The name of this script derives from “Diwan,” the name of the Ottoman royal chancery. It was used in the courts to write official documents. Developed during the 16th century, it reached its final shape in the 19th century and is still used today.

It is defined by its beautiful curved letters, merged to form complex shapes and decorative forms. This complexity makes it harder to use with long text, so a simpler version of the script is needed if a calligrapher is to use it for that purpose.


Example of Diwani script (Image source: Wikimedia)


Another complex instance of the Diwani script in the shape of a boat (Image source: Wikipedia)

Riq’a Script

As we’ve seen, the names of some scripts come from the geographical area where they developed. In this case, the name “Riq’a” derives from how the script was used: written on small pieces of paper or cloth. It seems to be one of the more recent scripts, developed in the 18th century, and is still used today.

The Riq’a script is known for its simple form, making it perfect for paragraphs and long texts. The way its letters are connected makes it particularly easy to convert into a digital font. However, it is not especially attractive in titles or decorations because it does not have the sophisticated letterforms of the Diwani, Thuluth and Kufic scripts.


Paper from the Holy Qur’an in Riq’a script (Image source: Wikimedia)


Paper from the Holy Qur’an in Riq’a script (Image source: Wikimedia)

Conclusion

Arabic calligraphy has developed for over 14 centuries in various regions around the world. This history and diversity has enriched Arabic scripts with ever more complex and artistic forms. During this long period, the Baghdadi and Ottoman eras contributed the most to its development.

Arabic calligraphy is still today one of the most widely acknowledged arts and continues to develop both in traditional methods as well as in digital and computer-generated arts. Arabic calligraphers from around the world continue to develop their own styles and artwork based on existing scripts and their own letters and scripts. Free modern scripts contribute to the art just as much as traditional scripts have done.

Resources

Below are links to some master calligraphers of today who enrich Arabic calligraphy with their artwork and masterpieces:

In researching for this article, I relied on the following resources:

(ac, al, il)

© Rafiq Elmansy for Smashing Magazine, 2014.

WordPress Performance Improvements That Can Go Wrong

Thu, 03/20/2014 - 02:31

  

If you’ve searched recently for tips on optimizing WordPress’ performance, then you have definitely come across various techniques that people recommend. These include all sorts of caching mechanisms, such as reverse proxies, object caching and cache plugins, CSS minification, using sprites for images, and so on. All of them are viable and effective ways to speed up a WordPress website’s performance. However, be careful when implementing any of these techniques, and always test their effect on your particular website.

In this article, we’ll cover some of the most common issues with various speed boosters that I have encountered and share solutions to help you fix those problems or find ways around them.

Possible Problems When Using Reverse Proxies Such As Varnish And Nginx

I will start with the reverse proxies because, when used correctly, they can give you the biggest speed boost and, when used improperly, can cause serious problems, such as making your website inaccessible or showing the wrong information to the wrong visitors.

How Do Reverse Proxies Work?

Reverse proxies, like Varnish and Nginx, stand between your visitors and your Web server. When a request for one of your pages is made, your Web server usually has to execute the PHP service that makes calls to the database and then provides the page output and the static resources needed to visualize the page. With a reverse proxy enabled, this result is cached, and the next time someone requests that page, the ready output will be delivered by the reverse proxy, which is much faster and causes no load on your server.

This is great, but to operate correctly, the cache must be purged every time something on the page has changed. This is where things can go wrong, mostly because WordPress does not natively support reverse proxies and requires additional tweaks for the cache to be cleared correctly. Usually, such tweaks rely on WordPress’ default core hooks (think of them as events) to purge the cache when necessary — when a post is updated, when a comment is added, when a post is created, etc. However, if an important hook is missed in the implementation of the reverse proxy that you’re using, then you might have a problem. Additionally, numerous events — ones not a part of WordPress’ core hooks but rather performed through plugins — could change the content on your website.

Possible Problems During WordPress Updates

When updating, WordPress puts your website in maintenance mode, updates its files and then disables maintenance mode. The reverse proxy could possibly cache some of your pages while your website is in maintenance mode. This means that if the cache is not purged, then this maintenance page would continue being served to visitors, actively preventing them from reaching your website even when it is operational on the Web server.

When you update a plugin, WordPress disables it, deletes its entire folder and then adds the new files. During that time, the plugin does not actually work. If it’s a big plugin that adds a lot of functionality, such as a gallery or online store, then your reverse proxy could cache pages with errors on them, instead of the actual content.

When you update manually, the easy fix is either to disable the cache during the update or to purge the cache manually once you are ready with the update. However, when you use WordPress’ native automatic update, these solutions are not very practical. What a good reverse proxy should do instead is automatically purge the cache on each update event. Because both core and plugin updates have hooks in the core, this is easily achievable and should be done by you (if you are implementing the reverse proxy yourself) or by your hosting provider (if you rely on the host’s implementation).

Problems With Online Store Plugins for WordPress

No matter which WordPress plugin you use for your online store, you should be very, very careful when implementing reverse proxy caching.

For example, you could create a lovely mess with a shopping-cart widget that displays the products that a customer has selected to buy. If that content is cached by the reverse proxies, then all of your visitors would see the products that the first customer has selected for purchase. Things could get even worse if pages containing personal information, such as thank-you pages, are cached and displayed incorrectly to the wrong visitor. Needless to say, this should be avoided at all costs.

The safest way to avoid such problems is to exclude the entire e-commerce part of your website from the cache. Usually, reverse proxies implemented by hosting companies exclude the most common WordPress e-commerce plugins from the cache by default.

If excluding the whole e-commerce part of your website does not sound to you like an elegant solution — because you would obviously lose the speed benefits — then, theoretically, there is a more intricate way around: using Edge Side Includes (ESI) to specify that parts of your pages should not be cached. In theory, you would simply surround your HTML with ESI tags:

<esi:include> Dynamic content <esi:remove>

Then, the content between those tags would be dynamically retrieved every time this page is requested.

Unfortunately, implementing ESI with WordPress is not straightforward at all, due to WordPress’ lack of native support for reverse proxies. Thus, ESI is usually not a viable option with hosts that support reverse proxies. But it is worth considering if you have an online store built with WordPress and you are implementing the reverse proxy yourself.

Problems With Rating Plugins

When you use a rating plugin on a WordPress website that is cached by a reverse proxy, chances are that visitors will often see an incorrect cached rating, instead of the real up-to-date rating. The reason is that a visitor’s vote given through such a plugin is not part of WordPress’ default hooks and will not trigger a cache purge.

Similar to the e-commerce issues, you could either exclude pages that you collect rankings for from the cache or implement the ESI model for those pages, if feasible.

Issues With Full-Page Caching Plugins

In case your hosting provider doesn’t provide you with a reverse proxy caching service, you could rely on one of the so-called full-page caching plugins for WordPress. When a visitor requests a page, the plugin would save the actual HTML output in a physical file on your server. The next time someone requests that page, it would be served as a static HTML file, which is much slower than a reverse proxy but still faster than not caching at all.

Unfortunately, due to the caching technique being used, all of the possible problems I’ve explained for reverse proxies hold true for the full-page caching plugins, plus some new ones.

Be careful using such caching on a website with many posts or pages. When you create content on a WordPress website, more pages are automatically created than just the one you’re working on directly: category pages that list all posts in that category, tag pages, archives, author pages, pages for uploaded images, etc. All of these add up to a big number of URLs that your website serves. Now, imagine all of those URLs being turned into HTML files in some folder (usually the uploads folder) on your Web server. When thousands of files are in a single directory, even listing those files is difficult, and we’re talking about the Linux OS here. The result for a big website is usually a huge number of files, a heavy I/O load on the server and, eventually, a slower website and problems with the hosting provider.

There is no exact number of posts above which you should not incorporate this method, and it also depends on the particular way the plugin stores the cache — using multiple folders instead of one, for example, would be more efficient, but still might not be enough for a really large website. Just bear in mind that if you use such a caching technique and your website starts slowing down, then this might be the reason.

Object Caching (Memcached) And How To Break It

Object caching is great for a website that gets a lot of requests to its database, and it can really speed up some websites. Memcached stores the result of the most commonly executed queries to your database in the server’s RAM and serves the cached results instead of querying the MySQL server each time. Unfortunately, in some scenarios, you could actually decrease your website’s performance, and here is why.

Some WordPress plugins are coded (badly) to store a huge amount of data in the application database. The Memcached service has a limited amount of memory for caching. Imagine what happens when a plugin stores huge images in the database. Memcached will try to store the result of this query in its buffer but will run out of space. Then, it will start to delete previously cached content on a first-in, first-out basis. If the query’s results are big enough, then no actual content would be cached because it would be removed before being served a second time. In this case, your website would actually slow down because not only would you fail to spare this load on the MySQL service, but you would add another service in the process that requires its own computing time.

If you find your website is working more slowly after enabling Memcached, then unfortunately your only solution is either to disable all plugins that store a huge amount of data in the database or to disable the Memcached service itself.

Sprites: Yes, You Can Go Wrong With Them, Too

I love sprites for the performance boost they give to a website when used correctly. This is why, when we redesigned SiteGround recently, we moved all navigation and UI elements and many other page elements to sprites. Our website became much faster, and we were quite happy with the result. Then, we continued adding elements to the sprite image, until at some point we noticed problems when some pages loaded on iOS devices.

This happened because we hit mobile Safari’s limit on the maximum number of decoded pixels that can be displayed. This limit is different for different devices. You could easily generate a sprite with a lot of pixels, and if it reaches the size limit, then the browser won’t load it, which will leave your website without all of the elements contained in that sprite. Of course, you don’t want this to happen.

A good man by the name of William Malone has crafted a nifty tool to check whether a sprite image will display correctly on all iOS devices. Enter the dimensions of your sprite image in the calculator, and the answer will appear.

If your sprite is too big, a possible solution is to split it into two images. If you have to do this, my advice is to relegate only the newest elements to a new image; otherwise you would have to adjust all of the CSS code that uses the sprite, a task that you’d want to avoid if possible.

Risks With CSS And JavaScript Minification

CSS and JavaScript minification is another of the most common techniques for speeding up a website. Generally, minifying these files entails removing all unnecessary symbols (new lines, semicolons after the final CSS property, comments, etc.), thus reducing the size of the files. This technique applies not only to WordPress but to any page that uses CSS and JavaScript.

Many tools and plugins will automatically minify files. However, some minify more aggressively than simply removing empty symbols. Some tools will rearrange CSS selectors, for example, grouping them by property, etc. In some cases, this could break the entire logic of a CSS file and turn your website into something that merely resembles the original.

To avoid such problems, use basic non-aggressive minification tools that remove only unnecessary data from JavaScript and CSS files, without reordering properties. In addition, always keep a copy of your unminified files because, after minification, they will become practically unreadable, making any further changes much harder. I use either a plugin or the online FreeFormatter.

Gzip: Can’t Go Wrong Here, But We Can Do It Better

Enabling Gzip for WordPress will greatly improve loading speed. Gzip compresses a page’s output and transfers it to the visitor’s browser, like a regular ZIP file, whereupon the browser decompresses and renders it. It’s great because the time a browser takes to decompress archived content is many times less than the time needed to physically transfer the uncompressed content from the server to the browser.

Most WordPress users rely on plugins when they can — at least the ones who can’t or don’t want to code — including for Gzip. Unfortunately, Gzip plugins run through PHP, which, although fast, is not as fast as running directly from the Apache server. All you need to do is install mod_deflate (ask your hosting provider if it is available — it should be because it is pretty much an industry standard) and add a few lines to your .htaccess file:

AddOutputFilterByType DEFLATE text/plain AddOutputFilterByType DEFLATE text/html AddOutputFilterByType DEFLATE text/xml AddOutputFilterByType DEFLATE text/css AddOutputFilterByType DEFLATE application/xml AddOutputFilterByType DEFLATE application/xhtml+xml AddOutputFilterByType DEFLATE application/rss+xml AddOutputFilterByType DEFLATE application/javascript AddOutputFilterByType DEFLATE application/x-javascript Conclusion

Knowing all of the risks involved in optimizing the speed of your WordPress website should not stop you from experimenting. To achieve the best results, just follow few simple principles: don’t change too many things at once, benchmark your loading speeds, use staging copies when possible, and test the website’s functionality after applying each new technique. In doing so, you will speed up your website without breaking any functionality or causing problems for visitors.

(dp, al, il)

© Hristo Pandjarov for Smashing Magazine, 2014.

How To Plan Your Next Mobile E-Commerce Website

Wed, 03/19/2014 - 16:36

  

The O’Neill Clothing store had a nearly 600% revenue increase from going responsive, and Skinny Ties saw a 377.6% increase in revenue for iPhones after going responsive as well. Even Think Tank Photo’s transactions on smartphones and tablets increased by more than 96%… go figure!

In this article, we’ll walk through all of the vital steps when planning a highly converting mobile e-commerce website. The most important questions you need to ask are:

  1. Who are we building this mobile website for?
  2. How will we measure conversion success?
  3. What design factors affect mobile e-commerce conversion rates?
  4. What is the ideal product page?

Let’s get started.

So, Who’re We Building This Mobile Website For?

The mobile customer is someone we are constantly learning about as mobile adoption becomes more widespread and filters into everyday life. To plan a mobile e-commerce store, we need to put ourselves in the mindset of the mobile customer and understand their intentions and mood.

Phone Usage Locations

The mobile device is a life-invading piece of equipment. We use it in diverse situations:

  • while watching TV;
  • while shopping or on a night out;
  • in bed or in the bathroom;
  • while eating a meal (a pet hate of mine!);
  • when bored or waiting at our desk, at a train station or as a car passenger.

In each situation above, the person’s mind will be in a different state and may or may not be in “purchasing mode.” We also use mobile at different times of the day.


(Large preview)

How does this help us? Well, for example, you could strategically place different banners on the home page of your mobile e-commerce website, such as price promotions, discounts or coupons, perhaps offering early-morning discounts for commuters, while offering TV dinner viewers something else in the evening (something like “Bored of watching soaps? Grab a DVD bundle now!”).

The Main Types of Mobile Shoppers

Columbia Business School identified five types of mobile shoppers in showrooms and stores: exploiters, savvys, price sensitives, experience-seekers and traditionalists. I have gone one step further by thinking about how people use their phones outside of the showroom to decide whether to purchase products.

  • The comparer
    The comparer browses products in brick-and-mortar stores while price-checking on their mobile device. They might buy in-store, using the online price as negotiation leverage. However, if the online offer is strong enough and the product is available, they will purchase on their phone there and then or when they get home later.
  • The deal lover
    This person loves a bargain, and when they are in store, they’ll look for an online voucher, a Groupon deal or something to save them from buying at the high street price. They differ from the comparer in that they want to believe they are getting a special deal, a limited offer or an exclusive promotion (think Secret Escapes’s exclusive deals or Booking.com’s lowest-price guarantee).
  • The social shopper
    Constantly connected to a range of social channels, the social shopper follows celebrities, industry leaders and brands on Instagram, Twitter and Pinterest, seeking out the latest fashion trends, gadgets and the like. Clicking through everything from vintage-filtered photos to heavily liked dresses, they just have to buy to be ready for the weekend.
  • The time passer
    This person just needs to pass the time while waiting for someone or something. They are normally an impulse buyer, browsing stores they already know (a form of direct traffic) for the latest products. They might subscribe to news feeds or email lists and click through from direct promotion in social channels, too.

All of these types of mobile shoppers have high expectations of mobile e-commerce stores.


(Large preview)

Why is this important? You need to ensure that you’re catering to all of the different types of shoppers who might visit your store on a mobile device. You’ve got to identify them, give them the options they seek and present information in a format they are comfortable with. If not, you’ll end up annoying them, rather than increasing your client’s bottom line.

How Will We Measure Conversion Success?

We need to define what conversion success looks like. Typically, a conversion falls into one of the following categories:

  • Purchase
    The visitor has completed a purchase transaction.
  • Social promotion
    The visitor might follow your social channel; share, tweet or like your product or brand; write a review; subscribe to a newsletter; etc.
  • Complete a task
    The visitor has completed some task, whether playing a game, filling out a poll, entering a competition, etc.

We then need to set ourselves some SMART goals (as defined by Paul J. Meyer) to track and measure our success. These goals will also help us focus on the project and not get carried away with over-spec’ing or over-designing the website. So, what are SMART goals?

  • Specific
    The goal should be unambiguous and should define what we are trying to achieve.
  • Measureable
    How are we going to measure this? By what method? We could go further by saying who will be responsible for reporting this and whom they will report to.
  • Attainable
    How will this goal be achieved? What needs to be done to make this happen? Do we have the budget, skill and time?
  • Relevant
    Is this in line with our overall vision? Is the market ready? Are we the right people to do this?
  • Time-bound
    How quickly can this be achieved? When are we going to start and finish?

Below are three sets of goals we’ve set in the past. These would directly affect how one goes about designing and developing a mobile e-commerce store.

SMART Goals 1
  • Specific
    Increase mobile e-commerce conversions by 35%.
  • Measurable
    Segment sales report in Magento.
  • Attainable
    Do this by creating a responsive e-commerce store.
  • Relevant
    This aligns with our overall conversion targets and goals to adopt mobile technology.
  • Time-bound
    Accomplish it within three months of the website’s launch.
SMART Goals 2
  • Specific
    Increase the average order on mobile by £5.
  • Measurable
    Combine the segmented sales report in Magento to give an average daily order value.
  • Attainable
    Improve upselling and cross-selling on product pages, and recommend complementary products in the shopping cart.
  • Relevant
    This aligns with our overall conversion targets.
  • Time-bound
    Accomplish this within 30 days, and then continually improve through testing and iteration.
SMART Goals 3
  • Specific
    Reduce bounce rates to below 56% for top-level categories.
  • Measurable
    Analyze the report of page visits within a set time period in Google Analytics.
  • Attainable
    Improve loading time to below four seconds on a 3G network, and improve the landing page design.
  • Relevant
    Although not a direct conversion itself, this would improve all other conversion rates by keeping users on the website for longer and increasing the number of pages visited by each user.
  • Time-bound
    Test over a 14-day rolling period, iterating on the design until we hit the target.

Tip: Print these goals in a large font size and put them where the whole team can see them. Ask the team members how their work will contribute to the shared goals. If a task doesn’t contribute at all, then question whether it’s needed.

What Design Factors Affect Mobile E-Commerce Conversion Rates?

Let’s go through the factors that affect how customers browse an e-commerce website, from a mobile perspective.

Hierarchy and Navigation

Space is at a premium on mobile. We don’t have the luxury of providing mega menus for users to browse multilevel categories. Therefore, we need to prioritize key features and content and provide a search box that’s easily accessible in a consistent location. The adoption of off-canvas navigation is becoming widespread as users start to understand how to use it.

Currys’ responsive website does this very well by providing off-canvas top-level navigation, a search drop-down box, instant cart and account access, and a store finder, all in a very small space that remains consistent throughout the customer’s entire journey.


(Large preview)

When you scroll further down, the logo area disappears and the five main menu items move up, decreasing the space taken up by the header and giving priority to the content that the visitor is interested in.


(Large preview)

Trading Usability and Loading Time for Branded Navigation

Sometimes you need to make a tradeoff. When we developed Crockett & Jones’ mobile website, our branding guidelines and the company’s heritage and reputation for quality led us to a more pictorial menu system, to reinforce the brand. We experimented with five intuitive navigation methods:


(Large preview)

From our research into the leading mobile e-commerce websites, we felt that a fixed menu at the top would offer the best usability. Icons like the ones on Currys’ website wouldn’t be right for Crockett & Jones’ audience. Instead, we used a menu button that expands down to a navigation list, with subpages that load via a matrix menu. This allowed us space to add imagery, to give that look and feel of British heritage.


From left to right: (1) the expanded navigation; (2) the matrix submenu; (3) the product search results with matrix navigation for finger-friendly tapping, plus another expanding menu for the product filter. (Large preview)

Fixed Navigation Vs. Non-Fixed Navigation

Fixed navigation sits in place, always visible to the user whether they scroll up or down. Non-fixed navigation is the opposite, visible only when user is at the top of the page.

Based on the e-commerce websites of major brands I have followed, the trend is towards fixed navigation, which I think is justified. For me, fixed navigation wins hands down; having to scroll all the way back to the top of the page to find the menu bar is annoying. With fixed navigation, you are only ever a quick finger movement away from accessing deep sections of the website. Achieving this is easy with the MeanMenu jQuery plugin or with Bootstrap’s NavBar.

Imagery and Product Photography

We all know that photography can make or break a website’s look and feel. The mobile consumer wants to see imagery that captivates them and inspires them to make a purchase, whether it’s a vacation or a saucepan. The fundamentals of product photography are ever critical here, so make sure to get all of the pictures that a customer requires to make a decision.

  • Individual shot
    This is a shot of the product at its best angle, normally against a white background.
  • Detail shot
    This is a closeup showing the product’s special features or details of design — for example, the quality of the stitching, the materials used, the label or the handcrafted detail.
  • Components shot
    If it’s a home cinema system, then take shots of its individual parts, including the DVD player, speakers, remote control and accessories.
  • 360° shot
    This is an animated set of images that allows the user to spin the product through 360° of rotation. It’s normally comprised of 36 shots, each 10° apart. We used this to fantastic effect with the shoes on Crockett & Jones’ website. We shot with Eme Digital’s Large 360 Photography System, and then writing custom jQuery to control the rotation effect.
  • Group shot
    This is normally used at the category level or for bundle offers. Group shots — whether for a range of saucepans or for a pizza, side and drink — show complementary products and help the vendor upsell to customers.
  • In-use shot
    An important but often forgotten shot is one of the product being used. For example, clothes look very different when laid flat than when shown on a live model. These shots are aspirational and can highly motivate a customer to purchase.

On mobile, speed is a hurdle, so remember to optimize images to load quickly, without compromising on quality. Of course, a lot of effort is being put into developing a responsive image solution, but whatever approach you take will only be as good as your photography. Peter Crawfurd goes over how to “Improve Your E-Commerce Design With Brilliant Product Photos.”

Typography

Wondering how to turn off mobile users very quickly? Make them have to pinch and zoom to read text! Having to zoom in to make text legible on a phone is very annoying, so ensure that your typography is readable, contrastive, responsive and well spaced. There are techniques for responsive typography that we can follow.


(Large preview)

We achieved the typography above with a simple CSS media query, based on Bootstrap 3’s breakpoints for device widths, to ensure consistency across all devices.

@media screen and (max-width: 320px) { .hero h2 { color: white; font-size: 2em; font-weight: 100; font-family: "bebas-neue"; } } Finger Friendly

All of those critical calls to action should be large enough to be pressed by a finger. According to “Finger-Friendly Design: Ideal Mobile Touchscreen Target Sizes,” that’s about 57 pixels wide for a finger and 72 pixels wide for a thumb. The article also notes, “This is consistent with Fitt’s Law, which says that the time to reach a target is longer if the target is smaller. A small target slows users down because they have to pay extra attention to hit the target accurately.” I would say that most of us have overlooked this fact for many years, especially as we adjust out of our 1024 × 768 mindset.

This is very important for all areas that are common to mobile e-commerce websites:

  • navigation of category tree;
  • search buttons and filters (especially checkboxes that require precise touch);
  • all buttons, including “Add to cart” and “Pay now securely”;
  • form fields to enter billing and shipping details;
  • thumbnail pictures of products;
  • swiping for product photos, instead of tapping left and right arrows.
Contrastive Color and Light Conditions

Whatever color palette you choose, strong contrast is imperative for buttons and calls to action. If an object blends in, users will likely miss it.

Consider the lighting conditions of your mobile users and how to accommodate them in the look and feel of the website. Try turning off the lights, going out into bright sunlight and huddling under a reflective lamp to see how your color palette performs. You can adjust the CSS to account for different lighting conditions with what are known as light-level media queries.

@media (light-level: normal) { p { background: url("texture.jpg"); color: #333 } } @media (light-level: dim) { p { background: #222; color: #ccc } } @media (light-level: washed) { p { background: white; color: black; font-size: 2em; } }

Although no browser currently supports these, light-level media queries are a cool feature that will hopefully be adopted soon because mobile devices really are used in different lighting conditions. This sort of technology could improve conversions with mobile usage in dark and bright sunlight. One could even imagine swapping promotional banners for daytime and nighttime!

Tip: Don’t be afraid of red buttons. Conversions have increased on a ton of websites that switched to red for strong contrast. Test and iterate!

White Space and Encapsulation

White space gives content room to breathe, aids eye flow and declutters. It can relax the visitor when making a purchasing decision.

Use encapsulation to draw the visitor’s attention to an element, such as an “Add to cart” button. Create a container for the button with a contrasting background color. Unbounce does a great job of explaining encapsulation.

Copywriting

The majority of clients will supply you with copy for their products, categories and generic pages, because we designers and developers don’t always know the products as well as our clients (hopefully!). However, we do know about persuasive wording and how to use it in calls to action. For example, “Pay securely now” is more motivating and instills more trust than just “Check out.”

Long descriptions can be annoying on a small screen. Consider a “Read more” link to reveal more text, or split up a description into a few tabs to allow mobile users to flick through for the information they are looking for.

Tip: If your client is writing the product descriptions, get them to read Craig Anderson’s “E-Commerce Copywriting: The Guide to Selling More,” which walks through the basics of writing good copy.

Forms

Forms slow everyone down. The user has to stop and think about filling it in, provide the right data, scan for accuracy, check and uncheck boxes and so on. Forms can be especially cumbersome on a mobile device, so make sure yours are finger-friendly and legible. Remember to use the right input type (URL, email, telephone, etc.) so that the mobile browser displays the appropriate keyboard.

Indicate to users their position in the checkout process, too, so that they see their progress and see the light at the end of the tunnel. Derek Nelson puts it well in “Designing a Better Mobile Checkout Process.”

The Ideal Product Page

I don’t think you could ever get the “perfect” product page because a lot is left to the eye of the beholder. However, Currys’ product page gets pretty darn close. Let’s break it down.

Currys’ has the following attributes:

  • clear product title, with responsive typography in corporate color palette;
  • price in contrasting color and responsive typography that stands out and is readable above all other pricing information;
  • very clear call to action that stands out above all other links on the page (with simple form encapsulation and finger-friendliness);
  • great photography, with all of the shots a user needs to make a purchasing decision (including individual, component and detail shots);
  • short description giving a quick overview of the product’s features;
  • more detailed information about the product for researcher-type customers;
  • indication of availability, showing where and when the customer can get it (with simple form encapsulation).

Overall, the page is well spaced, with 20 pixels of white space between block-level elements. Corporate branding is present without cluttering the page, and the goal funnel is clearly defined. If the visitor is interested in the product and the price is right, then they would have no barriers to purchasing it.

Is It All Worth It? Crockett & Jones

The results for Crockett & Jones were overwhelming, with increased time on pages, increased views of the 360° photos (which we set as a conversion goal in Google Analytics to measure their effectiveness) and a reduced bounce rate for mobile users, which I strongly believe is due to the quality of the content, images and videos. The pages visited has also gone up, which I attribute to the navigation layout. The expanding menu fixed to the top makes it very easy for the user to jump around the website and find their way back, while upholding the heritage of the brand. Page speed could certainly be improved, but we had to balance optimization with high-quality images that reflect the brand, and this is certainly something we are still working on.

Summing Up

Putting together a mobile e-commerce website is a multidisciplinary task that encompasses business management, design, development and marketing. Whatever your agency’s size, create a boilerplate process that you can follow for all websites but that you can adapt to each project’s specifics. In the planning stage of this process, cover the following:

  • Who are you designing for (i.e. your customers)? What are their buying habits, and what drives them to buy?
  • Put together SMART goals that give you and the client a common vision.
  • Create a style guide that is suited to mobile devices, including button design, font size and so on.
  • Generate wireframes with details for all key pages (home page, category page, product page, search and shopping cart).
  • Bring together all digital assets (photography, video and copy).

Planning in this way will help you deliver an e-commerce website that is well optimized for mobile, that is targeted at your client’s customers and that coverts more visitors into buyers.

Bonus Take-Away Material

You can download the “Mobile E-Commerce Conversion Rate Optimization Checklist” (PDF), with 80+ points to help you get your mobile e-commerce store in ship shape.

(al, il)

© Lawrence Howlett for Smashing Magazine, 2014.

Getting Your App Ready For iOS 7&#8242;s New Dynamic Interactions

Mon, 03/17/2014 - 13:45

  

There’s no need to bust out a physics textbook to make your iOS 7 app’s views animate like real-world objects. With iOS 7’s new Dynamics API, views can be influenced by gravity, attached to each other with springs, and bounced up against boundaries and each other.

Physics engines are no stranger to game designers. Whether it’s the perfect gravity-induced parabolas of Angry Birds or the swinging candy in Cut the Rope, we’re used to objects in games feeling real. To get this effect, game designers don’t write code to set the position of each object manually. Instead, they use a physics engine that treats the elements as bodies in a simulation and that uses Newton’s laws of motion to calculate how they move over time.


The birds travel along a trajectory determined by physics (Image credits).

In using the engine, designers specify an object’s bounciness, its density, the level of gravity, and how things are attached to each other. In iOS 7, Apple made that technology available to UIKit-based apps as well. With these new UIKit features, we can integrate dynamic behavior without having to learn how to program a game engine. If you use them carefully, your UX will be more immersive and intuitive because users will interact with it as they would with objects in the real world.

Where Would You Use This?

If you are looking for places in your app to upgrade to feel more iOS 7-native, any animation is a candidate. You can see it all over the built-in apps, which will give you some ideas. I’d look anywhere that you’re already using several parallel animations with overlapping timelines and timed triggers to start other ones. Are you trying to do something that the Dynamics system would do for you automatically?

Another great candidate is anywhere you are using pan gestures to manipulate views, particularly with screen transitions. Play around with the camera icon on your phone’s lock screen to see an example. Tapping it will create an impulse force from the bottom, which gravity eventually overcomes. Dragging it up and dropping it shows how the view has an elastic bottom that bounces against the phone’s edge. You can even give the view an initial velocity by slamming it down.

See It in Action

I’ve put together a simple video demo of Dynamics to show how you can use it for view transitions. The first part of the video shows what you could do easily in iOS 6 and below. It simply attaches a pan gesture to the view and uses its y-translation to set the center of the view. This gives the illusion that you are directly moving it. Then, when you end the pan gesture by lifting your finger, it triggers a Core Animation that returns the center to its starting position. This automatically slides the view down as if it’s falling.


Video demo of UIDynamics in action.

The second part is similar but is done with the Dynamics physics engine. We’re still making a pan gesture, but we attach it to the view with a spring. Then, we make the bottom of the screen a solid barrier to collide against and add gravity. Now, when we grab the view, it follows our finger as before (but with a springy connection), and when we let go, the view falls with an acceleration determined by the gravity field. When it lands, it bounces. We can also throw the view by letting go while our finger is moving, and the velocity of our finger will be imparted to the view.

You can get the project by cloning DynamicUtility on GitHub. If you don’t have Xcode, you can install it on your machine through the Mac App Store. In Xcode, open DynamicUtility.xcodeproj, and run it in the simulator (Command + R). If you have a developer account with Apple, the effect is even better on a phone.

Piecing It Together With Core Animation Before iOS 7

Core Animation is a powerful system, and you can absolutely get exactly the same results using it (with a lot of work). The advantage of the Dynamics system is that you are able to express what you want in terms of physical attributes, and layering more and more complex behavior and playing around with it are much easier. In an equivalent Core Animation set-up, the variables that govern the behavior aren’t as clear. Let’s look at a simple example.

In the Xcode Utility Application template, we start with two views, the main and flip side of an application. Let’s add a way for the user to pan the main view up to get to the flip side view using gestures and Core Animation.

To start, all we need to do is add a pan gesture to the storyboard and attach it to our view. Then, we can set up its selector action to send this message:

- (IBAction)onPan:(UIPanGestureRecognizer*)pan { static CGFloat startY; CGPoint delta = [pan translationInView:self.view.superview]; if (pan.state == UIGestureRecognizerStateBegan) { startY = self.view.center.y; [pan setTranslation:CGPointZero inView:pan.view.superview]; } else if (pan.state == UIGestureRecognizerStateChanged) { CGFloat newY = self.view.center.y + delta.y; // detect a collision with the bottom if (newY > startY) { newY = startY; } // attach the pan to the view self.view.center = CGPointMake(self.view.center.x, newY); [pan setTranslation:CGPointZero inView:pan.view.superview]; } else if (pan.state == UIGestureRecognizerStateEnded) { // gravity? [UIView animateWithDuration:.3 animations:^{ self.view.center = CGPointMake(self.view.center.x, startY); }]; } }

This is a simple implementation of an interaction that enables you to drag a view that drops back into place when let go. The first comment shows where we stop the user from dragging it down below the screen’s edge. The second one shows how we’re attaching it to the finger. The final comment shows where we animate it back into place.

This is a great start, but consider how you’d implement the following features:

  1. imparting your finger’s velocity to the view when you let it go,
  2. attaching the view to your finger with a spring,
  3. accelerating the drop based on a gravitational force,
  4. detecting collisions against the boundaries and bouncing the view against them.

Even after you did this, changing the animation so that gravity is stronger, the springs are springier, and every variable is exactly right would leave you with a code mess, or, to paraphrase Philip Greenspun, you’d end up with a poorly specified, half-implemented physics engine. We can use the Dynamics system instead.

iOS 7’s New Dynamics System Makes This Much Easier

The Dynamics system enables us to define a complex system of behavior by combining a few simple concepts. Let’s use a few to recreate the sliding effect in a more lifelike way.

Setting It Up

The Dynamics system is made up of three basic parts. UIDynamicAnimator controls the whole system by running the physics simulation and moving and rotating the objects. Each body in the simulation is represented by UIDynamicItem, a protocol implemented by UIView. Finally, we specify what we want to happen by creating and adding UIDynamicBehavior objects to the animator.

We’ll combine a few behaviors to get the effect we want:

  • UIAttachmentBehavior
    This lets us attach items to each other or to an anchor point. The attachment may be either a stiff strut or springy.
  • UICollisionBehavior
    This adds a boundary that contains the views. If we had more than one view, we could use this to make them bounce against each other.
  • UIGravityBehavior
    This specifies a gravitational field. If a view isn’t attached to something and isn’t up against a boundary, then gravity will draw it down (or in whatever direction we want).
  • UIDynamicItemBehavior
    This describes attributes of the item it’s attached to. It controls whether the item may be rotated, how elastic it is and how much it resists movement.

To use the Dynamics system, we construct the behaviors we want and attach them to the items that they will affect. Then, we add them to the animator.

A Simple Gravity Demo

Let’s build a simple demo so that you get the hang of it before we jump into a view transition. First, you’ll need these properties in your header:

@property (strong, nonatomic) UIView *body; @property (strong, nonatomic) UIDynamicAnimator *gravityAnimator;

Next, in your viewDidLoad message, add a call to this message:

-(void)addBodyView { self.body = [[UIView alloc] initWithFrame:CGRectMake(155, 40, 10, 10)]; self.body.backgroundColor = [UIColor blackColor]; [self.view addSubview:self.body]; }

This will put a black square at the top of the view. In your storyboard, add a “Demo Gravity” button, and connect it to this action:

- (IBAction)onDemoGravity:(id)sender { self.body.center = CGPointMake(160, 50); self.gravityAnimator = [[UIDynamicAnimator alloc] initWithReferenceView:self.view]; UIGravityBehavior *gravityBehavior = [[UIGravityBehavior alloc] initWithItems:@[self.body]]; [self.gravityAnimator addBehavior:gravityBehavior]; }

The first line repositions the view at the top. The second line creates the animator, with your view as its reference. The next two lines just say that the body view we added is affected by gravity. Now, run it in the simulator, and tap your “Demo Gravity” button. The black square will drop to the bottom of the screen (and then keep going).

The Dynamics system also support collisions against objects and boundaries. A common boundary is the view that contains the animation (also called the reference view). To designate the reference view as a boundary, just add these three lines to the end of onDemoGravity:

UICollisionBehavior *viewIsBoundary = [[UICollisionBehavior alloc] initWithItems:@[self.body]]; viewIsBoundary.translatesReferenceBoundsIntoBoundary = YES; [self.gravityAnimator addBehavior:viewIsBoundary];

Now, when you run it, the box will bounce at the bottom of the view.

Our next step is to see how to control the parameters of the animation. To do this, the Dynamics system has a special behavior named UIDynamicItemBehavior, which is a collection of attributes that affect a given item. Let’s alter the elasticity of the box so that it bounces higher. Just add these lines to onDemoGravity:

UIDynamicItemBehavior *itemBehavior = [[UIDynamicItemBehavior alloc] initWithItems:@[self.body]]; itemBehavior.elasticity = .8; [self.gravityAnimator addBehavior:itemBehavior];

The elasticity defaults to 0 and can be set to any number between 0 and 1, where 1 represents complete elasticity — and a very long animation if we had used it in this case.

If you want to get a feel for how realistic this simulation is, try rotating the body view with this line (right after you’ve set its center):

self.body.transform = CGAffineTransformMakeRotation(M_PI/5.0);

When you run this, you’ll see that the simulation takes shape into account as well and bounces the object off its edges, not just up and down.

Making A Custom Behavior

For our simple demo, creating the behaviors right in an action message was fine, but for real apps, this would get complex very quickly. One nice thing about UIBehavior is that you can create composite behaviors by inheriting an object from UIDynamicBehavior and then adding child behaviors inside of its init message. This lets us package a set of related behaviors in a reusable class. Let’s replace our original iOS 6 gesture-based animation with a dynamic one by creating a new behavior class named LDUSlideBehavior.

Here’s a header file for our sliding behavior:

#import @interface LDUSlideBehavior : UIDynamicBehavior -(instancetype) initWithItem:(UIView*) item; @property (strong, nonatomic) UIPanGestureRecognizer* pan; @property (strong, nonatomic) UIAttachmentBehavior *attachment; @property (strong, nonatomic) UIDynamicItemBehavior *behavior; @end

Our init takes the view that we’re going to slide. It looks like this:

-(instancetype) initWithItem:(UIView*)item { if (self = [super init]) { // create a pan gesture self.pan = [[UIPanGestureRecognizer alloc] initWithTarget:self action:@selector(onPan:)]; [item addGestureRecognizer:self.pan]; // attach the view to a spring self.attachment = [[UIAttachmentBehavior alloc] initWithItem:item attachedToAnchor:CGPointMake(item.center.x, item.center.y)]; self.attachment.damping = .1; self.attachment.frequency = 5.0; // make a boundary UICollisionBehavior * collision = [[UICollisionBehavior alloc] initWithItems:@[item]]; [collision setTranslatesReferenceBoundsIntoBoundaryWithInsets: UIEdgeInsetsMake(-item.superview.bounds.size.height, 0, 0, 0)]; collision.collisionMode = UICollisionBehaviorModeBoundaries; [self addChildBehavior:collision]; // add a gravitational field UIGravityBehavior *gravity = [[UIGravityBehavior alloc] initWithItems:@[item]]; [self addChildBehavior:gravity]; // behavior parameters for the view self.behavior = [[UIDynamicItemBehavior alloc] initWithItems:@[item]]; self.behavior.allowsRotation = NO; self.behavior.elasticity = .4; self.behavior.resistance = .7; [self addChildBehavior:self.behavior]; } return self; }

Breaking this down, we can see that all we’re doing is creating standard behaviors and adding them to our custom behavior. We don’t add UIAttachmentBehavior immediately because we want that to be active only when the pan gesture is active, so we’ll add and remove it in the onPan: message.

UICollisionBehavior uses insets on our parent’s bounds to set up a barrier around our simulation that has its top side set to be offset by the height of the view. The left, right and bottom boundaries are left in place, so that the view can slide up but not left, right or below the screen’s bounds.

One thing to notice is that we’ve set allowsRotation to NO. Strictly speaking, this shouldn’t be necessary because all of our motion is vertical and confined to a view with 0 horizontal space and all of the view’s edges are perfectly flat. There is simply no room for the view to rotate. However, UIDynamics sometimes have floating point errors, and if you don’t do this, then the view will sometimes rotate as you drag it. It’s impossible in the real world, but, as we know, computers can only simulate the real world. Another issue you might run into with dynamics and rounding is that a simulation could go on forever if the floating point error causes tiny movements. If you see this, you can monitor the animator’s elapsedTime and then call removeAllBehaviors to stop it.

We still need to implement a pan gesture handler, and we’ll do that right in the custom behavior class. Here it is:

-(void)onPan:(UIPanGestureRecognizer*)pan { if (pan.state == UIGestureRecognizerStateBegan) { [self addChildBehavior:self.attachment]; } else if (pan.state == UIGestureRecognizerStateChanged) { CGPoint delta = [pan translationInView:pan.view.superview]; self.attachment.anchorPoint = CGPointMake(self.attachment.anchorPoint.x, self.attachment.anchorPoint.y + delta.y); [pan setTranslation:CGPointZero inView:pan.view.superview]; } else if (pan.state == UIGestureRecognizerStateEnded || pan.state == UIGestureRecognizerStateCancelled || pan.state == UIGestureRecognizerStateFailed) { [self removeChildBehavior:self.attachment]; // impart the velocity to the view when we let it go [self.behavior addLinearVelocity: [pan velocityInView:pan.view.superview] forItem:pan.view]; } }

When the gesture begins, we add the UIAttachmentBehavior, and we remove it once the gesture is over. While it’s changing, we just need to move the attachment’s anchor point to stay under the user’s finger, and the behavior object will move the view that we attached to it as if it were attached with a spring.

Note the last line of function, where we take the velocity of the pan and add it to the item that’s being dragged. This enables the animation to transition very smoothly from panning to what happens after we let it go.

Finally, we need to clean up our pan gesture when we are deallocated.

-(void) dealloc { [self.pan removeTarget:self action:@selector(onPan:)]; [self.pan.view removeGestureRecognizer:self.pan]; }

This class may be infinitely customized. For example, the damping and frequency of the spring may be changed using the attachment, and the gravitational constant may be set in the gravity behavior. The UIDynamicItemBehavior class has a few more properties to play with. And we’ve only scratched the surface, because other behavior classes can simulate magnets, constant and impulse forces and a few other things.

Adding the Behavior to an Animator

Now that we have a custom behavior class, adding it to the animator is easy. The UIDynamicAnimator class must be instantiated and retained throughout the life of the simulation, so the easiest thing to do is use a property on your view controller.

Then, just allocate it and add in the behavior, like so:

-(void)setUpDynamics { self.animator = [[UIDynamicAnimator alloc] initWithReferenceView:self.view.superview]; [self.animator addBehavior:[[LDUSlideBehavior alloc] initWithItem:self.view]]; }

That’s all there is to it. To download the full project, just clone DynamicUtility on GitHub

Where To Go From Here

Take a good look at your own apps. A good place to start with dynamics is when you transition from one screen to another. If you are using a swipe gesture, consider replacing it with a pan gesture attached to a view, and let the user directly manipulate it. For example, instead of swiping an object to bring up a menu to delete it, let them throw it away directly by tossing it.

But be careful. Don’t add dynamics just to show off. Used correctly, dynamics add playfulness and immersion but, if overused, can make an app feel like a mishmash of fancy effects.

To learn more, watch the WWDC 2013 video “Getting Started With UIKit Dynamics,” then download the Dynamics Catalog sample app. This sample app is a comprehensive catalog of the various behaviors and their uses. And if you need details on any of the classes or messages, read Apple’s official documentation on UIDynamics in the “UIKit” section.

(al, il)

© Lou Franco for Smashing Magazine, 2014.

Are We Thinking About Digital All Wrong?

Fri, 03/14/2014 - 14:21

  

I want to let you in on a secret — writing a book is a scary experience. You pour your heart into it and then wait for the reaction when it is published. You can be certain of only one thing: You will be criticized.

My book Digital Adaptation will soon be officially released, and I know a lot of clever people are going to disagree with what I have written. They are going to argue that I focus too much on digital and its characteristics and its implications and its impact on business and on the way we work and organize teams, when ultimately digital is just a tool.

If Digital Is Just A Tool

If digital is just a tool in our business arsenal, then it fundamentally alters how we approach this new medium. It will even redefine what your job should be. If digital is just a tool, we might not even need Web professionals. I can tell you now that from a certain point of view they are right to criticize me.

In fact, yes, at their most fundamental level, digital technologies such as the Web and mobile are just tools like any other we work with. Like electricity or the printing press, we can use these tools to achieve a business objective. For example, to persuade prospective customers to buy a product, you might get a brochure printed. This would require both the power of electricity and a printing press. Alternatively, you could build a website, send an email or create a Facebook page. Digital is just another tool in your arsenal.


Is digital really just a tool? Digital challenges companies to rethink and adapt their existing practices, and usually it’s not enough to see it as a tool alone.

Many argue that viewing digital in this way will shape a person’s thinking about how digital can be used and referred to. Suddenly, having a digital strategy or even a digital team sounds ridiculous. You wouldn’t have a brochure strategy or a team dedicated to managing electricity. Why, then, do you need a digital strategy or a digital team?

They go on to argue the dangers associated with thinking of digital as more than a tool. If we treat digital as special in some way, then we risk isolating it from the broader business. The digital team ends up doing its own thing, rather than helping the entire company make use of the tool.

If we create a separate digital strategy, they argue, then the danger is that, rather than helping to achieve the overall business strategy, we would distract or confuse it. Surely, the argument goes, devising a business strategy that draws on digital when appropriate makes more sense.

These are all completely valid points, and I entirely understand their logic. However, I passionately argue that we do need separate digital strategies and that we also need empowered digital teams. I take this approach because I believe that digital is more than another tool in our business arsenal.

Digital Is More Than A Tool

I strongly believe that describing digital as a tool diminishes its profound impact on the world we live in. Digital has transformed society, government, culture, business, media and more. Barely an aspect of our lives has not been touched in some way.

Therefore, when I write about forming a digital strategy, I am not referring to a strategy for using a tool. I am talking about forming a strategy to adapt to the fundamental changes that digital has brought upon society.

Take, for example, the power that the Web has provided consumers to identify competitors, recommend products and services to friends, and share their dissatisfaction when things go wrong.


Before the Web, if somebody was unhappy with a product or service, they could moan to their friends, but that was about it. Now, we live in a world where a dissatisfied customer has global reach!

That single change in customer behavior has incredible ramifications on how we do business. When a “tool” has that kind of power, it warrants special attention.

This isn’t the first time a tool has so radically transformed society. The printing press is another good example. The printing press enabled the Lutherans to spread their message and to challenge the dominance of the Catholic Church. As a result, the Vatican took the printing press very seriously. They understood that the key aspect was the impact of the tool, not the tool itself.

Companies today need a digital strategy to help them adapt to the change that digital has brought to the world. They now operate in the context of this new world, and they need a clear vision of how to adapt to it.

As long as companies think of digital as just another tool, they will fail to embrace the full potential of the Web and mobile. Many organizations are still trying to wrap their heads around the changes that these innovations have brought. They are still unsure of how to deal with them properly.

We Are Still Learning How To Use Digital

For a long time, the industrial revolution was driven by the power of steam and water. That required building factories near rivers. The mass availability of electricity did away with that need, and yet over a decade later companies were still building their factories next to water. The full potential of electricity had just not sunk in.

We are in a similar situation today. Most organizations are carrying on with business as usual, even though the world has changed around them. For companies to adapt to this new world, somebody has to disrupt the status quo. Somebody has to demonstrate the full scope of how digital has changed business and show people how to harness this new technology.


Most organizations are not aware of the full potential of digital. Mentally, they are still building their factories by the water.

This is a problem that the industrialists tackled by appointing Chief Electricity Officers. To our eyes, this might seem ridiculous because electricity is now so ubiquitous, but at the time it was crucial for helping organizations to adapt to this revolutionary technology.

For this same reason, we need digital teams and strong digital leaders today. Companies need expert help to adapt. They need fresh blood to disrupt the old ways of working and to encourage new thinking. In short, companies need digital leadership.

As I have written before, this shouldn’t last forever. The digital team should exist primarily to educate, empower and support other business units. Companies will eventually adapt, and digital will become as ubiquitous as electricity. But until that day, we need digital champions to stop us from blindly building our factories next to water.

This is not to say that senior managers believe they are building by the water. That brings me to my final point.

Digital Is A Catalyst For Change

I am often surprised at how resistant managers are to adapt their companies’ structure to accommodate the new reality of digital. They persist in trying to squeeze it into their existing mental model by making it an IT problem or a communications tool.

Of course, as Web professionals, we know that digital does not fit comfortably in existing departmental silos. It requires a huge amount of cross-departmental collaboration.

How, then, do we bring managers to realize that digital is a company-wide issue? How do we get them to grasp the ramifications of this cultural phenomena?

Some would argue that we need to disabuse managers of their preconceptions, that the way to convince them that digital is a company-wide issue is to do away with separate digital strategies and digital teams. They argue that managers must understand that, one day, digital will be as ubiquitous as electricity is now to modern business life.

However, company-wide change is a tough sell to senior management. We need to be more pragmatic. We need to meet them halfway. To their minds, digital is an isolated problem, and so we need to start there and slowly widen their view.

By focusing initially on digital, we have a starting point to address their broader concerns. By appointing somebody as a digital lead and forming a digital team, we can highlight broader problems and work collaboratively with other units of the business.


A strong digital team can instigate a program of education across the whole organization. It can also work collaboratively with other departments to increase the impact of digital.

A strong digital lead with real authority can ensure that digital is included in all management discussions. They can disrupt out-of-date practices and encourage managers to consider digital options before falling back on traditional approaches.

Finally, a digital strategy can be used to instigate broader discussions about a company’s overall business goals and road map.

The key is to recognize that digital-focused thinking will not be required forever. One day, companies will not need Chief Digital Officers, the way we no longer have Chief Electricity Officers. We also need to recognize that the most important role of a digital team is not to own and implement a digital vision, but to facilitate company-wide change and to educate colleagues about the potential of digital in their areas of responsibility.

(al, il)

The illustrations in this article were thoroughly crafted by Veerle Pieters.

© Paul Boag for Smashing Magazine, 2014.

Pages

X
Secure Login

This login is SSL protected