Easing Animations in Canvas

The <canvas> element in HTML and Canvas API in JavaScript combine to form one of the main raster graphics and animation possibilities on the web. A common canvas use-case is programmatically generating images for websites, particularly games. That’s exactly what I’ve done in a website I built for playing Solitaire. The cards, including all their movement, is all done in canvas.

In this article, let’s look specifically at animation in canvas and techniques to make them look smoother. We’ll look specifically at easing transitions — like “ease-in” and “ease-out” — that do not come for free in canvas like they do in CSS.

Let’s start with a static canvas. I’ve drawn to the canvas a single playing card that I grabbed out of the DOM:

Let’s start with a basic animation: moving that playing card on the canvas. Even for fairly basic things like requires working from scratch in canvas, so we’ll have to start building out functions we can use.

First, we’ll create functions to help calculate X and Y coordinates:

function getX(params) {
  let distance = params.xTo - params.xFrom;
  let steps = params.frames;
  let progress = params.frame;
  return distance / steps * progress;
}


function getY(params) {
  let distance = params.yTo - params.yFrom;
  let steps = params.frames;
  let progress = params.frame;
  return distance / steps * progress;
}

This will help us update the position values as the image gets animated. Then we’ll keep re-rendering the canvas until the animation is complete. We do this by adding the following code to our addImage() method.

if (params.frame < params.frames) {
  params.frame = params.frame + 1;
  window.requestAnimationFrame(drawCanvas);
  window.requestAnimationFrame(addImage.bind(null, params))
}

Now we have animation! We’re steadily incrementing by 1 unit each time, which we call a linear animation.

You can see how the shape moves from point A to point B in a linear fashion, maintaining the same consistent speed between points. It’s functional, but lacks realism. The start and stop is jarring.

What we want is for the object to accelerate (ease-in) and decelerate (ease-out), so it mimics what a real-world object would do when things like friction and gravity come into play.

A JavaScript easing function

We’ll achieve this with a “cubic” ease-in and ease-out transition. We’ve modified one of the equations found in Robert Penner’s Flash easing functions, to be suitable for what we want to do here.

function getEase(currentProgress, start, distance, steps) {
  currentProgress /= steps/2;
  if (currentProgress < 1) {
    return (distance/2)*(Math.pow(currentProgress, 3)) + start;
  }
  currentProgress -= 2;
  return distance/2*(Math.pow(currentProgress, 3)+ 2) + start;
}

Inserting this into our code, which is a cubic ease, we get a much smoother result. Notice how the card speeds towards the center of the space, then slows down as it reaches the end.

Advanced easing with JavaScript

We can get a slower acceleration with either a quadratic or sinusoidal ease.

function getQuadraticEase(currentProgress, start, distance, steps) {
  currentProgress /= steps/2;
  if (currentProgress <= 1) {
    return (distance/2)*currentProgress*currentProgress + start;
  }
  currentProgress--;
  return -1*(distance/2) * (currentProgress*(currentProgress-2) - 1) + start;
}
function sineEaseInOut(currentProgress, start, distance, steps) {
  return -distance/2 * (Math.cos(Math.PI*currentProgress/steps) - 1) + start;
};

For a faster acceleration, go with a quintic or exponential ease:

function getQuinticEase(currentProgress, start, distance, steps) {
  currentProgress /= steps/2;
  if (currentProgress < 1) {
    return (distance/2)*(Math.pow(currentProgress, 5)) + start;
  }
  currentProgress -= 2;
  return distance/2*(Math.pow(currentProgress, 5) + 2) + start;
}

function expEaseInOut(currentProgress, start, distance, steps) {
  currentProgress /= steps/2;
  if (currentProgress < 1) return distance/2 * Math.pow( 2, 10 * (currentProgress - 1) ) + start;
 currentProgress--;
  return distance/2 * ( -Math.pow( 2, -10 * currentProgress) + 2 ) + start;
};

More sophisticated animations with GSAP

Rolling your own easing functions can be fun, but what if you want more power and flexibility? You could continue writing custom code, or you could consider a more powerful library. Let’s turn to the GreenSock Animation Platform (GSAP) for that.

Animation becomes a lot easier to implement with GSAP. Take this example, where the card bounces at the end. Note that the GSAP library is included in the demo.

The key function is moveCard:

function moveCard() {
  gsap.to(position, {
    duration: 2,
    ease: "bounce.out",
    x: position.xMax, 
    y: position.yMax, 
    onUpdate: function() {
      draw();
    },
    onComplete: function() {
      position.x = position.origX;
      position.y = position.origY;
    }
  });
}

The gsap.to method is where all the magic happens. During the two-second duration, the position object is updated and, with every update, onUpdate is called triggering the canvas to be redrawn.

And we’re not just talking about bounces. There are tons of different easing options to choose from.

Putting it all together

Still unsure about which animation style and method you should be using in canvas when it comes to easing? Here’s a Pen showing different easing animations, including what’s offered in GSAP.

Check out my Solitaire card game  to see a live demo of the non-GSAP animations. In this case, I’ve added animations so that the cards in the game ease-out and ease-in when they move between piles.

In addition to creating motions, easing functions can be applied to any other attribute that has a from and to state, like changes in opacity, rotations, and scaling. I hope you’ll find many ways to use easing functions to make your application or game look smoother.

The post Easing Animations in Canvas appeared first on CSS-Tricks.

Just another +1 for subgrid

I’d say 85% of my grid usage is in one of these two categories…

  1. I just need some pretty basic (probably equal width) columns that ends up being something like like grid-template-columns: repeat(3, minmax(0, 1fr)); to be safe.
  2. Actually doing some real layout where five minutes in I realize I’d really like subgrid.

