How to Create an Editable Line Chart in Adobe Illustrator

Post pobrano z: How to Create an Editable Line Chart in Adobe Illustrator

Final product image
What You’ll Be Creating

In the following steps, you will learn how to create a fully editable line chart in Adobe Illustrator and how to easily adjust its style.

First, you will learn how to create the starting line chart using the Line Graph Tool. Using the Group Selection Tool and the Graphic Styles panel along with some basic colors and effects, you will learn how to stylize the main components of your chart. Taking full advantage of the Appearance panel, you will learn how to add a frame to your chart and how to apply subtle shading and highlights. Finally, you will learn how to easily adjust the data on your chart.

For more inspiration on how to adjust or improve your final chart, you can find plenty of resources at GraphicRiver.

What You Will Need

You will need the following in order to complete this project:

1. How to Create a New Document and Set Up the Starting Chart

Step 1

Hit Control-N to create a new document. Select Pixels from the Units drop-down menu, enter 850 in the width box and 665 in the height box, and then click that More Settings button. Select RGB for the Color Mode, set the Raster Effects to Screen (72 ppi), and then click Create Document.

Don’t forget to set the unit of measurement to pixels from Edit > Preferences > Units. All these options will significantly increase your work speed.

new document

Step 2

Focus on your toolbar and double click the Line Graph Tool to open the Graph Type window. Enter the attributes shown in the following image and then click OK.

graph type

Step 3

Make sure that the Line Graph Tool is selected and simply click on your artboard to open the Graph window. Set both Width and Height to 350 pt, and then click OK.

Enter the data shown below and then click that Check button. Your graph should look roughly as shown in the following image.

line graph tool

2. How to Adjust the Text on the Chart

Step 1

Pick the Group Selection Tool and focus on the column of text from your chart design. Click once on one of those pieces of text to select it, and then click a second time on the same text to select all the text from that column. You can use the Group Selection Tool to easily select multiple elements with similar attributes from your graph.

Make sure that these pieces of text remain selected and open the Character panel (Window > Type > Character). Select the Krona One font, set the size to 15 px, and change the text color to R=81 G=90 B=95.

adjust text

Step 2

Using that same Group Selection Tool, select the numbers from your chart. Focus on the Character panel, change the font to Krona One font, and set the size to 12 px and the text color to R=81 G=90 B=95.

group selection tool

3. How to Adjust the Line Separators on the Chart

Step 1

Focus on the bottom side of your graph and pick the Group Selection Tool. Select all horizontal and vertical paths (highlighted in the first image), go to the Appearance panel, and simply remove the existing stroke color. This should basically make your selected paths invisible.

invisible stroke

Step 2

Focus on the left side of your graph, select that long, vertical path, and remove its stroke color.

horizontal path

Step 3

Using the Group Selection Tool, select the tiny horizontal paths from your chart (highlighted in the first image). Focus on the Appearance panel, set the stroke color to R=81 G=90 B=95, and then open the Stroke fly-out panel. Make sure that the Weight is set to 1 px and check the Round Cap button.

Keep focusing on the Appearance panel and add a second stroke using the Add New Stroke button. Select the bottom stroke from the panel, lower its Opacity to 20%, and then go to Effect > Distort & Transform > Transform. Enter the settings shown below and click OK.

add new stroke

Step 4

Make sure that your tiny horizontal paths are still selected and keep focusing on the Appearance panel. Add a new stroke, drag it below the other two strokes, and select it.

Change the color to black (R=0 G=0 B=0), lower its Opacity to 20%, and go to Effect > Distort & Transform > Transform. Enter the settings shown below (in the left window), click OK, and go again to Effect > Distort & Transform > Transform. Enter the settings shown below (in the right window) and click OK.

transform effect

Step 5

Select only the bottom tiny path and focus on the Appearance panel. Remove the top and bottom strokes, select the remaining stroke, and increase the Opacity to 100%.

delete stroke

4. How to Add a Frame to Your Chart

Step 1

Pick the Move Tool (V) and select your entire graph. Focus on the Appearance panel and use the Add New Fill button to add a new fill.

Make sure that the fill lies below the Contents section and select it. Set the color to R=30 G=38 B=41 and go to Effects > Convert to Shape > Rectangle. Enter the settings shown below, click OK, and go to Effect > Stylize > Rounded Corners. Set the Radius to 20 px, click OK, and go to Effect > Distort & Transform > Transform. Enter the attributes shown in the following image, click OK, and go to Effect > Stylize > Drop Shadow. Enter the settings shown below and click OK.

frame

Step 2

Make sure that your entire graph is still selected and keep focusing on the Appearance panel. Add a second fill and drag it below the existing one.

Select this new fill, lower its Opacity to 70%, change the color to black, and go to Effect > Convert to Shape > Rectangle. Enter the settings shown below, click OK, and go to Effect > Stylize > Rounded Corners. Set the Radius to 20 px, click OK, and go to Effect > Distort & Transform > Transform. Enter the attributes shown in the following image, click OK, and go to Effect > Blur > Gaussian Blur. Set the Radius to 15 px and click OK.

gaussian blur

5. How to Stylize the First Line on the Chart

Step 1

