How to Build a Stunning Portfolio Website as a Web Developer

Original Source: https://www.sitepoint.com/how-to-build-a-stunning-portfolio-website-as-a-web-developer/

This sponsored article was created by our content partner, BAW Media. Thank you for supporting the partners who make SitePoint possible.

In your role as a professional web developer, you're up for just about any website-building challenge. But, building a creative website portfolio for your own services isn't something you're accustomed to.

As much as you love web development, you've probably never thought of it as being a particularly sexy or creative profession.

The truth is, it's not all that difficult to put an eye-grabbing portfolio together rather easily when you're armed with the right tools, and you have a selection of inspiring and relevant concepts to choose from.

Here are 8 powerful ideas, together with 32 examples, to inspire you and enable you to promote your services on your own stunning portfolio website.

The post How to Build a Stunning Portfolio Website as a Web Developer appeared first on SitePoint.

A Beginner’s Guide to npm — the Node Package Manager

Original Source: https://www.sitepoint.com/beginners-guide-node-package-manager/

Node.js makes it possible to write applications in JavaScript on the server. It’s built on the V8 JavaScript runtime and written in C++ — so it’s fast. Originally, it was intended as a server environment for applications, but developers started using it to create tools to aid them in local task automation. Since then, a whole new ecosystem of Node-based tools (such as Grunt, Gulp and Webpack) has evolved to transform the face of front-end development.

This popular article was updated on 08.06.2017 to reflect the current state of npm, as well as the changes introduced by the release of version 5.

To make use of these tools (or packages) in Node.js we need to be able to install and manage them in a useful way. This is where npm, the Node package manager, comes in. It installs the packages you want to use and provides a useful interface to work with them.

In this article I’m going to look at the basics of working with npm. I will show you how to install packages in local and global mode, as well as delete, update and install a certain version of a package. I’ll also show you how to work with package.json to manage a project’s dependencies. If you’re more of a video person, why not sign up for SitePoint Premium and watch our free screencast: What is npm and How Can I Use It?.

But before we can start using npm, we first have to install Node.js on our system. Let’s do that now…

Installing Node.js

Head to the Node.js download page and grab the version you need. There are Windows and Mac installers available, as well as pre-compiled Linux binaries and source code. For Linux, you can also install Node via the package manager, as outlined here.

For this tutorial we are going to use v6.10.3 Stable. At the time of writing, this is the current Long Term Support (LTS) version of Node.

Tip: You might also consider installing Node using a version manager. This negates the permissions issue raised in the next section.

Let’s see where node was installed and check the version.

$ which node
/usr/bin/node
$ node –version
v6.10.3

To verify that your installation was successful let’s give Node’s REPL a try.

$ node
> console.log(‘Node is running’);
Node is running
> .help
.break Sometimes you get stuck, this gets you out
.clear Alias for .break
.exit Exit the repl
.help Show repl options
.load Load JS from a file into the REPL session
.save Save all evaluated commands in this REPL session to a file
> .exit

The Node.js installation worked, so we can now focus our attention on npm, which was included in the install.

$ which npm
/usr/bin/npm
$ npm –version
3.10.10

Node Packaged Modules

npm can install packages in local or global mode. In local mode it installs the package in a node_modules folder in your parent working directory. This location is owned by the current user. Global packages are installed in {prefix}/lib/node_modules/ which is owned by root (where {prefix} is usually /usr/ or /usr/local). This means you would have to use sudo to install packages globally, which could cause permission errors when resolving third-party dependencies, as well as being a security concern. Lets change that:

Parcel delivery companyTime to manage those packages
Changing the Location of Global Packages

Let’s see what output npm config gives us.

$ npm config list
; cli configs
user-agent = “npm/3.10.10 node/v6.10.3 linux x64”

; userconfig /home/sitepoint/.npmrc
prefix = “/home/sitepoint/.node_modules_global”

; node bin location = /usr/bin/nodejs
; cwd = /home/sitepoint
; HOME = /home/sitepoint
; “npm config ls -l” to show all defaults.

This gives us information about our install. For now it’s important to get the current global location.

$ npm config get prefix
/usr

This is the prefix we want to change, so as to install global packages in our home directory. To do that create a new directory in your home folder.

$ cd ~ && mkdir .node_modules_global
$ npm config set prefix=$HOME/.node_modules_global

With this simple configuration change, we have altered the location to which global Node packages are installed. This also creates a .npmrc file in our home directory.

$ npm config get prefix
/home/sitepoint/.node_modules_global
$ cat .npmrc
prefix=/home/sitepoint/.node_modules_global

