Costly Freelance Design Mistakes (and How to Avoid Them)

Original Source: http://feedproxy.google.com/~r/1stwebdesigner/~3/S5kuOVUc_iY/

While being a freelance designer can be an incredibly fun and fulfilling career, it’s not without its downsides. Chief among them is that it can place those of us who aren’t experienced businesspeople into a position of having to make critical decisions. Worse yet, it’s very possible to make the exact wrong choice in any given situation.

Making the wrong choice could be as harmless as ordering the wrong paper stock on your new business cards. Or, it could be serious enough to cost you a small fortune in money, reputation or both.

Truth be told, I have made costly mistakes over my time in business (their depths go far beyond this list). I can tell you from experience that it’s not very fun. But thankfully each mistake has provided me with a learning experience. So now I’m going to pass those lessons on to you. Hopefully, they save you from having to learn the hard way.

Unauthorized Use of a Copyrighted Image

There was a time when the use of images on the web was just a matter of saving one and then doing whatever you wanted with it. It probably wasn’t smart then, but it’s really not a good idea now. With copyright trolls looking for literally the slightest excuse to send you a hefty bill for unauthorized use of an image – you’d better make sure that you have clear rights to use it (including ones that clients provide).

It’s bad enough if this happens with your own website. But it’s a whole other kind of terrible when it happens to a client’s site – and it was you who posted the image. It puts you on the hook financially and makes you look the fool (I won’t comment on any personal involvement on this one).

The Solution
Scrutinize any image you download from the web. If it’s from a stock photo site (free or premium) ensure that the license allows you to use the image for your intended purpose (commercial, for example). Some license agreements even include limits as to the image’s size when used on a website. With free images, look for the CC0 type of license. That allows you the freedom to use the image in both personal and commercial projects.

Failure to Put Agreements in Writing

Knowing that you are running a business, working without at least some form of a contract is an invitation to get stiffed on payment. For your consideration, a personal anecdote:

For a long time, I relied on the goodness of people when starting new projects. Amazingly, it worked out quite well for a number of years. Then I got burned. I started a project without getting the standard deposit – even though I knew better. And when the relationship soured, I lost out on that check. While I could have gone through the legal process to get it straightened out, in this case it was good enough just to be able to walk away from a bad situation.

The Solution
When a new client wants you to work on a project – get the terms agreed to in writing. If you usually require that a client provide a deposit, you’ll want to make sure that they know you won’t start work until you have it in your hands. It doesn’t mean that you’ll never have an issue with payment or other related troubles, but at least you’ll have it down on paper.

Taking Responsibility for Things You Shouldn’t

This one will come back to bite you over and over. And it’s especially difficult because we so often say yes to things (out loud or in our heads) in the early part of our freelancing career. But usually, the pain really starts later – well after you’ve decided that you no longer want to do a specific task.

I can share an example of this from my own experience. Over a decade ago, I had agreed to administer a promotional app on a client’s website. Essentially, it was there to send a birthday coupon out to folks who signed up to their mailing list. Sounds simple enough, right? Well, not the way I did it.

Since I didn’t have anything to tie directly into their email list that would trigger the sending of a message, I instead rigged up this ridiculous system for manually adding users to an app that would send out those coupons. Because of my foolishness, I manually checked the mailing list for new subscribers and added them to a separate coupon app – for years.

This, along with a sprinkling of other short-sighted decisions took up a great deal of time that really could have been better spent. The frustration was compounded by the less-than-ideal setup.

The Solution
Think long and hard about taking on things you really don’t want to do before saying yes. You could be living with the consequences long after. Oh, and automate everything you can!

Failure to do Your Homework

The last costly mistake in our roundup can really cost you – as in tons of time and lost revenue. It’s the failure to do enough research to provide an accurate cost estimate for a project. And the real kicker is that this sin is just as easy to commit when quoting a from-scratch website or a redesign.

So often, we see cases of “scope creep” work their way into our projects. It’s those seemingly little things that turn into a huge mess. But part of that might be because we didn’t ask enough probing questions at the beginning of the process. If we’re not on the same page with our client, we might be in for a surprise.

When it comes to redesigns, we might do a cursory scan of an old site thinking that there’s nothing major lurking underneath (especially so if a prospective client hasn’t mentioned it). So, instead of clicking through a bunch of content – we assume it’s all the same. Only when we begin working on the project do we find that key element we missed. At this point, it’s probably too late (or at least too awkward) to go back to the client and ask for more money.

The Solution
The key here is to be as thorough as possible when reviewing an existing website or going over project requirements with your client. Reviewing a website should be simple enough. It’s a matter of clicking through each and every link to see what’s there. If there’s something you don’t quite understand – ask questions. And, when going over project requirements, it’s not enough to just know what functionality the client needs. It’s also important to find out how they expect the whole process to work and any data portability needs they may have. The more information you collect, the more accurate your estimate will be.

Learning as You Go

If you’ve never been in business before and all-of-the-sudden find yourself running one, you’re bound to have some missteps. That’s a natural part of the process. As a designer or developer, we’re often focused on what we do best. Sometimes the other job requirements aren’t as apparent until something goes wrong.

