Wszystkie wpisy, których autorem jest admin

30+ Premium Adobe Photoshop Brushes and Tutorials

Post pobrano z: 30+ Premium Adobe Photoshop Brushes and Tutorials

Final product image
What You’ll Be Creating

Photoshop comes with a large and varied set of different brushes and brush tips, but one of the most useful features of the tool is the ability to use custom brushes. Custom brush tips allow for much more creative effects that simply are not possible with the default brushes. Using the custom brushes gives absolute control over the color and placement of the brush appearance. Learning how to use custom brushes is one of those necessary steps for increasing the quality of your digital artwork. The use and application of custom brushes feels almost limitless!

30+ Premium Photoshop Brushes

Creating your own custom brushes is a skill that has a lot of value and can be quite rewarding. But if you are a little short on time, resources, or inspiration there are a host of high-quality custom brushes available on Envato Market and Envato Elements.

30 Particle Photoshop Brushes

Let’s kick start this selection with this lovely particle pack. 30 Particle Photoshop Brushes comes with an awesome collection of 30 handcrafted particle brushes. Create an Envato Elements account today to unlock unlimited assets for one monthly fee!

30 Particle Photoshop Brushes
30 Particle Photoshop Brushes

Flame Wings Brushes

The Flame Wings Brushes from market author DreamWarrior contains 20 beautiful wing flame fractals brushes for Photoshop. This product is available for $6.

Flame Wings Brushes
Flame Wings Brushes

69 Watercolor Brushes for Photoshop

This wonderful set of Watercolor Photoshop Brushes contains 69 total brushes hand crafted with incredible textures. Enjoy 11 total textures included with this download.

69 Watercolor Brushes for Photoshop
69 Watercolor Brushes for Photoshop

9 Massive Grunge Brushes

The 9 Massive Grunge Brushes from market author scarab13 contains 9 massive grunge brushes at 2000×2000 resolution. This product is available for $7.

9 Massive Grunge Brushes
9 Massive Grunge Brushes

Nebula Photoshop Brushes

The Nebula Photoshop Brush pack contains 16 Photoshop brushes great for wallpapers, print, and photo effects. This pack is fully customizable, so you’ll be able to adjust the settings easily.

Nebula Photoshop Brushes
Nebula Photoshop Brushes

12 High Resolution Cloud Brushes

The 12 High Resolution Cloud Brushes from market author Folksnet contains 12 high-resolution cloud brushes with shapes and forms and with fine details. This product is available for $6.

12 High Resolution Cloud Brushes
12 High Resolution Cloud Brushes

Watercolor Brushes for Photoshop

This set of Watercolor Photoshop Brushes contains 30 gorgeous watercolor brushes for all your creative projects. A simple text file is also included with further instruction.

Watercolor Brushes for Photoshop
Watercolor Brushes for Photoshop

Bokeh Brushes

Bokeh Brushes from market author editingninja contains 13 bokeh brushes. This product is available for $4.

Bokeh Brushes
Bokeh Brushes

Natural Shades Brushes for Adobe Photoshop

This awesome set of Natural Shade Brushes contains 40 total brushes to paint over your work! Enjoy pressure sensitive brushes that work perfectly with any drawing tablet.

Natural Shades Brushes for Adobe Photoshop
Natural Shades Brushes for Adobe Photoshop

8 Line Burn Photoshop Brushes

The 8 Line Burn Photoshop Brushes from market author fawwaz contains 8 brushes of high-quality line burns. This product is available for $4.

8 Line Burn Photoshop Brushes
8 Line Burn Photoshop Brushes

40 Halftone Illustration Brushes for Photoshop

This epic set of Halftone Illustration Brushes contains 40 high quality Photoshop brushes you’ll want to download! Enjoy these amazing brushes to add a unique texture to your digital shading.

40 Halftone Illustration Brushes for Photoshop
40 Halftone Illustration Brushes for Photoshop

Brush Pack Professional

The Brush Pack Professional from market author kirk3d contains a classic art brush pack of realistic art tools for PS. This product is available for $9.

Brush Pack Professional
Brush Pack Professional

Machine Washed Photoshop Brush Presets

This lovely set of Machine Washed Photoshop Brush Presets contains 18 brushes inspired by natural textures. You’ll also receive a handy instructional guide for more help.

Machine Washed Photoshop Brush Presets
Machine Washed Photoshop Brush Presets

26 Watercolor Splatter Brushes

The 26 Watercolor Splatter Brushes from market author Motionreactor contains 26 High-Res Watercolour Splatter Brushes. This product is available for $6.

26 Watercolor Splatter Brushes
26 Watercolor Splatter Brushes

20 Splatter Brushes

This set of Photoshop Splatter Brushes contains 20 various splatters perfect for any messy project. Add a beautiful splatter element to your designs with this remarkable download.

20 Splatter Brushes
20 Splatter Brushes

30 Shattered Glass Brushes

The 30 Shattered Glass Brushes from market author kirk3d contains 30 Hi-Res Shattered Glass Brushes files. This product is available for $5.

30 Shattered Glass Brushes
30 Shattered Glass Brushes

Lens Flare & Stars Photoshop Brushes

This Lens Flare and Star Photoshop Brush pack contains 42 amazing brushes perfect for adding a little shine to your work. Get great results with these easy-to-use brushes and download today!

Lens Flare  Stars Photoshop Brushes
Lens Flare & Stars Photoshop Brushes

30 Optical Flare Brushes

The 30 Optical Flare Brushes from market author nada-images contains 30 optical flare brushes and transparent .png files. This product is available for $6.

30 Optical Flare Brushes
30 Optical Flare Brushes

Subtlecraft – Brushes

In this mega pack of Subtle Craft Photoshop Brushes, you’ll get a wonderful collection of 50 high resolution brushes. Also included is an awesome set of 50 textures perfect for retro effects.

Subtlecraft - Brushes
Subtlecraft – Brushes

Spotlight Brushes

The Spotlight Brushes from market author Codevz contains 15 spotlight brushes. This product is available for $5.

Spotlight Brushes
Spotlight Brushes

PSD Survival Brush Pack

Or get this super cool PSD Survival Brush Pack. This pack contains over 100 high quality Photoshop brushes perfect for any creative scenario. Enjoy fabulous textures and incredible creativity all in one download!

PSD Survival Brush Pack
PSD Survival Brush Pack

30 Hi-Res Custom Brushes – Nature

The 30 Hi-Res Custom Brushes – Nature from market author PrismaDesign contains a set of professional Photoshop brushes perfect for graphic designers and illustrators. This product is available for $6.

30 Hi-Res Custom Brushes - Nature
30 Hi-Res Custom Brushes – Nature

25 Soft Waves Photoshop Brushes

The 25 Soft Waves Photoshop Brushes from market author env1ro contains 25 abstract soft waves/smokes/flows in high resolution. This product is available for $4.

25 Soft Waves Photoshop Brushes
25 Soft Waves Photoshop Brushes

74 Handcrafted Splatter Brushes

Add some splashes to your designs with this set of 74 Handcrafted Splatter Brushes. This set contains incredible, detailed brushes you’ll definitely want in your arsenal. Download to access this pack today!