We still have npm installed in a location owned by root. But because we changed our global package location we can take advantage of that. We need to install npm again, but this time in the new user-owned location. This will also install the latest version of npm.

$ npm install npm –global
└─┬ npm@5.0.2
├── abbrev@1.1.0
├── ansi-regex@2.1.1
….
├── wrappy@1.0.2
└── write-file-atomic@2.1.0

Finally, we need to add .node_modules_global/bin to our $PATH environment variable, so that we can run global packages from the command line. Do this by appending the following line to your .profile, .bash_profileor .bashrc and restarting your terminal.

export PATH=”$HOME/.node_modules_global/bin:$PATH”

Now our .node_modules_global/bin will be found first and the correct version of npm will be used.

$ which npm
/home/sitepoint/.node_modules_global/bin/npm
$ npm –version
5.0.2

The post A Beginner’s Guide to npm — the Node Package Manager appeared first on SitePoint.

Collective #508

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

C508_Handbook

Front-end Developer Handbook 2019

Cody Lindley wrote this guide that outlines and discusses the practice of front-end engineering, how to learn it and what tools are used when practicing it in 2019.

Check it out

C508_VC

Our Sponsor
Visual Composer founder had an AMA on Reddit – and he survived!

Here are the most surprising 5 things he’s learned from the community and the future he’s planning for Visual Composer. Bonus: there’s a great freebie at the end of his post, go check it out!

Discover more

C508_yuantalk

Generative Art with CSS

The translation of Yuan Chuan’s CSSConf talk by Chen Hui Jing.

Read it

C508_CodeGuppy

CodeGuppy

A place where kids and adults alike learn JavaScript coding through fun and easy to follow tutorials.

Check it out

C508_artdirection

Art Direction For The Web Using CSS Shapes

A tutorial by Andy Clarke where he goes beyond basic CSS Shapes and shows how you can use them to create five types of distinctive and engaging layouts for your art-directed designs.

Read it

C508_typora

Typora

A very minimal Markdown editor with a seamless writing and reading experience.

Check it out

C508_griditems

Controlling leftover Grid items with pseudo-selectors

Michelle Barker describes a technique for taking care of leftover grid items.

Read it

C508_svgload

Inline an SVG file in HTML, declaratively & asynchronously!

A fast and easy way to inline some remote SVG or HTML into your page. By Scott Jehl.

Check it out

C508_styleguide

CSS Grid: Style Guide

Olivia Ng created this great style guide with CSS Grid.

Check it out

C508_deno

Deno, a new way to JavaScript

A presentation by Ryan Dahl on the new TypeScript runtime for Node called Deno.

Watch it

C508_test

Domain-Oriented Observability

Pete Hodgson describes a pattern for adding business-relevant observability in a clean, testable way.

Read it

Screen-Shot-2019-04-15-at-22.55.10

CSS masonry with flexbox, :nth-child(), and order

Tobias Ahlin describes a CSS-only way of creating a masonry (or mosaic) layout.

Read it

C508_poster

Free Font: Postertoaster

A very artsy monospace typeface by Vsevolod Abramov.

Get it

C508_acc

Accessibility Events

An article by Mat Marquis about why we don’t want a way to know when a user has a disability.

Read it

C508_3dyuan

Chasing

Yuan Chuan’s awesome animation with a 3D look.

Check it out

C508_boilerplate

Three.js Boilerplater for CodeSandbox

Francesco Michelini created a really useful Three.js boilerplate to easily quickstart a project on CodeSandbox.

Check it out

Screen-Shot-2019-04-15-at-22.45.53

GLSL: Blinn-phong shading

An incredible GLSL sphere demo by Liam Egan.

Check it out

C508_deutschmeister

Free Font: Deutschmeister Moderne

Rick Lewik created this typeface as a homage to the Grobe Deutschmeister font.

Get it

C508_variable

Get a CSS Custom Property value with JavaScript

Andy Bell shows a trick for getting a CSS variable value with JavaScript.

Read it

C508_editor

Editor

In case you didn’t know about it: a real-time, responsive HTML/CSS/JS code editor.

Check it out

C508_spiral

Whirling

A fantastic spiral demo by Yuan Chuan. Support on Chrome and Firefox.

Check it out

Screen-Shot-2019-04-15-at-22.46.16

Instagram Layout built in CSS Grid, Flexbox and Vue

A fully responsive take on the Instagram app layout using CSS Grid and Flexbox for the implementation of the layout and VueJS for the processing of the data.

Check it out

C508_pixelcorner

Pixel borders

A SASS mixin to add pixelated borders to HTML elements.

Check it out

C508_hooks