The good news is that most mistakes are correctable – if not outright preventable. The best way to avoid these situations is to really think things through. Take time and review the pros and cons. Think about how a decision may impact you a year or two down the road. Over time, you may find that doing things this way will become easier. And both your bank account and sanity will be the better for it.


Collective #412

Original Source: http://feedproxy.google.com/~r/tympanus/~3/izmYPZ0PNj4/

C412_WOTW

Inspirational Website of the Week: Fazeta Producciones

Some interesting interaction details and a unique design. Our pick this week.

Get inspired

C412_francine

Pure CSS Francine

A piece of HTML/CSS art made by Diana Smith.

Check it out

C412_curtain

Curtains.js

Curtains.js is a light-weight WebGL JavaScript library that turns HTML elements into interactive textured planes.

Check it out

C412_Divi

Our Sponsor
Divi: A Web Designer’s Dream

Divi is the ultimate tool for web designers. Hundreds of thousands of WordPress freelancers and agencies are empowered by Divi to help run their growing businesses.

Try it now

C412_knockout

Responsive Knockout Text With Looping Video

A tutorial by Giulio Mainardi where he shows how to pull off a video text effect.

Read it

C412_githubcont

GitHub Contributions Chart Generator

Visualize your GitHub contributions with differently themed images.

Check it out

C412_bigint

BigInt: arbitrary-precision integers in JavaScript

Read all about the new numeric primitive in JavaScript that can represent integers with arbitrary precision. By Mathias Bynens.

Read it

C412_displaycontents

Display: Contents Is Not a CSS Reset

Adrian Roselli explains why using display: contents as a quick and dirty CSS reset is a terrible idea.

Read it

C412_subgrids

Grid Level 2 and Subgrid

An article by Rachel Andrew where she explains subgrids and why they’d make a good addition to the Grid specification.

Read it

C412_cards

Cards Webflow UI Kit

A clonable Webflow Style UI Kit fully developed in Webflow Designer and also available as Sketch file. By Jan Losert.

Check it out

C412_print

A Guide To The State Of Print Stylesheets In 2018

Rachel Andrew’s guide to modern print stylesheets.

Read it

C412_dropdown

Solved With CSS! Dropdown Menus

Una Kravets shows how to create CSS powered dropdown menus.

Read it

C412_lobe

Lobe

Build, train, and ship custom deep learning models using a simple visual interface. Available for beta invitations.

Check it out

C412_wireframe

Priority Guides: A Content-First Alternative to Wireframes

Heleen van Nues and Lennart Overkamp write about the drawbacks of wireframes and suggest the “priority guide” as alternative.

Read it

C412_minmax

CSS Grid: More flexibility with minmax()

Michelle Barker explores the minmax() function and shows why it’s so powerful.

Read it

C412_color

The Surprising Science Behind Color Codes

Patrick Woodhead shares some interesting facts on color codes.

Read it

C412_relaxed

ReLaXed

ReLaXed is a tool which creates PDF documents interactively using HTML or Pug.

Check it out

C412_grid

Smart CSS Grid

Smart CSS Grid is a minimal CSS Grid based responsive layout system with 12 columns.

Check it out

C412_selection

Selection

A simple and light-weight library for visual DOM selection.

Check it out

C412_flocking

Starling Simulation

A flocking simulation of starling murmuration using WebGL.

Check it out

C412_v8bigint

Adding BigInts to V8

The interesting story behind implementing support for BigInts in V8.

Read it

C412_sslgithubpages

Custom domains on GitHub Pages gain support for HTTPS

Read about how GitHub Pages are gaining support for HTTPS.

Read it

Collective #412 was written by Pedro Botelho and published on Codrops.

Sketchbook 4.0 for Android review

Original Source: http://feedproxy.google.com/~r/CreativeBloq/~3/2qLAjvb44Fo/sketchbook-40-for-android-review

Any Android owners who feel a sense of competition with their iPad-wielding counterparts may be slightly irked that SketchBook 4.0 is only appearing on their platform months after it launched on iOS. But set any irritation aside, and you’ll discover a compelling update with features artists looking for Android apps will appreciate.

Chief among these is a revamped user interface that stays out of your way as you work. It vanishes if your brushstrokes veers near one of its tool panels, and many interface elements are reduced in scale. This makes some controls, like the drawers for adjusting Brush size and Opacity, a little fiddly to access, however. Tap near the centre-bottom of the screen, meanwhile, and a menu with shortcuts appears.

Complicated pricing

When you first install SketchBook, it’s the Free edition, with limited functionality but no time limit on how long you can use it. To unlock the full toolset, you have two options: you can either spend £4.09 on the Pro Tools in-app purchase, which gives you the tools only within the Android app; or get an annual SketchBook subscription (£4.09 a month or £24.99 a year). The subscription must be renewed each year, unlike the in-app purchase, but you get access to the full tools on the versions of SketchBook for Windows, Mac and iOS as well as Android. 

Shibuya Race was created by artist Ryohei Yamashita using SketchBook

Bear in mind that the desktop computer editions don’t offer the one-off purchase option, only the subscription, so if you plan to use SketchBook on either Windows or Mac as well as Android, you may as well forget the in-app purchase and commit to the subscription instead.