Pick the Group Selection Tool and select the five segments that make up the top line of your line chart. Focus on the Appearance panel and select the stroke. Change the color to R=246 G=178 B=33 and make sure that the Weight is set to 2 px.

yellow line

Step 2

Focus on your yellow line and select one of the black squares that indicate the end point of a line segment. Focus on the Appearance panel, remove the stroke color, and change the fill color to R=246 G=178 B=33.

yellow square

Step 3

Make sure that your yellow square stays selected and keep focusing on the Appearance panel. Select the entire path (simply click that Path section from the Appearance panel) and go to Effect > Path > Offset Path. Enter a 2 px Offset, click OK, and go to Effect > Stylize > Rounded Corners. Enter a 5 px Radius and click OK.

rounded corners

Step 4

Make sure that your yellow square is still selected and keep focusing on the Appearance panel.

Add a second fill and select it. Change its blending mode to Soft Light and apply the linear gradient shown below.

linear gradient

Step 5

Make sure that your yellow square is still selected and keep focusing on the Appearance panel.

Add a third fill and select it. Set the color to R=30 G=38 B=41 and go to Effects > Path > Offset Path. Enter a -3 px Offset, click OK, and go to Effect > Stylize > Drop Shadow. Enter the attributes shown below and click OK.

offset path

Step 6

Make sure that your yellow square is still selected and keep focusing on the Appearance panel.

Drag the stroke below the existing fills and select it. Set the color to R=30 G=38 B=41 and open the Stoke fly-out panel. Change the Weight to 2 px and check the Align Stroke to Outside button.

align stroke

Step 7

Make sure that your yellow square is still selected and keep focusing on the Appearance panel. Select the yellow fill and apply the two Drop Shadow effects shown below, starting with the left one.

drop shadow

Step 8

Make sure that your yellow square is still selected, open the Graphic Styles panel, and click the New Graphic Style button.

graphic style

Step 9

Pick the Group Selection Tool and select the other black squares that go along your yellow line. Once selected, simply apply your style from the Graphic Styles panel.

apply graphic style

Step 10

Focus on the bottom row of your legend and select that horizontal path. Change the stroke color to R=246 G=178 B=33, increase the Weight to 2 px, and don’t forget to check the Round Cap button from the Stroke fly-out panel.

Move to the black square, select it, and simply apply your graphic style from the Graphic Styles panel.

legend

6. How to Stylize the Other Lines on the Chart

Step 1

Move down to the next line from your line chart. Use the Group Selection Tool to select all segments of this line and change the stroke color to R=255 G=118 B=4.

Select the black squares that go along the orange line and apply your graphic style. Make sure that all these shapes remain selected and focus on the Appearance panel. Select the yellow fill and replace that color with R=255 G=188 B=4.

orange line

Step 2

Move down to the next line from your line chart. Use the Group Selection Tool to select all segments of this line and change the stroke color to R=190 G=74 B=124.

Select the black squares that go along the purple line and apply your graphic style. Make sure that all these shapes remain selected and focus on the Appearance panel. Select the yellow fill and replace that color with R=190 G=74 B=124.

purple line

Step 3

Move down to the next line from your line chart. Use the Group Selection Tool to select all segments of this line and change the stroke color to R=40 G=118 B=221.

Select the black squares that go along the blue line and apply your graphic style. Make sure that all these shapes remain selected and focus on the Appearance panel. Select the yellow fill and replace that color with R=30 G=118 B=221.

blue line

Step 4

Move down to the next line from your line chart. Use the Group Selection Tool to select all segments of this line and change the stroke color to R=0 G=165 B=0.

Select the black squares that go along the green line and apply your graphic style. Make sure that all these shapes remain selected and focus on the Appearance panel. Select the yellow fill and replace that color with R=0 G=165 B=0.

green line

7. How to Add a Background and Edit the Chart

Step 1