Subgrid? It’s a nice intuitive way to have a child element on the grid inherit relevant grid lines from the parent grid.

Here’s a great recent video from Rachel Andrew covering it. Last year, we linked up her talk on the same! It’s such a clutch feature and I wish we could rely on it cross-browser. Right now, Firefox is the only one that has it. (Chrome issue, Safari issue)

In my recent video, right about at 20 minutes, I realize subgrid would make even a fairly simple layout much nicer, like removing the need for variables or resorting to magic numbers.

The post Just another +1 for subgrid appeared first on CSS-Tricks.

Virtual Project Management: An Alternative to Conventional PM Practices

Even if the pandemic ceases to exist in the near future, you will have millions of businesses that have been bullied into becoming virtual companies. It was not by choice, but it sure taught a lot of valuable lessons to organization owners.

Speaking of businesses transitioning to virtual companies, and what comes next is strongly tied to virtual project management these days. Given that you are using the right tactics, VPM tools and improvising as a project manager, the chances of making through the existing pandemic are high.

SVG-Path Animation in React Native

Program Statement: Designing mesmerizing, interactive timeline for the user’s weight loss journey.

For the past few months, we are working on a health app that helps users in their weight loss journey. Here we call it more of a Wellness Journey. This app keeps track of your weight, your inches, water intake, and of course your calories. We are creating a platform that acts as a personal assistant in their journey. Lately, our users have been asking us for a feature in the app where they can view their entire journey i.e what was their weight when they started, and how things progressed along the weeks, their major achievements (things like the 1st pound lost, after a month and so on….). So we decided to give it a go. Read along to see what we came up with.

7 Best Highrise CRM Alternative to Use in 2020

Looking for the right Highrise CRM alternative is a crucial task since there are a lot of various options available in the market these days. Since Highrise is a customer relationship and resource management software – and that too with an abundance of features, we think you might like these alternatives as a backup solution. This write-up rounds of best Highrise CRM alternatives to date, and the reason why you might fall in love with them. One of the best things about the modern world is the absence of a monopoly.

Gone are the days when there was one specific product or service to meet customers’ standards. Right now, it is the age of alternatives, choices, and options. If you are looking for a Highrise alternative, this article will fill you in on a handful of software solutions.

The Top 6 ActiveCollab Alternatives to Use in 2020

If you just started in project management, you have probably heard of ActiveCollab amongst. If you haven’t, well, it is a project management tool with many nifty features to make workflow easy. Although this article isn’t about ActiveCollab, it fares well to say that the write-up suggests many ActiveCollab alternatives to use in 2020.

But before we do all that, let us take a brief look at what ActiveCollab is about.

Protractor Tutorial: Handle Mouse Actions and Keyboard Events

At times, while performing automated browser testing, you often have to deal with elements, which reveal only after you hover on the menu or after you click on them. In such cases, you can opt for using the action class for keyboard and mouse actions in Selenium Protractor. With the action class, you can automate representation of mouse activities, such as a mouse clicking, mouse hovering, etc.

The Selenium Protractor framework has in-built capabilities to manage various forms of keyboard and mouse events. This handling of keyboard and mouse events is achieved using the Advanced User Interfaces API. These are web-based API for emulating complex movements performed by the user. 

A Comprehensible Guide to Real-Time Features in Mobile App Development

The rapid development of computer technology has led to the fact that the developed devices have become more complex and include a large number of functions. It became possible to develop devices that meet modern requirements thanks to progress in the field of design technologies and a significant reduction in the cost of the elemental base.

Introduction to Real-Time Systems 

Real-time features are nowadays necessary for a successful mobile app. There are a large number of real-time operating modules, and they all perform one task - managing a system. Below, we listed some of the most important features of the real-time operating app nowadays.

Where Do You Learn HTML & CSS in 2020?

The question of how and where to learn HTML & CSS is a highly reasonable thing to ask. The answer depends on all sorts of things: how serious you are, your current foundation, what other resources are available to you, what you hope to do with what you learn, and how much time you have, among probably a zillion other things.

Let’s look at a bunch of options and you can choose the ones that feel right to you.

You could read a book.

There are a ton of books out there that cover HTML and CSS (and often together). They probably all do a fine job. There’s no need to chronicle all the choices here. These two are my personal recommendations. You probably don’t even need both.

HTML and CSS: Design and Build Websites

Jon Duckett’s is incredibly well-designed and approachable:

Learning Web Design: A Beginner’s Guide to HTML, CSS, JavaScript, and Web Graphics

Jennifer Robbins’ covers a bit more ground and is designed to be useful for either personal reading or as a classroom textbook.

You could go through a free online course or guide.

Frontend Masters

Frontend Masters has a very in-depth bootcamp they give away for free. It’s 21 hours of high-quality video learning! If it clicks with you, you can sign up for the more advanced paid courses.

freeCodeCamp

freeCodeCamp is also (wait for it) free and has a step-by-step process to it where you don’t just watch, there are tasks for you to complete.

Khan Academy

Khan Academy has an Intro to HTML/CSS: Making webpages course that’s packaged in a super cool format. It’s like video in that you get to hear the instructor talk you through the learning, but what you see is a real live text editor and real-live output. Sometimes the teacher is controlling the code, and then sometimes it breaks for challenges in which you take over and edit the code yourself.

A screenshot of the Khan Academy course. It has a white background, blue navigation bar across the top, sidebar containing the course contents, and a video player in the main area.

Don’t Fear the Internet

Jessica Hische and Russ Maschmeyer’s Don’t Fear the Internet is an eight-part series that gets you going with HTML & CSS — it even delves into the all-important topic of typography.