With all these complicated buying options, it’s worth mentioning first that the Android app smoothly recognises your subscription when you first log in on the app; and second that once you’ve logged in, the app keeps all the Pro Tools active even if your tablet isn’t connected to the internet.

New features

The main differences your upgrade awards are customisable canvas sizes; dozens more brushes, including a Inking brush with a pleasing line quality; a limit to the number of layers dictated by your device’s memory rather than the Free version’s miserly three layers; the ability to make selections and masks; and unlimited Undos. You also get access to more drawing tools, including rulers and fills.

SketchBook’s user interface is much improved

We also like the Predictive Stroke mode, which tidies up your line after you draw it. It’s a real boon for digital inkers, and you can adjust the extent to which your lines will be altered.

This release brings SketchBook for Android up to speed with other versions and maintains the software’s reputation as a quality, unobtrusive drawing tool. Perhaps more importantly for patient Android owners, the under-the-bonnet changes should see more contemporaneous updates across all SketchBook versions in the future. 

This article was originally published in ImagineFX issue 158, the world's best-selling magazine for digital artists. Subscribe now.

Read more: 95 tutorials on how to draw

The Keys to Advertising Your Web Design Business

Original Source: http://feedproxy.google.com/~r/1stwebdesigner/~3/kBaw0miLtno/

If you’ve just started a new business, congratulations! Once you have your site up and running, now comes the real challenge: advertising. You may not even know where to begin, so here’s a quick guide on how to spread the word and get your name out there.

Advertisement Banners

One of the easiest ways to advertise your business is with an online banner. These little rectangles don’t pull in many clicks, but they’re cheap. It can help immensely to advertise on relevant websites, and people may remember a good ad even if they don’t click right then.

You can use a service like Google Adwords, Facebook Ads or BlogAds. Just make sure to design a banner that’s memorable – not annoying or distracting. You are a designer, after all!

Advertisement Banners

Social Media

Want to know the best part of social media advertising? It’s free, assuming you don’t hire someone to do it for you! It’s also surprisingly effective. Generic social media accounts may fail, but if you put a bit of personality behind it, you‘ll find your business soaring. Interact first, promote your business second.

Take time to share curated content, partner with other businesses, share fun but relevant videos and images, give a behind-the-scenes look into web design life and use personal branding; people trust the individual more than the business.

Social Media

Directories

Get your business listed in a directory. Yelp, White Pages, Foursquare and any other relevant site you think will help. Many of these are free, so do your research. Don’t forget Google My Business, which adds a helpful little box on the right of search results that lists relevant information.

Email Marketing

Email marketing is highly effective – when done correctly. If done incorrectly, the only place you’ll be marketing to is the spam folder.

So grow your email list in legal ways, not by purchasing lists, but by offering an incentive for people to give you their info. Coupons, tips, eBooks, the list goes on. Personalize your emails so they get sent to the right people. Customers who’ve used your services before could get special rewards, while you can focus on converting those who haven’t. Autoresponders can automate the whole process.

Here’s a more in-depth guide if you’re confused. Email marketing services include Campaign Monitor, MailChimp and AWeber.

Email Marketing

Create a Portfolio

Of course your website itself should show off your skills, but you may wish to create a portfolio page or even a separate site. This can display the extent of your creativity, or use testimonials from past clients and examples of your work. Visitors will be hooked.

In Person

The last way to directly market your business is in-person – get your business cards ready and get out there! Attend seminars, conferences, events and try to secure a chance to participate if you can. Otherwise, it’s a learning experience.

Just remember business card etiquette. Don’t run around throwing cards at people; wait until you’re asked for it. Make sure to follow up with any businesses you exchange cards with. You might just end up with a partnership!

In Person

Say No

While not exactly a marketing tip, this is very important for designers to understand. Sometimes, you need to turn down a client. If you’re not comfortable, they’re overly demanding, or they aren’t paying their invoices, professionally turn them down and swallow the negative review. (Some review sites may allow you to respond with your side of the story, but be civil and calm.)

A new business, of course, often doesn’t have this luxury. You may need to deal with a few unpleasant clients. However, always be firm about getting paid – don’t work for free or get scammed out of money!

Getting the Word Out

Whether you have no advertising budget or are willing to spare any expense, you should have at least a few options. Social media, directories, portfolios and email marketing are often free – so start there if you don’t know what to do. Now that you know how to advertise your design business, which of these methods will you use?


Awaken Akira pays tribute to an animated classic

Original Source: http://feedproxy.google.com/~r/CreativeBloq/~3/LTNE124JLkA/awaken-akira-pays-tribute-to-an-animated-classic

It's almost 30 years since Katsuhiro Otomo's Akira was released in Japan on 16 July 1988. Otomo's epic animated tale of teenage biker gangs and rampant genetic mutations in post-apocalyptic Neo-Tokyo took another three years to make it to the West, but once it arrived it quickly became a cult hit and is largely responsible for bringing the word 'manga' to Western vocabularies.

How to colour your manga art like a pro

