Smashing Magazine

Smashing Magazine

Vitaly Friedman, Smashing Magazine, an online magazine for professional Web designers and developers.

Smashing Magazine

Smashing Magazine

How To Build A Simple Cryptocurrency Blockchain In Node.js

The unprecedented rise of cryptocurrencies, and their underpinning blockchain technology, have taken the world by storm — from the humble beginnings of being an academic concept over a decade ago to current increased adoption in various industries.

The blockchain technology is receiving a lot of attention because of its ability to enhance security in trustless environments, enforce decentralization, and make processes efficient.

Traditionally, Python has been the de facto programming language for blockchain development. However, with the proliferation of this amazing technology, the development options have also increased — and Node.js has not been left behind.

In this tutorial, I’m going to talk about how to build a simple cryptocurrency blockchain in Node.js. It’s not going to be too fancy, but just sufficient to assist you to understand how a blockchain works.

I’ll call this simple cryptocurrency smashingCoin.

Read the article (8 min read)
Smashing Magazine

Smashing Magazine

How To Design Mobile Apps For One-Hand Usage

On Friday, January 2007 the world shrank into our palms as three revolutionary products — the iPod, a phone, and a breakthrough internet communicator — were unified to create the smartphones we know and love today.

Steve Jobs on One-Handed UX
The first iPhone introduced in 2007 marked the fall of Qwerty keypad and stylus. (Large preview)

iPhone was built to be comfortably used for one-handed operation, allowing for a smoother thumb movement across the screen.

Steve Jobs once said that the 3.5-inch screen is the “perfect size for consumers” and that larger screens are foolish.

Read the article (14 min read)
Smashing Magazine

Smashing Magazine

How To Use The HTML Drag-And-Drop API In React

The drag-and-drop API is one of the coolest features of HTML. It helps us implement drag-and-drop features in web browsers.

In the current context, we will be dragging files from outside the browser. On dropping the file(s), we put them on a list and display their names. With the files in hand, we could then perform some other operation on the file(s), e.g. upload them to a cloud server.

In this tutorial, we’ll be focusing on how to implement the action of dragging and dropping in a React application. If what you need is a plain JavaScript implementation, perhaps you’d first like to read “How To Make A Drag-And-Drop File Uploader With Vanilla JavaScript,” an excellent tutorial written by Joseph Zimmerman not too long ago.

Read the article (7 min read)
Smashing Magazine

Smashing Magazine

How To Make Cross-Browser Testing More Efficient With LambdaTest

Before consumers sat in front of mobile devices for hours every day, there were numerous browsers and operating systems web designers had to contend with. So, it’s not like the concept of cross-browser testing is new.

Because web browsers don’t always render websites the same way or process data in the manner originally intended, cross-browser testing has long been an important part of web design and development. It’s the only way to ensure that what’s built behind the scenes is properly implemented on the frontend of a website.

But it can quickly become a tedious undertaking if you attempt to review every browser, OS and device on your own.

Fortunately, we’re living in an era where automation is king and we now have a better way of conducting cross-browser tests (and more frequently, too). So, let’s talk about why you need to automate this process and how to do so with the help of LambdaTest.

Read the article (8 min read)
Smashing Magazine

Smashing Magazine

What To Do If People Hate Your Brand Mascot

There are a number of reasons why businesses decide to use mascots to represent their brands:

  • They want there to be a friendly and reliable face to welcome visitors to the site.
  • They know they need something more than an inventory of products to make an emotional connection with shoppers.
  • They want a strong and recognizable personality that can tie all of their marketing channels together.

While it’s clear that mascots can be invaluable for the business-consumer connection, there’s a very thin line between mascots turning customers into loyal advocates and sending prospects running away in fear.

If you’re struggling to get traction on an existing website and fear the mascot might have something to do with it, this post is for you. You should also keep reading if you’re designing a mascot from-scratch and aren’t sure how to create something your audience will fall in love with.

Read the article (12 min read)
Smashing Magazine

Smashing Magazine

Staying Up To Date With Smashing Monthly Updates

An important part of our job is staying up to date, and we know how difficult it can be. Technologies don’t really change that fast — coding languages take a long time to be specified and implemented. But the ideas surrounding these technologies and the things we can do with them are constantly evolving, and hundreds of blog posts and articles are published every day. There’s no way you can read all of those but you’ll still have to keep up to date.

Fear not, we’ve got your backs! Our bi-weekly Smashing Podcast has you covered with a variety of topics across multiple levels of expertise.

A shout-out and big thank you to both Drew McLellan and Bethany Andrew for making the episodes so brilliantly witty and informative!

Read the article (7 min read)
Smashing Magazine

Smashing Magazine

Setting Up API Mocking With Mirage JS And Vue.js

Quite a number of all JavaScript projects in the wild interact with a web service or API and either use it for authentications or getting user-related data. In the era of SPA and the JAMstack, there is always a separation of concern between the APIs and the front-end.