Through short tutorial videos, you’ll learn how to take a basic WordPress blog and manipulate the CSS, HTML (and even some PHP!) to match your aesthetic. 

A screenshot of the Don’t Fear the Internet webpage, which is sage green, has a large heading with the course title, two columns of text and a video player.

Interneting is hard

Oliver James has a wonderful online course called Internetting is Hard (But it doesn’t have to be).

We designed HTML & CSS Is Hard to be the only introduction to HTML and CSS that you’ll ever need. If you put in the effort to read every section and write every code snippet, this tutorial has the potential to replace hundreds or even thousand of dollars worth of online courses and live training.

A screenshot of a webpage with a white background and large heading that says Basic Web Pages.

Scrimba / Intro to HTML

Eric Tirado has an Intro to HTML course on Scrimba, which is also a neat platform in that Eric’s voice guides you through the course, but visually it’s a combination of slides with a real code editor and preview.

A screenshot of the Scrimba course. It resembles a code editor with a dark gray background, sidebar outlining web assets, and an editor with code in the main area.

You could read through all the posts in our Beginner’s Guide.

We have a guide (a collection of articles, videos, and links) called Just Starting Out with CSS & HTML. I hope there is stuff in there that can help kickstart or augment your early learning because that’s the intent.

You could find and take a paid online course.

I often join gyms because the accountability of paying for something gets me to do it. I know I can do situps, pushups, and go for a jog for free, but the gym membership makes a thing of it. Well, same could be said about paying for a course on HTML and CSS.

These are broad generalizations, but good places to start:

You could go to an in-person code school or coding bootcamp

If you wanna put even more skin in the game, you could consider literally going to school. If you don’t have a college degree, that’s an option, although you’ll be looking at a broad education rather than a ticket to leveling up your web design and development skills alone. I’m a fan of that just for the general mind-broadening it involves.

But assuming you’re going to go to a coding-specific school…

There are probably dozens — if not hundreds — more, so this is more to inform you of the possibility of schooling. You don’t even have to go to a physical school since plenty of these offer online courses, too (but with the advantage of live instruction and cohorts). For example, LambdaSchool has the novelty of being free to start and paid later in the form of letting them take a portion of your salary after you get a job in the industry.

You could practice on CodePen.

Not every second of your learning should be strictly following some course laid out by a book, class, or teacher. It wouldn’t even be that way if you tried. You might as well embrace that. If something tickles your muse, go play!

I hope CodePen is a rewarding place to do that, making it both easy and useful, while providing a place to connect with other folks in the field.

You could build a personal site and learn what you need to get it done.

That’s how absolutely countless developers have cut their teeth, including me. I wanted a personal website years ago, and I struggled through getting a self-hosted WordPress site online so I could have full control over everything and bend it to my will. Once you have an actual website online, and you know at least some people are seeing it, it gives you all the motivation in the world to keep going and evolve further.

Equally as common: build a website for your band. Or a friend, friend-of-a-friend, or the business of your mother’s business partner’s sister. When you have a real project (a real website on the live internet) you have that feet-in-the-fire feeling that you’re responsible for something real that real people are going to see and you have to get it done and do a good job. That works tremendously well for some people.

You will actually learn by doing a combination of all this stuff.

People are obsessed with asking musicians if they’re “self-taught”. Like, if they are, their amazingness triples because it means their creative genius was delivered by a lightning bolt at birth. They don’t need anyone else to learn; they merely look at those guitar strings or piano keys and know what to do.

And if they were taught by a teacher, then, well, that’s all out the door. If they are good at all, then it’s because the teacher delivered that to them.

Total nonsense.

People learn anything — music and web development included — inside a hurricane of influences. Let’s stick with music for a second. Learning to play comes in many forms. You learn by listening to music an awful lot. You can do fundamental practice, like finger exercises and going up and down scales. You can learn to transpose chords on a chalkboard. You can watch YouTube all day and night. You can sign up for online courses. You can go to local jams to watch and play along. You can join a band. You can take lessons from someone advertising on Craigslist. You can go to a local music school. You can read books about music.

You get the idea.

You can and will do all of that. With learning web design and development, getting anywhere will involve all sorts of ways. There’s no silver bullet. It takes bashing on it lots of different ways. There’s no requirement to sprinkle money on it, but you do need multiple angles, time, and motivation.


Go forth and build websites, the ol’ ShopTalk mantra!

The post Where Do You Learn HTML & CSS in 2020? appeared first on CSS-Tricks.

This Week In Web Design – June 19, 2020

This Week In Web Design is our weekly roundup of web design and development articles published in the past seven days. This week’s edition includes articles about CSS, UI, typography, developer tools, WordPress, and some tips to help with clients. Ready, set, go!

Your Designer Toolbox
Unlimited Downloads: 500,000+ Web Templates, Icon Sets, Themes & Design Assets


 

Guide Into Types of UI Copy for Mobile and Web Interfaces

A guide to different types of copy applied in user interfaces and shows UI copywriting examples.

Top 7 Typography Trends For 2020

In the online world, Typography has a direct impact on user experience and conversions.

Building ADA-Compliant Websites Part 1: Top 3 Most Common Accessibility Issues

In this 3-part series, we will explore how to build websites that are compliant with the “Americans with Disabilities Act” (ADA) of 1990.

The Most Important Thing Your Clients Should Know About Their Website

What is it that these clients are missing? It may just be the most important thing they need to know.

10 Ways for Designers to Keep the Creative Juices Flowing

We have put together a list of things that you can try to push creativity forward.

Exciting New Tools for Designers, June 2020