Akira's notable for its insanely smooth and detailed hand-drawn animation, giving it an almost CG look years before actual CG animation became the norm. And while talk of a live action remake of Akira keeps cropping up, so far it's yet to materialise.

So for now we'll just have to make do with Awaken Akira, an amazing CG tribute created by a couple of dedicated Akira fans, Ash Thorp and Zaoeyo (XiaoLin Zeng).

Awaken Akira only lasts a minute – and that's including the credits – but it's a glorious taster of a dream Akira remake that we'd love to see in full. It took Thorp and Zaoeyo a year to make, fitting in work on it between other commitments, and demonstrates a similar attention to detail to that which you'll see in the original animated film.

Tetsuo!

Awaken Akira comes across like a teaser trailer or taster reel; rather than replicate action from the film, it instead recreates a selection of key shots from the film in CG, focusing on locations and items rather than the characters. It does an incredible job of conjuring up the flavour and atmosphere of Otomo's iconic original, and the enterprise is lent further impact with a score by Pilotpriest that echoes the original soundtrack superbly.

If you're keen to see how Thorp and Zaoeyo did it, they've thoughtfully collected a number of their processes into a YouTube playlist, showcasing and explaining their techniques over the course of 26 in-depth videos.

Kaneda!

The sheer amount of work that's gone into creating this minute of video gives you a whole new appreciation of the effort that Katsuhiro Otomo and his team must have put into animating the original film. 

It's a beautiful love letter to an animated classic, and even if it's all over just a little too quickly, it's just the incentive to dig out your DVD or Blu-Ray and watch the original again. Enjoy!

How to draw manga charactersThe 27 greatest animated music videos6 manga artists to watch out for

Building A Serverless Contact Form For Your Static Site

Original Source: https://www.smashingmagazine.com/2018/05/building-serverless-contact-form-static-website/

Building A Serverless Contact Form For Your Static Site

Building A Serverless Contact Form For Your Static Site

Brian Holt

2018-05-02T18:30:17+02:00
2018-05-02T17:49:19+00:00

Static site generators provide a fast and simple alternative to Content Management Systems (CMS) like WordPress. There’s no server or database setup, just a build process and simple HTML, CSS, and JavaScript. Unfortunately, without a server, it’s easy to hit their limits quickly. For instance, in adding a contact form.

With the rise of serverless architecture adding a contact form to your static site doesn’t need to be the reason to switch to a CMS anymore. It’s possible to get the best of both worlds: a static site with a serverless back-end for the contact form (that you don’t need to maintain). Maybe best of all, in low-traffic sites, like portfolios, the high limits of many serverless providers make these services completely free!

In this article, you’ll learn the basics of Amazon Web Services (AWS) Lambda and Simple Email Service (SES) APIs to build your own static site mailer on the Serverless Framework. The full service will take form data submitted from an AJAX request, hit the Lambda endpoint, parse the data to build the SES parameters, send the email address, and return a response for our users. I’ll guide you through getting Serverless set up for the first time through deployment. It should take under an hour to complete, so let’s get started!

The static site form, sending the message to the Lambda endpoint and returning a response to the user.The static site form, sending the message to the Lambda endpoint and returning a response to the user.

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.

Setting Up

There are minimal prerequisites in getting started with Serverless technology. For our purposes, it’s simply a Node Environment with Yarn, the Serverless Framework, and an AWS account.

Setting Up The Project

The Serverless Framework web site. Useful for installation and documentation.

The Serverless Framework web site. Useful for installation and documentation.

We use Yarn to install the Serverless Framework to a local directory.

Create a new directory to host the project.
Navigate to the directory in your command line interface.
Run yarn init to create a package.json file for this project.
Run yarn add serverless to install the framework locally.
Run yarn serverless create –template aws-nodejs –name static-site-mailer to create a Node service template and name it static-site-mailer.

Our project is setup but we won’t be able to do anything until we set up our AWS services.

Setting Up An Amazon Web Services Account, Credentials, And Simple Email Service

The Amazon Web Services sign up page, which includes a generous free tier, enabling our project to be entirely free.

The Amazon Web Services sign up page, which includes a generous free tier, enabling our project to be entirely free.

The Serverless Framework has recorded a video walk-through for setting up AWS credentials, but I’ve listed the steps here as well.

Sign Up for an AWS account or log in if you already have one.
In the AWS search bar, search for “IAM”.
On the IAM page, click on “Users” on the sidebar, then the “Add user” button.
On the Add user page, give the user a name – something like “serverless” is appropriate. Check “Programmatic access” under Access type then click next.
On the permissions screen, click on the “Attach existing policies directly” tab, search for “AdministratorAccess” in the list, check it, and click next.
On the review screen you should see your user name, with “Programmatic access”, and “AdministratorAccess”, then create the user.
The confirmation screen shows the user “Access key ID” and “Secret access key”, you’ll need these to provide the Serverless Framework with access. In your CLI, type yarn sls config credentials –provider aws –key YOUR_ACCESS_KEY_ID –secret YOUR_SECRET_ACCESS_KEY, replacing YOUR_ACCESS_KEY_ID and YOUR_SECRET_ACCESS_KEY with the keys on the confirmation screen.