So when it comes to the point in your front-end development of a project and the API needed hasn’t been implemented by the back-end team or you want to quickly test a feature, you have some of the following options:

  • You could proxy to a locally running version of your actual backend which in most cases as a front-end developer, you wouldn’t have.
  • You could comment out actual request and replace with mock data. (This is okay but not so great as you would need to undo that to get to production and you might not be able to deal with network states and latency.)
Read the article (9 min read)
Smashing Magazine

Smashing Magazine

Understanding CSS Grid: Grid Template Areas

When using CSS Grid Layout, you can always place items from one grid line to another. However, there is an alternate way of describing your layout, one that is visual in nature. In this article, we will learn how to use the grid-template-areas property to define placement on the grid and find out how the property really works.

In case you missed the previous articles in this series, you can find them over here:

Describing Layout With grid-template-areas

The grid-template-areas property accepts one or more strings as a value. Each string (enclosed in quotes) represents a row of your grid. You can use the property on a grid that you have defined using grid-template-rows and grid-template-columns, or you can create your layout in which case all rows will be auto-sized.

Read the article (8 min read)
Smashing Magazine

Smashing Magazine

How To Book More Appointments And Events With A WordPress Booking Plugin

When it comes to running a service-based business online, scheduling appointments with prospects and clients is critical. The downside of that, of course, is that it takes a lot of time to manage appointments and event bookings if you do it on your own.

With WordPress, however, there are a bunch of booking plugins that’ll get the job done. Put one of them in place and you can kiss many of those tedious appointment management tasks goodbye.

But all this is contingent on using the right WordPress booking plugin.

Today, I’m going to introduce you to the Amelia appointments and events WordPress booking plugin. But rather than show you how to install and use the plugin (which is very easy), I want to spend this time showing you how to design an effective booking system using it.

How To Book More Appointments And Events With Amelia

There are many kinds of clients that would benefit from a booking system:

Read the article (9 min read)
Smashing Magazine

Smashing Magazine

Smashing Podcast Episode 9 With Stéphanie Walter: How Can I Work With UI Frameworks?

Stéphanie WalterAs a developer myself, one of the things that I like about UI frameworks is that they often come with default styling, but is that something that we should be relying on in projects? Simply using the default styling and trusting that whoever produced the framework has done a really good job in designing those components? Join me for today ’s podcast episode in which I soeak to UX Designer Stéphanie Walter about things we should be considering when building on a UI framework.

Show Notes

Read the article (30 min read)
Smashing Magazine

Smashing Magazine

An Interview With Rémi Parmentier: A SmashingConf Austin Speaker

We are so excited to be bringing SmashingConf to a new city this year. We’re bringing you SmashingConf Austin and we have a fantastic line-up of speakers.

Check out this post, where we introduce our new venue of Austin and share an interview with Miriam Suzanne, and last week’s video interview with Zach Leatherman. This time we speak to Rémi Parmentier and find out what he will share with the Austin audience.

Rémi will be talking about HTML email at SmashingConf Austin. See you there?

We’ve invited Rémi back to share more of his knowledge because he was so popular at SmashingConf Freiburg last year, and in the webinar he presented to Smashing members. You can find all of that content, including a full transcript of the webinar in the post “Become An HTML Email Geek With These Videos From Rémi Parmentier”. Also, take a look at some of Rémi’s articles on the subject.

Read the article (1 min read)
Smashing Magazine

Smashing Magazine

How To Create Maps With React And Leaflet

Grasping information from a CSV or a JSON file isn’t only complicated, but is also tedious. Representing the same data in the form of visual aid is simpler. In this article, we’re going to represent the locations of the non-medical fire incidents to which the SF Fire Department responded on a map.

For this tutorial, we will be utilizing the following tools:

  • Leaflet
    A JavaScript library for interactive maps
  • React
    A JavaScript library for building user interfaces
  • React-Leaflet
    React components for Leaflet maps

What Is Leaflet?

At about 27k stars, Leaflet.js is one of the leading open-source JavaScript libraries for mobile-friendly interactive maps. It takes advantage of HTML5 and CSS3 on modern browsers while being accessible on older ones too. All in all, it supports all the primary desktop and mobile platforms.

Read the article (7 min read)
Smashing Magazine

Smashing Magazine

Django Highlights: User Models And Authentication (Part 1)

There are two types of websites: static and dynamic. Django is a framework for developing dynamic websites. While a static website is one that solely presents information, there is no interaction (beyond simple page requests) that gets registered to a server. In a static website, the server sends HTML, CSS, and JavaScript to a client and that’s it. More capabilities require a dynamic website, where the server stores information and responds to user interaction beyond just serving pages. One major reason to develop a dynamic site is to authenticate users and restrict content.

Read the article (9 min read)
Smashing Magazine

Smashing Magazine

Magic Flip Cards: Solving A Common Sizing Problem

What are the chances your next client will use the word interactive while introducing their project? In my experience, the answer is 100%, so I’m always looking for robust CSS techniques to help me deliver the various features and effects that come up when discussing this goal.

A little piece of interactivity I’m asked to implement again and again is flip cards — blocks of content that turn about when hovered or tapped to reveal content on their reverse side. It’s a neat effect that encourages playful browsing, and another way to show more information without navigating away from the page. But the standard method has a problem when it comes to accommodating different card content lengths.

