70 best tattoo designs

Original Source: http://feedproxy.google.com/~r/CreativeBloq/~3/uKkjFiGVg-4/best-tattoo-designs

Getting a tattoo is a big deal. Whether it’s a classic or unique design you simply love or a picture or symbol that marks a meaningful event in your life, bagging the best tattoo design is a long and sometimes difficult process. Here, we’ve pulled together some inspiration that’ll help you choose the tattoo design that’s right for you.

To make things simple, we've split the article into themes: flower tattoos (this page), tribal tattoos, mandala tattoos, dragon tattoos, cross tattoos, skull tattoos, geometric tattoos, anchor tattoos, animal tattoos, and couples' tattoos. (If you'd like a slightly different take, check out these incredible examples of watercolour tattoos).

Each of the categories contains more traditional tattoo designs, as well as quirky original ideas. You can navigate to the section you want using the drop-down menu above. Click on the images to see more of each tattoo artists' work.

Doodle art: 52 great examples
01. Rainbow roses tattoo

rose tattoo

By Morag at Purple Rose Tattoo

This rose tattoo steers away from the standard red colouring, marking it as a classic design but with a modern twist. The intricate shading and delicate leaves add to its realistic execution.

02. Monochrome tattoo

monochrome rose tattoo

By Hannah Louise Kyle

This black and white rose tattoo again steers away from the classic red, offering up an elegant black-and-white design. The heavy line work keeps it to a traditional tattoo style.

03. Pink rose tattoo

pink rose tattoo design

By Esme Loasby

The bright colours is what makes this flower tattoo design stand out, especially when you look closely at the clever colour gradient. Adding more than one flower always makes for a special piece.

04. Wildflowers tattoo

wild flowers tattoo

By Esme Loasby

Speaking of choosing more than one type for your flower tattoo, this beautiful botanical creation proves that you can put a lot of elements into one piece and it’ll still work, provided you use a tattoo artist who knows what they're doing.

05. Rose and dagger tattoo

Rose and dagger tattoo

By Tom Butts

If you’re looking for a more traditional design, this rose tattoo could be just the inspiration you’re looking for. The inclusion of the dagger adds an edge and makes it a bold, stand-out piece.

06. Red rose tattoo

red rose tattoo on head

By Sascha Roth

A bolder choice is this rose tattoo design, with clever colour work placed just away from the careful lining. Including so much black might not work for some tattoo designs, or tattooees, but it does here.

07. Geometric peonies tattoo

Geometric peonies tattoo

By Mark Jelliman

The linework on this trio of peonies is crafted with such elegance, it makes a real statement. It just goes to show that keeping things simple can often be the best approach when it comes to tattoo design.

Next page: Tribal tattoo designs

These great tattoo designs are all inspired by tribal artworks from around the world. Some of these stick to common themes from native American tribal art, for example, while others give them a contemporary twist. 

As before, click on the image to go to the tattoo artist's website or Instagram page.

08. Tribal mask-inspired tattoo

Tribal mask-inspired tattoo

By Manu Dermagrafics

This stunning leg piece was crafted freehand, and with its bold shapes, colour-blocking and seamless line work, it’s a tribal tattoo worth showing off. The shape itself complements the shape of the leg, too.

09. Subtle shading tribal tattoo

 Subtle shading tribal tattoo

By Paxii

What makes this tribal tattoo design stand out is that through the thick line work and colour-filled shapes, there’s a subtle shading that brings it to life, adding new dimensions.

10. Thick framed tribal tattoo

Thick framed tribal tattoo

By Mike Schwalger

This custom Polynesian tribal tattoo sleeve is able to include a variety of different shapes and lines without making it look too busy. The thick line framing adds a more artistic flair.

11. Pared-back tribal tattoo

Pared-back tribal tattoo

By Leo Braz

Sometimes tribal tattoos can be simple. This piece signifies the serpent in the Marajoara tribe, with the back placement proving to be the perfect place to show it off. 

12. Repeat pattern tattoo

Repeat pattern tattoo

By Sunset Tattoo

Keeping with the simple theme, this half-sleeve tribal tattoo offers an intricate yet uncomplicated design. And with such a clean design, the pattern is as mesmerising as it is timeless. 

13. Tribal collar tattoo

Tribal collar tattoo

By Margaret River

Tribal tattoo designs often demand a bold placement and this visayan tribal collar is a breathtaking example of how simple line work and intricate patterns can make a statement. 

14. Modern twist

Modern twist

By Daniel Matsumoto

This work, by Daniel Matsumoto, manages to put a modern twist on the classic tribal tattoo design. Mixing thin lines with block colour is a simple but unique way to make it pop. 

Next page: Mandala Tattoos

Mandalas are peaceful, spiritual symbols in both the Hindu and Buddhist faiths. With their intricate, nature-inspired patterns, it's no wonder they're a popular choice for tattoos.

As before, click on the image to go to the tattoo artist's website or Instagram page.

15. Pointillist mandala tattoo

Pointillist mandala tattoo

By Ricky Williams

With its circular shape, placing a Mandala tattoo around the ear is a great way to make impact. The pointillism aspect in this design is stunning.

16. Hidden mandala tattoo

Hidden mandala tattoo

By Ricky Williams

Mandala tattoos come in all sizes and this delicate design could be just the kind of thing you’re after. Sleek, delicate work that gradually moves into darker colour is a special touch.

17. Bold mandala tattoo

Bold mandala tattoo

By Jayne Rogers

The thick lines on this half-Mandala tattoo design make it the perfect way to go if you want to make a statement. Choosing to do a half design is also an option if placed around the ear.

18. Layered mandala tattoo

Layered mandala tattoo

By Niky Brown

Opting for a layering effect on this Mandala tattoo design enables it to take on a more 3D-design effect. Adding some point work really makes this one inspiring. 

19. Colourful mandala tattoo

Colourful mandala tattoo

By Mors Tattoo

Taking on a more classic style, the colour work enables the Mandala tattoo to make more of a statement. Adding colour to the leaf exterior makes for a seamless execution.

20. Shaded mandala tattoo

Shaded mandala tattoo

By Renette Hammer

Mandala tattoos circular shape enable them to be placed almost anywhere, but the chest provides a nice canvas to really show them off. Pointillism is also a great way to add depth and subtlety.

21. Stained glass mandala tattoo

Stained glass mandala tattoo

By Skylar Rose Wasserman

If you’re after a Mandala tattoo design with a more colourful, unexpected twist, you could go for something like this. The stained glass window colour effect allows shades to blend into each other. 

Next page: Dragon tattoos

Dragon tattoos might show the world how brave and fiery you are, they might celebrate your cultural heritage, or they might just exist because you think dragons are really cool (you're not wrong). Whatever your reason for wanting a dragon tattoo, check out these designs for inspiration and click on the image to go to the artist's website or Instagram page.

22. Whimsical dragon tattoo

Whimsical dragon tattoo

By Alice Badger

Sometimes, it’s best to look to the world of TV and movies for your tattoo design inspiration. This one featuring Haku from anime classic Spirited Away is a great place to start.

23. Fierce dragon tattoo

Fierce dragon tattoo

By Lydia Bruno

Dragons are also the perfect way to start off a sleeve, thanks to the variety in which they can be presented. This colourful example leaves room all around for more designs.

24. Oriental dragon tattoo

Oriental dragon tattoo

By HH Orlando Tattoo

Speaking of sleeves, this Japanese style dragon tattoo offers colourful inspiration. The detail on the scales is a particularly nice touch, as are the juxtaposing, delicate flowers underneath.

25. Symmetrical dragon tattoo

Symmetrical dragon tattoo

By Joe Fletcher

If you love the idea of a dragon tattoo but you’re wary of getting the whole form tattooed onto, opting for the head could be a great way to show your beast appreciation.

26. Linework dragon tattoo

Linework dragon tattoo

By Heritage Tattoos

A dragon's serpentine body can make it a great option for a head tattoo. This simple, black-and-white linework tattoo design offers elegant inspiration if you’re willing to take the leap.

27. Abstract dragon tattoo

Abstract dragon tattoo

By Dámaris Argüelles Pérez

A more experimental tattoo design could be just the dragon you’re looking for. This puzzle-like piece keeps it modern while also harking back to more traditional tattoo styles.

28. Etchwork dragon tattoo

Etchwork dragon tattoo

By Byron Barker

This etchwork dragon tattoo design harks back to a neo-traditional style of tattooing and works best when placed on the side of the body, allowing lots of detail.

Next page: Cross tattoo designs

Meaningful and beautiful, cross tattoos also come in a variety of styles. Choose a style that's right for you with these great designs. As before, click on an image you like to go to the artist's website or Instagram page.

29. Botanical cross tattoo

Botanical cross tattoo

By Reny Tattoos

Cross tattoo designs don’t always need to be in a standard, straight line. This example shows that cross tattoos can be moulded with another style to create something really beautiful. 

30. Pretty cross tattoo

Pretty cross tattoo

By Bruno Diego

Another way to amp up a cross tattoo design is with layering. This delicate design incorporates illustrations of love hearts in an elegant and original way, making for a special piece.

31. Symbolic cross tattoo

Symbolic cross tattoo

By Hegotme

This clever cross tattoo design references the crucifixion in a minimal but impactful manner. Adding the nails into the design is a great way to do this.

32. Curvy cross tattoo

Curvy cross tattoo

By Kelly Kossuth

Maybe you’re looking for a bolder cross tattoo design? This one from Kelly Kossuth shows how you can be both bold and minimal, thanks to thick line work.

33. Minimal cross tattoo

Minimal cross tattoo

By Tattooist Uzi

If minimal is more your style, this delicate cross tattoo design could be just the inspiration you need. Delicate line work and zero colour can still make an impact.

34. Shaded cross tattoo

Shaded cross tattoo

By Slicecrust

This classic cross tattoo design works well thanks to neat shading work and clean, thick lines. It’s a perfect design if you want one placed on your arm.

35. Artistic cross tattoo

Artistic cross tattoo

By Steven Gilliard

If you want to combine your love of being a designer or artist with your cross tattoo, then this clever piece could be right up your street. The dot work makes it pop.

Next page: Skull tattoo designs

If dragons weren't tough enough for you, how about a skull tattoo? Some of these skull designs are pretty scary, but others are actually really beautiful, and even cute. We're sure they'll all serve to inspire your skull tattoo design.

36. Skull and rose tattoo

Skull and rose tattoo

By Phatt German

Sometimes you want to add a bit more depth to a skull tattoo design. This skull, which has a rose design incorporated into its cap, does this very effectively.

37. Multi-layered skull tattoo

Multi-layered skull tattoo

By Charlotte’s Web Tattoos

Another way to incorporate depth into a skull tattoo is this half-dead design, which sees a skull merged with a crying face. The addition of a clock makes it extra creepy.

38. Mexican skull tattoo

Mexican skull tattoo

By Barbie Lowenberg

If you’re wanting something a little less creepy, this cute skull tattoo – complete with floral decoration, in the style of Mexican Día de Muertos (Day of the Dead) skull masks and decorations – is the perfect way to show off your love of the dead.

39. Delicate skull tattoo

Delicate skull tattoo

By Uvethekid

Sticking with the floral theme, this skull design offers a more freehand approach, with wavy lines. The difference in line thickness and the dotted shading is what makes it great.

40. Gruesome skull tattoo

Gruesome skull tattoo

By Kelly Violet

If you’re looking for something truly bold, a half-sleeve skull tattoo design is one of the options you could go for. This one, illustrated with medieval weaponry, is jaw-dropping.

41. Baroque skull tattoo

Baroque skull tattoo

By Siren1

Sometimes, two skulls is better than one, and this detail tattoo design effortlessly places them together without looking crowded. It's perfect on the arm.

42. 3D-effect skull tattoo

3D-effect skull tattoo

By Bali Namaste Tattoo Studio

This small skull tattoo takes a different approach when blending two skulls together, giving off a 3D effect with a minimal and cute design, which is perfect for small areas.

Next page: Geometric tattoo designs

For something a bit different, why not get an interesting tattoo featuring geometric shapes and patterns? They can be as colourful or as big as you like, as these great designs show.

43. Artistic geometric tattoo

Artistic geometric tattoo

By Expanded Eye

Expanded Eye is a duo known for its incredible geometric tattoo designs. With splashes of colour, clever shading and breathtaking structure, this is the perfect geometric tattoo design inspiration.

44. Prisms tattoo

Prisms tattoo

By Malvina Maria Wisniewska

The great thing about geometric tattoos is they can be formed of simple structures but with a detailed execution. The interweaving line thickness on this design is a great example of that. 

45. Honeycomb tattoo

Honeycomb tattoo

By Miriam Frank

Mixing shapes and colours into your geometric tattoo design can make for a pretty amazing final piece. By adding just the red to this piece, it ensures the design doesn’t go overboard.

46. Golden Ratio tattoo

 Golden Ratio tattoo

By Michele Volpi

The Golden Ratio describes the perfectly symmetrical relationship between two proportions; this geometric tattoo design is a gorgeous and clever way to pay tribute to its perfections. 

47. Pared-back geometric tattoo

Pared-back geometric tattoo

By Sarah Lu

The simplicity of geometric tattoos also means that the hand poking technique can work really well. This simple but effective design puts a different spin on the arrow. 

48. Kaleidoscopic tattoo

Kaleidoscopic tattoo

By Diego Favaretto

If you’re wanting a larger geometric piece, this tattoo is a great example of one that works well when placed on the back. The never-ending detail on this one is particularly impressive.

49. Colourful geometric tattoo

Colourful geometric tattoo

By Sasha Unisex

Of course we couldn’t feature geometric tattoo designs without mentioning Sasha Unisex – the tattoo artist who has become renowned across the world for her stunning, colourful geometric work.

Next page: Anchor tattoo designs

Anchor tattoos are about as traditional as tattoo designs get, and are currently enjoying a retro resurgence. But, as these designs prove, a traditional theme doesn't have to result in a stale old-fashioned design. Click on any image to discover the tattoo artist behind the innovative design.

50. Anchor and heart tattoo

Anchor and heart tattoo

By Patryk Hilton

If you’re after a classic tattoo staple, an anchor design is one of the best options. This traditional style piece is a great way to make a statement.

51. Exotic anchor tattoo

Exotic anchor tattoo

By Sam Ricketts

Anchors can also act as a frame for a tattoo design, with this example proving particularly impressive. By using a simple anchor as your base, you can embellish it to your heart’s content.

52. Anchor and bird tattoo

Anchor and bird tattoo

By Sami Tutch

You can always embellish your anchor tattoo design but in a more subtle, sweet way. This little anchor features cartoonish characters that make it perfect for a cute arm piece.

53. Watercolour anchor tattoo

Watercolour anchor tattoo

By Tracy Burton

If you want a splash of colour on your anchor tattoo design, adding in wave-like watercolour is a great way to include your love of anchors in the sea.

54. Sketchy anchor tattoo

Sketchy anchor tattoo

By Elena Aiello

Continuing the watery theme is this cute anchor tattoo design, which adds splashes of colour in a simple, hand-drawn style. The heart is also perfectly incorporated in the design.

55. Monochrome anchor tattoo

Monochrome anchor tattoo

By Ecke Wunderland

The detail on this tiny anchor tattoo design is so perfectly executed, it almost deserves more space. The inclusion of the paper boat is a delightful touch, finishing off the piece beautifully.

56. Geometric anchor tattoo

Geometric anchor tattoo

By Aracely Ramírez Ponce

If you want the colour to be the main focus of your anchor tattoo design, this watercolour, geometric anchor is a great way to show it off. 

Next page: Animal tattoo designs

Another popular choice, animal tattoos might honour a beloved pet, serve as a reminder of a great experience, or show part of your personality through your choice of a favourite animal. 

These animal tattoos again vary wildly in style, so if you find an art style that you like, click on the image to go through to the artist's website or Instagram page to see more.

57. Fox tattoo

Fox tattoo

By Lotte Vanns

This simple, hand-poked design is the perfect way to pay tribute to your favourite animal. Because of this fox's long body, placing it around the knee is a great way to show it off. 

58. Greyhounds tattoo

Greyhounds tattoo

By Daemon Rowanchilde

These racing greyhounds are stunning in their own right – thanks mostly to their meticulously drawn anatomy – but by placing them within another design, the whole piece becomes pretty breathtaking.

59. Dinosaur tattoo

Dinosaur tattoo

By Kimsany

The cartoonish colour-blocking on this brachiosaurus makes it truly unique. Complete with intricate line work and the perfect long arm placement, this is one way to get noticed.

60. Elephant tattoo

Elephant tattoo

By Adrián Desgracia

This sketchy design is great if you want to go for a sleeve design with a difference. The surrealist aspect of the elephant is also reminiscent of Salvador Dali’s work. 

61. Whale tattoo

Whale tattoo

By Raphael

Not sure what style to go for in your animal tattoo design? This is one solution: this unique killer whale design combines two different styles in one, with the animal's middle section drawn as shaded scales. 

62. Bird tattoo

Bird tattoo

By Jason Corbett

Pointillism is a beautiful option when it comes to bird tattoo designs. This one, perched just on the shoulder, keeps it simple with minimal detail and colour.

63. Dog tattoo

Dog tattoo

By Ricardo Romero Rios

Lots of people get their best pal tattooed on them. This one, depicting man’s best friend, is a cute way to illustrate your love for your furry friend – and there's a sweet Up reference to boot.

Next page: Couples' tattoo designs

Not just the preserve of drunken nights out, matching tattoos are a popular way to mark your commitment to your other half. While some of these designs go sickeningly all-out on the slush factor, others are more subtle, fun, and perhaps even  tasteful enough to dodge the laser should you break up (not that you will, obviously).

64. Pizza tattoos

Pizza tattoos

By justinsams

There’s no better way of combining your love of your partner with your love of pizza. This cute design may be a little cheesy for some.

65. Sun and moon tattoos

 Sun and moon tattoos

By Jessica Leigh Ozimek

If you’re getting married, you might want to make things even more permanent with ring finger tattoos. This sun and moon tattoo design is a sweet way to show off your love.

66. Chatty tattoos

Chatty tattoos

By Dream Tattoo

Your best pal is always there to listen when you need it most. When you’re far away from each other, this simple tattoo design will remind you that they’re always there.

67. King and queen tattoos

King and queen tattoos

By B9 Tattoo Studio

Be the king and queen of all couples with these minimalist playing-card inspired tattoo designs. It’s best to keep it simple, especially when placed on the hands or wrists. 

68. Fox tattoos

Fox tattoos

By Farbenfroh Tattoo Art

These playful partner tattoos are great if you’re thinking of getting a couples' tattoo on your leg. The hand-drawn, sketchy style and clever shading make these particularly beautiful. 

69. Colour mode tattoos

Colour mode tattoos

By NYC Adorned

If you’re looking for something with a designer twist, you couldn’t opt for anything better than these cute colour mode pieces (you might recognise these as belonging to Jessica Hische and Russ Maschmeyer). If you're screen-based, go for RBG, while print designers are more likely to favour CMYK.

70. Heart tattoos

Heart tattoos

By First Class Tattoo Studio

How about combining your couples tattoo design with your favourite show? This Game of Thrones-inspired piece is a great way to show off two of the things you love.

Read more:

3 tips for designing tattoosWhat happens when tattoo design meets illustration13 incredible examples of watercolour tattoo art

93% Off: Get the Complete Full Stack Developer eBook Bundle for Only $29

Original Source: http://feedproxy.google.com/~r/Designrfix/~3/lz0VpLWXPvM/full-stack-developer-ebook-bundle

Over the years, we’ve seen an immense growth in demand for developers. Now more than ever, many companies are looking at hiring full stack developers, who are comfortable working with front-end web technologies and back-end databases.  In fact, full stack developer is one of the most in demand positions in enterprise this year. Don’t get […]

The post 93% Off: Get the Complete Full Stack Developer eBook Bundle for Only $29 appeared first on designrfix.com.

How to Deploy Your Secure Vue.js App to AWS

Original Source: https://www.sitepoint.com/deploy-your-secure-vue-js-app-to-aws/

This article was originally published on the Okta developer blog. Thank you for supporting the partners who make SitePoint possible.

Writing a Vue app is intuitive, straightforward, and fast. With low barriers to entry, a component-based approach, and built-in features like hot reloading and webpack, Vue allows you to focus on developing your application rather than worrying about your dev environment and build processes. But, what happens when you are ready to deploy your app into production? The choices can be endless and sometimes unintuitive.

As an AWS Certified Solutions Architect, I am frequently asked how to deploy Vue apps to AWS. In this tutorial, I will walk you through building a small, secure Vue app and deploying it to Amazon Web Services (AWS). If you’ve never used AWS, don’t worry! I’ll walk you through each step of the way starting with creating an AWS account.

About AWS

Amazon Web Services (AWS) is a cloud platform that provides numerous on-demand cloud services. These services include cloud computing, file storage, relational databases, a content distribution network, and many, many more. AWS came into existence not as a retail offering, but rather Amazon’s internal answer to the growing complexity of the infrastructure that was responsible for powering Amazon.com and their e-commerce operations. Amazon quickly realized their cloud-based infrastructure was a compelling, cost-effective solution and opened it to the public in 2006.

At the time of writing this article, AWS is worth an estimated $250B (yes, that’s a B for BILLION) and used by thousands of companies and developers worldwide.

AWS Products

What You Will Build

I feel the best way to learn is by doing. I’ll walk you through building a small, Vue app with an Express REST server. You will secure your app using Okta’s OpenID Connect (OIDC) which enables user authentication and authorization with just a few lines of code.

You will begin by building the Vue frontend and deploy it to Amazon S3. Then you will leverage Amazon CloudFront to distribute your Vue frontend to edge servers all around the world. Lastly, you will create an Express API server and deploy it with Serverless. This API server will contain a method to fetch “secure data” (just some dummy data) which requires a valid access token from the client to retrieve.

The goal of this article is to show you how to leverage multiple AWS services rather than just spinning up a single EC2 instance to serve your app. With this services-based approach, you have a limitless scale, zero maintenance, and a cost-effective way to deploy apps in the cloud.

What is Okta?

Okta is a cloud service that allows developers to manage user authentication and connect them with one or multiple applications. The Okta API enables you to:

Authenticate and authorize your users
Store data about your users
Perform password-based and social login
Secure your application with multi-factor authentication
And much more! Check out our product documentation

Register for a free developer account, and when you’re done, come on back so we can learn more deploying a Vue app to AWS.

Bootstrap Frontend

You are going to build the Vue frontend to your secure app first and deploy it to Amazon S3 and Amazon CloudFront. Amazon S3 (Simple Storage Service) is a highly redundant, object-based file store that is both powerful and featureful. In the scope of this article, we will focus on one of the best features S3 provides: Static website hosting.

To get started quickly, you can use the scaffolding functionality from vue-cli to get your app up and running quickly. For this article, you can use the webpack template that includes hot reloading, CSS extraction, linting, and integrated build tools.

To install vue-cli run:

npm install -g vue-cli@2.9.6

Next up is to initialize your project. When you run the following vue init command, accept all the default values.

vue init webpack secure-app-client
cd ./secure-app-client
npm run dev

The init method should also install your app’s dependencies. If for some reason it doesn’t, you can install them via npm install. Finally, open your favorite browser and navigate to http://localhost:8080. You should see the frontend come alive!

Welcome to Your Vue.js App

About Single Page Applications

When you create an application with Vue, you are developing a Single Page Application (or “SPA”). SPAs have numerous advantages over traditional multi-page, server-rendered apps. It’s important to understand the difference between SPAs and multi-page web applications — especially when it comes to deploying.

A SPA app is often referred as a “static app” or “static website.” Static, in this context, means that your application compiles all its code to static assets (HTML, JS, and CSS). With these static assets, there is no specialized web server required to serve the application to your users.

Traditional web applications require a specialized web server to render every request to a client. For each of these requests, the entire payload of a page (including static assets) is transferred.

Conversely, within an SPA there is only an initial request for the static files, and then JavaScript dynamically rewrites the current page. As your users are navigating your app, requests to subsequent pages are resolved locally and don’t require an HTTP call to a server.

SPA versus Traditional Web Server

Vue-router and Creating Additional Routes

The component of an SPA that is required to rewrite the current page dynamically is commonly referred to as a “router”. The router programmatically calculates which parts of the page should mutate based off the path in the URL.

Vue has an official router that is aptly named vue-router. Since you used the vue-cli bootstrap, your app has this dependency and a router file defined (./src/router/index.js). Before we can define additional routes, we need to create the pages (or components) that you want the router to render. Create the following files in your project:

Homepage: ./src/components/home.vue

<template>
<div>
<h1>Home</h1>
<div>
<router-link to=”/secure”>Go to secure page</router-link>
</div>
</div>
</template>

Secure Page (not secured… yet!) ./src/components/secure.vue

<template>
<div>
<h1>Secure Page</h1>
<div>
<router-link to=”/”>Go back</router-link>
</div>
</div>
</template>

Using vue-router, you can inform the application to render each page based on the path.

Modify ./src/router/index.js to match the following code snippet:

import Vue from ‘vue’
import Router from ‘vue-router’
import Home from ‘@/components/home’
import Secure from ‘@/components/secure’

Vue.use(Router)

let router = new Router({
routes: [
{
path: ‘/’,
name: ‘Home’,
component: Home
},
{
path: ‘/secure’,
name: ‘Secure’,
component: Secure
}
]
})

export default router

Try it out! Tab back to your browser, and you should see the new home screen. If you click on the “Go to secure page” link you will notice the page (and URL) change, but no request was sent to a server!

Understand Hash History

As you navigated between the two pages above, you might have seen that the URL looks different than expected (do you noticed the “#/” at the beginning of the path?)

http://localhost:8080/#/ and http://localhost:8080/#/secure

The reason the URL looks like is because vue-router’s default mode is hash mode. Hash mode simulates a new URL change without instructing the browser to reload the page. This behavior is what allows SPA’s to navigate pages without forcing your browser to make any additional HTTP requests. Vue-router listens for changes in the hash portion of the URL (everything after the “#”) and responds accordingly based on the routes configured.

You can change the mode of vue-router to leverage history mode which will give your app “pretty URLs” like:

http://localhost:8080/secure

But, this comes with a significant drawback — especially when you are deploying. Since your SPA compiles to a static assets, there is just one single entry point index.html. If you try to access a page direction that is not index.html page (i.e.; http://localhost:8080/secure) the web server will return a 404 error. Why? The browser is sending a GET /secure request to the server and trying to resolve to the filesystem “/secure” (and the file doesn’t exist). It does work when you navigate to /secure from the homepage because vue-router prevents the default behavior of the browsers and instructs the router instance to fire in any mode.

By using history mode, you have to take additional steps to make sure page refreshes work correctly. You can read more about HTML5 History Mode. To keep things easy, I will show you a simple trick to ensure your refreshing works with AWS CloudFront.

Enable history mode by modifying ./router/index.js with the following setting.

let router = new Router({
mode: ‘history’,
})

Note: The dev server (npm run dev) automatically rewrites the URL to index.html for you. So the behavior you see locally is how it should work in production.

Building Your Single Page Application

Now that you have a simple, two-page frontend working locally, it’s time to build your app and get it deployed to AWS!

Because you used vue-cli scaffolding, a single call to the included build script is all you need. From your project root, run npm run build and webpack will build your application into the target ./dist directory. If the dev server is still running in your console, you can press CTRL+C.

If you open the ./dist folder and you should see the results of the build process:

./index.html – This is the entry point of your SPA. It’s a minified HTML document with links to the apps CSS and JS.
./static – This folder contains all your compiled static assets (JS and CSS)

During the build, you might have noticed the following notification: Tip: built files are meant to be served over an HTTP server. Opening index.html over file:// won’t work. If you want to test your newly compiled application locally, you can use serve (install via npm install -g serve). Run serve ./dist and it will output a URL for you to load into your browser.

This also gives you to have a hands-on experience with the major caveat of history mode with vue-router. After running serve ./dist, click on the “Go to secure page”. You should see a 404 error.

404 Error

Getting Started with AWS

You will need an AWS account to continue beyond this point. If you already have an AWS account, you can skip ahead. If you don’t, it’s a simple process that only takes a few minutes.

Navigate to the Amazon Web Services home page
Click Sign Up (or if you have signed into AWS recently choose Sign In to the Console)
If prompted, you can select “Personal” for account type
Complete the required information, add a payment method, and verify your phone number
After your account is created, you should receive a confirmation email
Log in!

Note: Amazon requires you to enter a payment method before you can create your account. All the services discussed in this article are covered under AWS Free Tier which gives you 12 months FREE.

Host Your App on Amazon S3

Since your SPA is comprised of only static assets, we can leverage Amazon S3 (Simple Storage Service) to store and serve your files.

To get started, you will need to create a bucket. Buckets are a logical unit of storage within S3, and you can have up to 100 buckets per AWS account by default (if you are studying for the AWS Certified Solutions Architect exam, you should know this!). Each bucket can have its own configuration and contain unlimited files and nested folders.

After you log in to your AWS Console, navigate to the S3 console (you can do this under AWS services search for “S3”).

Click “Create Bucket” and enter a Bucket name. Important: Bucket names are unique across the entire AWS platform. I chose bparise-secure-app-client for this article, but you might need to be creative with your naming!
Click “Create” in the bottom left.

Create S3 Bucket

You should now see your bucket listed. Next, let’s configure it for static website hosting.

Click your Bucket name and then choose the “Properties” tab.
Click on “Static website hosting” box
Choose “Use this bucket to host a website” and add “index.html” as the index document. Click “Save”.

Static website hosting

At the top of the Static website hosting box, you should see a URL for “Endpoint”. This is the publicly accessible URL to view your static website. Open the link into a new browser window, and you should see this:

403 Forbidden

Access Denied and S3 Bucket Policies

Yes, you should see a 403 Forbidden error! By default, S3 bucket permissions are deny all. To access your bucket’s contents, you must explicitly define who can access your bucket. These bucket permissions are called a Bucket Policy.

To add a Bucket Policy, click on the “Permissions” tab and click “Bucket Policy” button at the top. The following policy allows anyone to read any file in your bucket. Make sure to replace “YOUR-BUCKET-NAME” with your actual bucket name.

{
“Version”: “2012-10-17”,
“Statement”: [
{
“Sid”: “PublicReadAccess”,
“Effect”: “Allow”,
“Principal”: “*”,
“Action”: “s3:GetObject”,
“Resource”: “arn:aws:s3:::YOUR-BUCKET-NAME/*”
}
]
}

Bucket Policies can be quite complex and powerful. But, the main parts of the policy that you should be aware of are:

“Effect”: “Allow”
“Principal”: “*” – Who the policy covers (“*” implies everyone)
“Action”: “s3:GetObject” – The action allowed (s3:GetObject allows read-only access to all objects in your bucket)
“Resource”: “arn:aws:s3:::YOUR-BUCKET-NAME/*” – Which bucket and objects the policy is about.

Click “Save” on the Bucket Policy editor. You should notice a new error is displayed if you set up the policy correctly:

This bucket has public access

This warning is good advice and a rule of thumb for all S3 buckets. But, since our bucket is exclusively used to host a static website, we don’t have to worry about anyone accessing a file within the bucket they shouldn’t.

Tab back to your browser and refresh the endpoint. You should now see a 404 Not Found error. This error is much easier to resolve because you don’t have any files in your bucket yet.

404 index.html not found

Deploy to AWS with aws-cli

Now that you have a bucket created and permissions correctly set, it’s time to upload your static assets. Although you can do this manually through the interface by using the “Upload” button, I feel using the aws-cli is more efficient.

Installing asw-cli is different based on your OS. Choose one:

The post How to Deploy Your Secure Vue.js App to AWS appeared first on SitePoint.

Collective #451

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

C451_keyframers

Apple Watch Scroll Border Animation

A great coding session by the keyframers, David Khourshid and Stephen Shaw, where they show how to code the scroll border animation as seen on the Apple Watch site.

Watch it

C451_HelloSign

This content is sponsored via Syndicate Ads
HelloSign API: Everything IT requires and Developers love

With a robust SDK, amazing support, detailed documentation, and super clean dashboard, HelloSign API is sure to make your team happy.

Try it free

C451_noscript

Chrome’s NOSCRIPT Intervention

Tim Kadlec digged through Blink issues to find out more about the intervention that would disable JavaScript altogether on slow networks.

Read it

C451_gradient

Making colour gradients

Monica Dinculescu made a demo that shows how to darken, lighten or blend colors in JavaScript.

Check it out

C451_icons

Ikonate

A versatile and accessible vector icon set that can be customized easily.

Check it out

C451_ios

Force restart on any iOS device with just CSS

Developer Sabri shows how to cause a restart on iOS devices using loads of nested divs and the backdrop filter. Ouch!

Check it out

C451_genart

Generative Art Finds Its Prodigy

Read about generative artist Manolo Gamboa Naon and his inspiring works in this article by Jason Bailey.

Read it

C451_posters

Minimalistic Geometry: Poster Templates

A beautiful set of poster templates by Pixelbuddha.

Get it

C451_transformorigin

Transform-origin illustration

A demo that visualizes the transform-origin property. By Stephen Shaw.

Check it out

C451_beam

Colour Beam

A great demo by Chris Gannon.

Check it out

C451_chrome

Redesigning Chrome: An interview with Chrome’s lead designer

Read about how Google Chrome was redesigned to focus more on web content.

Read it

C451_vuegsap

Vue.js + GSAP = &#x1F525 Animations

Read how to integrate the GSAP animation library in your Vue.js project.

Read it

C451_uber

Uber Rebrand 2018

A nice presentation of how the Uber brand was redesigned.

Check it out

C451_500

500 Error – Animated text fill

A text fill animation for a 500 error page. Made by Mansoour.

Check it out

C451_conical

New in Chrome 69: building <progress> doughnut charts with conical gradients

Facundo Corradini shows how you can build conical gradients for the first supportive version of Chrome.

Read it

C451_font

Free Font: Kielo

A free uppercase headline font designed by Mikko Nuuttila.

Get it

C451_capacitor

Capacitor (Beta)

In case you didn’t know about it: Capacitor is a cross-platform API and code execution layer that makes it easy to call Native SDKs from web code. By Ionic.

Check it out

C451_Basic

WWWBasic

WWWBasic is an implementation of BASIC for web pages.

Check it out

C451_https

How HTTPS Works

If you missed it: A side project from DNSimple where HTTPS is explained in fun comics.

Check it out

C451_libre

From Our Blog
Freebie: “Libre” Web App Template

Libre is a responsive single page app template that was designed for developers who want to create collection management-like projects.

Check it out

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

Infographic: The Future of E-Commerce

Original Source: https://www.webdesignerdepot.com/2018/09/infographic-the-future-of-e-commerce/

Worldwide, retail e-commerce sales totaled $2.29 trillion last year. By the end of this year they’ll have reached $2.8 trillion. If the trend continues apace, e-commerce sales will reach a whopping $4.479 trillion by 2021.

The message is clear: Consumers love the convenience of e-commerce; the reduced prices compared to real world stores, with their real world overheads; the greater range of products.

With a simple click, or tap, you can buy or subscribe to almost any product or service. Never has impulse buying been so easy.

It’s clear that e-commerce will continue to grow as a sector. But what exactly will it look like in the coming months and years?

Add Realistic Chalk and Sketch Lettering Effects with Sketch’it – only $5!

Source

p img {display:inline-block; margin-right:10px;}
.alignleft {float:left;}
p.showcase {clear:both;}
body#browserfriendly p, body#podcast p, div#emailbody p{margin:0;}

Collective #450

Original Source: http://feedproxy.google.com/~r/tympanus/~3/AW-4rz7Tynw/

C450_WOTW

Inspirational Website of the Week: KIKK Festival 2018

This year’s Kikk festival page has a vibrant design and some beautiful effects. Our pick this week.

Get inspired

C450_Pendo

This content is sponsored via Syndicate Ads
Art + Science of Product Design

?A picture is worth a thousand words. Learn why design should be every product person’s superpower. Watch the webinar!

Check it out

C450_tree

Project Explorer

A CLI tool to create an annotated tree visualization of any project. By Sarah Drasner.

Check it out

C450_pullrequests

GitHub Pull Requests in Visual Studio Code

Now you can review and manage GitHub pull requests right from VS Code.

Read it

C450_Bellwoods

Bellwoods

A beautiful audio-visual art game made by Matt DesLauriers.

Check it out

C450_Highway

Highway

Highway is a lightweight and flexible library for AJAX-based website transitions.

Check it out

C450_beerslider

Beer Slider: Responsive & Accessible Before-After Slider

PeHaa Hetman shares this great JavaScript library of a responsive “before-after” slider.

Check it out

C450_copyright

Today, Europe Lost The Internet. Now, We Fight Back.

Read about the terrible proposal the European Parliament adopted regarding the new Copyright Directive.

Read it

C450_taskrunner

Drome

A task runner that lets you define tasks with command line statements and Node.js APIs.

Check it out

C450_access

The Importance Of Manual Accessibility Testing

Read how automated accessibility tests don’t just magically make your site accessible. An article by Eric Bailey.

Read it

C450_cssvars

Updating a CSS Variable with JavaScript

A useful snippet for dynamically updating CSS variables. By Chris Coyier.

Check it out

C450_Houdini

Houdini Spellbook

An interactive introduction to CSS Houdini. Made by Sam Richard.

Check it out

C450_Froma

Free Font: Forma

A pixel-style Memphis-inspired geometric type. Licensed under CC BY 4.0.

Get it

C450_VueToolbox

Vue Toolbox

The best Vue.js libraries in one place. Created by Tiago Alves and Filipe Pina.

Check it out

C450_emojitown

3D Emoji Town (Pure CSS)

George W. Park created this wonderful little Emoji town just with CSS.

Check it out

C450_PeterWolf

Peter and the Wolf

A Progressive Web App audio player experiment made by Koen van Gilst.

Check it out

C450_momentjs

You don’t (may not) need Moment.js

A list of date-fns or native functions which you can use to replace moment.js.

Check it out

C450_500

500 Error

A hypnotizing 505 error page animation made by Liam Egan.

Check it out

C450_doodleaddicts

Doodle Addicts

A fantastic community site for discovering art and artists.

Check it out

C450_wedding

Wedding Icons

A hand-drawn wedding themed icon set including 24 icons in various formats.

Get it

C450_trendy

Trendy Palettes

A curated collection of beautiful hand picked color palettes.

Check it out

C450_morph

HyperMorph 3000™

Andreas Borgen’s fantastic demo of image morphing.

Check it out

C450_scrollbars

Taste Your Scroll

A tool that will help you customize the scroll bars of your project.

Check it out

C450_paravel

Color Cycling with Workers

Read about the process that lead to the animation on the new Paravel site. By Dave Rupert.

Read

C450_pwc

PWC

A continuous collection of papers with code.

Check it out

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

83% Off: Get the Smartphone Photography Basics Bundle for Only $19

Original Source: http://feedproxy.google.com/~r/Designrfix/~3/85j4tfDP-Ug/smartphone-photography-basics-bundle

Not too long ago, people invest in fancy cameras in order to take good quality photos. Some even hire professional photographers just to capture their life’s precious moments. Today, however, you no longer need to spend a huge sum of money on top-of-the-line equipment in order to take decent quality photos. In fact, your smartphone […]

The post 83% Off: Get the Smartphone Photography Basics Bundle for Only $19 appeared first on designrfix.com.

iPhone XS and XR Pre-order Dates and Prices in Singapore

Original Source: https://www.hongkiat.com/blog/iphonexs-xr-preorder-dates-prices-in-singapore/

iPhone XS, XS Max, XR prices and pre-registration dates/links with Singtel, Starhub, and M1

The post iPhone XS and XR Pre-order Dates and Prices in Singapore appeared first on Hongkiat.

Visit hongkiat.com for full content.

Smashing Book 6 Is Here: New Frontiers In Web Design

Original Source: https://www.smashingmagazine.com/2018/09/smashing-book-6-release/

Smashing Book 6 Is Here: New Frontiers In Web Design

Smashing Book 6 Is Here: New Frontiers In Web Design

Vitaly Friedman

2018-09-13T13:25:00+02:00
2018-09-13T15:20:36+00:00

Imagine you were living in a perfect world. A world where everybody has fast, stable and unthrottled connections, reliable and powerful devices, exquisite screens, and capable, resilient browsers. The screens are diverse in size and pixel density, yet our interfaces adapt to varying conditions swiftly and seamlessly. What a glorious time for all of us — designers, developers, senior Webpack configurators and everybody in-between — to be alive, wouldn’t you agree?

Well, we all know that the reality is slightly more nuanced and complicated than that. That’s why we created Smashing Book 6, our shiny new book that explores uncharted territories and seeks to discover new reliable front-end and UX techniques. And now, after 10 months of work, the book is ready, and it’s shipping. Jump to table of contents and get the book right away.

Smashing Book 6: New Frontiers in Web Design

eBook

Hardcover

eBook$19Get the eBook

PDF, ePUB, Kindle. Free for Smashing Members.

Hardcover$39Get the Print (incl. eBook)

Printed, quality hardcover. Free airmail shipping worldwide.

About The Book

Finding your way through front-end and UX these days is challenging and time-consuming. But frankly, we all just don’t have time to afford betting on a wrong strategy. Smashing Book 6 sheds some light on new challenges and opportunities, but also uncovers new traps and pitfalls in this brave new front-end world of ours.

Our books aren’t concerned with short-living trends, and our new book isn’t an exception. Smashing Book 6 is focused on real challenges and real front-end solutions in the real world: from accessible apps to performance to CSS Grid Layout to advanced service workers to responsive art direction. No chit-chat or theory. Things that worked, in actual projects. Jump to table of contents.

Smashing Book 6

The Smashing Book 6, with 536 pages on real-life challenges and opportunities on the web. Photo by our dear friend Marc Thiele. (Large preview)

In the book, Laura and Marcy explore strategies for maintainable design systems and accessible single-page apps with React, Angular etc. Mike, Rachel and Lyza share insights on using CSS Custom Properties and CSS Grid in production today. Yoav and Lyza take a dive deep into performance patterns and service workers in times of Progressive Web Apps and HTTP/2.

Inner design of the Smashing Book 6.

Inner design of the Smashing Book 6. Designed by one-and-only Chiara Aliotta. Large view.

Ada, Adrian and Greg explore how to design for watches and new form factors, as well as AR/VR/XR, chatbots and conversational UIs. The last chapter will guide you through some practical strategies to break out of generic, predictable, and soulless interfaces — with dozens of examples of responsive art direction. But most importantly: it’s the book dedicated to headaches and solutions in the fragile, inconsistent, fragmented and wonderfully diverse web we find ourselves in today.

Table Of Contents

Want to peek inside? Download a free PDF sample (PDF, ca. 21 MB) with a chapter on bringing personality back to the web by yours truly. Overall, the book contains 10 chapters:

Making Design Systems Work In Real-Life
by Laura Elizabeth
Accessibility In Times Of Single-Page Applications
by Marcy Sutton
Production-Ready CSS Grid Layouts
by Rachel Andrew
Strategic Guide To CSS Custom Properties
by Mike Riethmueller
Building An Advanced Service Worker
by Lyza Gardner
Loading Assets On The Web
by Yoav Weiss
Conversation Interface Design Patterns
by Adrian Zumbrunnen
Building Chatbots And Designing For Watches
by Greg Nudelman
Cross Reality And The Web (AR/VR)
by Ada Rose Cannon
Bringing Personality Back To The Web (free PDF sample, 21MB)
by Vitaly Friedman

.c-garfield-the-cat img {
border-radius: 11px;
}
@supports (display: grid) {
.smb6-authors {
display: grid;
grid-template-columns: repeat(auto-fit, 130px);
grid-gap: 1em;
}
.smb6-authors figcaption {
grid-column: 1 / -1;
}
.smb6-authors::before {
display: none;
}
}

Laura Elizabeth
Marcy Sutton
Rachel Andrew
Mike Riethmuller
Lyza Danger Gardner
Yoav Weiss
Adrian Zumbrunnen
Greg Nudelman
Ada Rose Edwards
Vitaly Friedman
From left to right: Laura Elizabeth, Marcy Sutton, Rachel Andrew, Mike Riethmuller, Lyza D. Gardner, Yoav Weiss, Adrian Zumbrunnen, Greg Nudelman, Ada Rose Edwards, and yours truly.

536 pages. Quality hardcover + eBook (PDF, ePUB, Kindle).
Published late September 2018.
Written by and for designers and front-end developers.
Designed with love from Italy by Chiara Aliotta.
Free airmail worldwide shipping from Germany.
Check delivery times for your country.
If you are a Smashing Member, don’t forget to apply your Membership discount.
Good enough? Get the book right away.

Smashing Book 6: Covers of Chapter 1 and Chapter 10

eBook

Hardcover

eBook$19Get the eBook

PDF, ePUB, Kindle. Free for Smashing Members.

Hardcover$39Get the Print (incl. eBook)

Printed, quality hardcover. Free airmail shipping worldwide.

About The Designer

Chiara AliottaThe cover was designed with love from Italy by one-and-only Chiara Aliotta. She founded the design studio Until Sunday and has directed the overall artistic look and feel of different tech companies and not-for-profit organizations around the world. We’re very happy that she gave Smashing Book 6 that special, magical touch.

Behind The Scenes Of The Design Process

We asked Chiara to share some insights into the design process of the cover and the interior design and she was very kind to share some thoughts with us:

“It all started with a few exchanges of emails and a Skype meeting where Vitaly shared his idea of the book and the general content. I had a lot of freedom, which is always exciting and scary at the same time. The only bond (if we want to call it like this) was that the “S” of Smashing Magazine should be the main protagonist of the cover, reinvented and creatively presented as per all the other previous Smashing Books.

The illustration on paper. The cover sketched on paper. Also check the close-up photo. (Large preview)

I worked around few keywords that Vitaly was using to describe the book during our meetings and then developed an idea around classical novels of adventure where the main hero leaves home, encounters great hazards, risks, and then eventually returns wiser and/or richer than he/she was before.

So I thought of Smashing Book 6 as a way to propose this basic and mythic structure under a new light: through the articles of this book, the modern web designer will be experiencing true and deep adventures.

I imagined the “S” as an engine, the starting point of this experience, from where different worlds were creating and expanding. So the cover was the map of these uncharted territories that the book explores.

Every element on the cover has a particular meaning that constructs the SEvery element on the cover has a particular meaning that constructs the S. Large view.

I am a person who judges books by its cover and having read some of the chapters and knowing some of the well-established writers, I wanted to honour its content and their work by creating a gorgeous cover and chapter illustrations.

For this edition of Smashing Book, I imagined a textile cover in deep blue, where the graphic is printed using a very old technique, the hot gold foil stamping.

Together with Markus, part of the Smashing Magazine team and responsible for the publishing of all the Smashing Books, we worked closely to choose the final details of the binding and guarantee an elegant and sophisticated result, adding a touch of glam to the book.

Smashing Book 6 comes wrapped with a little bookmark. Photo by our dear friend Marc Thiele.

As a final touch, I added a paper wrap around the book that invites the readers to “unlock their adventure”, suggesting a physical action: the reader needs to tear off the paper before starting reading the book.
And for this only version, we introduced a customise Smashing Magazine bookmark, also in printed on gold paper. Few more reasons to prefer the paperback version over the digital ones!”

A huge round of applause to Chiara for her wonderful work and sharing the thoughts with us. We were remarkably happy with everything from design to content. But what did readers think? Well, I’m glad that you asked!

Sketches for chapter illustrations. (Large preview)

Feedback and Testimonials

We’ve sent the shiny new book to over 200 people to peek through and read, and we were able to gather some first insights. We’d love to hear your thoughts, too!

“Web design is getting pretty darned complicated. The new book from SmashingMag aims to bring the learning curve down to an accessible level.”

— Aaron Walter, InVision

“Just got the new Smashing Book 6 by SmashingMag. What a blast! From CSS Grid Layout, CSS Custom Properties and service workers all the way to the HTTP/2 and conversational interfaces and many more. I recommend it to all the people who build interfaces.”

— Mihael Tomić, Osijek, Croatia

“The books published by SmashingMag and team are getting better each time. I was thrilled to be able to preview it… EVERY CHAPTER IS GOOD! Having focused on a11y for much of my career, Marcy Sutton’s chapter is a personal favorite.”

— Stephen Hay, Amsterdam, Netherlands

Smashing Book 6, a thank-you page

The Smashing Book 6, with 536 pages on real-life challenges and solutions for the web. Huge thank-you note to the smashing community for supporting the book and out little magazine all these years. (Large preview)

Thank You For Your Support!

We’re very honored and proud to have worked with wonderful people from the industry who shared what they’ve learned in their work. We kindly thank all the hard-working people involved in making this book reality. We kindly thank you for your ongoing support of the book and our little magazine as well. It would be wonderful if you could mention the book by any chance as well in your social circles and perhaps link to this very post.

We’ve also prepared a little media kit .zip with a few photos and illustrations that you could use if you wanted to — just sayin’!

We can’t wait to hear your thoughts about the book! Happy reading, and we hope that you’ll find the book as useful as we do. Just have a cup of coffee (or tea) ready before you start reading, of course, stay smashing and… meow!

Smashing Book 6: New Frontiers in Web Design

eBook

Hardcover

eBook$19Get the eBook

PDF, ePUB, Kindle. Free for Smashing Members.

Hardcover$39Get the Print (incl. eBook)

Printed, quality hardcover. Free airmail shipping worldwide.

Smashing Editorial
(ra, il)

Scroll Snap in CSS: Controlling Scroll Action

Original Source: https://www.sitepoint.com/scroll-snap-in-css/

The following is a short extract from Tiffany’s upcoming book, CSS Master, 2nd Edition, which will be available shortly.

As the web platform grows, it has also gained features that mimic native applications. One such feature is the CSS Scroll Snap Module. Scroll snap lets developers define the distance an interface should travel during a scroll action. You might use it to build slide shows or paged interfaces―features that currently require JavaScript and expensive DOM operations.

Scroll snap as a feature has undergone a good deal of change. An earlier, 2013 version of the specification — called Scroll Snap Points at the time — defined a coordinates-and-pixels-based approach to specifying scroll distance. This version of the specification was implemented in Microsoft Edge, Internet Explorer 11, and Firefox.

Chrome 69+ and Safari 11+ implement the latest version of the specification, which uses a box alignment model. That's what we'll focus on in this section.

Warning:
Many of the scroll snap tutorials currently floating around the web are based on the earlier CSS Scroll Snap Points specification. The presence of the word “points” in the title is one sign that the tutorial may rely on the old specification. A more reliable indicator, however, is the presence of the scroll-snap-points-x or scroll-snap-points-y properties.

Since scroll snap is really well-suited to slide show layouts, that's what we'll build. Here's our markup.

<div class="slideshow">
<img src="avocado-and-bacon-salad.jpg" alt="avocado and bacon salad">
<img src="salad-eggs-and-scallops.jpg" alt="salad topped with hard boiled eggs and seared scallops">
<img src="seafood-and-noodles.jpg" alt="seafood stew over noodles">
<img src="grilled-salmon-and-side-salad.jpg" alt="grilled salmon steak with avocado and side salad">
<img src="avocado-toast-with-egg.jpg" alt="avocado toast with egg">
</div>

That's all we need. We don't need to have an outer wrapping element with and an inner sliding container. We also don't need any JavaScript.

Now for our CSS:

* {
box-sizing: border-box;
}

html, body {
padding: 0;
margin: 0;
}

.slideshow {
scroll-snap-type: x mandatory; /* Indicates scroll axis and behavior */
overflow-x: auto; /* Should be either `scroll` or `auto` */
display: flex;
height: 100vh;
}

.slideshow img {
width: 100vw;
height: 100vh;
scroll-snap-align: center;
}

Adding scroll-snap-type to .slideshow creates a scroll container. The value for this property, x mandatory describes the direction in which we'd like to scroll, and the scroll snap strictness. In this case, the mandatory value tells the browser that it must snap to a snap position when there is no active scroll operation. Using display: flex just ensures that all of our images stack horizontally.

Now the other property we need is scroll-snap-align. This property indicates how to align each image's scroll snap area within the scroll container's snap port. It accepts three values: start, end, and center. In this case, we've used the center which means that each image will be centered within the viewport as shown below.

How scroll-snap-align: center aligns images within a scroll container, in Chrome 70 for Android

For a more comprehensive look at Scroll Snap, read Well-Controlled Scrolling with CSS Scroll Snap from Google Web Fundamentals guide.

The post Scroll Snap in CSS: Controlling Scroll Action appeared first on SitePoint.