React Hooks Cheat Sheet

A React hooks cheat sheet with live editable examples.

Check it out

C508_reactsvg

From Our Blog
Pulling Apart SVGs with Reusable WebGL Components Using React-three-fiber

Learn how to pull apart SVGs in 3D space with Three.js and React, using abstractions that allow us to break the scene graph into reusable components.

Check it out

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

What’s New For Designers, April 2019

Original Source: https://www.webdesignerdepot.com/2019/04/whats-new-for-designers-april-2019/

We’re all about learning tools this month in our round of up new resources and tools for designers. From games to books to tutorials, there’s something new for everyone to learn and enjoy.

If we’ve missed something that you think should have been on the list, let us know in the comments. And if you know of a new app or resource that should be featured next month, tweet it to @carriecousins to be considered!

CSSBattle

Jump to the top of the CSSBattle leaderboard by using CSS skills to replicate targets with the smallest possible code. Put your skills to the test in this fun way to test your knowledge. New targets being added as well so you can keep going and moving up in the rankings.

UX Agenda

UX Agenda is a compilation of conferences, meetups and workshops in a single, searchable location. Look for events near you or add your own UX events for free.

Codetalks.tv

Codetalks.tv is a collection of the best talks about coding around the world in one place. Watching any of the videos is free. Look for talks from specific conferences or by topic.

Static Pages

Static Pages allows you to publish any static page on a WordPress website with any URL in a matter of seconds. It also includes SEO optimization for ease of use.

Static Pages – Upload Static HTML Pages to WordPress

Javascript Grammar

Javascript Grammar is an educational e-book offering from Greg Sidelnikov, also known as @js_tut or JavaScript teacher on twitter. You can get it on Amazon, with a tweet or direct from the author.

Illustration Gallery

Illustration Gallery is a collection of royalty-free illustrations for projects. It’s updates weekly with plenty of options for personal or business use in a clean, modern style.

Neort

Neort (which is still in beta) is a digital art gallery where you can share artwork and how it was created. Upload work with a short description and gather feedback on it from a community of artists. Think of it as the artist version of Dribbble.

Geenes

Geenes is a color scale tool to help you generate color palettes for user interface elements and then export the hues for Sketch or other programing tools.

Color Review

Color Review is a tool to help you test contrast between color elements in a design. This can help you ensure that foreground and background elements have enough contrast to be read with ease by all users and is a great accessibility tool. Use it online or download the app.

Spider

Spider is a tool that helps you turn websites into organized data without coding. Add the extension to Google Chrome to start scraping data; just point and click to collect the data you need.

Code2Flow

Code2Flow is a tool to describe workflows and patterns in an easy (and visual) format. Create and build flowcharts in seconds and don’t worry about needing more complicated drag and drop tools. And it’s all interactive.

Mosaic

Mosaic is a front-end JavaScript library for building user interfaces. It uses a component-based system and has an extremely small library size.

Humane by Design

Humane by Design is a project by Jon Yablonski to provide information about designing ethically humane digital products. From the site: “The exponential growth of mobile technology has ushered in an age where time and attention is an increasingly scarce resource. Instead of technology enhancing our abilities as humans, we’ve seen it become a vehicle for extracting our attention, monetizing our personal information, and exploiting our psychological vulnerabilities. As designers, we play a key role in the creation of such technology, and it’s time we take responsibility for the impact that these products and services we build are having on people it should serve.”

Outdoor Icon Pack

The Ultimate Outdoor Icon Pack includes 64 editable vector icons and a checklist for adventure designs. The flat line styles are trendy and easy to use.

Friendly Faces

Friendly Faces is an inclusive avatar generator. Pick random options or adjust specifics to find an avatar that looks more like you. Then download and share.

Remix Icon

Remix Icon is a set of open source line-style icons in a variety of categories. Use them as part of a consistent design system or as stand-alone elements.

Asian Adventure Icons

Asian Adventure is a colorful set of 76 flat icons that represent Asian culture and elements. Icons comes in AI, SVG and PNG formats.

Tutorial: How to Make a Speech Synthesis Editor

This great – and detailed – tutorial from Smashing Magazine helps you understand the logic behind the technology powering all the voice assistants in our homes. This guide helps you create a “What You Get is What You Hear editor for digital speech synthesis.

Tutorial: How to Create Clipped, Blurred Background Images in CSS

This tutorial takes you through creating seamless blur effects using CSS filters for a trending photo look. The tutorial includes written and video instructions and is easy to follow.

Tutorial: All You Need to Know About Hyphenation in CSS