74 Handcrafted Splatter Brushes
74 Handcrafted Splatter Brushes

Snow & Rain Brushes

The Snow & Rain Brushes from market author nada-images contains 30 high-quality snow and rain brushes. This product is available for $6.

Snow  Rain Brushes
Snow & Rain Brushes

Metal Sparks – 20 Photoshop Brushes

The Real Fireball Brush Resource Kit from market author kirk3d contains 30 brushes, 30 high-quality jpg and 30 transparent png files of actual fireballs. This product is available for $6.

Photoshop Space Brushes

This cool set of Photoshop Space Brushes contains 10 photo realistic starscape brushes. Create a beautiful night sky with this easy-to-use set today!

Photoshop Space Brushes
Photoshop Space Brushes

Electrical Lightning Brushes

The Electrical Lightning Brushes from market author GrDezign contains 94 awesome high-quality lightning brushes. This product is available for $5.

Electrical Lightning Brushes
Electrical Lightning Brushes

30 Stroke Brushes

This beautiful set of Photoshop Stroke Brushes contains 30 artful brushes crafted from traditional media. Feel free to download the companion ink set for more incredible effects!

30 Stroke Brushes
30 Stroke Brushes

40 Halftone Photoshop Brushes

The 40 Halftone Photoshop Brushes from market author env1ro contains 40 halftone in high-resolution brushes. This product is available for $4.

40 Halftone Photoshop Brushes
40 Halftone Photoshop Brushes

Gouache & Acrylic Photoshop Brushes

The Gouache & Acrylic Photoshop Brushes from market author M-e-f contains 30 Photoshop brushes that imitate traditional acrylic and gouache tools! This product is available for $4.

Gouache  Acrylic Photoshop Brushes
Gouache & Acrylic Photoshop Brushes

Againts Alphabethical Brushes

This set of Against Alphabethical Brushes contains a wicked selection of 11 watercolor brushes we’re sure you’ll love. Dive into a grunge-inspired project with this collection today!

Againts Alphabethical Brushes
Againts Alphabethical Brushes

Abstraktt Shapes V2

The Abstraktt Shapes V2 from market author Shemul contains a collection of some smoky lines or random lines or just abstract brushes. This product is available for $5.

Abstraktt Shapes V2
Abstraktt Shapes V2

8 Birds Silhouette Brushes

The 8 Birds Silhouette Brushes from market author BenjaminnSmith contains 8 bird silhouette brushes at a good PS brush size. This product is available for $2.

8 Birds Silhouette Brushes
8 Birds Silhouette Brushes

Real Fireball Brush Resource Kit

In full disclosure, I pull double duty as an article writer and content developer for Envato Market. The following are brush packs of my own that are available on Envato Market, and I would ask that you might consider them as well as the brushes that are featured above.

The Real Fireball Brush Resource Kit from market author kirk3d contains 30 brushes, 30 high-quality jpg and 30 transparent png files of actual fireballs. This product is available for $6.

Real Fireball Brush Resource Kit
Real Fireball Brush Resource Kit

50 Vintage Woodblock Brushes

Last but not least, enjoy this amazing set of 50 Vintage Woodblock Brushes. Made from scratch, these textures reflect actual high quality woodblock textures. Download this set today to add a retro flair to your designs.

50 Vintage Woodblock Brushes
50 Vintage Woodblock Brushes

Photoshop Brush Tutorials on Envato Tuts+

Creating your very own custom brushes in Photoshop gives you ultimate control over your own resources. These tutorials will walk you through that process of crafting your very own creative custom brushes.

How to Create Your Own Light Ray Brushes From Scratch in Adobe Photoshop

In this tutorial you’ll learn an easy technique to create your own custom sun ray brushes. To do that, you’ll use different filters and color adjustments.

How to Create Your Own Light Ray Brushes From Scratch in Adobe Photoshop
How to Create Your Own Light Ray Brushes From Scratch in Adobe Photoshop

How to Create Your Own Fog Brushes in Adobe Photoshop

In this tutorial you will learn how you can easily create your own mist brushes using different filters and transformations. 

How to Create Your Own Fog Brushes in Adobe Photoshop
How to Create Your Own Fog Brushes in Adobe Photoshop

How to Create Custom Shattered Glass Brushes in Adobe Photoshop

Adding shattered glass to a design is a great way to introduce drama and interest. The visual depiction of broken glass is very evocative and full of energy and conflict. Creating it is full of technical challenges. Illustrating it is difficult and time consuming, but photographing it well is no easy task! In this Quick Tip, we will give you a great technique for safely generating shattered glass brushes in Adobe Photoshop.

How to Create Custom Shattered Glass Brushes in Adobe Photoshop
How to Create Custom Shattered Glass Brushes in Adobe Photoshop

How to Create Custom Brushes to Render Fur in Adobe Photoshop

In this tutorial we’ll create a small set of custom brushes from scratch and learn how to render animal fur with them. We’ll focus on rendering a fox tail in grayscale, using custom brushes and the Smudge Tool to create both soft and coarse fur, and using Blending Modes to add color and warmth to the rendered piece.

How to Create Custom Brushes to Render Fur in Adobe Photoshop
How to Create Custom Brushes to Render Fur in Adobe Photoshop

Create Your Own Blood Spatter Adobe Photoshop Brush

This tutorial covers the materials and techniques that can be used to create your own blood splatter brushes.

Create Your Own Blood Spatter Adobe Photoshop Brush
Create Your Own Blood Spatter Adobe Photoshop Brush

How to Create Custom Smoke Brushes in Adobe Photoshop

Smoke trails are elegant, beautiful, and amazing to watch. Thin wisps of smoke dancing through the air reveal just how fluid our atmosphere really is. The effect is deceptively simple, and the dynamics of it are dizzyingly complex. 

Recreating believable smoke in a digital environment is no easy task. However, capturing the practical effect is a much easier prospect. In this quick tip, I’ll share a technique that I use to create stunningly beautiful custom smoke brushes in Adobe Photoshop.

How to Create Custom Smoke Brushes in Adobe Photoshop
How to Create Custom Smoke Brushes in Adobe Photoshop

Create Your Own Grunge Brushes in Adobe Photoshop

It’s a fairly easy feat to create custom sets of grunge brushes in Adobe Photoshop once you have a couple of techniques down. The main ideas are to have a textured source and to play around with filters that manipulate the look of sketched-out lines and doodles. Join me below in creating a custom set of brushes, ready for painting with, using three sources of texture: scanned paper and objects, a stock photo, and manipulated doodles within Photoshop itself.

Create Your Own Grunge Brushes in Adobe Photoshop
Create Your Own Grunge Brushes in Adobe Photoshop

How to Create Custom Water Splash Brushes in Adobe Photoshop

Water splashes are a beautiful phenomenon. The randomness of liquid physics ensures that every splash is unique. The result is a natural struggle of the fluid as an external force flings it around and gravity insists it return to a resting state. This struggle takes place in the span of a fraction of a second, and it often happens too quickly for us to be able to capture and appreciate the simple majesty of the effect.