From tools to help you capture and manage color palettes to AI-powered design analytics to simple animations, there’s something for almost every designer or developer.

5 Ways PMs Can Bridge the Gap with Web Developers

A communication gap often exists when it comes to issues in technical development.

Adding a Custom Welcome Guide to the WordPress Block Editor

We’re going to bake documentation directly into the plugin and make it easily accessible in the block editor.

Online Tools I Recommend to Every Web Developer

Tools that I use regularly to improve my workflow.

What is Developer Experience (DX)?

Let’s dig in a bit and apply it to the different ways people think about and use the term.

How CSS Variables Can Improve Efficiency and Consistency

Code repetition is one of the more frustrating aspects of CSS. CSS variables (a.k.a. Custom Properties) are a great way to combat these issues.

3 Ways to Check If an Object Has a Property in JavaScript

In this post, you’ll read about the 3 common ways to check whether a property exists in an object.

Make It Count – A Guide to Measuring the User Experience

By evaluating products with qualitative and quantitative methods, we gain access to a host of illuminating UX metrics.

Everything You Need to Know About FLIP Animations in React

Let’s take a look at the intersection of using the WAAPI, FLIP, and integrating all that into React.

Black and White Patterns for Web Design

The perfect use of black and white web design can make a site more ‘appealing’ to the eyes of the viewers than a site with lots of bright colors. But the designer must know how to do this.

CSS Floats Explained in Five Questions

This post covers five basic questions that will help you become an expert at floating elements.

9 Ways Creatives Can Manage Anxiety

Much like your your creative practice, your response to times of stress or uncertainty is a work in progress.

Inclusively Hiding & Styling Checkboxes and Radio Buttons

Checkboxes and radio buttons are two common examples of interactive form elements that we desperately want to have full control over styling but we don’t.

The Importance of Educating Your Web Design Clients

Educating your web design clients isn’t in the initial job description – so why do we do it?

Create Animation in CSS Easily with Animate.css

Animate.css is a ready-to-use library collection of CSS3 animation effects that supplies you with over 50 different animation effects.

Making Stagger Reveal Animations for Text

A short tutorial on how to recreate a letter stagger animation with GSAP and Splitting.js.

20 Best Color Palettes Tools

These 20 best color palette tools will help you to create the best color palettes for your next project.

How To Benefit From Mental Models in UX Design

A closer look at a psychological concept known as mental models.

Advice for Complex CSS Illustrations

While there is no “one size fits all” approach to CSS illustration, what I can offer is a set of techniques that might help you on your journey.

A Comprehensive Guide to Notification Design

Addressing notification design early in the product design process will produce better results.

10 Things Not to Do While Designing a Website for Restaurants

This blog post focuses significantly on the factors that decide the feasibility of a website for in the restaurant / food / catering industry.

Perfecting Your Web Designer Resume for a Freelance Job in 4 Easy Steps

Read on to learn the tricks to writing a shortlist-worthy resume.

How to create a UX project proposal that wins clients

A vital part of doing any fixed scope or priced work is the proposal – here’s some tips that might help.

How to design a HIPAA-compliant website

A medical provider’s website can’t just be a good website; it also has to comply with the Health Insurance Portability and Accountability Act (HIPAA).

What Vitruvius Can Teach Us About Web Design

The ancients can teach us a thing or two about design — even web design.

5 Open Source Website Builders for the Newbie Web Designer

Compared to CMS platforms, website builders offer much more complete packages to users where the software itself performs the backend coding.

10+ Best HR Software to Keep Your Team Organized and Effective

Best HR software can help you get the most out of your employees and team. The very best solutions out there help with streamlining onboarding, payroll, internal processes, and more. In this roundup, we compare the features, prices and qualities of the best HR software the market has to offer!

6 Best WooCommerce Payment Gateways for WordPress

Are you looking for the best WooCommerce payment gateways for your online store?

Choosing the right WooCommerce gateway for payments is a very important decision. It will have long term effects on the success and sustainability of your online business.

In this article, we will compare the top WooCommerce payment gateways for WordPress, so you can choose the right option for your business.

Comparing the best WooCommerce payment gateways

How to Choose The Best WooCommerce Payment Gateway

If you have just started your WooCommerce store, then you will be faced with the decision to select and set up a payment gateway.

Payment gateways are third-party service providers that enable you to accept online payments on your eCommerce store.

However, not all of them have the same polices, processing rates, and features. Choosing an unsuitable payment gateway will increase your costs and hurt your business long-term.

Following are a few important aspects you should consider when choosing your WooCommerce payment gateway.

1. Transacion Fees

Most WooCommerce payment gateways charge a fee for each transaction that takes place on your store. This fee can be vary based on your business location, customers’ card type, the payment gateway you choose, etc..

You can try to remedy this by passing the burden to your customers. However, this also means you will have to increase product prices, and your customers may find the same products elsewhere at lower costs.

Alternatively, you can compare transaction fees with other providers and try to find the right balance between transaction fees and other features.

2. Other Charges

Apart from the transaction fees, some WooCommerce payment service providers may also charge you additional fees. This could be set up fees, account maintenance fees, or charges for bank withdrawals.

These charges can be a nuisance particularly for businesses that are just starting out.

3. Recurring Payments

Many businesses sell subscription-based products, like membership plans, or an online course. In that case, you may also want to look for recurring payments feature.

Some payment gateways require customers to manually complete each transaction and don’t support recurring payments. Make sure you check for this option if your business requires automatic renewals.

4. Availability in Your Target Region

Next, you need to make sure that the payment service you choose is available in your country and in your customers’ country.

