So You Want to Persuade Users? Make Things Simple!

Original Source: https://www.smashingmagazine.com/2018/07/persuasion-user-experience-design/

So You Want to Persuade Users? Make Things Simple!

So You Want to Persuade Users? Make Things Simple!

Lyndon Cerejo

2018-07-17T16:15:38+02:00
2018-07-17T15:48:55+00:00

(This article is kindly sponsored by Adobe.) The persuasive design toolbox is filled with powerful tools based on psychology. These tools range from Cialdini’s set of six principles of persuasion to ten times that number of Persuasive Patterns. Presented with all these methods, it can be tempting to use all of them to cover all possible bases, using a shotgun approach, hoping that one will resonate with your target users.

However, applying persuasion principles and patterns in a haphazard manner just ends up being persuasive design clutter. Like user experience design, designing for everyone is designing for no one. Randomly thrown together persuasive techniques will also make users feel manipulated, not in control, making them abandon the site or experience. The key to persuading your users is to keep it simple: using focused persuasive techniques and tactics that will work for your users.

Persuasion Funnel

AIDA is an acronym used in marketing and advertising to describe the stages that a customer goes through in the purchase process. The stages of Attention, Interest, Desire and Action, generically follow a series of cognitive (thinking) and affective (feeling) stages culminating in a behavioral (doing e.g. purchase or trial) stage. This should sound familiar since this is what we do through design, especially persuasive design.

When it comes to persuasive design, users go through a few stages between Awareness and Action, and the design should guide them from one stage to the next. I don’t have a clever acronym for it (yet), but the stages the design has to take the users through are:

Awareness
Relevant
Credible
Usable
Desirable
Persuasive
Action

(Large preview)

When users are contemplating an action (like booking a hotel room), they have to be aware of your site, app, or experience. Once they begin their journey on your site, they quickly evaluate the experience and either proceed to the next step or leave and go elsewhere. With fewer users continuing to subsequent stages, the number of users at each stage begins to resemble the shape of a funnel as shown above.

Let’s peek inside what could be going on in hypothetical users’ minds as they go through the experience of booking a hotel room for New Year’s Eve in Times Square, and some of the reasons they may drop off in each stage.

Awareness

“Hmmm… Where do I start? Hotel chains promise the lowest rate if we book directly with them, but I won’t be able to see other hotel options around Times Square. Hotel… Maybe I should try an online travel agency like Trivago (looks like the Trivago guy / Trivago girl advertising works!) to find a wider range of hotels. I’m going to also quickly Google it to see if there are other options.”

Users have to be aware of your site, app or experience to use it — Duh!

Relevant

“I found HotelTonight on Google. It looks like a great way to get rooms last minute, but not this far in advance — it’s not relevant to me.”

If your experience is not relevant to the task they are trying to accomplish, users will leave and try elsewhere. If your products or services are relevant, but not findable by the user, work on your navigation, search, and content layout to ensure your products and services are visible. Everything does not have to be one click away, but if the user gets the scent of information, or cues that make them think they are on the right path, they will follow the trail to that information.

Credible