Your credentials are configured now, but while we’re in the AWS console let’s set up Simple Email Service.

Click Console Home in the top left corner to go home.
On the home page, in the AWS search bar, search for “Simple Email Service”.
On the SES Home page, click on “Email Addresses” in the sidebar.
On the Email Addresses listing page, click the “Verify a New Email Address” button.
In the dialog window, type your email address then click “Verify This Email Address”.
You’ll receive an email in moments containing a link to verify the address. Click on the link to complete the process.

Now that our accounts are made, let’s take a peek at the Serverless template files.

Setting Up The Serverless Framework

Running serverless create creates two files: handler.js which contains the Lambda function, and serverless.yml which is the configuration file for the entire Serverless Architecture. Within the configuration file, you can specify as many handlers as you’d like, and each one will map to a new function that can interact with other functions. In this project, we’ll only create a single handler, but in a full Serverless Architecture, you’d have several of the various functions of the service.

The default file structure generated from the Serverless Framework containing handler.js and serverless.yml.

The default file structure generated from the Serverless Framework containing handler.js and serverless.yml.

In handler.js, you’ll see a single exported function named hello. This is currently the main (and only) function. It, along with all Node handlers, take three parameters:

event
This can be thought of as the input data for the function.
context object
This contains the runtime information of the Lambda function.
callback
An optional parameter to return information to the caller.

// handler.js

‘use strict’;

module.exports.hello = (event, context, callback) => {
const response = {
statusCode: 200,
body: JSON.stringify({
message: ‘Go Serverless v1.0! Your function executed successfully!’,
input: event,
}),
};

callback(null, response);
};

At the bottom of hello, there’s a callback. It’s an optional argument to return a response, but if it’s not explicitly called, it will implicitly return with null. The callback takes two parameters:

Error error
For providing error information for when the Lambda itself fails. When the Lambda succeeds, null should be passed into this parameter.
Object result
For providing a response object. It must be JSON.stringify compatible. If there’s a parameter in the error field, this field is ignored.

Our static site will send our form data in the event body and the callback will return a response for our user to see.

In serverless.yml you’ll see the name of the service, provider information, and the functions.

# serverless.yml

service: static-site-mailer

provider:
name: aws
runtime: nodejs6.10

functions:
hello:
handler: handler.hello

How the function names in serverless.yml map to handler.js.

How the function names in serverless.yml map to handler.js.

Notice the mapping between the hello function and the handler? We can name our file and function anything and as long as it maps to the configuration it will work. Let’s rename our function to staticSiteMailer.

# serverless.yml

functions:
staticSiteMailer:
handler: handler.staticSiteMailer

// handler.js

module.exports.staticSiteMailer = (event, context, callback) => {

};

Lambda functions need permission to interact with other AWS infrastructure. Before we can send an email, we need to allow SES to do so. In serverless.yml, under provider.iamRoleStatements add the permission.

# serverless.yml

provider:
name: aws
runtime: nodejs6.10
iamRoleStatements:
– Effect: “Allow”
Action:
– “ses:SendEmail”
Resource: [“*”]

Since we need a URL for our form action, we need to add HTTP events to our function. In serverless.yml we create a path, specify the method as post, and set CORS to true for security.

functions:
staticSiteMailer:
handler: handler.staticSiteMailer
events:
– http:
method: post
path: static-site-mailer
cors: true

Our updated serverless.yml and handler.js files should look like:

# serverless.yml

service: static-site-mailer

provider:
name: aws
runtime: nodejs6.10

functions:
staticSiteMailer:
handler: handler.staticSiteMailer
events:
– http:
method: post
path: static-site-mailer
cors: true

provider:
name: aws
runtime: nodejs6.10
iamRoleStatements:
– Effect: “Allow”
Action:
– “ses:SendEmail”
Resource: [“*”]

// handler.js

‘use strict’;

module.exports.staticSiteMailer = (event, context, callback) => {
const response = {
statusCode: 200,
body: JSON.stringify({
message: ‘Go Serverless v1.0! Your function executed successfully!’,
input: event,
}),
};

callback(null, response);
};

Our Serverless Architecture is setup, so let’s deploy it and test it. You’ll get a simple JSON response.

yarn sls deploy –verbose
yarn sls invoke –function staticSiteMailer

{
“statusCode”: 200,
“body”: “{“message”:”Go Serverless v1.0! Your function executed successfully!”,”input”:{}}”
}

The return response from invoking our brand new serverless function.

The return response from invoking our brand new serverless function.

Creating The HTML Form

Our Lambda function input and form output need to match, so before we build the function we’ll build the form and capture its output. We keep it simple with name, email, and message fields. We’ll add the form action once we’ve deployed our serverless architecture and got our URL, but we know it will be a POST request so we can add that in. At the end of the form, we add a paragraph tag for displaying response messages to the user which we’ll update on the submission callback.

<form action=”{{ SERVICE URL }}” method=”POST”>
<label>
Name
<input type=”text” name=”name” required>
</label>
<label>
Email
<input type=”email” name=”reply_to” required>
</label>
<label>
Message:
<textarea name=”message” required></textarea>
</label>
<button type=”submit”>Send Message</button>
</form>
<p id=”js-form-response”></p>