How do you feel about hyphenation on the web? It can be a somewhat touchy subject. This tutorial by Richard Rutter explains hyphenation dictionaries for the web and related CSS guidelines.

Tutorial: How to Organize Files in a Design Agency

It’s an age-old question: How to you best organize design files? The team at Clay digital agency go behind the curtain on their process, and you can definitely learn from their workflows and file structures.

Generative Poster

Generative Poster is a fun pen that will allow you to adjust parameters and create an abstract poster design quickly. Just adjust the controls to see changes as they happen and keep tweaking until you find the right design.

Lovely Puppy

Lovely Puppy is a light and cheerful display font for children’s or whimsical purposes. The download includes a font duo with the sans serif and script versions as well as a set of doodles and patterns.

Melvick

Melvick is a strong, display sans serif. It has a distinct style with upright letterforms with some disconnected strokes. This typeface includes uppercase characters and numerals.

Public Sans

Public Sans is a strong neutral typeface for various uses. The family includes thin, extra light, light, regular, medium, semibold, bold, extra bold and black variations. Plus, you can join the development on GitHub. The typeface is a variation of Libre Franklin.

Pulpo

Pulpo is a Clarendon style typeface with the skeleton of Century Schoolbook. Longer extenders give text a bit more air to breathe and improve legibility in small text sizes. Despite the strength and sturdiness of the design, each letter shape carries warmth and an echo of the human hand. The familiarity of the letterforms also conceals some nostalgia. The family has 10 styles, ranging from light to black (including italics) and is ideally suited for editorial, advertising and packaging as well as web and app design. A massive body combined with low stroke contrast, emphasizing the horizontal elements, make it very suitable on screen and for small text sizes on newsprint paper.

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;}

Get a massive 41% off Corel Painter 2019

Original Source: http://feedproxy.google.com/~r/CreativeBloq/~3/HCEotnSRmgo/get-41-off-corel-painter-2019

Looking to up your painting game? Corel Painter 2019 will help you create your next masterpiece. Though it typically costs $429, it's currently on sale with 41% off at just $249.

This painting tool is one of our picks for the best software for digital artists. And rightly so. With over 900 different brushes in 25 different types of brush categories, Corel Painter 2019 is a must-have in the arsenal of any digital artist. It boasts the most realistic Natural Media and exclusive particles, pattern pens, thick paint brushes and even more – so anything you dream up you'll be able to paint perfectly. 

Since artists are known to be particular, everything is totally customisable. Import brushes, custom palettes, textures and gradients as you wish. Auto-Painting Panels make prepping, auto-painting and restoring details even easier. And thanks to Corel Painter's multi-core processors and CPUs you'll be able to create your masterpieces faster than before.

Start making masterpieces today with Corel Painter 2019. It's available for $249 here.

Related articles:

Create portrait art in Corel PainterThe 29 best iPhone apps for designers20 illustrators to follow on Instagram

Friday Game Design: Tsuvatt Run of Fury

Original Source: http://feedproxy.google.com/~r/abduzeedo/~3/8s6ZS_RJ5-0/tsuvatt-run-fury-game-design

Friday Game Design: Tsuvatt Run of Fury
Tsuvatt Run of Fury Game Design

abduzeedoApr 12, 2019

The 80s are definitely back after the amazing Stranger Things Netflix show. For some it never went away and some of the designers that I admire the most are masters at keeping the style of that decade alive. One of the cool things about it is of course the video-games. The pixelated badass action games like Double Dragon. We used to play that like crazy. Tsuvatt Run of Fury mobile game design is a project that brings back the 80s in style.

Tsuvatt Run of Fury was created and shared by Roman Sokolov a design and illustrator from Minsk, Belarus. For more information make sure to check out his Behance profile.

Game Design


Collective #507

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

C507_WOTW

Inspirational Website of the Week: Home Société

A delightful and refreshing scroll experience with some experimental elements. Our pick this week.

Get inspired

C507_tm

Our Sponsor
HTML Membership

Get lifetime free templates and plugins. Work with the best visual HTML drag and drop builder you’ve ever seen.

Try it now

C507_stackoverflow

Developer Survey Results 2019

The results of Stackoverflow’s survey that was answered by nearly 90,000 developers on how they learn and level up, which tools they’re using, and what they want.

Check it out

C507_quiz

Well-aimed?

Test how well you know CSS selectors with this interactive quiz by Paulina Hetman.

Check it out

C507_display

Digging Into The Display Property: The Two Values Of Display

Rachel Andrew takes a closer look at the CSS display property, a workhorse of a property that doesn’t get a lot of attention.

Read it

C507_city

Citybound