In this tutorial, we’re going to build a flip card grid which solves that problem with some CSS basics — transforms, flex, and grid. You’ll need to be familiar with these, and it will help to have a good grasp of CSS positioning techniques. We will cover:

Read the article (8 min read)
Smashing Magazine

Smashing Magazine

Meet “The Ethical Design Handbook”: How To Leave Dark Patterns Behind

Over the past twenty years, user privacy has become merely a commodity on the web: there, but hardly ever respected — and often swiftly discarded. No wonder ad-blockers have gained traction, browsers have introduced tracking protection, and new legislation in form of GDPR and CCPA brought regulations for data collection.

We need to craft better digital products that respect customer’s choices without hurting business KPIs. And we need to do so by taming data collection and abandoning dark patterns, from hidden checkboxes to ambiguous copywriting. How do we get there?

That’s the question we wanted to answer. Meet Ethical Design Handbook, a new Smashing book full of practical techniques and blueprints on how companies ridden with shady practices can shift towards better, sustainable design. Download a free PDF excerpt (1 MB).

Read the article (6 min read)
Smashing Magazine

Smashing Magazine

How To Create A Headless WordPress Site On The JAMstack

In the first article of this series, we walked through Smashing Magazine’s journey from WordPress to the JAMstack. We covered the reasons for the change, the benefits that came with it, and hurdles that were encountered along the way.

Like any large engineering project, the team came out the other end knowing more about the spectrum of successes and failures within the project. In this post, we’ll set up a demo site and tutorial for what our current recommendations would be for a WordPress project at scale: retaining a WordPress dashboard for rich content editing, while migrating the Front End Architecture to the JAMstack to benefit from better security, performance, and reliability.

We’ll do this by setting up a Vue application with Nuxt, and use WordPress in a headless manner — pulling in the posts from our application via the WordPress API. The demo is here, and the open-source repo is here.

Read the article (13 min read)
Smashing Magazine

Smashing Magazine

An Interview With Zach Leatherman: A SmashingConf Austin Speaker

We are so excited to be bringing SmashingConf to a new city this year. We’re bringing you SmashingConf Austin and we have a fantastic line-up of speakers.

Check out this post, where we introduce our new venue of Austin and share an interview with Miriam Suzanne. This time we have an interview with Zach Leatherman.

Zach will be talking about type and font performance at SmashingConf Austin. See you there?

Zach is no stranger to the Smashing stage, and if you want to find out more about web fonts and loading strategies, you can watch his talk from SmashingConf London 2018, paired with a talk by Monica Dinculescu from SmashingConf Barcelona, “Web Fonts And Performance: SmashingConf Videos".

Read the article (1 min read)
Smashing Magazine

Smashing Magazine

29 Days Of February (2020 Wallpapers Edition)

What will you make of the extra day that February has in store for us this year? Visit an old friend, explore a new place, or use it to get stuff done you have put off for so long? Whatever you might have planned this month, our new collection of wallpapers is bound to cater for a little inspiration spark along the way.

Created by artists and designers from all across the globe, the wallpapers come in versions with and without a calendar for February 2020 and can be downloaded for free — a Smashing tradition that has been going on for more than nine years already. A big thank-you to everyone who challenged their creative skills and shared their artworks with us this time around!

As a little bonus goodie, we also added some February favorites from our archives to the end of this post. Because, well, some things are just too good to be forgotten, right? Enjoy!

Please note that:

Read the article (6 min read)
Smashing Magazine

Smashing Magazine

How To Create A Card Matching Game Using Angular And RxJS

Today, I’d like to focus on data streams resulting from click events on the user interface. The processing of such clickstreams is particularly useful for applications with an intensive user interaction where many events have to be processed. I’d also like to introduce you to RxJS a bit more; it’s a JavaScript library that can be used to express event handling routines compactly and concisely in a reactive style.

What Are We Building?

Learning games and knowledge quizzes are popular both for younger and older users. An example is the game “pair matching”, where the user has to find related pairs in a mixture of images and/or text snippets.

Read the article (14 min read)
Smashing Magazine

Smashing Magazine

Using CSCS Scripting Language For Cross-Platform Development

Our goal is not to build a platform; it’s to be cross all of them.
— Mark Zuckerberg

CSCS (Customized Scripting in C#) is an open-source scripting language implemented in C#. Syntactically it’s very similar to JavaScript, but it also has some similarities with Python. Some of these similarities are the keywords in the well-known if…elif…else construct, and also have the same variable scope definition as in Python (e.g. a variable defined inside of an if block or inside a loop will be also visible outside).

As opposed to JavaScript and Python, variables and functions in CSCS are case-insensitive. The primary goal of CSCS is to let the developer write as little code as possible. Also, the same code is used for both iOS and Android development. Additionally, CSCS can be used for Windows, Mac, and Unity development.

Note: You can read more about how Microsoft uses CSCS in their Maquette product (based on Unity) over here).

Read the article (9 min read)