Pick the Rectangle Tool (M) and create an 870 x 685 px shape. Fill this rectangle with R=81 G=90 B=95, send it to back (Shift-Control-[) and make sure that it covers your entire canvas.

background

Step 2

Finally, remember that you can always edit the data from your chart, and your design will not change.

Here’s how you can easily do it: Make sure that your chart is selected, right click anywhere on your artboard, and go to Data. Adjust your data and then click that check button.

edit chart

Congratulations! You’re Done!

Here is how it should look. I hope you’ve enjoyed this tutorial and can apply these techniques in your future projects. Don’t hesitate to share your final result in the comments section.

Feel free to adjust the final design and make it your own. You can find some great sources of inspiration at GraphicRiver, with interesting solutions to improve your design.

final product

Vue + TypeScript: A Match Made in Your Code Editor

Post pobrano z: Vue + TypeScript: A Match Made in Your Code Editor

Vue is so hot right now and I’ve been thinking of doing a serious project with it since quite a while, so when the opportunity popped up, I hopped in. But there was a little problem — one of the requirements of the project was to write it in TypeScript. At first, I was super stressed about how I was going to ever get started on this combo, but vue-cli made it so easy.

I’d be lying if I said this ride was super smooth. There were frustrations, hours of staring at the screen and some fistbumps with my table but after working with Vue + TypeScript for over a month now, I can say it was worth it — and if I had to code another app with Vue, I wouldn’t do it without TypeScript.

Prerequisites

This article is about pairing Vue and TypeScript and assumes some basic knowledge of both. If you haven’t had a chance to play with them yet and are curious, Vue has a great guide, and the TypeScript docs are a great place to start.

We need to have vue-cli installed globally, so we can quickly spin up Vue project. Install vue-cli by running the following command in your terminal:

npm install -g @vue/cli

Once we have that installed, we’re good to go. If you don’t have TypeScript installed, we don’t need to do that beforehand, as vue-cli takes care of that when you start a new project and choose TypeScript there.

Getting Started

Now that we have vue-cli installed, all we need to do to get a project with Vue + TypeScript started is to run vue create. While creating a new project, choose TypeScript and we’re good to go.

vue create <app-name>

Here’s the result once our project spins up:

vue-cli also provides us the ability to choose Babel along with TypeScript for polyfills, CSS preprocessors, linter, unit testing libraries (I picked Jest, go Jest!) along with other config. You can even save your choices in a preset, to use it later, for another project.

Here’s a rundown of the handy questions you’ll get asked to configure the project:

One thing I’d like to mention is that vue-cli 3.0 comes with a user interface which makes it even more easy to create a new project. Run vue ui in terminal and vue-cli opens a UI where you can set up a new project.

What’s in the Box

After vue-cli is done, we get a nice directory structure of our app with all the setup already done.

  • tsconfig.json: This is all set up and we can edit it to suit our requirements.
  • shims-vue.d.ts: These shims are already set up to help TypeScript understand .vue files (Single File Components) when they are imported.
  • vue-property-decorator: If you choose to use class-style components, vue-cli adds this plugin so we can use all sorts of decorators. This comes quite handy and make the code more readable.
  • Class components: If you choose to use them, vue-cli sets the stage for you. Bear in mind that you would still need to register router hooks so class components can resolve them.

Sass Setup

One thing that I needed to set up and I wish was included out of the box was shared Sass partials. To avoid importing my Sass variables and mixins in every component, I had to load them in vue.config.js. shared.scss is the file exporting all variables and mixins that are used within the app.

Here’s where I landed with my Sass configuration:

chainWebpack: (config) => {
   config
     .module
     .rule('vue')
     .uses
     .get('vue-loader')
     .tap(({ loaders, loaders: { scss }, ...options }) => ({
       ...options,
       loaders: {
         ...loaders,
         scss: [
           ...scss,
           {
             loader: 'sass-resources-loader',
             options: {
               resources: [
                 './src/styles/shared.scss',
               ],
             },
           },
         ],
       },
     }));

Vue Property Decorator

The vue-property-decorator package exposes Vue properties and makes them available to use as decorators. In my application, I ended up using only @Component, @Prop, @Watch but there are others such as @Emit, @Inject and @Model, that make your code much more verbose when used extensively.

Vuex

Vuex has typings…nuff said! Vuex supports TypeScript to boot and, at first, I didn’t even know it. I started to look for proper ways to combine Vuex with TypeScript and stumbled upon Alex Jover Morales’ egghead.io course on Vue.js State Management with Vuex and TypeScript. It helped me understand the correct way of managing Vuex state when using TypeScript.

For example:

// actions.ts
import { ActionTree } from 'vuex';
import { RootState, ModuleState } from '@/types';


const actions: ActionTree<ModuleState, RootState> = {
  // all your actions go here
};

Vuex-class

This is yet another thing that I didn’t know existed when I first started but know wish I had found it sooner. I was creating getters for almost everything, but that didn’t feel right. I started looking for better ways to do this and found an interesting article by Francesco Vitullo which cleared up a few things for me. That’s where I found out about vuex-class which provides decorators for all vuex mappers.

So, now instead of writing a new getter for simply accessing a property in state, I could do this:

import {
  State,
} from 'vuex-class'

@Component
export class MyComp extends Vue {
  @State(state => state.bar) stateBar
}

Development Experience With VS Code

With TypeScript, the coding experience on VS Code is so much better. There is no going back and forth to check what mutation types I declared in mutation-types.ts because VS Code can recognize them and suggest correct ones as I type.

The same goes for modifying state in mutations — with TypeScript, the editor knew what my state structure looks like and suggests correct properties.

If you’re using VS Code, I strongly recommend using the Vetur plugin because it provides Vue tooling and comes with other bells and whistles like syntax highlighting (this works great with Vue single file components) and linting right out of the box.

Final Thoughts

Just like everything else in the JavaScript ecosystem, Vue + TypeScript still has a long way to go. For example, I could not use vuelidate because it doesn’t have typings. But thankfully vee-validate provided a workaround, so I didn’t have to go down the difficult road of writing those myself.

In conclusion, I found the development experience to be much smoother and VS Code is a totally different beast when you work with TypeScript. I don’t really need to sing the praises of Vue — it is very easy to pick up and start building and saves days trying to wrap your head around the inner workings of a framework.

The post Vue + TypeScript: A Match Made in Your Code Editor appeared first on CSS-Tricks.

Design deals for the week

Post pobrano z: Design deals for the week

Every week, we’ll give you an overview of the best deals for designers, make sure you don’t miss any by subscribing to our deals feed. You can also follow the recently launched website Type Deals if you are looking for free fonts or font deals.

5,000 High-Quality Graphic Resources

You’re looking at 5,000 graphic elements including illustration, logo, seamless patterns, watercolor textures, backgrounds, badges, fonts, borders, florals and more. With so many resources at your fingertips, that means you can spend more time working on your designs and expanding your client base.

 $14 instead of $3000 – Get it now!

Beautiful Solomon Font Family (12 fonts)

Fonts can be so much fun to work with. Whether you’re creating a logo, a T-shirt or a funky poster, having the right font can make all the difference. If you’re looking for something new, something clean, and something fun, you’ve come to the right place. This Mighty Deal offers up the Solomon Font Family, from Fontfabric, at a ridiculously reduced price.

$9 instead of $279 – Get it now!

50 Fabulous Fonts from Vintage to Modern

Meet the Summer Typographic Collection chock full of 50 fonts. You’ll be privy to a wide variety of styles ranging from vintage to cartoon, and script to monograms, not to mention a slew of extras like alternates and ligatures. No matter your latest project, you’re bound to find the perfect font in this collection.

$10 instead of $150 – Get it now!

50 Custom Clear Labels from StickerMule

Promoting yourself or your business is a sticky situation! This fantastic Mighty Deal from StickerMule will get you 50 Custom Clear Labels that clock in at 3″ x 3″ and are printed in full color, plus white ink for a “no label” type of appearance. You’ll get free worldwide shipping, free online proofs, free artwork setup and a super fast 4-day turnaround.

$9 instead of $65 – Get it now!

10 Professional Script Fonts

If you’re looking to give your typeface toolbox a boost, you’ve come to the right place. This deal features 10 highly legible PUA encoded fonts. Elegant in nature, these script fonts feature a variety of extra characters to give you some real flexibility in your designs.

$7 instead of $144 – Get it now!

International Artist Feature: Denmark

Post pobrano z: International Artist Feature: Denmark

Welcome back to our International Artist Series.

Today
we’re catching up with five incredible artists from Denmark, a Scandinavian country with a love of design. I
asked each artist how
their country and culture inspired their work, and they delivered great
responses.

Mani Zamani

Mani is a digital artist and product designer living in Vejle, Denmark. Drawing from his diverse inspirations, he creates futuristic handmade and digital crafts that are creative and intriguing.

See more in his portfolio and follow him on Instagram.

The PhoneMaster

I love the open
minded mentality in Denmark and the appreciation of art and design even on a daily
basis. There’s such simplicity and very quick access to almost everything.

The PhoneMaster
The PhoneMaster

Extraterrestrial Aristocrats

My works are a mix of what I daydream, or see and experience. I’ve lived in four different countries and although I never directly
pinpoint the culture of where I live in my work, I do use some visual
nodes from that specific area. Denmark has a rich design heritage and I
do appreciate the pure minimalism and pastel colors with accents
they use in their everyday objects.

Extraterrestrial Aristocrats
Extraterrestrial Aristocrats

The Zoo Series: Whale

The Zoo Series Whale
The Zoo Series: Whale

Calm Kayak

I live in Vejle although I spend the majority of the day designing toys
for a toy company in Billund. I participate and organize workshops with a friend of mine in a cultural center here, and the community is very open to any new ideas that celebrate
creativity.

Calm Kayak
Calm Kayak

Melany Vilchynska

Melany is an illustrator and graphic designer currently living in Copenhagen, Denmark. Featuring bold colors and unique concepts, her illustrations are clever and inspiring.

See more in her portfolio.

Cosmo I

I am from Ukraine but currently live in Denmark. I
enjoy this country a lot, it is small but there are so many places you
can go and just catch pure inspiration. People are also an important
part of living „Danishly.”

They are cheerful, they always smile to you
if you exchange glances, and they are always ready to help. I think their
secret is just that they have a positive approach to life.

Cosmo I
Cosmo I

Illustrations for Polish Magazine

I recently became more courageous in my artwork and have tried more techniques to find new ways to make my illustrations more rich and interesting.

Denmark is the country where people like to express
themselves and are not afraid of being judged. It helps a lot since we
are always thinking that something in our drawings may not be accepted or
warmly welcomed by society.

Illustrations for Polish magazine
Illustrations for Polish Magazine

Psychologia dla Rodziców

Psychologia dla Rodzicw
Psychologia dla Rodziców

Illustrations for Polish Magazine

Here, design is a key. Folks love to pay attention to every detail and
create comfortable and well-designed spaces around them. It influences every
aspect of life.

Copenhagen is full of art museums and galleries which
are all separate worlds, presenting a variety of époques and artists.
But the first thing you learn is how to save money so you can buy only that
lamp which you saw in a small shop and have already started dreaming about.

Illustrations for Polish Magazine
Illustrations for Polish Magazine

Rune Elias

Rune is a visual artist and designer living in Copenhagen, Denmark. His work is subtle yet unique, and often communicates strong themes in various styles.

See more in his portfolio.

CPH:DOX Poster

I love the summer here which is the only reason I’m staying, the other 8 months are straight up hell!

CPHDOX Poster
CPH:DOX Poster

Movie Poster: Where Have All The Good Men Gone?

I’m living in Copenhagen, hanging around with good and weird people,
which inspires me the most! The culture of hanging out at different
brown Bodegas definitely gives my work some edge. And it’s how people understand what they are seeing in
the easiest way.

Movie Poster Where Have All The Good Men Gone
Movie Poster: Where Have All The Good Men Gone?

No Title

No Title
No Title

Formaldehyde

The art community is always fun here. I mostly only mingle with the „art community” when there is free beer!

Formaldehyde
Formaldehyde

Michelle Carlslund

Michelle is an illustrator and poster maker living in Copenhagen, Denmark. Featuring flat illustrations with lots of patterns and textures, Michelle’s work is beautifully hand crafted.

See more in her portfolio and follow her on Instagram.

The Golden Collection

Even though I am not very fond of winter I really love seeing the
seasons change in Denmark. The sense of euphoria that happens when we have the
first day of spring is the best. It is like everyone is in love with the
world all at once!

I also love the Scandinavian design tradition; the
minimal, clean and functional designs using a lot of natural materials
like wood, metals and stone. My own work is a bit more colorful but it
looks really nice when you combine all the colors with the neutral and
calm surroundings.

The Golden Collection
The Golden Collection

Michelle Carlslund x Södahl

I think that the color palette I use is quite typical for Danish and
Scandinavian design. I adapted some of their clean
lines and simplicity and added it to my illustration style.

Denmark is a really nice place to live as an illustrator because
we have a lot of dark winter months here. They’re perfect for
staying inside, coming up with ideas and drawing all through the
winter!

Michelle Carlslund x Sdahl
Michelle Carlslund x Södahl

Forest Poster

Forest Poster
Forest Poster

Peacock

We have a lot of creatives and entrepreneurs in Denmark in many
different fields. I think the creative scene is quite innovative and I
see so many great things happening and ideas coming to life.

Peacock
Peacock

Johanna Wurm

Johanna is a creative designer living in Aarhus, Denmark. With a specialty in brand design and illustration, her work features heartwarming creations you’ll love.

See more in her portfolio and follow her on Instagram.

Spring Chinchilla Illustration

Denmark is a place of high standards in all aspects of life, which makes
my work both challenging and a great deal of fun. I am very lucky to have some great influences around me.

Spring Chinchilla Illustration
Spring Chinchilla Illustration

Cute Bunny Textile

People appreciate and
value design in Denmark and they are willing to pay for it. This gives me the
opportunity to constantly push myself to be better at my craft.

Cute Bunny Textile
Cute Bunny Textile

Branding for Aalborg Zoo

Branding for Aalborg Zoo
Branding for Aalborg Zoo

Kernehuset Branding

The art
community is very vibrant here. In my
experience, to fit into the Danish design culture you need to elevate the
quality, push your boundaries and do it with passion. People are open and passionate about their
work and it is common to work as a team.

Kernehuset Branding
Kernehuset Branding

Many thanks to the artists who took time to answer my
questions and share a bit about themselves and how their country and/or culture
has affected their work. You can check out more of their work in the links
below:

Better rendering for variable fonts

Post pobrano z: Better rendering for variable fonts

I was messing around with a variable font the other day and noticed this weird rendering issue in the latest version of Chrome where certain parts of letterforms were clipping into each other in a really weird way. Thankfully, though, Stephen Nixon has come to the rescue with a temporary hack to fix the issue which using a text-shadow on the text that’s using the variable font:

.variable-font {
  text-shadow: 0 0 0 #000; /* text color goes last here */
} 

Once you do that, you shouldn’t be able to see those weird clip marks in the letterforms anymore. Yeah, it feels pretty hacky but I’m sure this rendering bug will be fixed relatively soon. It doesn’t look like it affects other browsers, as far as I can tell.

Direct Link to ArticlePermalink

The post Better rendering for variable fonts appeared first on CSS-Tricks.

How to Create an Abstract Poster Using the Puppet Warp Tool in Adobe Photoshop

Post pobrano z: How to Create an Abstract Poster Using the Puppet Warp Tool in Adobe Photoshop

Final product image
What You’ll Be Creating

Creating posters is difficult when images are not of optimal size. Here is a trick to create an abstract poster when you either don’t have a good enough image or you want to create something outside the box!

What You Will Need

You will need the following resources in order to complete this project:

1. How to Create a Photoshop Document

Step 1

In Photoshop, go to File > New. Name the document Abstract Poster. Set the Width to 1270 px and Height to 1600 px. Set the Resolution to 72 Pixels/Inch. Click OK.

Create a new Photoshop file

Step 2

Let’s start by adding a black background. On the Layers panel, click on Create a New Fill or Adjustment Layer > Solid Color and choose black as the background.

Add a solid black color background

Step 3

Drag the Building Exterior Wall from Envato Elements by Liufuyu into the Photoshop window. Double click to unselect.

Place the building image into the file

2. How to Use the Puppet Warp Tool

Step 1

For this tutorial, we will be using the Puppet Warp tool to create an interesting abstract image. Head over to Edit > Puppet Warp. This action will apply many triangle shapes to the image. These shapes are the density in which you will be able to edit. You can change this by going to the Options bar and clicking on Density. For this tutorial, we will be using Normal, so set the Mode to Normal and Expansion to 0 px.

Use the Puppet Warp tool on the building image

Step 2

When you hover over the image, you will notice a pin with a plus sign. This will allow us to add points to the image to hold them to a specific place. Click on the top left quadrant—anywhere is fine. 

At this point, nothing will happen. In order for this to work, we need to move these pins around, so we need to place several of them. Click in the opposite direction and move the pin around. 

Create more than two points with the Puppet Warp tool to edit the image

Step 3

Now that we know how the Puppet Warp tool works, add pins on the image and move them around.

Something to remember here is that there is no right or wrong—this is an abstract poster, and pretty much anything goes! 

Create multiple points with the Puppet Warp tool and move them around

Step 4

You can edit the points after you’ve moved them around. Simply head over to the Layers panel and click on the dropdown arrow on the building layer. Double-click on the Puppet Warp layer settings and edit away!

I ended up with the image below. Press Enter when you are done to set the image.

You can edit after youve set on your image on the layers panel

3. How to Use Clipping Masks

Step 1

On the Layers panel, click Create New Fill or Adjustment Layer > Black & White. We want this layer to be applied only to the one below, so while selecting the Black and White layer, Right click > Clipping Mask. To see if this is working, check that the layer has an arrow on the left side pointing down, meaning it will only affect the layer below it.

Add a new black and white adjustment layer and create a clipping mask

Step 2

Add a new layer on the Layers panel. We want to add color blotches on the building. On the toolbar, select the Brush tool. Right click on the page, and set the Size to 300px and Hardness to 0%.

Use the following color codes to create strokes over the layer.

  • Pink: #e21efc 
  • Cyan: #11fdfb
  • Blue: #0018ff
  • Green: #11fdc3
Add a new layer and use the brush to apply different color strokes

Step 3

Set the Blending Mode of the layer with the strokes to Multiply on the Layers panel. Again, we want this layer to be applied only to the two layers below it, and we can do this with Right click > Create Clipping Mask. To see if this is working, check that the layer has an arrow on the left side pointing down, meaning it will only affect the layers below it.

Let’s group these three layers by selecting them and dragging them to the folder on the bottom of the Layers panel.

Set the new layer to multiply and create a clipping mask

Step 4

We want to create a glitchy poster, so let’s move the Group 1 folder to the right side of the page. We want it to go over the margin. Duplicate the folder by pressing Command-J and rename it to Group 2. Then place it in the opposite direction. I am placing them at different heights to add movement.

Create a folder with the layers we created and duplicate it to place on the left side of the poster

Step 5

Let’s create a line between the objects to make it appear like a glitched image. On the toolbar, select the Line Tool (U) and draw a line vertically, holding Shift to draw a straight line. Head over to the Options bar, select white for the Stroke, and set the Shape Stroke Width to 3 pt and the Width to 6 px.

Yo create a misplaced glitchy poster draw a line in between the two objects

Step 6

On the Layers panel, add a new layer and, as before, use the Brush Tool (B) and add strokes of different colors to be applied to the line.

  • Pink: #e21efc 
  • Cyan: #11fdfb
  • Blue: #0018ff
  • Green: #11fdc3

When you are done, while selecting the layer, Right click > Create Clipping Mask.

Add different color brush strokes on a new layer and create a clipping mask over the new line we created

Step 7

Let’s add some more details. Add a new layer on the layers panel; the goal for this will be to add strokes with the same colors as above, but this time they will be applied to the whole poster.

Using the Brush Tool (B), create strokes on the poster. We will edit them in the next step.

  • Pink: #e21efc 
  • Cyan: #11fdfb
  • Blue: #0018ff
  • Green: #11fdc3
Create colored strokes on a new layer again

Step 8

While selecting the layer, choose Filter > Blur > Motion Blur.

Use the Motion Blur effect on the layer we created

Step 9

Move the layer below all the grouped layers. Using the Rectangular Marquee Tool (M), select the areas you’d like to delete. I am deleting things after/before the line we created as this poster is intended to look glitchy and displaced.

Move the layer below all the grouped layers and using the Marquee Tool delete some spots

Step 10

Add a Layer Mask to the strokes layer and use the Brush Tool (B) in black to erase and soften a few spots. Set the Opacity to 80%.

Set the opacity to 80 Add a layer mask and use a black brush to soften some spots

4. How to Add Text Details

Step 1

Let’s go back to the top of the layers. Use the Text Tool (T) to add text. I used Chinese characters to add more interesting shapes to the poster: 步步高升. I used Kozuka Gothic Pr6N in 47pt size, but feel free to use any font in any language! 

I am placing this initial text on the lower right side of the stroke.

Add text details

Step 2

Let’s duplicate these letters and place them on the background. I am placing two on either side of the stroke and changing the Opacity to 15%.

Multiply the text details and resize for prominence Move them to bottom of the layers

Step 3

As before, let’s add a new layer and add color strokes to it, and we’ll also create a Clipping Mask for both of these text layers. Start by applying the strokes on one layer, duplicate it, and then move them to apply a Clipping Mask as in the steps before.

Also feel free to use black on this layer to create a “barely there” look. 

Add a new layer with color strokes and create clipping masks to the text layers

Step 4

Let’s add more text, this time with words related to metamorphosis. I added this twice: “1. denoting a change of position or condition. Metamorphosis.” I set it in RNS Sanz from Envato Elements in 25 pt. 

Duplicate the text layer above by pressing Command-J, and while selecting the duplicated layer, Right click > Rasterize Type.

Add a few more text details and duplicate Rasterize one of the text layers

Step 5

Head over to Filter > Liquify. The Liquify option window will open. Use the Forward Warp Tool and set the Tools options: Brush Size to 300, Brush Density to 10 and Brush Pressure to 60. Click OK. 

Lower both the text layer and the rasterized layer to 40% Opacity.

Liquify the rasterized text layer

Step 6

Add one more text layer with the word “meta” to the left side of the poster to add balance. Rotate the layer vertically by pressing Command-T, and hold Shift for an even rotation.

I added one more word Meta to the top left side of the poster to add balance

Step 7

Let’s add some texture to the poster. Select all of the layers on the Layers panel and duplicate them by dragging them to the Create New Layer button. This action will duplicate all the layers and will keep them selected. While they’re selected, Right click > Merge Layer. 

Let’s add some noise by going to Filter > Noise > Add Noise.

Multiply all the layers and merge them to add texture add noise to the poster

5. How to Save a File

Head over to File > Save and save the file as you would normally. 

To save a JPEG file, head over to File > Save for Web or Shift-Options-Command-S. Select the file type you want to save the document in; I am choosing JPEG and setting 100 for Quality. Under Image size, you can change the pixel size of the image if you have any size constraints. 

On the bottom left-hand side, you can see a preview of the size of the file. This is useful when there are size constraints on a website and you need to lower the quality or the size of the image. 

Click on Save… to choose the location in the new window, and then click on Save again.

Save the poster

Congratulations! You’ve Finished This Tutorial!

In this tutorial, we’ve learned how we can make an image work for an abstract poster. Today we’ve learned:

  • how to use the Puppet Warp Tool
  • how to use Clipping Masks and how to apply them to specific layers
  • how to use layer styles
  • how to use the Liquify effect to add dimension to text

If you liked this tutorial, you might like these:

Handling Errors with Error Boundary

Post pobrano z: Handling Errors with Error Boundary

Thinking and building in React involves approaching application design in chunks, or components. Each part of your application that performs an action can and should be treated as a component. In fact, React is component-based and, as Tomas Eglinkas recently wrote, we should leverage that concept and err on the side of splitting any large chunking into smaller components.

Splitting inevitably introduces component hierarchies, which are good because they bloated components and architecture. However, things can begin to get complicated when an error occurs in a child component. What happens when the whole application crashes?! Seriously, React, why do the parent and sibling components have to pay for the sins of another component? Why?

Error Boundaries

React 16 came with a lot of goodies, one of which is error boundaries. Let’s consult the documentation and break down what it says about this gem because we can use it to spot errors where they occur and resolve them faster and with less headache!

Error boundaries are React components that catch JavaScript errors anywhere in their child component tree, log those errors, and display a fallback UI instead of the component tree that crashed. Error boundaries catch errors during rendering, in lifecycle methods, and in constructors of the whole tree below them.

That’s a lot of jargon but, like components, we can break it down into less complex chunks.

Error boundaries are React Components

This makes a lot of sense and useful because it’s a concept we have using all along. The difference is that juice was sprayed on it to make it different from a normal component. Still, don’t forget the basic idea that error boundaries are themselves React Components!

Error boundaries catch JavaScript errors anywhere in their child component tree

In case you have forgotten how children component tree work, here is an example:

<ParentComponent>
  <FirstChild>
    <FirstChildDaughter>
    </FirstChildDaughter>
  </FirstChild>
  <SecondChild>
  </SecondChild>
</ParentComponent>

We have two parent and three child components. According to what we have learned so far about error boundaries, we can replicate the above tree to:

<ErrorBoundaryComponent>
  <ParentComponent>
    <FirstChild>
      <FirstChildDaughter>
      </FirstChildDaughter>
    </FirstChild>
    <SecondChild>
    </SecondChild>
  </ParentComponent>
</ErrorBoundaryComponent>

By wrapping the whole tree up in an ErrorBoundaryComponent, we can catch any JavaScript errors that occur in its child components. Cool, right?

Error boundaries log those errors

When errors are caught, we want boundaries errors to do something with them, preferably something to tell us about the. Developers often make use of error logging platforms to monitor errors that occur on their software. With error boundaries, we can do the same.

Error boundaries display a fallback UI

Instead of displaying the whole annoying combo of reds in different shades, you can choose a customized user interface to display when an error occurs. That can come in super handy because it allows you to tailor errors in a style that makes it easier for you to read and scan. Super cool, right?

Like me, you’ll think that this means error boundaries will catch all JavaScript errors. Sadly, that’s not true. Here are errors that they will gracefully ignore:

  • Event handlers
  • Asynchronous code (e.g. setTimeout or requestAnimationFrame callbacks)
  • Server-side rendering
  • Errors thrown in the error boundary itself (rather than its children)

componentDidCatch()

The extra juice that makes a component an error boundary is componentDidCatch() — this is a lifecycle method that works like the JavaScript catch{} block, but for components. When an error is found in a child component, the error is handled by the closest error boundary. Only class components can be error boundaries.

componentDidCatch() accepts two parameters:

  • error: This is the error that was thrown
  • info: An object which contains a trace of where the error occurred

Error Boundary In Action

Say we are working on a feature that lists locations where conferences can be held. Something like this:

See the Pen error boundary 0 by Kingsley Silas Chijioke (@kinsomicrote) on CodePen.

The application lists locations from the Location component and the individual locations are output as Location Cards. We take a little extra care to ensure the name of each location is rendered in uppercase for consistency. For this tutorial purpose, we will add an empty object to the list of locations.

class Location extends React.Component {
  state = {
    locations: [
      {
        "name": "Ojo",
        "zone": "Lagos State",
        "region": "South West"
      },
      {
        "name": "Ahiazu Mbaise",
        "zone": "Imo State",
        "region": "South East"
      },
      {
        "name": "Akoko-Edo",
        "zone": "Edo State",
        "region": "South South"
      },
      {
        "name": "Anka",
        "zone": "Zamfara State",
        "region": "North West"
      },
      {
        "name": "Akwanga",
        "zone": "Nasarawa State",
        "region": "North Central"
      },
      {
        
      }
    ]
  }
  render() {
    return (
      <div>
        <div>
          <div>
            <h2>Locations</h2>
          </div>
        </div>
        <div>
          {this.state.locations
            .map(location => 
              <LocationCard key={location.id} {...location} />
          )}
        </div>
      </div>
    )
  }
}

const LocationCard = (props) => {
  return (
    <div>
      <hr />
      <p><b>Name:</b> {props.name.toUpperCase()}</p>
      <p><b>Zone:</b> {props.zone}</p>
      <p><b>Region:</b> {props.region}</p>
      <hr />
    </div>
  )
}

const App = () => (
  <div>
     <Location />
  </div>
)

ReactDOM.render(<App />, document.getElementById("root"));

If you run this in the browser, you will see an error similar to this screenshot:

A screenshot of the Type Error providing the error message Cannot read property toUpperCase of undefined. Background color is tan and there is a block of code with a light red background indicating where the error is in the code base.

That’s not totally helpful, so let’s apply an error boundary to handle help us out. First, we’ll create an ErrorBoundary component:

class ErrorBoundary extends React.Component {
  constructor(props) {
    super(props);
    this.state = {
      hasError: false,
      error: null,
      info: null
    };
  }
  componentDidCatch(error, info) {
    this.setState({
      hasError: true,
      error: error,
      info: info
    });
  }
  render() {
    if (this.state.hasError) {
      return (
        <div>
          <h1>Oops, something went wrong :(</h1>
          <p>The error: {this.state.error.toString()}</p>
          <p>Where it occured: {this.state.info.componentStack}</p>
        </div>
      );
    }
    return this.props.children;
  }
}

An initial state for hasError, error, and info is created. Then, the componentDidCatch() lifecycle method is added. If an error occurs in the constructor, render or lifecycle method of any of its children components, the hasError state will be changed to true. When this happens, the ErrorBoundary component renders and displays the error. But if there are no errors, the children of the ErrorBoundary component are rendered instead as we’d expect.

Next, we need to add both the ErrorBoundary and Location components to our main App component:

const App = () => (
  <div>
    <ErrorBoundary>
      <Location />
    </ErrorBoundary>
  </div>
)

See the Pen error boundary 2 by Kingsley Silas Chijioke (@kinsomicrote) on CodePen.

We don’t see that annoying TypeError UI anymore! Things are working!

There’s one little thing we can do to improve the app. If you check the code in the demo, you’ll see an empty object we added at the end. Is it possible to have the other credible locations render? Most definitely! Inside the Location component, we can wrap the LocationCard component with the ErrorBoundary component to scope error logging directly to the cards:

class Location extends React.Component {
  state = {
    locations: [
      {
        "name": "Ojo",
        "zone": "Lagos State",
        "region": "South West"
      },
      {
        "name": "Ahiazu Mbaise",
        "zone": "Imo State",
        "region": "South East"
      },
      {
        "name": "Akoko-Edo",
        "zone": "Edo State",
        "region": "South South"
      },
      {
        "name": "Anka",
        "zone": "Zamfara State",
        "region": "North West"
      },
      {
        "name": "Akwanga",
        "zone": "Nasarawa State",
        "region": "North Central"
      },
      {
        // Empty!
      }
    ]
  }
  render() {
    return (
      <div>
        <div>
          <div>
            <h2>Locations</h2>
          </div>
        </div>
        <div>
          {this.state.locations
            .map(location => 
            <ErrorBoundary>
              // Should render all locations, but the empty instance
              <LocationCard key={location.id} {...location} />
            </ErrorBoundary>
          )}
        </div>
      </div>
    )
  }
}

This time, the credible locations show, except the one that is empty. You can choose to wrap the whole component tree with an error boundary component once, or you can wrap different components at strategic places. The decision is up to you.

Wrapping Up

I encourage you to start making use of error boundaries in your applications. Similarly, it’s worth digging in a little deeper. For that, here are some issues in the React repo on Error Boundaries and event handles, go through them so you can see the current state of where things are at:

The post Handling Errors with Error Boundary appeared first on CSS-Tricks.

Agregator najlepszych postów o designie, webdesignie, cssie i Internecie