An amazing city building game that uses microscopic models to vividly simulate the organism of a city arising from the interactions of millions of individuals.

Check it out

C507_designtools

What design tools get wrong

An interesting article by Kilian Valkhof on the limitations of modern design tools.

Read it

C507_acctools

Color accessibility: tools and resources to help you design inclusive products

Stéphanie Walter shares some useful resources, tips and tools she regularly uses to build and check the color accessibility of products.

Read it

C507_Puplicsans

Free Font: Public Sans

A strong, neutral, principles-driven, open-source typeface for text or display.

Get it

C507_tunnel

Floating heart

A mesmerizing demo by Yuan Chuan.

Check it out

C507_toggle

How to create a custom radio switch in CSS

Claudia Romano shows how to create a custom accessible radio switch.

Read it

C507_structure

Rocking JS data structures!

Areknawo explores the new data structures in JavaScript that came with ES6 and shows how useful they can be.

Read it

C507_spider

Spider

A Chrome extension by Amie Chen that lets you turn websites into organized data without coding.

Check it out

C507_snake

Writing a Snake Game for the Terminal in Object-Oriented JavaScript (Node.js)

A tutorial by Tania Rascia where you’ll learn how to code a Snake game in JavaScript.

Read it

C507_uxconf

UX Agenda

A website that collects design conferences, workshops and meetups.

Check it out

C507_antimedium

Long-form websites and typography

A very interesting article by Eric Lawler on the art of creating stable, long-term websites and content.

Read it

C507_rickrolled

GitHub got rickrolled

Follow this tweet by GitHub and check out Muhammad Mustadi’s amazing GIF hacked GitHub profile.

Check it out

C507_env

Why you should use CSS env()

Harry Nicholls explains how you can use the upcoming CSS env() feature.

Read it

C507_amp

Google AMP lowered our page speed, and there’s no choice but to use it

An unsettling review of Google’s Accelerated Mobile Pages (AMP).

Read it

C507_perf

Perflink

Live JavaScript benchmarking where you can see results graphed out as you type.

Check it out

C507_nails

Nails

Teeny-tiny, satisfying scratchy hand. Simply epic. By Char Stiles.

Check it out

C507_chriscss

JavaScript vs. CSS – More control means more responsibility

Chris and Sadek talk about when is it best to use JavaScript over CSS, and should we all learn CSS as we learn JavaScript? Read the transcript here.

Watch it

C507_localstorage

Don’t trust the locals: investigating the prevalence of persistent client-side cross-site scripting in the wild

Some valuable insights into the vulnerabilities of local storage.

Read it

C507_sticky

From Our Blog
How to Create a Sticky Image Effect with Three.js

Daniel Velasquez shows how to code a recreation of the sticky image effect seen on the websites of MakeReign and Ultranoir using three.js.

Check it out

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

Designing Better Mobile Experiences for All of Your Clients’ Websites

Original Source: http://feedproxy.google.com/~r/Designrfix/~3/b-Kb0Np6ID0/designing-better-mobile-experiences-for-all-of-your-clients-websites

As a design agency professional, you must design your clients’ websites with a mobile-first approach in mind. Mobile-first user experiences make it easy for visitors to find what they’re looking for quickly and encourage them to take action. Doing so can help increase conversions and boost sales. With this in mind, in this article, we’ll […]

The post Designing Better Mobile Experiences for All of Your Clients’ Websites appeared first on designrfix.com.

Art Direction For The Web Using CSS Shapes

Original Source: https://www.smashingmagazine.com/2019/04/art-direction-for-the-web-using-css-shapes/

Art Direction For The Web Using CSS Shapes

Art Direction For The Web Using CSS Shapes

Andrew Clarke

2019-04-11T13:30:16+02:00
2019-04-11T17:35:05+00:00

Last year, Rachel Andrew wrote an article that took a new look at CSS Shapes in which she reintroduced readers to the basics of using CSS Shapes. For anyone keen to understand how to use properties like shape-outside, shape-margin, and shape-image-threshold, Rachel’s is the ideal primer.

I’ve seen many examples of using the properties, but very few go beyond Basic Shapes, including circle(), ellipse(), inset(). Even examples using polygon() shapes rarely go far beyond them. Considering the creative opportunities CSS Shapes offer, this is disappointing. But, I’m sure that with a little inspiration and imagination, we can make more distinctive and engaging designs. So, I’m going to show you how to use CSS Shapes to create the following five different types of layout:

V-shapes
Z-patterns
Curved shapes
Diagonal shapes
Rotated shapes

A Little Inspiration