For instance, if most of your customers are based in Europe, then you may want to look for a payment service that is widely available and popular in that region.

You’ll find this information on each payment gateway’s website under ‘Supported Countries’. If you cannot find this information, then email them to be certain.

These are just the most important items to look for. You may also want to see other features that your business may need. For instance, easy refunds, extra security, verification, and regulatory compliance based on your region.

That being said, now let’s take a look at some of the best WooCommerce payment gateways for WordPress, and see how they stack up on these requirements.

Top WooCommerce Payment Gateways for WordPress

WooCommerce supports a ton of payment gateways through extensions. These extensions are WooCommerce plugins that integrate those payment services into your WooCommerce checkout process.

The following are the most popular WooCommerce payment gateways trusted by thousands of businesses around the world.

1. Stripe

Stripe

Stripe is the most popular payment gateway to accept credit card payments on your website. WooCommerce comes with built-in support to select Stripe as your payment gateway.

It supports all top credit and debit cards. Your customers can also pay using Apple Pay, Google Pay, and Alipay.

Stripe is available in 40+ countries and supports 135+ currencies. There are no setup or annual fees for Stripe, but they do charge 2.9% + 30¢ per transaction.

It also offers a better checkout experience. Your customers stay on your website during checkout, and it works smoothly on mobile as well as desktop.

Stripe supports recurring payments and can be used with any subscription or WordPress membership plugin.

Note: If you’re just looking to create a simple payment form for donations or online orders without the headache of managing a full eCommerce system, then look at WPForms which offers Stripe forms for WordPress.

2. PayPal Standard

PayPal

PayPal is one of the most popular payment services available for eCommerce stores. WooCommerce comes with built-in support for using PayPal on your online store.

As one of the pioneers in the payment industry, PayPal offers a variety of services suitable for personal, business, and eCommerce.

It is available in dozens of countries, but there are different restrictions on some countries. Make sure that it is supported in your country as well as your target customers.

The Standard PayPal extension for WooCommerce requires a PayPal business account. It does not offer an on-site checkout experience which means your customers will be redirected to PayPal website to complete the purchase.

PayPal charges are based on your account type, and the number/volume of sales you make. This makes a significant impact on your business, and you would want to review them beforehand.

Note: If all you need is a PayPal payment form for your business, then check out WPForms. It allows you to easily accept payments and donations via PayPal.

3. WooCommerce PayPal Pro

PayPal Pro

PayPal Pro for WooCommerce is a paid extension developed by the folks behind WooCommerce. It enables you to use PayPal with a better checkout experience allowing customers to complete the purchase without leaving your website.

It is available in UK, US, and Canada, but you’ll need a PayPal merchant account to use it. If your business is based in Australia, then you can use it with a PayPal Pro Payflow account.

It does not support recurring payments, which means it will not work for a membership website selling subscription-based products.

PayPal pro requires a monthly payment and transaction fees vary depending on the country. This makes it more expensive for a new business.

4. Square

Square

Square is another excellent payment gateway for WooCommerce stores. Particularly, for stores with physical locations, delivery, and other selling options.

Square is available in the U.S., Canada, Australia, Japan, and the UK. The transaction fee varies for each country, but it offers a fixed transaction rate.

The WooCommerce Square Extension syncs product between your website and your Square account. You can also add products to your Square account, and they will be added to your WooCommerce store.

Additionally, it supports recurring payments when used alongside the WooCommerce Subscriptions extension.

5. Authorize.Net

Authorize.Net

Authorize.Net is a popular payment gateway used by thousands of businesses. It is available for merchants located in United States, Canada, United Kingdom, Europe or Australia,

Authorize.Net for WooCommerce extension provides a seamless checkout process to your customers using credit cards. Customers don’t leave your website while transaction is securely processed in the background on Authorize.Net servers.

The extension also supports recurring payments for WooCommerce Subscriptions. It is user friendly and allows users to save their payment method and reuse it.

Note: You can create an Authorize.Net payment form with WPForms. This is perfect for websites that don’t need a full-fledged eCommerce platform.

6. WooCommerce Payments

WooCommerce Payments

WooCommerce Payments is a payment solution provided by the folks behind WooCommerce. It offers a better checkout experience and a deeply integrated payment gateway for your store.

Currently, WooCommerce Payments is only available to US-based merchants selling products in US Dollars.

It offers a pay as you go fee structure set at 2.9% + $0.30 per transaction for U.S.-issued cards. Additional 1% fee for cards issued outside the United States. This makes it slightly expensive than other solutions.

This solution is simply a white-label version of Stripe.

You’ll also need a WordPress.com account and install the JetPack plugin on your store.

Which is The Best WooCommerce Payment Gateway?

The best WooCommerce payment gateway is the one that provides you the best transaction fees, is available in your target region, and offers a better user experience for your customers.

Considering these factors, we would recommend Stripe as the best payment gateway for WooCommerce. It provides good checkout experience, competitive transaction, and is available in 40 countries.

Both PayPal Standard and Authorize.Net offer similar features. However, PayPal Standard does not provide a better checkout experience which may result in more abandoned cart sales.

Typically store owners offer multiple payment options to their users. For example, on our WooCommerce store for All in One SEO, we accept credit cards with Stripe and PayPal.

In our experience, this has proven to increase online store conversions. You can also add live chat software and an email marketing service to further boost your sales conversion.

We hope this article helped you find the best WooCcommerce payment gateway for your business. You may also want to see our comparison of the best business phone services for small businesses and online store owners.

If you liked this article, then please subscribe to our YouTube Channel for WordPress video tutorials. You can also find us on Twitter and Facebook.