“This design looks like it hasn’t been updated since the [GeoCities era](http://www.arngren.net/).

— Warning bells go off in head —

I’m out of here.”

Users are aware of many of the risks available online and look for trust indicators including a known brand and domain, secure site, professional design, real-world contact information and third-party certificates or badges. Incorporate these elements to create a comfort level for the user.

Usable

“I can’t figure out where things are in the navigation, and the search results had hundreds of unhelpful results. The homepage has nice big images, but that meant I had to scroll before I could see any real content.”

Usability is surprisingly still an issue with many sites. Follow User Experience best practices during design, and test with users to validate that the design is usable.

Desirable

“This reminds me of Craigslist — it is usable, but the design does not make me want to stay and use it. I’ll try that other hotel website that provides an immersive, interactive experience as I search for hotels.”

As much as we like to believe it, users’ decisions are not always rational, and very often driven by emotion, and we can address that through design. Usability is about making it work well; this is about making it beautiful as well.

In his book Emotional Design, Don Norman explains: “Attractive things do work better — their attractiveness produces positive emotions, causing mental processes to be more creative, more tolerant of minor difficulties.” Don talks about the three different aspects of design: visceral, behavioral, and reflective. Visceral design is about appearance, behavioral about the pleasure and effectiveness of use, and reflective design involves the rationalization and intellectualization of a product.

Persuasive

“Oh, Wow! That’s a long list of hotels, with plenty of availability for New Year’s Eve. There’s no real reason to book now. I’ll just come back to book after Thanksgiving…”

The user was interested, able, and willing, but the design did not motivate him to take intended action. Use relevant persuasion techniques that apply to your user to move them toward the desired action.

Examples of persuasive methods while shopping on Travelocity for a hotel room for New Year’s Eve.

Examples of persuasive methods while shopping on Travelocity for a hotel room for New Year’s Eve. (Large preview)

Action

“Oh, Wow! 65% of hotels are already booked in this area for New Year’s Eve. I better make a reservation now. . This looks like a nice hotel, and it also offers free cancellation – I’m reserving it now!”

The user who made it to this stage was interested, able, and willing, and the design nudged him to take intended action of making a reservation before leaving the site.

Persuasion is not about applying all available principles and patterns to your designs, but systematically identifying how you can address users’ barriers and motivators during each step of the journey, and guiding your users through the funnel to take the desired action.

The KISS Approach

Most of us are familiar with the acronym KISS: “Keep It Simple, Stupid,” a principle advocating simplicity as a key goal in design by avoiding unnecessary complexity. Let’s borrow that acronym for a 4-step approach to persuasive design.

Know The Right Behavior To Target

The first step is knowing the behavior you would like to target, and identifying the simplest action that can lead to that behavior change. Take the example of term life insurance companies who, to put it very bluntly, stand to benefit if their policyholders are healthy and don’t die while the policy is active. While those companies have a long-term ambitious goal of helping their policyholders lead healthy lives (mutually beneficial), that could be broken down into a simpler target behavior of walking 10,000 steps daily. This behavior is simple to understand, achieve, measure, and contributes to the long-term goal of healthier policyholders.

One such insurance company is offering new policyholders the latest Apple Watch for a low initial down payment ($25). The ongoing monthly payments can be waived each month that the policyholder leads an active lifestyle and exercises regularly (e.g. walks about 10,000 steps a day). About half the people who participated have achieved monthly goals, despite potential privacy implications.

John Hancock Term Life Insurance Apple Watch offer targets walking about 10,000 steps a day.

John Hancock Term Life Insurance Apple Watch offer targets walking about 10,000 steps a day. (Large preview)

Identify Barriers And Motivators

User research for persuasive design digs below the surface thinking level to the feeling level, and moves beyond the rational to the emotional level, as shown below. Getting to know your users at a deeper level will help you use psychology to focus your design to get users to engage in the target behavior identified above. User interviews that focus on users’ feelings and emotions are used to uncover barriers and motivators they consciously or subconsciously face while trying to achieve the target behavior. This helps us identify which blocks we need to weaken, and which motivators we should strengthen, through persuasive design techniques and tactics.

Tip of the iceberg user research diagram

(Large preview)

Simplify The Experience

Simplify the design experience of the first stages of the funnel, as users go through the mental verifications of relevancy, credibility, and usability of the experience. This includes making it easy for the user to find what they are looking for, credibility indicators like professional design, contact information, and third-party certificates or badges, as well as addressing usability issues. As Steve Krug put it very succinctly: “Don’t Make Me Think”.

Select Appropriate Triggers

Users who have made it this far in the process are interested in something you have to offer. As a designer, you have to nudge them to take the desired action. A good starting point is Robert Cialdini’s, six key principles of persuasion:

Reciprocity
People are obliged to give something back in exchange for receiving something.
Scarcity
People want more of those things they can have less of.
Authority
People follow the lead of credible, knowledgeable experts.
Consistency
People like to be consistent with the things they have previously said or done.
Liking
People prefer to say yes to those that they like.
Consensus (Social Proof)
Especially when they are uncertain, people will look to the actions and behaviors of others to determine their own.

These principles can be applied through dozens of different persuasive design patterns and methods, some of which have been previously published on Smashing Magazine (patterns, triggers), or in the books listed in the resources at the end. As you may notice, many persuasive patterns are related to UI patterns, because part of persuasion is reducing friction and simplifying what the user needs to do at any given point in time. For example, the persuasive pattern of Limited Choice can be realized through UI Pattern of Progressive Disclosure.

Given that there are dozens of patterns and methods (depending on where you look), it is important to selectively use methods that will resonate with your users. Applying all design patterns in the hope of some working will result in persuasion clutter and overwhelm the user, possibly driving them away from your site.

Examining Persuasion

Let’s take a closer look at the earlier example of the term life insurance through the eyes of someone who is motivated (shopping for life insurance) and has the ability (to pay monthly life insurance cost). Like me, let’s assume that this user was made aware of this through a sponsored post on Facebook. During the stages of awareness and relevance, there are a few persuasive triggers as shown below that make the user click “Learn More”.

facebook

(Large preview)

Clicking the “Learn More” button takes the user to a landing page that we will examine in sections for a persuasive flow:

(Large preview)

The user’s primary motivation in shopping for term life insurance is: “Protect Family,” and a big barrier is “High Cost.”

Reputable Name (Credibility)
Even if you’ve not heard of this company, John Hancock is a famous person and the term used as a synonym in the United States for one’s signature. The company reinforces it’s longevity later on the page.
Toll-free Number (Credibility)
Established and legitimate organization.
Message Framing
Live healthy, is also reinforced by the image of a family enjoying outdoors.
“This life insurance product will help me live longer, lead a happy life like them, and protect my family in case something happens, and won’t cost much.”
People Like Me & Association
This family looks like mine (or the family next door) — I can see myself in this wide-open field (visceral and reflective triggers).
Extrinsic Reward
An Apple watch for $25 — that’s a bonus here!
Visual Cueing
The person in focus (stereotypical breadwinner) has his gaze directly focused at the form below, leading the user to the next step.
Foot In The Door
This quote won’t cost anything — zip, nada.
Computer As A Social Actor
The information takes a conversational tone and format, not the usual form in rows and columns. The information seems reasonable to generate a quote.
Commitment & Consistency
By filling this quick, easy, and free form, chances are that the user will act consistently and proceed when it comes to the next step (application), unless there’s another barrier (price, benefits, etc.)

(Large preview)

Control
The user has a choice of devices.
Extrinsic Rewards
More rewards to be earned.
Control
The user controls how much they pay (the more active, the less you’ll pay). Also, in case the user does is not active, the cost is framed as just $13 (for a month).
Credibility
The company reinforces longevity and protector of America.
Authority
Licensed Coverage Coach (not just a sales agent).
Flow
One way to keep users in the flow and not get distracted is by disabling the social media links (which could raise the question: why display them?).

That took longer to dissect and read than it does in real life, where most of this is processed consciously and subconsciously in a few seconds, often with a glance or two.

Apart from the methods establishing credibility, the persuasive methods are used to strengthen the primary motivator of “Protect Family” (get insurance, extrinsic reward will help me live longer for my family), and weaken the barrier of “High Cost” (low monthly cost, additional savings, no ongoing watch payments). Note how they work together and don’t conflict or clutter the experience.

Conclusion

Persuasion is all around us, in our everyday lives. As designers, we can use ethical persuasive design methods to get users to take some action. With plenty of persuasive methods available, we have to be selective about what we use. We can use the KISS approach to keep it simple:

Know the right behavior to target
Identify barriers and motivators
Simplify the experience
Select appropriate triggers

KISS also reminds us to Keep It Simple & Straightforward, by selecting a simple target behavior, simplifying the experience for the user, and by applying persuasive techniques that will lead to the target behavior without overwhelming the user.

Further Reading

“Neuro Web Design: What Makes Them Click?,” Susan Weinschenk
“Design for the Mind: Seven Psychological Principles of Persuasive Design,” Victor S. Yocco
“Influence: The Psychology of Persuasion, by Robert B. Cialdini
“Persuasive Technology: Using Computers to Change What We Think and Do,” B.J. Fogg
“Persuasive Design Patterns (scroll down the page),” UI-Patterns
“Persuasive Patterns Card Deck,” UI-Patterns

This article is part of the UX design series sponsored by Adobe. Adobe XD tool is made for a fast and fluid UX design process, as it lets you go from idea to prototype faster. Design, prototype, and share — all in one app. You can check out more inspiring projects created with Adobe XD on Behance, and also sign up for the Adobe experience design newsletter to stay updated and informed on the latest trends and insights for UX/UI design.

Smashing Editorial
(yk, il)

50 Fascinating Facts About Google You Probably Don’t Know

Original Source: https://www.hongkiat.com/blog/interesting-facts-about-google/

Google is the most visited website on the planet, but you already knew that, right? However, do you know that Google does 65k+ searches every second? And it is not the only fascinating fact about…

Visit hongkiat.com for full content.

Learning To Code By Writing Code Poems

Original Source: https://www.smashingmagazine.com/2018/07/writing-code-poems/

Learning To Code By Writing Code Poems

Learning To Code By Writing Code Poems

Murat Kemaldar

2018-07-11T14:00:32+02:00
2018-07-17T15:48:55+00:00

Back in 2008, I started studying design and clearly remember how the sheer sight of code just intimidated me. I had some coding classes, and without any prior coding experience, I had a tough time understanding the code I first got in touch with. Suddenly, the words that I was used to in the English language (such as “new,” “return” and “throw/catch”) took on a whole new meaning; the cryptic syntax, semicolons, brackets and completely new rules didn’t make things any easier for me.

If you are new to JavaScript and/or have struggles adding it to your skillset, I may have an approach for you to overcome those barriers. You are definitely not alone, and you have every right to think that learning to code is a tough nut to crack.

Why Is Learning To Code So Tough?

Here are some of the misconceptions about why I think people are having a hard time learning or getting interested in JavaScript (or any coding language):

Code is cryptic, purely functional and scary;
Code is meant for machines only, so people do not feel addressed or engaged;
Code is not treated as a language because it has a completely different use case and looks very different from anything they have seen before;
People think of stereotypes (evil hackers, maybe some Matrix dudes), and thus do not identify themselves with it.

Nope, we can’t do any magic tricks, but we have articles, books and webinars featuring techniques we all can use to improve our work. Smashing Members get a seasoned selection of magic front-end tricks — e.g. live designing sessions and perf audits, too. Just sayin’! 😉

Explore Smashing Wizardry →

Smashing Cat, just preparing to do some magic stuff.

A young and unexperienced student with a pacifier and pillow

Me, before any contact with code (Large preview)

As a developer, you are expected to treat code in a very specific way — even to think in a quite different (and highly logical) way. Coding languages are quite strict and intolerant; a single character can make the machine fail to understand what you mean and make applications crash. You are expected to ignore and override certain things you know from speaking and writing a human language (which is, by the way, also the case when learning a new human language).

But not all programming languages, documentations or tutorials on the web are made with this “human to programming language transition” in mind. Of course, they don’t have to. After all, the main purpose of code is to tell machines what to do.

Still, due to that purpose, a chance for comparison is simply missing and the languages you speak (vocabulary and rules) seem to be rendered useless for learning a programming language. There is no word for “love” in the JavaScript language, nor does it make sense to say “I love you.” A machine (or browser) simply does not know or care about love (yet?). This “completely new” and “don’t know where to start” feeling can be scary as hell.

 A student who is intimidated by coding languages

Me, after my first contact with code. (Large preview)

This is why I am here. I think that you can learn JavaScript in a much easier and artistic fashion, by holding on to your human language knowledge, and by treating JavaScript like any other human language. Let me demonstrate with a small example.

Fun fact: Some programming languages actually have the transition from one programming language to another in mind. This is why it is so much easier to learn a lot of programming languages — just by learning a single one.

A Small Example

In a lot of cases, when you want to execute JavaScript code, you want the “document” (basically the website, a user is downloading on each visit) to be ready so that you can interact with HTML elements, for example. In pure JavaScript, you may stumble over something this:

(function() {
// Your code goes here
})();

(Yuck! ? In this case, a function is defined in brackets, and then immediately called with another pair of brackets at the end. This is referred to as an IIFE.)

Or sometimes like this:

if (document.readyState === ‘complete’) {
// Your code goes here
}

The first snippet definitely requires an explanation, while with the second (and maybe some fantasy), one could comprehend that there is a condition which needs to be fulfilled so that something else happens just by just looking at it.

Imagine something like this, though:

onceUponATime(function () {
// Your code (story) goes here
})

“Once upon a time” is something (dare I say) even a child might understand. It addresses the developer (by referring to childhood memories), while theoretically doing the same thing. This is what I consider “having the human to coding language transition” in mind.

Quick note on “functions“: A function is basically a skill, which is dormant until you call upon it. “To read” is a skill function read() { … }, which is called upon when you are want to read something like this: read(). There is also something called “anonymous functions”, i.e. "function() { … } (has no name, like in the snippets above) which are basically “one-time / casual actions” that you wouldn’t consider to be a skill, such as “to push a button.”

Turning The Tables: From Message To Basics

So let’s take this idea a bit further. Let’s take the reasons and misconceptions above, and turn them upside-down:

A small poem.

Written in JavaScript.

Made for human beings.

About the love between two individuals.

// Love at first sight
if (me.getDistanceTo(you.position) < 200) {
me.setFeelings({
inLove: true,
});
}

It is not functional. It is currently not meant for machines. It is meant for you to read and understand.

If you got the message of the poem, you actually understood a piece of JavaScript code, which you might have compared to the English language.

Now you might ask yourself: I understand this, but why is it written like this? What are the rules (grammar) of this language? What is the meaning of “me” (in a technical sense), and why does this code look so similar to English?

Rules, Vocabulary, And Variables

One of the most important things to understand when learning a programming language is the concept of variables.

Every human language has its rules (grammar) and a lot of vocabulary (pre-defined). Obviously, both of these first need to be learned in order to be able to speak the language.

JavaScript, like many other programming languages, also comes with its own set of rules (e.g. the . between the words or how if statements are written) and its own vocabulary (if, document, window, Event, and so on). These keywords are reserved (or ‘pre-defined’) by JavaScript (and the browser), and each one of them has its specific purpose.

But like I mentioned earlier, a chance to compare the words and sentences you know from the English language is seemingly missing because there are no equivalents.

This is where variables come in; you (the developer) can (or even have to) define the variables in order to make machines and developers understand what something stands for. Variables can take a lot of forms (hence the name): They can be a chain of words and letters (strings), a number, an action (function), or even a collection (array). You name it.

In all languages, there is probably a word for love. You kinda know what it means, but not really, because it is so subjective. But still, there is a word for it.

But in JavaScript, there is no “love,” until you say there is. It can be whatever you want it to be.

var love = {
color: ‘red’,
duration: 365,
loveTarget: ‘cats’,
};
// a simple variable expression,
// where love is an object “{ … }”, a thing
// with some properties (color, duration, loveTarget).

const love2 = {
color: ‘purple’,
duration: ‘forever’,
loveTarget: ‘dogs’,
};

// also a variable expression, where love2 (a constant),
// cannot be redefined / overwritten completely:
// love2 = undefined; // => will not work

// (“undefined” is a pre-defined javascript keyword,
// basically saying “has no value”)

It is crucial to be able to distinguish between what is pre-defined in JavaScript (JavaScript rules and vocabulary), and what is actually custom defined by the developer (also known as ‘application logic’ or ‘business logic’).

Returning to the poem written above:

// Love at first sight
if (me.getDistanceTo(you.position) < 200) {
me.setFeelings({
inLove: true,
});
}

These expressions come from the following JavaScript vocabulary/ruleset:

if (…) { … }
// if statement: when … is met, do things in { … }

{
inLove: true,
}
// an “object” with some info, some thing in the world.
// can contain other info, and “skills” (functions).
// “inLove” is a custom property,
// “true” is pre-defined in javascript, (meaning: “yes”)
// and the value of “inLove”.

.
// needed to access an objects property “my name: me.name”

getDistanceTo()
// an expression to “call” a function (a “skill”).
// getDistanceTo is custom (not JavaScript), and a function,
// so it can be executed / called upon with the “()” after.
// sometimes you can pass arguments in those brackets (like “position”)
// to change the outcome of a function.

And these are the variables (where you have free reign over defining their names and behavior):

me // an object, some thing in the world
you // an object, some thing in the world
position // an info about “you”, accessed by the “.”
getDistanceTo // a skill of me, accessed by the “.”
getDistanceTo() // the skill, with javascript grammar telling: do it.
getDistanceTo(position) // same, but do it with “position”.
setFeelings // another skill of me, accessed by the “.”
setFeelings({ inLove: true }); // the skill, with some instructions (an object).

Let’s assume the poem is now human-readable. You might have understood the message, you also might see the difference between JavaScript language rules you need to follow, and the things you actually have to come up with yourself (the variables).

But what about the machine?

If the machine (the browser) were to read this poem, it would throw an error. The machine needs a definition of “me” and “you” because it tries to access its properties (via the . in me.getDistanceTo()). With the distinction ability mentioned above, you can actually engineer “me” and “you” to make the poem executeable/machine-readable, like this:

// This is how the definition of a being (me/you) could look like

var me = {
position: {x: 0, y: 0} // some coordinates, maybe
getDistanceTo: function(position) {
// calculate the distance, relative to own position
},
setFeelings: function(feelings) {
// handle those feelings…
}
}

var you = {
position: {x: 0, y: 0} // some coordinates, maybe
}

// the poem itself
if (me.getDistanceTo(you.position) < 200) {
me.setFeelings({
inLove: true,
});
}

So what happened here?

We read a JavaScript poem, written with JavaScript “grammar” with the only goal to be understood by human beings.
After understanding the message, we distinguished between rules, vocabulary, and variables, to understand the structure of the poem (grammar and basics of JavaScript).
With that distinction, we engineered the rest of the poems variables, with JavaScript rules in order to make it runnable by a machine (in the browser).

This was possible, because we treated JavaScript just like the English language.

A Bigger Example: Interactive Code Poetry

This is how my personal project LoveBits came to be. LoveBits is a code learning/storytelling experience.

Animated demonstration of the LoveBits projectLoveBits: Code poetry project in JavaScript (Large preview)

It tries to get people interested in JavaScript/coding by:

Putting readability and human language first;
Combining code with an art the reader might already be familiar with.

Storywise, it is about two Bits (rectangular beings); one of the Bits (blueBit) is the romantic one and writes JavaScript love poems to the other Bit (purpleBit).

When you start LoveBits, you can select one of the multiple love poems (written in JavaScript). Each poem has a code snippet which is written in a way that it is supposed to be understood by people who are not even familiar with programming. The only requirement is the English language.

“Love at first sight” (actually one of the LoveBits poems), for example, is about these two Bits in which the blueBit basically says, “If I get close enough to your position, I will ‘set my feelings’ to inLove: true.”

The special thing about these poems though is that you can “run” or “play” them simply by pressing the “play” button below. In the case of “Love at first sight,” you would see a blue and purple rectangle along with a number. As you might’ve already guessed, those are the two Bits mentioned in the poem, and the number below the blueBit is actually the distance between the blueBit and the purpleBit.

As the poem suggests, you may want to make the blueBit fall in love with the purpleBit by reducing the distance between them, right? So what can you do? You can interact and drag the blueBit around, and make it fall in love. But be careful, sometimes there is more than just one outcome.

One might actually say that you are the machine here. You’re the one who needs to interpret JavaScript code to be able to act and help two digital beings fall in love.

Where To Go From Here?

If you are a struggling developer, try treating JavaScript like a human language, and just understand what code snippets are supposed to do first instead of what they actually end up doing.

This is what I would recommend you to do next:

Always prefer going straight for examples and code for entire applications that combine rules, vocabulary, and variables together to form an application logic;
Application logic will tell the stories that will help you fill the gaps like in the code examples above. Code libraries and utilities such as lodash will only provide you with new vocabulary which will become helpful after being able to read and understand JavaScript code;
Review existing code, and try to break it down into small functions with names that reflect what they do. Write code which addresses humans and machines alike. Write code in such a way that it can be read like a sentence. Use comments wherever needed. Think about: How would I express this in a human language (to another developer)?

Conclusion

Learning to code can become easier once you start treating code as a human language and not as something aliens may have invented. Learning to distinguish between language features (built-ins) and variables/custom code for application logic is crucial. Being able to understand the application logic will put you in a powerful position to improve and change things, without even knowing language features.

Message before basics: Understand the message of any code snippet, and the basics of JavaScript will naturally follow. How many times have you heard someone say, “I understand the language, but I do not speak it yet”? It is a natural process, which can and maybe should be applied for learning both human and coding languages.

Also, always keep in mind that code has a clear functional purpose, but it does not always have to be like that. Even human languages were purely functional once, but then there came poems and even songs (JavaScript songs, anyone?), which connected people in entirely different ways. I think, or hope, that the same can apply here.

Always explore code projects, and perhaps even try writing a poem yourself (maybe even in another programming language you are familiar with)? I enjoyed creating the LoveBits project and would love to see some of your ideas in the comments below!

Further Reading

“If Hemingway wrote JavaScript,” Angus Croll
This is one of my favorite books which I actually stumbled upon after LoveBits. It’s about several famous poets and artists, and how they would have written JavaScript code snippets. It’s hilarious!

Smashing Editorial
(rb, ra, il)

Ethereum DApps: Cross-contract Communication & Token Selling

Original Source: https://www.sitepoint.com/building-ethereum-dapps-cross-contract-communication-token-selling/

In part 4 of this tutorial series on building DApps with Ethereum, we started building and testing our DAO contract. Now let’s go one step further and handle adding content and tokens to the story, as per our introduction.

Adding Tokens

For a contract to be able to interact with another contract, it needs to be aware of that other contract’s interface — the functions available to it. Since our TNS token has a fairly straightforward interface, we can include it as such in the contract of our DAO, above the contract StoryDao declaration and under our import statements:

contract LockableToken is Ownable {
function totalSupply() public view returns (uint256);
function balanceOf(address who) public view returns (uint256);
function transfer(address to, uint256 value) public returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
function allowance(address owner, address spender) public view returns (uint256);
function transferFrom(address from, address to, uint256 value) public returns (bool);
function approve(address spender, uint256 value) public returns (bool);
event Approval(address indexed owner, address indexed spender, uint256 value);
function approveAndCall(address _spender, uint256 _value, bytes _data) public payable returns (bool);
function transferAndCall(address _to, uint256 _value, bytes _data) public payable returns (bool);
function transferFromAndCall(address _from, address _to, uint256 _value, bytes _data) public payable returns (bool);

function increaseLockedAmount(address _owner, uint256 _amount) public returns (uint256);
function decreaseLockedAmount(address _owner, uint256 _amount) public returns (uint256);
function getLockedAmount(address _owner) view public returns (uint256);
function getUnlockedAmount(address _owner) view public returns (uint256);
}

Notice that we don’t need to paste in the “meat” of the functions, but only their signatures (skeletons). This is all that’s needed to interact between contracts.

Now we can use these functions in the DAO contract. The plan is as follows:

launch the token (we already did this)
launch the DAO from the same address
send all tokens from the token-launcher to the DAO, then transfer ownership over the contract to the DAO itself
at this point the DAO owns all tokens and can sell them to people using the transfer function, or can reserve them for spending using the approve function (useful during votes), etc.

But how does the DAO know which address the token is deployed on? We tell it.

First, we add a new variable at the top of the DAO contract:

LockableToken public token;

Then, we add some functions:

constructor(address _token) public {
require(_token != address(0), “Token address cannot be null-address”);
token = LockableToken(_token);
}

The constructor is the function which gets called automatically when a contract is deployed. It’s useful for initializing values like linked contracts, default values, etc. In our case, we’ll use it to consume and save the address of the TNS token. The require check is there to make sure the token’s address is valid.

While we’re at it, let’s add a function that lets users check how many tokens remain for sale in the DAO, and the ability to change to another token should something go wrong and such a change be required. This change deserves an event, too, so let’s add that in as well.

event TokenAddressChange(address token);

function daoTokenBalance() public view returns (uint256) {
return token.balanceOf(address(this));
}

function changeTokenAddress(address _token) onlyOwner public {
require(_token != address(0), “Token address cannot be null-address”);
token = LockableToken(_token);
emit TokenAddressChange(_token);
}

The first function is set to view because it doesn’t change the state of the blockchain; it doesn’t alter any values. This means it’s a free, read-only function call to the blockchain: it doesn’t need a paid transaction. It also returns the balance of tokens as a number, so this needs to be declared on the function’s signature with returns (uint256). The token has a balanceOf function (see the interface we pasted in above) and it accepts one parameter — the address whose balance to check. We’re checking our (this) DAO’s balance, so “this”, and we turn “this” into an address with address().

The token address changing function allows the owner (admin) to change the token contract. It’s identical to the logic of the constructor.

Let’s see how we can let people buy the tokens now.

Buying Tokens

As per the previous part of the series, users can buy tokens by:

Using the fallback function if already whitelisted. In other words, just sending ether to the DAO contract.
Using the whitelistAddress function by sending more than the fee required for whitelisting.
Calling the buyTokens function directly.

There is a caveat, however. When someone calls the buyTokens function from the outside, we want it to fail if there aren’t enough tokens in the DAO to sell. But when someone buys tokens via the whitelist function by sending in too much in the first whitelisting attempt, we don’t want it to fail, because then the whitelisting process will get canceled as everything fails at once. Transactions in Ethereum are atomic: either everything has to succeed, or nothing. So we’ll make two buyTokens functions.

// This goes at the top of the contract with other properties
uint256 public tokenToWeiRatio = 10000;

function buyTokensThrow(address _buyer, uint256 _wei) external {

require(whitelist[_buyer], “Candidate must be whitelisted.”);
require(!blacklist[_buyer], “Candidate must not be blacklisted.”);

uint256 tokens = _wei * tokenToWeiRatio;
require(daoTokenBalance() >= tokens, “DAO must have enough tokens for sale”);
token.transfer(_buyer, tokens);
}

function buyTokensInternal(address _buyer, uint256 _wei) internal {
require(!blacklist[_buyer], “Candidate must not be blacklisted.”);
uint256 tokens = _wei * tokenToWeiRatio;
if (daoTokenBalance() < tokens) {
msg.sender.transfer(_wei);
} else {
token.transfer(_buyer, tokens);
}
}

So, 100 million TNS tokens exist. If we set a price of 10000 tokens per one ether, that comes down to around 4–5 cents per token, which is acceptable.

The functions do some calculations after doing sanity checks against banned users and other factors, and immediately send the tokens out to the buyer, who can start using them as they see fit — either for voting, or for selling on exchanges. If there’s fewer tokens in the DAO than the buyer is trying to buy, the buyer is refunded.

The part token.transfer(_buyer, tokens) is us using the TNS token contract to initiate a transfer from the current location (the DAO) to the destination _buyer for amount tokens.

Now that we know people can get their hands on the tokens, let’s see if we can implement submissions.

The post Ethereum DApps: Cross-contract Communication & Token Selling appeared first on SitePoint.

Building Ethereum DApps: Whitelisting & Testing a Story DAO

Original Source: https://www.sitepoint.com/building-ethereum-dapps-whitelisting-testing-story-dao/

In part 3 of this tutorial series on building DApps with Ethereum, we built and deployed our token to the Ethereum testnet Rinkeby. In this part, we’ll start writing the Story DAO code.

We’ll use the conditions laid out in the intro post to guide us.

Contract Outline

Let’s create a new contract, StoryDao.sol, with this skeleton:

pragma solidity ^0.4.24;

import “../node_modules/openzeppelin-solidity/contracts/math/SafeMath.sol”;
import “../node_modules/openzeppelin-solidity/contracts/ownership/Ownable.sol”;

contract StoryDao is Ownable {
using SafeMath for uint256;

mapping(address => bool) whitelist;
uint256 public whitelistedNumber = 0;
mapping(address => bool) blacklist;
event Whitelisted(address addr, bool status);
event Blacklisted(address addr, bool status);

uint256 public daofee = 100; // hundredths of a percent, i.e. 100 is 1%
uint256 public whitelistfee = 10000000000000000; // in Wei, this is 0.01 ether

event SubmissionCommissionChanged(uint256 newFee);
event WhitelistFeeChanged(uint256 newFee);

uint256 public durationDays = 21; // duration of story’s chapter in days
uint256 public durationSubmissions = 1000; // duration of story’s chapter in entries

function changedaofee(uint256 _fee) onlyOwner external {
require(_fee < daofee, “New fee must be lower than old fee.”);
daofee = _fee;
emit SubmissionCommissionChanged(_fee);
}

function changewhitelistfee(uint256 _fee) onlyOwner external {
require(_fee < whitelistfee, “New fee must be lower than old fee.”);
whitelistfee = _fee;
emit WhitelistFeeChanged(_fee);
}

function lowerSubmissionFee(uint256 _fee) onlyOwner external {
require(_fee < submissionZeroFee, “New fee must be lower than old fee.”);
submissionZeroFee = _fee;
emit SubmissionFeeChanged(_fee);
}

function changeDurationDays(uint256 _days) onlyOwner external {
require(_days >= 1);
durationDays = _days;
}

function changeDurationSubmissions(uint256 _subs) onlyOwner external {
require(_subs > 99);
durationSubmissions = _subs;
}
}

We’re importing SafeMath to have safe calculations again, but this time we’re also using Zeppelin’s Ownable contract, which lets someone “own” the story and execute certain admin-only functions. Simply saying that our StoryDao is Ownable is enough; feel free to inspect the contract to see how it works.

We also use the onlyOwner modifier from this contract. Function modifiers are basically extensions, plugins for functions. The onlyOwner modifier looks like this:

modifier onlyOwner() {
require(msg.sender == owner);
_;
}

When onlyOwner is added to a function, then that function’s body is pasted into the part where the _; part is, and everything before it executes first. So by using this modifier, the function automatically checks if the message sender is also the owner of the contract and then continues as usual if so. If not, it crashes.

By using the onlyOwner modifier on the functions that change the fees and other parameters of our story DAO, we make sure that only the admin can do these changes.

The post Building Ethereum DApps: Whitelisting & Testing a Story DAO appeared first on SitePoint.

Tips to Design a Good Logo for A Client or Yourself

Original Source: http://feedproxy.google.com/~r/Designrfix/~3/NDhN2b4t5f8/tips-to-design-a-good-logo-for-a-client-or-yourself

Before entering your field of choice, you must understand that a good logo reflects the values of the brand by using forms, colors, and typographies. Its objective is to inspire confidence and recognition of your brand and help the company to stand out from the competition. When it comes to logo design, you get out of […]

The post Tips to Design a Good Logo for A Client or Yourself appeared first on designrfix.com.

50 Most Beautiful Blogger Templates to Download (2018)

Original Source: https://www.hongkiat.com/blog/50-most-beautiful-blogger-templates/

An updated list of beautiful yet advanced Blogger (Blogspot) templates free to download.

The post 50 Most Beautiful Blogger Templates to Download (2018) appeared first on Hongkiat.

Visit hongkiat.com for full content.

29 Chrome extensions for web designers and devs

Original Source: http://feedproxy.google.com/~r/CreativeBloq/~3/3whUD8CCERI/google-chrome-extensions-21410570

Chrome's DevTools are great, but it's possible to add even more exciting features to your internet browser to make web design and development easier. Here are 29 of our favourite Chrome extensions for web designers and developers.

01. Sizzy

Sizzy website

An easy way to test your site across multiple viewports

Responsive web design's a given these days, and it you want a straightforward way to check your designs across multiple viewports, Sizzy's worth a look. It'll show you an interactive view of your page rendered on a number of different device screen sizes, and you can also show and hide a simulated device keyboard, and switch between portrait and landscape modes.

02. Site Palette

Site Palette website

If a colour scheme takes your fancy, Site Palette will help you borrow it

The next time you see a site that makes great use of colour, here's a simple way to take advantage of it. Site Palette extracts the main colours from a website and generates a shareable palette that you can easily show to collaborators. You can also download a Sketch template, and there's Adobe Swatch support, too. 

03. Checkbot

Checkbot website

Sort out all those broken links and get a free SEO boost

Making sure that all the links on your site actually work is an instant usability win and it's a good way to improve your SEO, too. Checkbot is a Chrome extension that checks for broken links, duplicate titles, redirect chains, invalid HTML/JS/CSS and more, so you can quickly audit your site for bad links and get them fixed.

04. Toby

Toby website

Turn all those unruly tabs into useful collections of bookmarks

It is a truth universally acknowledged that by the time you've had Chrome open for a couple of hours it'll be a confusing nest of tabs the width of your little finger. Toby's a great way to tame them; with it you can organise all those tabs into collections of links as an alternative to loads of individual bookmarks, making them much easier to manage.

05. DomFlags

DomFlags website

A new way to work with DevTools

Radically speed up the processes of styling elements with DomFlags, a truly great extension that lets you create keyboard shortcuts for DOM elements. It's like having bookmarks for navigating the DOM; this will change the way you work with DevTools. 

06. Highly Highlighter

Highly website

Highly, a new way to participate in industry conversation

Here's an interesting way to bring people into a discussion: Highly lets you share highlights from articles on the web, so you can draw attention to the most significant bits of writing. 

07. Booom

Booom website

Get a better Dribbble experience with Booom

Booom makes Dribbble better by showing larger shots in lists; putting Like and Add to Bucket buttons in lists; making GIFs autoplay and bringing infinite scroll. 

08. CSS-Shack

Google Chrome extensions - CSS Shack

This Chrome extension enables you to create layer styles and export them into a CSS file

This powerful Chrome extension enables you to create designs then export them into a CSS file for use on your site. It supports layers and contains a plethora of the tools that you're used to from your regular photo editor.

09. Marmoset

Google Chrome extensions - Marmoset

With Marmoset you can create gorgeous code snapshots within seconds

This brilliant extension will take your code and output snapshots for your demos and mockups. You can also add themes and effects to create images for promo and your online portfolio.

10. iMacros for Chrome

Google Chrome extensions - IMacros

iMacros Chrome extension enables you to record actions and save them

As a web developer, you may be required to test your webpages. Repeating the same actions over and over again can be a tiresome process. iMacros is a handy Chrome extension that lets you record your actions and save them so you only need to do them once. After that you can test your pages over and over again, repeating the action with a click of a button. It saves valuable time, freeing up your time so you can concentrate on more pressing matters.

Next: 10 more Chrome extensions

11. Window Resizer

Google Chrome extensions - Windows Resizer

This Chrome extension re-sizes the browser window in order to emulate various resolutions

This Chrome extension is a useful tool that does exactly as it says on the tin – resizes your browser window to help you with your responsive website designs. Choose from a list of popular monitor dimensions or add custom sizes and resolutions for increased accuracy.

12. Project Naptha

Google Chrome extensions - Project Naptha

With Naptha you can highlight, copy, edit, and translate text from any image on the web

If you ever find yourself working from a mockup image with embedded text, Project Naptha could save you a world of mild irritation. Thanks to some smart OCR trickery it enables you to highlight, copy and paste text from any image; it can even translate it for you.

13. WhatFont

Google Chrome extensions - What Font

What font are they using? The WhatFont Chrome extension can tell you!

A very useful Google Chrome extension, WhatFont allows developers and designers to identify the fonts being used on a webpage. So, if you stumble upon a fancy-looking web font that you want to use in one of your future projects, just hover over it and find out instantly which font it is.

14. Web Developer

Google Chrome extensions - Web Developer

The Web Developer Chrome extension provides a range of useful dev tools

As a web developer, you might ask yourself how you have lived without this extension. It adds a toolbar button to Chrome with a plethora of useful web developer tools. It's the official port of the Web Developer extension for Firefox.

15. Web Developer Checklist

Google Chrome extensions - Web Developer Checklist

Fix issues quickly with this handy Chrome extension

This tool allows you check if all of your webpages are following best practice when it comes to SEO, usability, accessibility and performance (page speed). So if, for example, you don't have an H1 tag on a webpage or if a webpage is missing its meta title or meta description, it will notify you so that you can fix the issue quickly. If you click the 'more info and help' link at the bottom of the extension, you will find a more in-depth checklist.

16. DevTools Autosave

Google Chrome extensions - Dev Tools Autosave

Automatically save any changes to a page’s CSS and JS to its source file

A true gem for all web developers out there, DevTools AutoSave allows you to automatically save any changes that you make to a webpage's CSS and JS via the Chrome Dev Tools environment to its source file. It's easy to set up and use and it will save you lots of time and stress.

17. Instant Wireframe

Google Chrome extensions - Instant wireframe

View live webpages with a wireframe overlay

Turn any webpage into a wireframe with just one click. This Google Chrome extension helps web developers and designers view webpages, whether local or live on the web, with a wireframe overlay.

18. ColorZilla

Google Chrome extensions - ColorZilla

With ColorZilla you can get a colour reading from any point in your browser

The ColorZilla Chrome extension is an advanced eyedropper, colour picker, gradient generator and useful colour tool that will help you in your design – right there in your browser window.

19. Streak CRM for Gmail

Google Chrome extensions - Streak

Turn an email conversation into a trackable, assignable ticket

Streak is the ultimate tool for managing CRM and support emails within Gmail. It allows you to turn a single email or an entire conversation into a trackable, assignable, organised ticket that you can manage yourself or share with others.

20. Search Stackoverflow

Google Chrome extensions - Search Stackoverflow

Get your questions answered quickly with this must-have extension

If you're a web developer then you've probably heard about Stack Overflow, the go-to place for any development related issues. If not, then you definitely need to check it out. The community is thriving and it covers a wide range of topics from C# and Java to PHP and jQuery. This fantastic extension adds a search box directly into your browser, allowing you to search the vast resources of Stack Overflow.

Next: more Chrome extensions

21. PerfectPixel

Google Chrome extensions - Perfect Pixel

This extension helps you ensure your site matches the design pixel for pixel

Designers hate it when their stunning design doesn't match up perfectly when it's coded. Perfect Pixel really is the perfect extension for web developers who are striving to develop sites that are accurate representations of designs. This easy-to-use extension enables you to put a semi-transparent image overlay over the top of your webpage and perform a per pixel comparison between them to ensure it is 100% accurate.

22. Code Cola

Google Chrome extensions - Code Cola

Edit your webpages’ CSS on the spot

Not only does this tool allow you to view the source code of what you've been working on, but it also functions as a CSS editor. This means you can edit your webpages' CSS style on the spot and see the changes instantly.

23. IE tab

Google Chrome extensions - IE Tab

Test webpages with different versions of IE

One of the most popular and useful IE emulators available on the web, IE tab enables web developers to test webpages with different versions of IE directly in their Chrome browser.

24. PicMonkey

Google Chrome extensions - PicMonkey

Grab every image from a webpage with a click of a button

This is an easy-to-use free online photo editor that allows you to edit webpage images and screenshots. But that's not what makes it so good. PicMonkey also lets you grab every image and a screenshot of the entire page with a click of a button. Once you select an image you can edit it in any way you wish, from applying effects to changing exposure.

25. Chrome Daltonize

Google Chrome extensions - Chrome Daltonize

Create images more suitable for viewing by those with Colour Vision Deficiency

Colour Vision Deficiency (CVD) or colour blindness affects millions of people across the globe. This ingenious extension uses Daltonization, a technique that allows the creation of images more suitable for viewing by those with CVD. This fantastic extension can be used to simulate how images appear to people with CVD and to help you design a more accessible web app.

26. Check My Links

Google Chrome extensions - Check My Links

Check My Links crawls through your webpage and looks for broken links

Finished building a site? Ah, but have you been through and checked all the links? No matter how careful you are, it's inevitable that you'll have overlooked one or two, and checking them all is a tedious chore. Unless…. With the Check My Links extension you can simply put it to work and it'll comb through all the links on any page, highlighting valid ones in green and broken ones in red.

27. Flickr Tab

Google Chrome extensions - Flickr Tab

Smarten up your Chome tabs with beautiful Flickr images

Are you tired of your Chrome tabs looking dull when you open a new one? The answer to your prayers has arrived in the form of Flickr Tab. It's a simple little Extension that displays a popular Fickr photograph each time you open up a window. Click the photo to view it in Flickr, or click the username to see more photos from the photographer.

28. Google Art Project

Google Chrome extensions - Google Art Project

Make each new Chrome tab an adventure in art and discovery with the Google Art Project

Similar to Flickr Tab's glossy photos, Google's Art Project extension treats you to a high-res masterpiece from the likes of van Gogh and Monet in each new tab you open. If an image sparks your interest, click on it to go to the Google Cultural Institute website, which is full of information about the work and its creator.

29. Data Saver

Google Chrome extensions - Data Saver

Save cash when viewing designs on your mobile with Google’s compression based Data Saver

So, your latest bill from your mobile provider was rather toe curling? Don't panic. You need Data Saver, from Google. The extension does what it says on the tin: it reduces the amount of data used when browsing the web. When enabled, Chrome will use Google servers to compress pages before you download them. There's only one caveat: SSL and incognito pages won't be included.

Read more:

13 best pieces of user testing software30 web design tools to speed up your workflow23 steps to the perfect website layout

96% Off: Get The Ultimate Front End Development Bundle for $39

Original Source: http://feedproxy.google.com/~r/Designrfix/~3/R12VbSw7AsM/ultimate-front-end-development-bundle

So you want to become a web developer? Well, you made the right choice. As we progress towards a more tech-filled future, the demand for web developers is increasing. Companies are upping the salary to ensure that they hire the best talent out there. The good news is that you don’t need a degree to […]

The post 96% Off: Get The Ultimate Front End Development Bundle for $39 appeared first on designrfix.com.

Sonikpass Awesome Brand Identity and Web Design

Original Source: http://feedproxy.google.com/~r/abduzeedo/~3/6F2YKAJcEfw/sonikpass-awesome-brand-identity-and-web-design

Sonikpass Awesome Brand Identity and Web Design

Sonikpass Awesome Brand Identity and Web Design

abduzeedo
Jul 23, 2018

Rolf Jensen shared an incredible brand identity and web design project on his Behance profile. It is for Sonikpass, a San Fransisco based startup company creating an incorruptible digital version of you at the moment you want to conduct a digital transaction of any kind from logging into a secure digital access point to digitally unlocking the door to your home.

This post features some of the key visual features made for the branding and website in early 2018. Including a concept called redacted identity, emphasizing the core messaging of their product, celebrated in WebGL.

Rolf is an independent design director based in New York. He has an extensive portfolio including incredible projects for Disney, Sony, Adobe and many others. I especially love the God of War project, maybe because I am a fan of the game. For more information make sure to check out http://rolfjensen.no/

Web design

 

brand identity