Sadly, you won’t find many inspiring examples of websites which use CSS Shapes. That doesn’t mean that inspiration isn’t out there — you just have to look a little further afield at advertising, magazine, and poster design. However, it would be foolish for us to merely mimic work from a previous era and medium.

You can find inspiration in surprising places, such as these vintage advertisements.

You can find inspiration in surprising places, such as these vintage advertisements.

For the past few years, I’ve filled Dropbox folders with inspiration and I really ought to move those examples to Pinterest. Fortunately, Kristopher Van Sant has been more diligent than me in compiling a Pinterest board full of inspiring ‘Shapes Of Text’ examples.

Shapes add energy to design, and this movement draws people in. They help to connect an audience with your story and make tighter connections between your visual and written content.

When you need content to flow around a shape, use the shape-outside property. You must float an element left or right for shape-outside to have any effect.

img {
float: <values>;
shape-outside: <values>;
}

NB: When you flow content around shapes, be careful not to allow any lines of text to become too narrow and fit only one or two words.

It often needs surprisingly little markup to develop dynamic and original layouts. My HTML for this series of five designs consists only of a header and main elements, figures, and images, and is often no more complicated than this:

<header role=”banner”>
<h1>Mini Cooper</h1>
</header>

<figure>
<img src=”mini.png” alt=”Mini Cooper”>
</figure>

<main>

</main>

1. V-Shapes

For me, one of the most incredible aspects of modern-day CSS is that I can create a shape from the alpha channel of a partially transparent image with no need to draw a polygon path. I only need to create an image, and then a browser will take care of the rest.

I think this is one of the most exciting additions to CSS and it makes developing art direction for the web more straightforward, especially if you work with a content management system and dynamically generated content.

Left: Without CSS Shapes, this design feels dull and lifeless. Right: Creating v-shapes makes this design more distinctive and engaging.

Left: Without CSS Shapes, this design feels dull and lifeless. Right: Creating v-shapes makes this design more distinctive and engaging.

To develop shapes from images, they must have an alpha channel which is either entirely or partially transparent. I needn’t draw a polygon to enable content to flow between the triangular shapes either side of my content in this first design; instead, I need only specify the URL of an image file as the shape-outside value:

[src*=”shape-left”],
[src*=”shape-right”] {
width: 50%;
height: 100%;
}

[src*=”shape-left”] {
float: left;
shape-outside: url(‘alpha-left.png’);
}

[src*=”shape-right”] {
float: right;
shape-outside: url(‘alpha-right.png’);
}

CSS Shape Example

Watch out for CORS (cross-origin resource sharing) when using images to develop your shapes. You must host images on the same domain as your product or website. If you use a CDN, make sure it sends the correct headers to enable shapes. It’s also worth noting that the only way to test shapes locally is to use a web server. The file:// protocol simply won’t work.

Generated Content

As Rachel explained in her article:

“You could also use an image as the path for the shape to create a curved text effect without also including the image on the page. You still need something to float, however, and so for this, we can use Generated Content.”

As an alternative to alpha channel, I can use Generated Content — applied to two pseudo-elements — one for a polygon triangle on the left, the other for the right. My running text will now flow between the two generated shapes:

main::before {
content: “”;
display: block;
float: left;
width: 50%;
height: 100%;
shape-outside: polygon(0 0, 0 100%, 100% 100%);
}

main p:first-child::before {
content: “”;
display: block;
float: right;
width: 50%;
height: 100%;
shape-outside: polygon(100% 0, 0 100%, 100% 100%);
}

NB: Bennett Feely’s CSS clip-path maker is a fabulous tool for working out coordinate values for use with CSS Shapes.

Adjusting the width of alpha images at several breakpoints allows the shape of this running text to best suit its viewport.

Adjusting the width of alpha images at several breakpoints allows the shape of this running text to best suit its viewport.

2. Z-Patterns

A Z-pattern is a familiar path our eyes follow when reading content from left–right, top–bottom. By placing content along the hidden lines which form a Z, these patterns help guide a reader along this path, from where we’d like them to start reading towards a destination such as a call-to-action. Z-patterns can be either discreet — implied by focal points or elements with higher visual weight — or made obvious using CSS Shapes.

The z-pattern created by driving a narrow column of running text between two shapes suggests speed and the fun people will have when driving this iconic little car.

The z-pattern created by driving a narrow column of running text between two shapes suggests speed and the fun people will have when driving this iconic little car.

In this next design, a discreet z-pattern is formed as:

The large image spans the full page width, the end-point emphasised with a right aligned headline.
A block of running text is formed by two CSS Shapes.
The thick top border on a figure acting as a footer completes the Z.