The post 6 Best WooCommerce Payment Gateways for WordPress appeared first on WPBeginner.

What Vitruvius Can Teach Us About Web Design

What Vitruvius Can Teach Us About Web Design

What Vitruvius Can Teach Us About Web Design

Frederick O’Brien

There’s no escaping the ancient masters. Their shadows loom large over philosophy, literature, architecture, warfare, and… web design? Believe it or not, yes. Although Plato infamously omitted CSS Grid from from the final draft of The Republic, there is nonetheless plenty the old heads can teach us about web development.

Today’s lecture is about architecture, and how some of its core tenets apply to the worldwide web. Architectural terms are not unusual in web development, and for good reason. In many ways, web developers are digital architects. This piece will focus on Vitruvius, a Roman architect, and how his principles can and should be applied to websites.

This will focus in particular on the Vitruvian triad, three qualities essential to any building: durability (firmitas) , usefulness (utilitas), and beauty (venustas). Familiarity with these terms — and what they mean in practice — will help make your website better.

Vitruvius

Marcus Vitruvius Pollio was a Roman architect, civil engineer, and author who lived during the first century BC. He is remembered mainly for his writings on architecture, De architectura. Addressing the then emperor Augustus, Vitruvius outlines his thoughts on architectural theory, history, and methods.

Drawing of Roman architect Marcus Vitruvius Pollio
Vitruvius posing for a LinkedIn headshot. (Large preview)

De architectura is the only treatise on architecture to survive from antiquity, and remains a design touchstone to this day. As you could probably guess, Leonardo da Vinci’s Vitruvian Man was inspired by Vitruvius’s writings about proportion.

For those of you interested in going down an architecture rabbit hole, the full text of De architecture is available for free on Project Gutenberg. This piece will not attempt to summarise the whole book. There are a couple of reasons for this. First, there’d be an awful lot to cover. Second, I haven’t totally lost sight of the fact this is a web design magazine. We will be honing in on the Vitruvian triad, a standard for design that applies well beyond architecture.

The ancients had a knack for reducing topics to their bare — you might say elemental — essentials. The Vitruvian triad is one such case. There are other architects worth studying, other design theories worth being familiar with, but Vitruvius offers a particularly neat ABC that applies just as well to the web as it does to temples.

The Vitruvian Triad

In De architectura, Vitruvius identified three qualities essential to any piece of architecture. In the centuries since they have established themselves as his ‘golden rules.’ If you want to make Vitruvius happy — which of course you do — whenever you make a thing you should strive to make it:

  • Useful (utilitas)
  • Durable (firmitas)
  • Beautiful (venustas)

Designing with these three things in mind will elevate your work. Having one of these qualities is nice; having two is good; and having all three together is divine. Divine seems like the best option. Let’s break down what each of the three qualities mean in principle, then how they can be applied to web design.

Useful (utilitas)

In principle

Buildings are designed and erected for a reason. Whatever that purpose is, it should always be an architect’s mind. If the structure does not meet its purpose then odds are it isn’t going to be very useful. A theatre with no stage has rather dropped the ball, for example.

According to Vitruvius, usefulness will be assured “when the arrangement of the apartments is faultless and presents no hindrance to use, and when each class of building is assigned to its suitable and appropriate exposure.”

You’ve heard this one before, albeit with different language. Vitruvius is the granddaddy of harping on about how form should follow function. Louis Sullivan, the ‘father of skyscrapers’, coined that particular term in 1896. Sullivan supposedly attributed the idea back to Vitruvius, although documentation of this is dubious. In any case, that’s what utilitas boils down to.

Photograph of the old Public Library of Cincinnati
Purpose: Library. All clear? (Large preview)

Different types of buildings have different requirements. A building designed with these requirements as an afterthought will likely disappoint. This may sound obvious, but there are enough white elephants in this world to warrant caution. Labyrinthine shopping centres and highly conductive metal domes in playgrounds may look cool in investor presentations, but they don’t wind up being terribly useful.

Screenshot of New York Times news article about a playground lawsuit
Don’t be the playground designer whose playground gives children second-degree burns. Full story in The New York Times. (Large preview)

This also means the individual parts of a structure should be logically connected. In other words, they should be simple to access and navigate. If a building is useful and easy to use that’s a very good start.

Online

Utilitas also applies to web design. Every website has a purpose. That purpose may be practical, like a search engine or weather forecast, or it may be artistic, like an interactive story or graphic design portfolio. Whatever it is, it has a reason to exist, and if it is designed with that reason in mind it is more likely to be useful to anyone who visits the site.

An encyclopedia you would expect to be easy to search and navigate, with cleanly presented and properly cited information. Wikipedia, for example, ticks all of those boxes. It is the web equivalent of an enormous library, right down to the obscure sections and staff bickering behind the scenes. It was built with usefulness front and center, and so its core design has remained consistent in the years since its founding.

Alternatively, the purpose of a publication is to produce original content that is of value or interest to its readers. To be useful, a website’s publication would present said content in a vibrant and direct way, paying special attention to the reading experience across various devices. A website with wonderful content and bad design undermines its own usefulness.

Homepage screenshot of The Guardian newspaper
The Guardian is a newspaper. It’s purpose is to report the news. Its award-winning website doesn’t faff around with slogans or spectacle; it packs it full of content. (Large preview)

A clear purpose leads to clear design. If a purpose has you pulling in several different directions then the same will be true of the website. You can’t be all things to all people, and it is pointless to try. Usefulness tends to meet specific needs, not all needs.