To capture the output we add a submit handler to the form, turn our form parameters into an object, and send stringified JSON to our Lambda function. In the Lambda function we use JSON.parse() to read our data. Alternatively, you could use jQuery’s Serialize or query-string to send and parse the form parameters as a query string but JSON.stringify() and JSON.parse() are native.

(() => {
const form = document.querySelector(‘form’);
const formResponse = document.querySelector(‘js-form-response’);

form.onsubmit = e => {
e.preventDefault();

// Prepare data to send
const data = {};
const formElements = Array.from(form);
formElements.map(input => (data[input.name] = input.value));

// Log what our lambda function will receive
console.log(JSON.stringify(data));
};
})();

Go ahead and submit your form then capture the console output. We’ll use it in our Lambda function next.

Capturing the form data in a console log.

Capturing the form data in a console log.

Invoking Lambda Functions

Especially during development, we need to test our function does what we expect. The Serverless Framework provides the invoke and invoke local command to trigger your function from live and development environments respectively. Both commands require the function name passed through, in our case staticSiteMailer.

yarn sls invoke local –function staticSiteMailer

To pass mock data into our function, create a new file named data.json with the captured console output under a body key within a JSON object. It should look something like:

// data.json

{
“body”: “{“name”: “Sender Name”,”reply_to”: “sender@email.com”,”message”: “Sender message”}”
}

To invoke the function with the local data, pass the –path argument along with the path to the file.

yarn sls invoke local –function staticSiteMailer –path data.json

An updated return response from our serverless function when we pass it JSON data.

An updated return response from our serverless function when we pass it JSON data.

You’ll see a similar response to before, but the input key will contain the event we mocked. Let’s use our mock data to send an email using Simple Email Service!

Sending An Email With Simple Email Service

We’re going to replace the staticSiteMailer function with a call to a private sendEmail function. For now you can comment out or remove the template code and replace it with:

// hander.js

function sendEmail(formData, callback) {
// Build the SES parameters
// Send the email
}

module.exports.staticSiteMailer = (event, context, callback) => {
const formData = JSON.parse(event.body);

sendEmail(formData, function(err, data) {
if (err) {
console.log(err, err.stack);
} else {
console.log(data);
}
});
};

First, we parse the event.body to capture the form data, then we pass it to a private sendEmail function. sendEmail is responsible for sending the email, and the callback function will return a failure or success response with err or data. In our case, we can simply log the error or data since we’ll be replacing this with the Lambda callback in a moment.

Amazon provides a convenient SDK, aws-sdk, for connecting their services with Lambda functions. Many of their services, including SES, are part of it. We add it to the project with yarn add aws-sdk and import it into the top the handler file.

// handler.js

const AWS = require(‘aws-sdk’);
const SES = new AWS.SES();

In our private sendEmail function, we build the SES.sendEmail parameters from the parsed form data and use the callback to return a response to the caller. The parameters require the following as an object:

Source
The email address SES is sending from.
ReplyToAddresses
An array of email addresses added to the reply to the field in the email.
Destination
An object that must contain at least one ToAddresses, CcAddresses, or BccAddresses. Each field takes an array of email addresses that correspond to the to, cc, and bcc fields respectively.
Message
An object which contains the Body and Subject.

Is your pattern library up to date today? Alla Kholmatova has just finished a fully fledged book on Design Systems and how to get them right. With common traps, gotchas and the lessons she learned. Hardcover, eBook. Just sayin’.

Table of Contents →

Since formData is an object we can call our form fields directly like formData.message, build our parameters, and send it. We pass your SES-verified email to Source and Destination.ToAddresses. As long as the email is verified you can pass anything here, including different email addresses. We pluck our reply_to, message, and name off our formData object to fill in the ReplyToAddresses and Message.Body.Text.Data fields.

// handler.js
function sendEmail(formData, callback) {
const emailParams = {
Source: ‘your_email@example.com’, // SES SENDING EMAIL
ReplyToAddresses: [formData.reply_to],
Destination: {
ToAddresses: [‘your_email@example.com’], // SES RECEIVING EMAIL
},
Message: {
Body: {
Text: {
Charset: ‘UTF-8’,
Data: `${formData.message}nnName: ${formData.name}nEmail: ${formData.reply_to}`,
},
},
Subject: {
Charset: ‘UTF-8’,
Data: ‘New message from your_site.com’,
},
},
};

SES.sendEmail(emailParams, callback);
}

SES.sendEmail will send the email and our callback will return a response. Invoking the local function will send an email to your verified address.

yarn sls invoke local –function testMailer –path data.json

The return response from SES.sendEmail when it succeeds.

The return response from SES.sendEmail when it succeeds.

Returning A Response From The Handler

Our function sends an email using the command line, but that’s not how our users will interact with it. We need to return a response to our AJAX form submission. If it fails, we should return an appropriate statusCode as well as the err.message. When it succeeds, the 200 statusCode is sufficient, but we’ll return the mailer response in the body as well. In staticSiteMailer we build our response data and replace our sendEmail callback function with the Lambda callback.

// handler.js