There’s no need for complicated markup to implement this design and my simple HTML includes just three elements:

<header role=”banner”>
<h1>Mini Cooper:icon of the ’60s</h1>
<img src=”banner.png” alt=”Mini Cooper”>
</header>

<main>
<img src=”placeholder-left.png” alt=”” aria-hidden=”true”>
<img src=”placeholder-right.png” alt=”” aria-hidden=”true”>

</main>

<figure role=”contentinfo”>

</figure>

My page-width spanning header and figure needs no explanation, but flowing text between two triangular shapes is a little more complicated. To implement this z-pattern design, I choose to include two tiny 1×1px placeholder images onto which I apply two larger, shape-forming images using shape-outside. By attaching an aria-hidden attribute to these images, a screen reader won’t describe them.

After giving the two shape images the same dimensions,
I float one image left and the other to the right, which allows my running text to run between them:

[src*=”placeholder-left”],
[src*=”placeholder-right”] {
display: block;
width: 240px;
height: 100%;
}

[src*=”placeholder-left”] {
float: left;
shape-outside: url(‘shape-right.png’);
}

[src*=”placeholder-right”] {
float: right;
shape-outside: url(‘shape-right.png’);
}

Left: A presentable but predictable design which lacks energy. Right: CSS Shapes suggest fun and speed.

Left: A presentable but predictable design which lacks energy. Right: CSS Shapes suggest fun and speed.

The iconic Mini Cooper was fast and fun to drive. While my design would be perfectly presentable without a z-pattern formed by CSS Shapes, this layout looks predictable and lacks energy. The z-pattern created by driving a narrow column of running text between two shapes suggests speed and the fun people will have when driving this iconic little car.

3. Curved Shapes

One of the most fascinating aspects of CSS Shapes is how I can create elegant shapes using the alpha channel from a partially transparent image. This shape can be anything I imagine. I only need to create the image, and a browser will flow content around it.

While confining content to within a shape has been proposed in the CSS Shapes Module Level 2 specification, there’s currently no way to know if and when this might be implemented in browsers. But while shape-inside isn’t available (yet!), that doesn’t mean I can’t create similar results using shape-outside.

Left: Another presentable, but predictable design. Right: A more distinctive look created by using CSS Shapes.

Left: Another presentable, but predictable design. Right: A more distinctive look created by using CSS Shapes.

By confining my content within a curved image floated right, I can easily add a distinctive look to this next design. To create the shape, I again use the shape-outside property, this time with the value being the same URL as my visible image:

[src*=”curve”] {
float: right;
width: 400px;
height: 100vh;
shape-outside: url(‘curve.png’);
}

To put some distance between my shape and the content flowing around it, the shape-margin property draws a further shape outside the contours of the first one. I can use any CSS absolute length unit — millimeters, centimeters, inches, picas, pixels, and points — or relative units (ch, em, ex, rem, vh, and vw):

[src*="curve"] {
shape-margin: 3rem;
}

More Margins

Adding movement to this curved design relies on more than CSS Shapes. Using viewport width units, I give my headline, image, and running text a different left margin, each one proportional to the width of the viewport. This creates a diagonal from the back of my headline to the front of the car:

h1 {
margin-left: 5vw;
}

img {
margin-left: 10vw;
}

p {
margin-left: 20vw;
}

4. Diagonal Shapes

Angles can help make layouts look less structured and feel more organic. The absence of clear structure encourages the eye to roam freely around a composition. This movement also causes an arrangement to feel energetic.

I see designs set around horizontal and vertical axes every day, but rarely anything based on a diagonal. Every once in a while, I spot an angled element — perhaps a banner graphic with its bottom sloping — but it’s rarely essential to a design.

It’s common to see content flowing around shapes in print design, but this was impossible to achieve on the web before CSS Shapes.

It’s common to see content flowing around shapes in print design, but this was impossible to achieve on the web before CSS Shapes.

Even though CSS Grid involves setting columns and rows, there’s no reason why it can’t be used to create dynamic diagonals. This next design needs just a header and main element:

<header role=”banner”>
<h1>Mini Cooper</h1>
<img src=”banner.png” alt=”Mini Cooper”>
</header>

<main>
<img src=”shape.png” alt=””>

</main>

To create the diagonal detail in this design, I again flow content around a shape image which itself is floated left. Again I use the shape-outside property with the same URL value as my visible image and a shape-margin to put distance between my shape and the content flowing around it:

[src*=”shape”] {
float: left;
shape-outside: url(‘shape.png’);
shape-margin: 3rem;
}