Because water splashes are so familiar, yet elusive, they make for excellent compositional elements. The image of a splash also conveys movement and mood. If you want to use them in your own designs, you probably consider purchasing stock images as your only option. This Quick Tip is here to show you that with a bit of effort, you too can create your own beautiful water splashes to use!

How to Create Custom Water Splash Brushes in Adobe Photoshop
How to Create Custom Water Splash Brushes in Adobe Photoshop

Create Your Own Rust Brushes From Scratch in Adobe Photoshop

Rust. That beautifully terrible oxidation of iron elements. It’s a fact of life in our world filled with metal and machines. Time and moisture take their toll, and even our most magnificent machines deteriorate. For digital artists who focus on photo manipulations, rust is a reliable way of adding realistic grunge, texture and realism to a piece. 

In this Quick Tip we will explore a method of rusting metal without having to wait for nature to do it for us! 

Create Your Own Rust Brushes From Scratch in Adobe Photoshop
Create Your Own Rust Brushes From Scratch in Adobe Photoshop

How to Make Your Own Watercolor Brushes in Adobe Photoshop

Creating custom watercolor brushes is as easy as dripping ink or watercolor paint onto paper. You will have custom, ready-to-paint brushes in no time thanks to this simple tutorial. Download the attached watercolor scans and follow the steps below to create your own set of drippy, splashy, and splattered brushes.

How to Make Your Own Watercolor Brushes in Adobe Photoshop
How to Make Your Own Watercolor Brushes in Adobe Photoshop

Brushes, Beloved Brushes

As you begin to explore the wonders of Photoshop Brushes, one of the things you should keep in mind is that having a massive selection of brushes loaded in Photoshop will soak up memory. It’s not unmanageable, but it can get out of hand if Photoshop has to load thousands of high-resolution brushes every time it starts. Consider keeping your .abr files stored in a separate folder and then loading that brush set as needed.

Custom Brushes in Photoshop are one of the most fun and interesting ways to add visual flavor and authentic texture to any digital work. Learn to love them and they will love you back.

Be sure to browse Envato Market and Envato Elements for more incredible resources.

How to Create the Justice League Logo With Adobe Photoshop & Illustrator

Post pobrano z: How to Create the Justice League Logo With Adobe Photoshop & Illustrator

Final product image
What You’ll Be Creating

In this tutorial, we are going to recreate logo of an upcoming movie, Justice League. In the movie, the logo was probably made using 3D software. But that won’t stop us from recreating it using Photoshop and Illustrator. We will use Illustrator to draw the logo’s shapes and then bring them into Photoshop to enhance its appearance. Let’s get started.

Get inspired with more amazing logos from GraphicRiver.

Tutorial Assets

The following assets were used in this tutorial:

1. How to Draw a Vector Outline

Step 1

First, we will draw the logo in vector software, Adobe Illustrator. You can draw it directly in Photoshop, if you want to. But personally I prefer Illustrator since it has better control for vector editing. In Illustrator, make a New Document (File > New). Any size is acceptable.

Create a new document

Step 2

Activate the Rectangle Tool and then click once on the empty canvas. A dialog box will pop up asking for the dimensions of the rectangle we want to make. Set it to 13 cm x 12 cm. Click the OK button to make the rectangle at exactly that size.

Draw a rectangle

Step 3

Make sure you have activated the Smart Guides (View > Smart Guides). Select the rectangle shape. Using Pen Tool, click on the center of its lower edge to add a new anchor point.

Add new point

Step 4

Pull the new anchor point down using the Direct Selection Tool while holding the Shift key.

Pull down the new point

Step 5

While the shape is selected, click Object > Path > Offset Path. Set a negative offset size until we have made the frame shape. Make sure the Preview option is selected, which will allow you to see the end result in real time.

Offset path

Step 6

Using Direct Selection Tool, select two anchor points on top. Add a small amount of radius corner from the Option Bar.

Add corner radius
Add corner radius result

Step 7

We’re done building the frame, so let’s move on to building the letters. You can try searching for a font type that matches the original letter shape, but in this tutorial we’ll draw them from scratch. We start with a rectangle shape as the base for the J letter.

Add a rectangle

Step 8

Duplicate the shape (Control-CControl-V) and then Rotate it 90°. Attach it onto the lower part of the J letter. Duplicate another shape and use it for the upper part of the J letter.

Add another rectangle
Resize the path
Add another path

Step 9

We need to move some anchor points using the Direct Selection Tool. Check out the following pictures for references.

Move the point
Move the point for the letter J

Step 10

Once you’re happy with the result, we need to combine all the shapes into a single letter J. Select the shapes and then click Unite on the Pathfinder panel.

Select all shapes and then click unite
J character

Step 11

Select all the anchor points and then add Radius Corner.

Apply corner radius to all points

Step 12

Add bigger Radius Corners to the two anchor points at the bottom of the J letter.

Add bigger radius

Step 13

Using a similar approach as in the previous steps, draw the L letter. We start with a rectangle. Make sure the rectangle shape has the same thickness as the one used in the J letter.

Draw L character

Step 14

Drag its right edge upward using the Direct Selection Tool.

Draw L character with direct selection tool

Step 15

Add another rectangle.

add rectangle to letter

Step 16

Select both shapes and Combine them into a single L letter.

Combine the shapes
L character result

Step 17

If we look closely at the vector path, we will notice that there are some unneeded anchor points, such as the two points shown below. It’s a good practice to always keep your path clean and free from unused anchor points. Click both points with the Pen Tool to remove them.

Remove unneeded points
Remove more unneeded points
Remove the last unneeded points

Step 18

Here are some more anchor points we want to remove.

Remove unneeded points on J
Remove points on letter J
Result after removing points

Step 19

Add a star shape using the Star Tool. Place it in the middle of the letters.

Draw star shape
Place star shape in the middle

Step 20

Select the star and then Copy it (Control-C). Then, select both the star and a letter. From the Pathfinder panel, select Subtract.

Subtract character using star shape
Result after subtracting star

Step 21

Hit Control-F to Paste the star object that we have copied earlier in the same place. Select the star and the remaining letter and then Subtract it from the Pathfinder panel.

Subtract other side of the star
result after both star shapes subtracted

2. How to Export Vector Paths to Photoshop

Step 1

We are done with the vector shapes, so let’s transfer them to Photoshop. Select all the shapes we have made and hit Control-C.

Copy paths from Illustrator and paste them into Photoshop

Step 2

Let’s open up Photoshop. Make a New File (Control-N).

Make new canvas in Photoshop

Step 3