module.exports.staticSiteMailer = (event, context, callback) => {
const formData = JSON.parse(event.body);

sendEmail(formData, function(err, data) {
const response = {
statusCode: err ? 500 : 200,
headers: {
‘Content-Type’: ‘application/json’,
‘Access-Control-Allow-Origin’: ‘https://your-domain.com’,
},
body: JSON.stringify({
message: err ? err.message : data,
}),
};

callback(null, response);
});
};

Our Lambda callback now returns both success and failure messages from SES.sendEmail. We build the response with checks if err is present so our response is consistent. The Lambda callback function itself passes null in the error argument field and the response as the second. We want to pass errors onwards, but if the Lambda itself fails, its callback will be implicitly called with the error response.

In the headers, you’ll need to replace Access-Control-Allow-Origin with your own domain. This will prevent any other domains from using your service and potentially racking up an AWS bill in your name! And I don’t cover it in this article, but it’s possible to set-up Lambda to use your own domain. You’ll need to have an SSL/TLS certificate uploaded to Amazon. The Serverless Framework team wrote a fantastic tutorial on how to do so.

Invoking the local function will now send an email and return the appropriate response.

yarn sls invoke local –function testMailer –path data.json

The return response from our serverless function, containing the SES.sendEmail return response in the body.

The return response from our serverless function, containing the SES.sendEmail return response in the body.

Calling The Lambda Function From The Form

Our service is complete! To deploy it run yarn sls deploy -v. Once it’s deployed you’ll get a URL that looks something like https://r4nd0mh45h.execute-api.us-east-1.amazonaws.com/dev/static-site-mailer which you can add to the form action. Next, we create the AJAX request and return the response to the user.

(() => {
const form = document.querySelector(‘form’);
const formResponse = document.querySelector(‘js-form-response’);

form.onsubmit = e => {
e.preventDefault();

// Prepare data to send
const data = {};
const formElements = Array.from(form);
formElements.map(input => (data[input.name] = input.value));

// Log what our lambda function will receive
console.log(JSON.stringify(data));

// Construct an HTTP request
var xhr = new XMLHttpRequest();
xhr.open(form.method, form.action, true);
xhr.setRequestHeader(‘Accept’, ‘application/json; charset=utf-8’);
xhr.setRequestHeader(‘Content-Type’, ‘application/json; charset=UTF-8’);

// Send the collected data as JSON
xhr.send(JSON.stringify(data));

// Callback function
xhr.onloadend = response => {
if (response.target.status === 200) {
// The form submission was successful
form.reset();
formResponse.innerHTML = ‘Thanks for the message. I’ll be in touch shortly.’;
} else {
// The form submission failed
formResponse.innerHTML = ‘Something went wrong’;
console.error(JSON.parse(response.target.response).message);
}
};
};
})();

In the AJAX callback, we check the status code with response.target.status. If it’s anything other than 200 we can show an error message to the user, otherwise let them know the message was sent. Since our Lambda returns stringified JSON we can parse the body message with JSON.parse(response.target.response).message. It’s especially useful to log the error.

You should be able to submit your form entirely from your static site!

The static site form, sending the message to the Lambda endpoint and returning a response to the user.The static site form, sending the message to the Lambda endpoint and returning a response to the user.

Next Steps

Adding a contact form to your static is easy with the Serverless Framework and AWS. There’s room for improvement in our code, like adding form validation with a honeypot, preventing AJAX calls for invalid forms and improving the UX if the response, but this is enough to get started. You can see some of these improvements within the static site mailer repo I’ve created. I hope I’ve inspired you to try out Serverless yourself!

Smashing Editorial
(lf, ra, il)

Is The Tor Browser Illegal?: What You Need to Know

Original Source: http://feedproxy.google.com/~r/Designrfix/~3/6FXF-P7m1oU/is-the-tor-browser-illegal-what-you-need-to-know

The Tor Browser has been in the news for the past few weeks with people looking for reassurance that Tor Browser lets them browse anonymously and safely. The biggest question on everyone’s mind right now – is Tor illegal? Could we be in trouble if we use Tor Browser to access the dark web links? […]

The post Is The Tor Browser Illegal?: What You Need to Know appeared first on designrfix.com.

The Startup Button Lets Discover New Startups with Just A Click

Original Source: https://www.hongkiat.com/blog/startup-button-randomizer/

Free gallery of fresh startup companies that you can browse through to take a look at their work and new projects.

The post The Startup Button Lets Discover New Startups with Just A Click appeared…

Visit hongkiat.com for full content.

20 Responsive Image Galleries and Slideshows (2018)

Original Source: https://www.hongkiat.com/blog/free-responsive-image-gallery/

If your website is image-heavy i.e. a portfolio or photography website etc., then there are two things that you’ll be needing the most – photo gallery plugins to help you better manage…

Visit hongkiat.com for full content.

How to build a chatbot interface

Original Source: http://feedproxy.google.com/~r/CreativeBloq/~3/IcBeA4d9R0Q/how-to-build-a-chatbot-interface

In the mid-2000s, virtual agents and customer service chatbots received a lot of adulation, even though they were not very conversational, and under the hood they were merely composed of data exchanges with web servers. 