Given that responsiveness is one of the web’s intrinsic properties, we can rarely predict how content will flow, but we avoid designs like this one. When there’s too little space for all my running text to fit above the shape, the fact that each shape is floated means that content will flow into space below the shape.

5. Rotated Shapes

Why settle for just using CSS Grid and Shapes when adding Transforms to the mix can enable layouts which were unimaginable only a few years ago? In this final example, flowing text around the cars in this image, while at the same time rotating the entire composition needed a combination of all those properties.

Why settle for using only CSS Grid and Shapes?

Why settle for using only CSS Grid and Shapes?

As the image of these cars has no transparent alpha channel, flowing text around the shapes, it contains needs a second image which includes only alpha channel information.

Implementing this design requires two images; one visible, the other proving alpha channel information.

Implementing this design requires two images; one visible, the other proving alpha channel information.

This time, I float the visible image right and apply the shape-outside property with a URL value which matches my alpha channel image:

[src*=”shape”] {
float: right;
width: 50%;
shape-outside: url(‘alpha.png’);
shape-margin: 1rem;
}

You may have noticed that both my images contain elements which I rotated clockwise by ten degrees. With those images in place, I can rotate the entire layout ten degrees in the opposite direction to give the illusion that my images are upright:

body {
transform: rotate(-10deg);
}

I rotate this layout just enough to make the design more appealing, without sacrificing readability.

I rotate this layout just enough to make the design more appealing, without sacrificing readability.

Bonus Example: Polygon Shapes Sculpt Columns

An extract from ‘Art Direction for the Web’ available from 26th March 2019.

You can create strong, structural shapes with nothing more than type. Combining polygon() shapes and pseudo-elements, you can sculpt shapes from solid blocks of running text, in the style of Alexey Brodovitch and his influential work for Harper’s Bazaar.

Left: These beautiful numerals are almost too lovely to hide. They’re also perfect for carving into those columns. Right: When I use invisible pseudo-elements with no background or borders to develop polygon shapes, the result is two unusually shaped columns.

Left: These beautiful numerals are almost too lovely to hide. They’re also perfect for carving into those columns. Right: When I use invisible pseudo-elements with no background or borders to develop polygon shapes, the result is two unusually shaped columns.

I formed these columns from two article elements, i.e. with a gutter between them and a maximum width, which help maintain a comfortable measure:

body {
display: grid;
grid-template-columns: 1fr 1fr;
grid-gap: 2vw;
max-width: 48em;
}

Because there are two article elements and I also specified
two columns for my grid, there’s no need to be specific about the position of those articles. I can let a browser place them for me, and all that remains for me is to apply shape-outside to a generated pseudo-element in each column:

article:nth-of-type(1) p:nth-of-type(1)::before {
content: “”;
float: left;
width: 160px;
height: 320px;
shape-outside: polygon(0px 0px, 90px 0px, […]);
}

article:nth-of-type(2) p:nth-of-type(2)::before {
content: “”;
float: right;
width: 160px;
height: 320px;
shape-outside: polygon(20px 220px, 120px 0px, […]);
}

The Pay-Off

Now that Firefox has released a version which supports CSS Shapes, and has launched a Shape Path Editor inside its Developer Tools, there’s now only Edge without support for Shapes. This situation will soon change now that Microsoft has announced a change from their own EdgeHTML rendering engine to Chromium’s Blink, the same engine as Chrome and Opera.

Tools like CSS Shapes now give us countless opportunities to use art direction to capture readers’ attention and keep them engaged. I hope by now you’re as excited about them as I am!

Editorial’s Note: Andy’s new book, Art Direction for the Web (pre-order your copy today), explores 100 years of art direction and how we can use this knowledge and the newest web technologies to create better digital products. Read an excerpt chapter to get a taste of what the book has to offer.

Further Resources

“Art Direction for the Web,” Andy Clarke
“Take A New Look At CSS Shapes,” Rachel Andrew
“CSS Shapes,” MDN web docs, Mozilla
“Edit Shape Paths In CSS,” MDN web docs, Mozilla
“Art Direction For The Web: A New Smashing Book,” Smashing Magazine

Smashing Editorial
(mr, ip, il)

3 Tips to Improve the Composition of Video Content by Cropping

Original Source: http://feedproxy.google.com/~r/Designrfix/~3/mJA2bGo0XKc/3-tips-to-improve-the-composition-of-video-content-by-cropping

Cropping a video is about much more than just removing part of its frame. Instead it is a powerful tool that will let you directly improve the composition of your videos. To do that however, you need to make sure that you take advantage of what the crop feature can do and use it to […]

The post 3 Tips to Improve the Composition of Video Content by Cropping appeared first on designrfix.com.