When it comes to usefulness you can’t afford to treat websites as something abstract. Like buildings, websites are visited and used by people, and ought to be designed with them in mind above all others. Investors, advertisers, and all the other sordid actors will have their time, but if you let them in too early a site’s usefulness will be compromised. When a publication breaks up articles across multiple pages purely to inflate traffic numbers, its usefulness is reduced. When an e-commerce platform seems more concerned with shoving you down conversion funnels than with providing honest information about its products, its usefulness is reduced. In such cases, the purpose has become secondary, and the design suffers as a result.

Homepage screenshot of the DuckDuckGo search engine
We recognise the hallmarks of search engine design just like we recognise theatres, libraries, or sport stadiums. Their forms are shaped around their function. (Large preview)

Also, like buildings, websites should be easy to navigate. Ensuring the usefulness of a website requires thorough planning. Where the architect has floor plans and models, the web developer has sitemaps, wireframes, and more. These allow us to identify layout problems early and address them.

Looking at the design through different lenses is especially important here. Does the palette account for colour blindness and cultural differences? Colours mean different things in different places, after all. Is it easy to browse using keyboards and screen readers? Not everyone navigates the web the same way you do. Surely it’s better to be useful to as many people as possible? There is no good excuse for websites not to be both accessible and inclusive.

Durable (firmitas)

In principle

Firmitas boils down to the idea that things should be built to last. A fantastically useful structure that topples over after a couple of years would be widely regarded as a failure. A well-made building can last for centuries, even millenniums. Ironically, none of Vitruvius’s own buildings survive, but the point still stands.

This principle encompasses more aspects of architecture than might immediately come to mind.

Durability will be assured when foundations are carried down to the solid ground and materials wisely and liberally selected.
— Vitruvius

In other words, choose your destination carefully, lay deep foundations, and use appropriate materials.

Photograph of the Great Wall of China
With some sections well over 2,000 years old, it’s safe to say the Great Wall of China was built to last. Photograph by Andrea Leopardi. (Large preview)

We all instinctively understand longevity is a mark of good design. It reflects quality materials, meticulous planning, and loving maintenance. The Pantheon in Rome, or the Great Wall of China, are testaments to durable design, renowned as much for their longevity as for their majesty.

The principle also concerns environmental factors. Are buildings designed with due thought to the strains of weather, earthquakes, erosion, etc.? If not, it may not be a building for long...

Footage of the Tacoma Narrows Bridge shortly before its collapse
The Tacoma Narrows Bridge has its durability put to the test after engineers cut corners on cost. Spoiler: it collapsed.

It’s reassuring to know you can count on a structure not collapsing for a while, and in the long run, it usually winds up being cheaper. A durable building sits on strong foundations and uses materials appropriate to its purpose and its environment. Buildings that aren’t designed to last are typically glorified film sets. Before long, they are rubble.

Online

Time seems to pass much faster on the web, but the principle of firmitas still applies. Given the endless turbulence of online life it makes sense to plant your flag in something sturdy. Out of the three qualities, it is the one least visible to users, but without it, everything else would fall apart.

This starts with under the hood considerations. The foundations must be strong. Where will the website go? Is the content management system the right fit? Can your web hosting provider handle the expected traffic (and more) and still run smoothly? As anyone who has migrated from one CMS to another can tell you, it’s worth getting it right the first time if possible.

A generic error message for websites with server issues
This is what a crumbling website looks like. (Large preview)

There is also the longevity of the web technologies you’re using. New frameworks may seem like a good idea at the time, but if a site needs to be around for years it may make sense to fall back on HTML, CSS, and JavaScript, as well as universally supported SEO markups like structured data. As in architecture, building things to last often means using established materials rather than newfangled ones.

Durability extends to design. Web pages have to bend and stretch and warp in ways that would make architects weep. A responsive website is a durable website. As new devices — foldables, for example — and markups enter come at us, websites need to be able to take them in stride. Architects don’t get to cross their arms and sulk about earthquakes, so why should web designers shy away from the hazards of the web? Great design faces up to environmental challenges; it doesn't avoid them.

As a site grows its users will become familiar with its design. The more that happens the more of a headache it is to make wholesale changes. If a site is designed carefully from the start then renovations are more likely than rebuilds, and the appearance remains familiar even when it is updated. In this sense, a site’s durability is helped immeasurably by clear purpose. That in itself is a kind of bedrock, helping to keep sites sturdy in times of change. Even the best sites need updates from time to time.

Homepage screenshot of Smashing Magazine website
Smashing Magazine’s 2017 redesign solidified behind the scenes elements like content management, job boards, and ecommerce while keeping the front-end character familiar. (Large preview)

There is also the question of sustainability. Is due attention being paid to the commercial realities of the site? In other words, where is the box office? Be it paywalls, advertising, or membership systems, there’s no shame in incorporating these into the design process. They are not a site’s purpose, but they help make it durable.

Beautiful (venustas)

In principle

As Vitruvius says, “the eye is always in search of beauty.” It is a perfectly legitimate quality to aim for.

According to De architectura, beauty occurs “when the appearance of the work is pleasing and in good taste, and when its members are in due proportion according to correct principles of symmetry.”

As well as being useful and well made, buildings ought also to be pleasing to the eye. Some may even touch the heart.

An illustration for Vitruvius’s writings on architecture
If you want to design a good temple, Vitruvius is useful for that, too. (Large preview)

Vitruvius outlines several qualities that help make buildings beautiful. Symmetry and proportion were of particular interest to him (hence Da Vinci’s Vitruvuian Man). Obsessively incorporating shapes into everything predates graphic design by a few millennia.

Each element of a structure should be considered in relation to others near it, as well as to the environment that it is being built. Vitruvius sums up this interplay with one word: eurythmy, a Greek term for harmonious rhythm. (British pop duo Eurythmics drew their name from the same term, in case you were wondering.) Vitruvius defines it in an architectural context as follows:

Eurythmy is beauty and fitness in the adjustments of the members. This is found when the members of a work are of a height suited to their breadth, of a breadth suited to their length, and, in a word, when they all correspond symmetrically.

Like music, buildings have rhythm; their individual pieces forming into a kind of harmony. A beautiful building might be the carved marble equivalent of a Beach Boys chorus, while an ugly one is like nails on a chalkboard.

An example of McMansion Hell critiquing shoddy architecture
For those curious what beautiful architecture doesn’t look like, McMansion Hell is a good place to start. (Large preview)

As well as being well proportioned and symmetrical, individual pieces can enhance beauty in other ways. Good craftsmanship is beautiful, as is attention to detail. Materials appropriate to the structure are also beautiful — reflecting the sound judgment and good taste of the designer.

Ornamentation is acceptable, but it must complement the core design of the structure — think column engravings, paving patterns, etc. All these little details and considerations amount to the building as a whole. When they all fall together, it’s breathtaking.

Online

Beautiful websites adhere to many of the same standards as architecture. Proportion and symmetry are mainstays of attractive design. Grid systems serve the same purpose of organizing content clearly and attractively. Beyond that, there are questions of color, typography, imagery, and more, all of which feed into a website’s beauty — or lack thereof.

To get the ball rolling, here are a handful of resources on Smashing Magazine alone:

An aspect of venustas that is especially relevant to web design is how users can interact with it. As well as being nice to look at, websites have the potential to be playful, even surprising. It’s one thing to sit there and be admired, it’s another to invite visitors to become part of the beauty.

Screenshot of Bruno Simon’s portfolio website
Bruno Simon’s portfolio website invites visitors to drive around using their arrow keys. (Large preview)

Google’s interactive doodles are another good — and less daunting — example of this. Covering all manner of subjects, they invite users to play games, to learn, and to be entertained. It’s nice in its own right, and aligns with Google’s purpose as a source of information.

Example of a Google Doodle
Ironically, this is just a GIF of an interactive thing rather than the interactive thing itself, but you can see the full doodle and details of its making here. (Large preview)

With the web continuing its shift towards mobile-first experience, in which users can literally touch the websites they visit, it should be remembered that beauty pertains to all the senses — not just sight.

As for the ‘environment’, with web design that is the device it is being displayed on. Unlike buildings, websites don’t have the luxury of being one shape at all times. To be beautiful they must be responsive, shifting size and proportion to compliment the device. This is pleasing on its own, and done well the shape shifting itself becomes beautiful in its own way.

A Balancing Act

Vitruvius’s rules of utilitas, firmitas, and venustas have endured because they work, and they have endured as a triad because they work best together. Attaining all three is a balancing act. If they pull in different directions then the quality of whatever is being made will suffer. Beautiful but unuseable is poor design, for example. On the flip side, when they work together the result can be far greater than the sum of their parts.

As with architecture this requires a bird's eye view. The pieces cannot be done one at a time, they must be done with the others in mind.

The architect, as soon as he has formed the conception, and before he begins the work, has a definite idea of the beauty, the convenience, and the propriety that will distinguish it.
— Vitruviuas

No doubt the details will change, but the harmony should not.

This extends to the people making a website. As with architecture websites typically have to balance the wants of a client, an architect, and a builder — not to mention investors, financiers, statisticians, and so on. For a website to be harmonious, so do the people responsible for building it.

None of this is to say that the three qualities are equally important regardless of the project — only that each should be given due thought in relation to the others. The usefulness of the Eiffel Tower seems fairly trivial, as does the beauty of the Hoover Dam, and that’s fine. If a website is made to be ornamental or temporary, it doesn’t have to be more than that. The natures of utilitas, firmitas, and venustas themselves change depending on the project. Like most rules worth following, don’t be afraid to bend — or even break — them when the mood takes you.

My Website Is A Temple

Web developers are the architects of the Internet, and websites are their buildings. Vitruvius makes a point of saying architects are not — and indeed cannot be — experts in every field. Instead, they are jacks of all trades (my phrasing, not his). For the triad to be achieved it is better to have a good grasp of many subjects than expertise in one:

Let him be educated, skillful with the pencil, instructed in geometry, know much history, have followed the philosophers with attention, understand music, have some knowledge of medicine, know the opinions of the jurists, and be acquainted with astronomy and the theory of the heavens.

The relevance of some of these is obvious, others less so, but it’s all valuable to architects and web developers alike. Geometry informs proportion and layout; history puts designs in context and ensures they are understood as they are meant to be; philosophy helps us to approach projects honestly and ethically; music awakens us to the role of sound; medicine gives thought to accessibility, and potential strains on the eye, ear, or even thumb; and law looms larger now than ever. The theory of the heavens might be a stretch, but you get the idea.

Here are yet more links to help you on your way:

Not that theory alone will get you there. There’s no substitute for learning through doing. As the Stanford Encyclopedia of Philosophy notes, “the Vitruvian picture of architecture is rooted in experiential knowledge of making, doing, and crafting.” Or better yet, as Vitruvius himself puts it: “Knowledge is the child of practice and theory.”

The Vitruvian triad is a worthy standard to use whether you’re building a coliseum or a portfolio website. Not everyone has the luxury of (or budget for) a team of experts, and even if we did, why deny ourselves of the breadth of knowledge that strong design requires? We can build Levittown or we can build Rome, and everything in between. A useful, durable, beautiful Internet sounds like a good deal to me.

Smashing Editorial (ra, yk, il)