Nowadays, even though a huge number of examples of ‘weak AI’ exist (including Siri, Alexa, web search engines, automated translators and facial recognition) and other topics such as responsive web design are hogging the limelight, chatbots are still causing a stir. With major investment from big companies, there remain plenty of opportunities to hack the conversational interfaces of the future.

How to design a chatbot experience

Sometimes they get a bad reputation, but chatbots can be useful. They don’t need to feel like a basic replacement for a standard web form, where the user fills in input fields and waits for validation – they can provide a conversational experience. 

Essentially we’re enhancing the user experience to feel more natural, like conversing with an expert or a friend, instead of web browser point-and-clicks or mobile gestures. The aim is that by providing empathetic, contextual responses, this technology will become embedded directly in people’s lives.

Watch the video below or read on to discover a practical way to design and build a chatbot, based on a real project-intake application in a service design practice.

01. Set a personality

It’s important to ensure the chatbot’s personality reflects the company it’s representing

As this practice serves over 110,000 members globally, the goal was to provide a quick, convenient and natural interface through which internal stakeholders could request effective digital services, instead of having to fill out confusing forms.

The first step was to establish the chatbot’s personality, as this would represent the voice of the service design team to its stakeholders. We built on Aarron Walter’s seminal work on design personas. This greatly helped our team develop the bot’s personality traits, which then determined the messages for greetings, errors and user feedback.

This is a delicate stage, as it affects how the organisation is perceived. To make sure we had as much information as possible, we immediately set up stakeholder workshops to nail the appropriate personality, colour, typography, imagery and user’s flow when engaging with the bot.

After we had gained all the necessary approvals – including seeking legal counsel – we set out to convert archaic request forms into a series of back- and-forth questions that mimicked a conversation between the stakeholders and a representative of our design services team.

02. Use RiveScript

This simple scripting language provides everything you need to design and build a chatbot POC

We knew we didn’t want to get too deep into AI markup language for the processing part – we just needed enough to jump-start the experience. 

RiveScript is a simple chatbot API that is easy enough to learn and sufficed for our needs. Within a few days we had the logic down to intake a project request from the bot, and parse it with enough business logic to validate and categorise it so it could be sent it through JSON REST services to the appropriate internal project tasking queue.  

To get this basic chatbot working, head to the RiveScript repo, clone it and install all the standard Node dependencies. In the repo you can also gain a taste of the interactions you can add with the various example snippets. 

Next, run the web-client folder, which turns the bot into a web page by running a basic Grunt server. At this point you can enhance the experience to suit your needs.

03. Generate your bot's brain

The next step is to generate the ‘brain’ of our bot. This is specified in files with the .RIVE extension, and thankfully RiveScript already comes with basic interactions out of the box (for example, questions such as ‘What is your name?’, ‘How old are you?’ and ‘What is your favourite colour?’).

When you initiate the web-client app using the proper Node command, the HTML file is instructed to load these .RIVE files.

Next we need to generate the part of our chatbot’s brain that will deal with project requests. Our main goal is to convert a selection of project tasking intake questions into a regular conversation.

So, for example:

Hello, how can we help?Great, how soon do we need to start?Can you give me a rough idea of your budget?Tell me more about your project…How did you hear about us?

A typical accessible web form would look like this:

With web forms, we’re very familiar with certain patterns: you click the Submit button, all form data is sent to another page where the request is processed, and then most likely a cheeky Thank you page pops up. 

With chatbots, we’re able to take the interaction of submitting a request, and make it more meaningful.

04. Design a voice

To convert this form to a conversational user interface served in RiveScript’s chatbot web client, we need to convert the information architecture from rigid to fluid; or field labels into UI strings. 

Let’s consider some accessible field labels, and their related question tone:

Request: How can we help? Not sure? Do you mind if I ask a few questions?Timeline: How soon do we need to get started?Budget information: Can you give me a rough idea of your budget?Project description: OK, can you tell me a summary of the problem to be solved?Reference: Also, who referred you to us?

Next we need to convert the web form’s code into AI script, following RiveScript’s very learnable processing logic for two-way conversations:

05. Request submission

As opposed to standard form variables being sent to another page or service to process, chatbots can validate and submit information entered by the user in a chat window (or spoken) immediately, which means users can also revisit previously entered values easily. 

We needed to send the user’s request entered in the chatbot UI via the JSON REST API to an external project tasking server.

In RiveScript-js we are free to make use of an XMLHttpRequest object to submit the request almost simultaneously, as the data is entered by the user:

06. Do not fear the chatbot

Soon, current ways of interacting with computers to obtain information will give in to AI-based technology like chatbots, where people just make simple voice commands, like we've seen with tech such as Amazon Echo and Google Home.

The web design community need not fear – we should all be embracing the added value of this new technology. 

It could be a game-changer for the companies it works for, offering fully scalable customer service and improved customer intelligence. 

This article was originally featured in net magazine,  the world's best-selling magazine for web designers and developers. Subscribe here.

Related articles:

How chatbots are learning – interview with Giles ColborneHow the intelligent web will change our interactionsHow conversational interfaces are innovating banking