Click the Add Adjustment Layer icon at the bottom of the Layers panel to add a Solid Color. In the next dialog box, select a dark color (#0e0f16) for the canvas background.

Set its background color to dark gray
Empty canvas in Photoshop

Step 4

Hit Control-V to Paste the vector path we made earlier in Illustrator. Paste it as a Shape Layer.

Paste paths into Photoshop as shape layer
Pasted shape result

Step 5

Double-click the layer shape thumbnail and change its color to a dark shade of gray (#414650).

Change the shape layer color

Step 6

Now, we want to move the letters and the frame into separate layers. This step will ease the editing process. Select the letters’ paths and then hit Control-Shift-J.

Move the character into its own layer
Separate the layers

Step 7

Change its color to a lighter shade of gray (#78757b).

Change the character color
Result after changing the color

Step 8

Repeat the process for its frame, and move it onto a separate layer. Keep in mind that now we have three shape layers: one for the JL letters, another for their frame, and another one for the pentagon shape background.

Change the frame color

Step 9

Make sure the letters’ layer shape is selected and then double-click the layer to add some styles. We want to add Bevel & Emboss to add a bit of 3D appearance onto the letters’ surface. Inner Glow and Gradient Overlay will help add lighting onto their surface. And Drop Shadow will lift the letters off their background.

Apply Bevel  Emboss into the character layer shape
Apply styles into the character layer shape
Apply Inner Glow into the character layer shape
Apply Gradient Overlay into the layer shape
Apply styles into the character layer shape
Apply Drop Shadow into the layer shape
Apply styles into the layer shape

Step 10

We also need to add styles onto the frame layer. For the frame, add a large Inner Glow with a sharp white to black Gradient to add metallic lighting onto the surface.

Apply bevel and emboss layer styles
Apply inner glow styles
Add gradient overlay to the logo elements
Gradient Editor
Add styles to the logo elements
Apply a Drop Shadow
Result after the layer styles are applied

Step 11

We also need to add styles to the logo background.

Add inner shadow
Inner shadow result
Add inner glow
Inner glow result
Add Satin Layer Style
Add Color Overlay
Result after layer styles

3. How to Apply Textures

Step 1

The logo appears three dimensional, but still too flat. To fix this, we need to add texture. Grab the metal texture number 4. Place it above the letters shape layer. Reduce its layer Opacity to 60% and then hit Control-Alt-G to convert the texture into a Clipping Mask.

Add metal texture
Apply metal texture
Set as a clipping mask

Step 2

Add another metal texture, this time number 8. Place it above the letters shape and just like the previous texture, convert it into a Clipping Mask.

Add metal texture 2
Apply metal texture 2

Step 3

Let’s add another texture, this time a marble one, to add random wavy lines across the letters. Hit D to reset the background and foreground color to their default settings, white and black. Make a New Layer and then make a new Selection covering the letters. Click Filter > Render > Clouds.

Add marble texture

Step 4

Click Filter > Render > Difference Clouds.

add the difference clouds filter

Step 5

Hit Control-F a few times to apply another Difference Clouds Filter. Once you get some interesting shapes, hit Control-Alt-G to convert it into a Clipping Mask and put the texture inside the letters shapes. In the Layers panel, change its Layer Blend Mode to Overlay and reduce its Opacity.

Create more difference clouds
Apply the texture

Step 6

And, of course, we need to add texture to the frame. This time, use a concrete texture. Place it above the frame, reduce its Opacity, and convert it into a Clipping Mask.

Add concrete texture
apply the concrete texture

Step 7

Add another metal texture, place it above the frame with low Opacity, and then convert it into a Clipping Mask.

Add metal texture
apply metal texture as clipping mask

Step 8

Don’t forget to add texture onto the logo background.

Add concrete texture to the logo
Apply concrete texture with a clipping mask

4. How to Add Lighting to the Background

Step 1

Add a New Layer and place it above the Justice League logo. Activate the Brush Tool. Right-click to open the list of available brushes. Select a Scatter Brush. Paint white inside the logo background.

Add subtle highlight inside the logo
Paint highlights with scatter brush

Step 2

Soften the brush stroke by applying a Gaussian Blur filter from Filter > Blur > Gaussian Blur. Use a big Radius Size until the stroke is completely blurred. In the Layers panel, reduce its Opacity and set its Layer Blend Mode to Overlay.

Blur the brush stroke
Apply the highlight

Step 3

Add another white brush stroke to add more lighting into the scene.

Repeat the lighting
Set the blend mode to overlay
Result after lighting application

Step 4

We still need to add stronger shadows to the letters manually. Add a New Layer and place it underneath the letters shape layer. Control-click the thumbnail of the letters layer to make a new selection based on its shape.

Make a selection of the letters

Step 5

Fill the selection with black. Then hit Control-D to remove the selection. Using the Move Tool, move the shadow a few pixels down. Keep the shadow soft by applying a Gaussian Blur filter (Filter > Blur > Gaussian Blur) and reducing its Opacity.

Create a shadow behind the letters
Blur the shadow
Lower the shadows opacity

Step 6

Let’s add another texture onto the logo. Make a New Layer and draw a selection covering the logo. Click Filter > Render > Clouds.

Add clouds texture

Step 7

Click Filter > Render > Difference Clouds a few times until you get an interesting texture.

Add more texture

Step 8

Click Image > Adjustments > Levels or hit Control-L. In the Levels dialog box, drag the white triangle until we have nice contrast inside the selection.

add a levels adjustment

Step 9

To isolate the texture in the letters and its frame, we’ll need masking. Control-click the letters thumbnail layer and then Shift-Control-click the frame thumbnail layers. Add a Mask to the shape layer and then set its Layer Blend Mode to Darker Color with 30% Opacity.

isolate the texture
Set blend mode to darker color

Step 10

We want to add depth into the scene. Paint white on a New Layer using a Soft Round Brush. If you want it to be softer, just apply a Gaussian Blur filter (Filter > Blur > Gaussian Blur). Reduce its layer Opacity and use Overlay for its Blend Mode.

Paint white onto a new layer
Set the blend mode to overlay

Step 11

Repeat this step to add another soft highlight on the scene.

Add more soft highlights

Step 12

Don’t forget to add the dark area. In the top left corner, paint a random black spot and keep it subtle by making it transparent. Add some Gaussian Blur if needed.

Paint dark pixel on the background

Step 13

Let’s add a grainy background to create a dark mood for the overall scene. To do this, add a New Layer and then Fill it with white. Click Filter > Noise > Add Noise. Make sure Monochromatic is selected. Click OK. Change the Layer Blend Mode to Multiply to preserve all the dark pixels and hide the white pixels from sight.

Add noise
Set the blend mode to multiply

Step 14

We want to add a blue shade into the background. From the Layers panel, add a Photo Filter and select Blue for its color. By default, the Photo Filter Adjustment Layer will affect every pixel underneath it. To confine it to the background, select its Layer Mask and paint over the logo with black.

Apply Photo Filter to the background
Paint on the photo filter mask

5. How to Add Lights and Reflections

Step 1

Make a New LayerControl-click the letters’ shape layer to make a new selection based on the letters shape. Click Edit > Stroke. In the dialog box, set white as its Stroke Color with a 1 px Width. Click OK to accept the result.

Add stroke
Apply the stroke

Step 2

Using the Eraser Tool with 0% Hardness, erase most parts of the stroke line and leave some on the letters’ corners.

Add light reflection

Step 3

Duplicate the stroke line and then apply the Gaussian Blur filter to soften the line. Reduce its layer Opacity to keep it subtle.

Apply a blur to the line

Step 4

Repeat the same procedure for its frame.

Add more light to the frame

Step 5

Zoom in on the center of the letters, right on the empty star area. Using a Soft Round Brush, dab once on a New Layer using light yellow as its color.

Use the brush tool to apply highlights

Step 6

Hit Control-T to Transform the brush stroke.

Transform the brush stroke

Step 7

Hold the Control key and then drag its corner to skew the brush stroke. Hit the Enter key to accept the transformation result.

Transform the light
Result after transformation

Step 8

Repeat the previous steps, add a quick dab of a brush stroke and then skew it. Repeat this a few times until we have enough light reflection to fill the gap.

Repeat the light reflection
Light reflectionr esult

Step 9

Behind the star reflection, paint white for a fill light on the logo background.

Fill the star background with light
Result after lighting

Step 10

We can add another light reflection on the other part of the logo where the light hits it. In this scene, the imaginary light source was placed in the top right corner. One of the best places for our next reflection is in the lower left part of the logo. Just like in the previous steps, we just need to paint a soft light yellow over the area.

Draw glow on the frame edge

Step 11

Make it more realistic by painting over it again using a smaller brush with white or another light color.

Add another light reflection
Add more reflection
Light result

Step 12

Using the same techniques, another light reflection is added to the top right corner. Considering this is where the imaginary light source was placed, the reflection should be bigger and stronger.

Add big light reflection on top right corner

Final Result

This is our final result. As you can see, we did a lot of manual painting and added some subtle highlights to keep the scene realistic. We also relied on textures to easily add realism to the shape.

Thank you for reading, and I hope you’ve learned some useful techniques from this simple tutorial. If you do follow along, please make sure to upload the result in the comments below—I’d love to see it.

Justic League Logo Photoshop and Illustrator Tutorial

BIKI: the first bionic underwater wireless drone

Post pobrano z: BIKI: the first bionic underwater wireless drone
first image of the post

When thinking of drones, the average Joe usually pictures a flying thing in his mind. This is far from reality, although most media focus is on the flying, noisy devices.

A Kickstarter campaign, already largely financed, is still collecting money to start producing the first bionic wireless underwater fish drone. This electronic fish, controllable with your smartphone, will be your underwater eyes and film some surprisingly good imagery.

As you can see on the above gif, the drone moves around a bit like a fish. It can go as deep as 196 feet, which is about 60 meters. The camera can produce 4K ultra HD videos and comes with a stabilizer. It can store 90 to 120 minutes of video.

Design Deals for the week

Post pobrano z: Design Deals for the week
first image of the post

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.

Best Seller Font Pack from TipoType

Now’s the chance to beef up your typeface toolbox with this Deal from TipoType! The Best Seller Font Pack features 3 unique font families: Amelia Rounded, Trasandina and Arya. These professional fonts offer real versatility in your projects with a variety of weights, styles and features.

$15 instead of $342 – Get it now!

Bundle: 2500+ Professional Photoshop Actions and Vectors

Now you can turn any photo into a professional image. Best of all, it’s not just simple, it’s lightning fast! With this Mega Photoshop Actions Bundle from Inventicons, you’ll get 7 different Photoshop Action sets, adding up to more than 2500 unique actions and vectors! Add everything from light leaks to vintage to bubbles with a few quick clicks of your mouse. Act now and get them all for a massive 96% off!

$17 instead of $475 – Get it now!

EASYTHREE Website UX Flowchart (Sketch Version)

Flowcharts make building websites and apps loads easier. But building flowcharts can be a bit tricky and time-consuming if you’re not careful. Luckily, if you have Sketch, this Mighty Deal will save you loads of time and money! The EasyThree Website UX Flowchart – Sketch version lets you quickly and easily whip up detailed flowcharts with mini wireframes, flowchart elements and a variety of styles and schemes to choose from.

$14 instead of $27 – Get it now!

Learn SWIFT iOS App Programming (Beginner/Intermediate)

Have a great idea for an app but don’t have the foggiest notion how to start? No worries, you’re halfway there already! This Mighty Deal from Appcoda offers you a big discount on beginner and intermediate eBooks that will teach you beginning iOS10 programming with Swift! Fully updated for Xcode 8, Swift 3 and iOS 10.3, you’ll learn to build real usable apps from scratch thanks to all sorts of hands-on exercises and projects. PLUS you’ll get 1 year of free updates, which includes the updated eBooks for iOS 11.

$27 instead of $49 – Get it now!

Using Filters in Vue.js

Post pobrano z: Using Filters in Vue.js

Filters are an interesting way to deal with data rendering in Vue but are only useful in a small amount of cases. The first thing to understand about filters is that they aren’t replacements for methods, computed values, or watchers, because filters don’t transform the data, just the output that the user sees. As of Vue 2.0, there are no built-in filters, we need to construct them ourselves.

We can use filters locally or globally, but it’s worth mentioning that if you declare a Vue filter globally it should come before the Vue instance. In both cases, we would pass the value in as a parameter.

//global
Vue.filter('filterName', function(value) {
  return // thing to transform
});
 
//locally, like methods or computed
filters: {
  filterName(value) {
    return // thing to transform
  }
}

Filters are used with a pipe, following the piece of data you’d like to be altered upon render. So we would show the piece of data we want to alter, followed by the filter

{{ data | filter }}

Here’s a small example, with a tip calculator:

See the Pen Filters by Sarah Drasner (@sdras) on CodePen.

new Vue({
  el: '#app',
  data() {
    return {
      customer1total: 35.43    
    }
  },
  filters: {
    tip15(value) {
      return (value*.15).toFixed(2)
    },
    tip20(value) {
      return (value*.2).toFixed(2)
    },
    tip25(value) {
      return (value*.25).toFixed(2)
    }
  }
});
<div id="app">
  <h2>Tip Calculator</h2>
  <p><strong>Total: {{ customer1total }}</strong></p>
  <p>15%: {{ customer1total | tip15 }}</p>
  <p>20%: {{ customer1total | tip20 }}</p>
  <p>25%: {{ customer1total | tip25 }}</p>
</div>

You can also use filters in v-bind directives rather than just the mustache template. Filters can also be chained. Keep in mind if you’re going to chain filters: ordering matters. The first filter will be applied first, the second will be applied to the completed first, and so on.

 {{ data | filterA | filterB }}

We can also pass additional arguments into filters like so:

{{ data | filterName(arg1, arg2) }}
// locally, like methods or computed
filters: {
  filterName(value, arg1, arg2) {
    return //thing to transform
  }
}

Now, you might think, based on the name, that filters would be great for forms when we want to show only some bits of data and not others. However, filters need to rerun on every single update, so if you have something like an input that updates every time you type, it’s not very performant. Better to use computed for something like this as it’s less overhead. The results will be cached based on their dependencies and won’t be rerun on every update. Computed properties will only be reevaluated when those dependencies change, but can also handle complex logic. This makes them excellent candidates for filtering information based on input. There are, however, circumstances where you do need to update based on changes in time, and for these instances, better to use a method.


Using Filters in Vue.js is a post from CSS-Tricks

Intro to Firebase and React

Post pobrano z: Intro to Firebase and React

Let’s take a look at building something using Firebase and React. We’ll be building something called Fun Food Friends, a web application for planning your next potluck, which hopefully feels like something rather „real world”, in that you can imagine using these technologies in your own production projects. The big idea in this app is that you and your friends will be able to log in and be able to see and post information about what you’re planning to bring to the potlock.

When we’re finished, it will look like this:

Our example app: Fun Food Friends

This article assumes you already have some basic knowledge of how React works and maybe built a few small apps with React. If you haven’t, I would recommend checking out a series like Wes Bos’ React for Beginners first before continuing on.

What is Firebase?

Google’s Firebase is a cloud-based database hosting service that will set up a database for you and host it, as well as offer you the tools to interact with it. You can use it to store and retrieve data in real time. That’s not all Firebase does, it can do more things like handle user authentication and store files, but we’ll be mainly focusing on data storage.

The data storage ability of Firebase make it a perfect fit for React. A persistent, real-time backend for your application to plug in to!

How does Firebase store data?

Firebase stores data as a giant object with key-value pairs. Unlike JSON or JavaScript objects, there are no arrays in Firebase.

A Firebase database might look something like this:

{
      "groceries": {
        "-KjQTqG3R2dPT8s2jylW": "tomato",
        "-KjQTrds1feHT3GH_29o": "pasta",
        "-KjQTsmfBR8zN1SwPPT8": "milk",
        "-KjQTtnzt_jJZPoCHWUM": "sugar"
      },
      "users": {
        "name": {
          "-KjQTyIfKFEVMYJRZ09X": "simon",
          "-KjQU-Xuy5s7I-On9rYP": "ryan",
          "-KjQU0MYVeKRsLuIQCYX": "sylvia"
        }
      }
}

For more information on the nuances of structuring data in Firebase, you can read the amazing Firebase documentation.

Ready to start? Let’s dig in!

Getting Started: Setting up Our App

We’ll start by using the incredibly handy `create-react-app` package in order to quickly set up a new React project without having to worry about any build configuration. Open up your command line, and type the following:

npm install -g create-react-app
    
create-react-app fun-food-friends
cd fun-food-friends
yarn add firebase --dev
yarn start

This will boot up your app in the browser, and start a watch task in your terminal so that we can begin hacking away at the project. We’re also installing the `firebase` package here as we’ll need it for the next step.

Creating our Firebase Database

Now that our app is set up, we’ll need to create an account and database on Firebase so that we can link up our application to it.

Head on over to Firebase’s website, and click Get Started.

This will take you to a page where you’ll be asked to authenticate with your Google account. Select the account that you’d like this project to be affiliated with, and press OK.

This should take you to the Firebase console, which looks something like this:

Now let’s create our project’s database. Click Add Project. Let’s call it „fun-food-friends” and press OK.

This will take you to your app’s dashboard, which looks like this:

Since we’ll be building a web app, select Add Firebase to your web app. This will trigger a popup with some code that looks like this:

<script src="https://www.gstatic.com/firebasejs/3.9.0/firebase.js"></script>
<script>
  // Initialize Firebase
  var config = {
     apiKey: "AIzaSyDblTESEB1SbAVkpy2q39DI2OHphL2-Jxw",
    authDomain: "fun-food-friends-eeec7.firebaseapp.com",
    databaseURL: "https://fun-food-friends-eeec7.firebaseio.com",
    projectId: "fun-food-friends-eeec7",
    storageBucket: "fun-food-friends-eeec7.appspot.com",
    messagingSenderId: "144750278413"
  };
  firebase.initializeApp(config);
</script>

Since we’ll be importing Firebase into our project using ES6 modules, we won’t need those script tags. That config object is important though: it’s how we authenticate our React application with our Firebase database.

Hooking up our App to Firebase

Copy that whole config object, and head back over to your React project. Find your `src` folder, and create a file called `firebase.js`. Inside of it, let’s import firebase, our config, and initialize our app:

// src/firebase.js
import firebase from 'firebase'
const config = {
    apiKey: "AIzaSyDblTESEB1SbAVkpy2q39DI2OHphL2-Jxw",
    authDomain: "fun-food-friends-eeec7.firebaseapp.com",
    databaseURL: "https://fun-food-friends-eeec7.firebaseio.com",
    projectId: "fun-food-friends-eeec7",
    storageBucket: "fun-food-friends-eeec7.appspot.com",
    messagingSenderId: "144750278413"
};
firebase.initializeApp(config);
export default firebase;

One last thing we’ll need to do before we can dive into roughing out our App. We need to temporarily disable authentication requirements on our app so that we can add and remove items without needing to have any kind of user authentication flow.

From the Firebase Dashboard, on the left-hand side of the screen, you’ll notice that there is a Database tab. Click on it. Then, on the right-hand side, under the subheading Realtime Database, you’ll see a Rules tab. This will cause an object to appear that looks something like this:

{
    "rules": {
      ".read": "auth != null",
      ".write": "auth != null"
    }
}

We need to set .read and .write to both be equal to true, otherwise later, when we try to add data to our database from our application, Firebase won’t let us. When you’re finished, it should look something like this:

Make sure to click the Publish button.

And that’s all there is to hooking up our database! Anytime we need a component of our application to connect with our Firebase database, we simply need to import our firebase module and we’ll have direct reference to it.

Building out our App’s Rough Skeleton

Let’s build out a rough HTML skeleton for our application. We’ll build a simple form with two inputs:

  1. A field where the user can submit their name
  2. A field where the user can enter what food they’re bringing to the potluck.

Since our app is quite simple, we’ll keep everything inside of one main component, `App.js`. Open up `src/App.js`, and remove the `App` component, replacing it with this basic skeleton:

import React, { Component } from 'react';
import logo from './logo.svg';
import './App.css';

class App extends Component {
  render() {
    return (
      <div className='app'>
        <header>
            <div className='wrapper'>
              <h1>Fun Food Friends</h1>
              
            </div>
        </header>
        <div className='container'>
          <section className='add-item'>
              <form>
                <input type="text" name="username" placeholder="What's your name?" />
                <input type="text" name="currentItem" placeholder="What are you bringing?" />
                <button>Add Item</button>
              </form>
          </section>
          <section className='display-item'>
            <div className='wrapper'>
              <ul>
              </ul>
            </div>
          </section>
        </div>
      </div>
    );
  }
}
export default App;

Get the CSS

I’ve prepared a little bit of CSS for you to paste into the `App.css` file, just so that our app doesn’t look totally bland. If you want to grab it, just go here and copy and paste the raw contents you find there into your `src/App.css` file!

We’ll also need to embed a link to Google Fonts and Font Awesome, so go ahead and open up `public/index.html` and add the following lines below the favicon:

<link rel="shortcut icon" href="%PUBLIC_URL%/favicon.ico">

<!-- add the lines below -->

<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Open+Sans">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css">  

At this point, your app should look like this:

Connecting our Form to Component State

Before we can start adding data into our Firebase database, we need to connect our inputs to our component’s state, so that React can keep track of them.

First, let’s carve out some space in our component’s state – a space to keep track of the user using our app (username) and the item they intend to bring (currentItem). We’ll do this by creating a constructor() hook for our app and setting a default value for our input’s state there:

class App extends Component {
  constructor() {
    super();
    this.state = {
      currentItem: '',
      username: ''
    }
  }
  // ....

We’ll add a onChange event handlers to our inputs, as well as providing them with a value derived from our state (this is called a „controlled input”), like this:

<section className="add-item">
  <form>
    <input type="text" name="username" placeholder="What's your name?" onChange={this.handleChange} value={this.state.username} />
    <input type="text" name="currentItem" placeholder="What are you bringing?" onChange={this.handleChange} value={this.state.currentItem} />
    <button>Add Item</button>
  </form>
</section>

And finally, we’ll create a catch-all handleChange method that receives the event from our inputs, and updates that input’s corresponding piece of state:

handleChange(e) {
  this.setState({
    [e.target.name]: e.target.value
  });
}

If you aren’t familiar with using brackets to dynamically determine key name in an object literal, check out the MDN docs on computed properties.

Since we’re using ES6 classes and need access to this in our handleChange method, we’ll also need to bind it back in our constructor() component like this:

constructor() {
  super();
  this.state = {
    username: '',
    currentItem: ''
  }
  this.handleChange = this.handleChange.bind(this);
}

If you now use the React DevTools to inspect your App component’s state, you’ll see that both of your inputs are now successfully hooked up and being tracked in your component’s state:

Adding a new Potluck Item to your Database

Now that we’re tracking our inputs, let’s make it so that we can add a new item to our database so that Firebase can keep track of it.

First we’ll need to connect to Firebase in order to do this, we’ll start by importing our firebase module that we created earlier. We’ll also delete the logo.svg import, since it’s just an unneeded part of the create-react-app boiler plate and will cause warnings if we don’t:

import React, { Component } from 'react';
import logo from './logo.svg'; // <--- remove this line
import './App.css';
import firebase from './firebase.js'; // <--- add this line

Once that’s done, we’ll need to make our 'Add Item’ button let Firebase know what we’d like to add to our database and where we’d like to put it.

First we’ll attach a submit event listener for our form, and have it call a handleSubmit method we’ll write in a minute:

<form onSubmit={this.handleSubmit}>
  <input type="text" name="username" placeholder="What's your name?" onChange={this.handleChange} value={this.state.username} />
  <input type="text" name="currentItem" placeholder="What are you bringing ?" onChange={this.handleChange} value={this.state.currentItem} />
  <button>Add Item</button>
</form>

Don’t forget to bind it in the constructor!

constructor() {
  super();
  this.state = {
    currentItem: '',
    username: ''
  }
  this.handleChange = this.handleChange.bind(this);
  this.handleSubmit = this.handleSubmit.bind(this); // <-- add this line
}

And now add the handleSubmit method to your component:

handleSubmit(e) {
  e.preventDefault();
  const itemsRef = firebase.database().ref('items');
  const item = {
    title: this.state.currentItem,
    user: this.state.username
  }
  itemsRef.push(item);
  this.setState({
    currentItem: '',
    username: ''
  });
}

Let’s break down what’s going here:

  • e.preventDefault() – we need to prevent the default behavior of the form, which if we don’t will cause the page to refresh when you hit the submit button.
  • const itemsRef = firebase.database().ref('items'); – we need to carve out a space in our Firebase database where we’d like to store all of the items that people are bringing to the potluck. We do this by calling the ref method and passing in the destination we’d like them to be stored (items).
  • const item = { /* .. */ } here we grab the item the user typed in (as well as their username) from the state, and package it into an object so we ship it off to our Firebase database.
  • itemsRef.push(item) similar to the Array.push method, this sends a copy of our object so that it can be stored in Firebase.
  • Finally this.setState({ currentItem: '', username: '' }); is just so that we can clear out the inputs so that an additional item can be added.

Now try adding a new item, and hitting submit! If you don’t have any errors in your console, you should be able to head on over to the Firebase dashboard, where you’ll see something like this inside your Database tab:

If you click the little + next to items you’ll be able to look inside, like this:

That strange looking -Kk8lHSMqC5oP6Qai0Vx key you see is a programmatically generated key created by Firebase when we called the push method, but inside you’ll find whatever item you added to the Potluck.

You’ll notice that all of our records are stored as objects with properties that have the generated names you see above – just another quick reminder that there are no arrays in Firebase!

Try adding more items and see what happens.

Way to go! We’re almost there, but we still have one more step: getting our potluck items to appear on the page.

Retrieving our Potluck Items from the database

Just like in a traditional React app, we need to find some way to keep track of all of the potluck dishes so that we can display what people are planning to bring on to the page.

Without a database, this poses an issue, since every time we refresh the page any new dishes that were added to the potluck would get lost. But with Firebase, this is a snap to fix!

First, let’s create a variable called items inside of default state. This will eventually hold all of the potluck items that are currently being tracked inside of our Firebase database.

constructor() {
  super();
  this.state = {
    currentItem: '',
    username: '',
    items: []
  }
  this.handleChange = this.handleChange.bind(this);
  this.handleSubmit = this.handleSubmit.bind(this);
}

Next, we need to actually grab those items from our Firebase database so that we can store them into our state.

The Firebase API offers us an incredibly easy way to not only grab this kind information from our database, but also to update us when new values get added to our database. It accomplishes this using the value custom event listener.

It looks like this:

itemsRef.on('value', (snapshot) => {
  console.log(snapshot.val());
});

The callback here, which we’ve called snapshot, provides you with a bird’s eye overview of the items ref inside of your database. From here, you can easily grab a list of all of the properties inside of that items ref, using the .val() method which you can call on the snapshot.

This value automatically fires on two occassions:

  1. Any time a new item is added or removed from our items reference inside of our database
  2. The first time the event listener is attached

This makes it especially useful for initially grabbing a list of all of the items inside of our database, and then subsequently tracking when new items get added and removed.

We’ll attach this event listener inside of our componentDidMount, so that we start tracking our Potluck items as soon as our component loads on to the page:

componentDidMount() {
  const itemsRef = firebase.database().ref('items');
  itemsRef.on('value', (snapshot) => {
    let items = snapshot.val();
    let newState = [];
    for (let item in items) {
      newState.push({
        id: item,
        title: items[item].title,
        user: items[item].user
      });
    }
    this.setState({
      items: newState
    });
  });
}

Here, we instantiate a new array and populate it with the results that come back from our value listener. We for…in over each key, and push the result into an object inside our newState array. Finally, once all the keys are iterated over (and therefore all items are grabbed from our database), we update the state with this list of items from our database.

Inspect your App using the React Dev Tools – you’ll notice that you now have an items property inside of your state with all of the items people have submitted for your potluck!

Displaying Potluck Items on the Page

Now let’s get these potluck items to actually display on the page. This is relatively easy, now that we have a list of all of our items being grabbed from Firebase and stored inside of our state. We just map over it and print the results on to the page, like so:

<section className='display-item'>
  <div className="wrapper">
    <ul>
      {this.state.items.map((item) => {
        return (
          <li key={item.id}>
            <h3>{item.title}</h3>
            <p>brought by: {item.user}</p>
          </li>
        )
      })}
    </ul>
  </div>
</section>

Try adding a new item through your form. You’ll notice that it automatically causes a new list item to appear on the page!

It’s not magic, Firebase’s value event is firing when you push the new item into your database, and sending back a new snapshot with a list of all of the items currently in your database, which ultimate updates your component through a setState which triggers a re-render and displays the new item on the page.

But we digress. There’s still one more step! We need to make it so that we can remove an item from the page.

Removing Items from the Page

We’ll need to create a new method on our component for this: removeItem. This method will need to be passed that unique key which serves as the identifier for each one of the items inside of our Firebase database.

It’s very simple, and looks like this:

removeItem(itemId) {
  const itemRef = firebase.database().ref(`/items/${itemId}`);
  itemRef.remove();
}

Here, instead of grabbing all of the items as we did before when adding a new item, we instead look up a specific item by its key (that strange –Kk8lHSMqC5oP6Qai0Vx key from before). We can then call firebase.database()’s remove method, which strips it from the page.

Finally, we’ll need to add a button to our UI with an onClick that calls our removeItem method and passes it the item’s key, like follows:

{this.state.items.map((item) => {
    return (
      <li key={item.id}>
        <h3>{item.title}</h3>
        <p>brought by: {item.user}</p>
        <button onClick={() => this.removeItem(item.id)}>Remove Item</button>
      </li>
    )
  })
}

And that’s all there is to it! Just like our addItem method, our UI and component state automatically update when an item is removed from the database.

Here’s what our completed `App.js` should look like:

import React, { Component } from 'react';
import logo from './logo.svg';
import './App.css';
import firebase from './firebase.js';

class App extends Component {
  constructor() {
    super();
    this.state = {
      currentItem: '',
      username: '',
      items: []
    }
    this.handleChange = this.handleChange.bind(this);
    this.handleSubmit = this.handleSubmit.bind(this);
  }
  handleChange(e) {
    this.setState({
      [e.target.name]: e.target.value
    });
  }
  handleSubmit(e) {
    e.preventDefault();
    const itemsRef = firebase.database().ref('items');
    const item = {
      title: this.state.currentItem,
      user: this.state.username
    }
    itemsRef.push(item);
    this.setState({
      currentItem: '',
      username: ''
    });
  }
  componentDidMount() {
    const itemsRef = firebase.database().ref('items');
    itemsRef.on('value', (snapshot) => {
      let items = snapshot.val();
      let newState = [];
      for (let item in items) {
        newState.push({
          id: item,
          title: items[item].title,
          user: items[item].user
        });
      }
      this.setState({
        items: newState
      });
    });
  }
  removeItem(itemId) {
    const itemRef = firebase.database().ref(`/items/${itemId}`);
    itemRef.remove();
  }
  render() {
    return (
      <div className='app'>
        <header>
            <div className="wrapper">
              <h1>Fun Food Friends</h1>
                             
            </div>
        </header>
        <div className='container'>
          <section className='add-item'>
                <form onSubmit={this.handleSubmit}>
                  <input type="text" name="username" placeholder="What's your name?" onChange={this.handleChange} value={this.state.username} />
                  <input type="text" name="currentItem" placeholder="What are you bringing?" onChange={this.handleChange} value={this.state.currentItem} />
                  <button>Add Item</button>
                </form>
          </section>
          <section className='display-item'>
              <div className="wrapper">
                <ul>
                  {this.state.items.map((item) => {
                    return (
                      <li key={item.id}>
                        <h3>{item.title}</h3>
                        <p>brought by: {item.user}
                          <button onClick={() => this.removeItem(item.id)}>Remove Item</button>
                        </p>
                      </li>
                    )
                  })}
                </ul>
              </div>
          </section>
        </div>
      </div>
    );
  }
}
export default App;

Conclusion

Now you can truly see how Firebase and React play beautifully together. Firebase’s ability to persist data on the fly, coupled with React’s component lifecycle, makes for an incredibly simple and powerful way to quickly build up simple applications.

This article just scratches the surface of what the Firebase API can provide us. For example, with just a few more steps (and perhaps we will go over this in a future article), it would be incredibly easy to expand this application so that users could log in and out, be able to have a display photo next to the item that they are bringing, and only be able to remove their own items.

Happy Firebasing!


Intro to Firebase and React is a post from CSS-Tricks

Componentizing a Framework

Post pobrano z: Componentizing a Framework

I’m sure most of you understand how you work with a framework like Bootstrap, Foundation, or Materialize. You use their CSS and JavaScript. You also use their chunks of HTML, piecing together and applying classes as needed to do what you need to do.

You’re on your own piecing the HTML together. That’s good, because it’s flexible. People use frameworks like this in all kinds of CMS’s and backend systems. But what if you want to apply some structure to this, making actual components out of the components given to you in the framework?

That’s exactly what Morgan Feeney did in Component-Led Design Patterns with Nunjucks & Grunt last year.

For example, Bootstrap gives you some HTML for alert messages, that are like this:”

<div class="alert alert-success" role="alert">...</div>
<div class="alert alert-info" role="alert">...</div>
<div class="alert alert-warning" role="alert">...</div>
<div class="alert alert-danger" role="alert">...</div>

We could abstract that into a reusable component by:

  1. Pass in the type of alert (second half of the second class)
  2. Pass in the content inside the alert

I’m sure you could imagine doing that in the backend or templating language of your choice. A single PHP file in which you set variables representing those things before you include it. A Rails partial in which you pass locals to it. A literal React component in JSX where you pass the stuff as props. This kind of thing makes these patterns a lot easier to reuse.

Morgan did this with Nunjucks:

{% macro alert(class="success", text="<strong>Well done!</strong> You successfully read this important alert message.") %}
  <div class="alert alert-{{ class }}" role="alert">
    {{ text | safe }}
  </div>
{% endmacro %}

I think this is super compelling and the kind of thing we’ll be doing more and more as design systems are becoming more of a standard practice.

I also think Nunjucks is pretty darn cool.

I ported Morgan’s idea (which is already a repo) over to a CodePen Project if you’d like to have a play there.


Componentizing a Framework is a post from CSS-Tricks

HelloSign: The Industry’s Fastest eSignature API Integration

Post pobrano z: HelloSign: The Industry’s Fastest eSignature API Integration

My favorite kind of software products are the ones that very clearly make life simpler. Being able to legally sign a document by clicking a button in an email and squiggling my mouse to make my signature is definitely one of those things.

You can provide that to your users with HelloSign! You can set up your documents there (it supports all the formats you’d need, like PDF, Microsoft Word, Powerpoint, etc) and start collecting the signatures you need very easily. Set up templates of your commonly used documents. Make sure your branding is present during the signing process. Get notifications when documents are reviewed and signed.

There are a bunch more killer features you should be aware of. For example, like I mentioned, you can sign documents without ever leaving your email with their Chrome browser extension for Gmail. Same with Google Docs and Salesforce!

Perhaps most importantly, you can use HelloSign right from your own interface through their API. That’s great for all us developers interested in building seamless useful experiences right in our own products. You can embed documents directly on your website with just a few lines of code!

Direct Link to ArticlePermalink


HelloSign: The Industry’s Fastest eSignature API Integration is a post from CSS-Tricks