2017/2018 JavaScript

Post pobrano z: 2017/2018 JavaScript

There has been a lot of research on the landscape this year! Here are a few snippets from a bunch of articles. There is a ton of information in each, so I’m just picking out a few juicy quotes from each here.

Perhaps the most interesting bit is how different the data looked at is. Each of these is different: a big developer survey, npm data, GitHub data, and StackOverflow data. Yet, they mostly tell the same stories.

The Brutal Lifecycle of JavaScript Frameworks

Ian Allen of StackOverflow writes:

JavaScript UI frameworks and libraries work in cycles. Every six months or so, a new one pops up, claiming that it has revolutionized UI development. Thousands of developers adopt it into their new projects, blog posts are written, Stack Overflow questions are asked and answered, and then a newer (and even more revolutionary) framework pops up to usurp the throne.

Using the Stack Overflow Trends tool and some of our internal traffic data, we decided to take a look at some of the more prominent UI frameworks: Angular, React, Vue.js, Backbone, Knockout, and Ember.

Read More

The Top JavaScript Trends to Watch in 2018

Ryan Chartrand of X-Team for Hackernoon writes:

This time last year, not many had faith that Vue would ever become a big competitor to React when it comes to major companies adopting it, but it was impossible to ignore Vue this year, even sending Angular a bit into the shadows in terms of developer hype.

Read More

The State of JavaScript 2017

Sacha Greif uses a survey rather than usage data:

We asked over a hundred questions to more than 28,000 developers all over the world, covering topics going from front-end libraries all the way to back-end frameworks.

I particularly enjoyed the opinions. Lots of people who love working with JavaScript and find it to be moving in the right direction and find it overly complex.

Read More

The State of JavaScript Frameworks, 2017

This one is from Laurie Voss of npm, which is probably the best source of data for usage but faces interesting challenges with that data:

You can use npm’s download statistics to give you insight into the amount of people actively invested in using and maintaining a package. However, probably more important than absolute popularity is growth.

Packages, once incorporated into software, have very long lives. People very seldom rip packages out of software once they’re installed. Because of this very low “churn,” packages hardly ever decline in usage. Furthermore, nearly all packages in the npm Registry grow in usage as the number of total npm users continues to skyrocket. They vary only in how fast they’re growing.

This makes measuring growth harder, since measuring absolute growth in downloads all the time makes almost everything look popular.

All in all it tells a familiar story: React is incredibly popular and Vue is the one to watch.

Read More

Top JavaScript Libraries & Tech to Learn in 2018

Eric Elliott writes:

Vue.js did do very well in 2017. It got a lot of headlines and a lot of people got interested. As I predicted, it did not come close to unseating React, and I’m confident to predict it won’t unseat React in 2018, either. That said, it could overtake Angular in 2018.

Read More

2017 JavaScript Rising Stars

Michael Rambeau’s writes:

Once again, Vue.js is the trendiest project of the year, with more than 40,000 stars added on GitHub during the year.

It’s far more than in 2016 (26,000 stars), and the gap with the next contender (React) is even bigger.

Read More


2017/2018 JavaScript is a post from CSS-Tricks

Secure Contexts Everywhere

Post pobrano z: Secure Contexts Everywhere

Anne van Kesteren for Mozilla says:

Effective immediately, all new features that are web-exposed are to be restricted to secure contexts. Web-exposed means that the feature is observable from a web page or server, whether through JavaScript, CSS, HTTP, media formats, etc. A feature can be anything from an extension of an existing IDL-defined object, a new CSS property, a new HTTP response header, to bigger features such as WebVR. In contrast, a new CSS color keyword would likely not be restricted to secure contexts.

In other words, if your site isn’t HTTPS, you won’t get new web tech features. Holy jeepers. The reasoning is the web should be using HTTPS, so this is our way of beating you with a stick if you try to use fancy features without going HTTPS first.

It’ll be fascinating to watch the first major feature drop and if they stick to their word here. The web dev forums of the internet will overflow with WHY DOESN’T grid-gap WORK WITH MY FLEXBOX? (or some likely coming-soon feature) questions and the answer will be: talk to your server team. What if they drop container queries behind this? That would be a hilarious devastating tornado of developer fury.

Direct Link to ArticlePermalink


Secure Contexts Everywhere is a post from CSS-Tricks

How to Create a Pastel Neon Club Flyer in Adobe InDesign

Post pobrano z: How to Create a Pastel Neon Club Flyer in Adobe InDesign

Final product image
What You’ll Be Creating

We’re celebrating all things celebratory this week! And what sort of celebration could be more fun than a night out clubbing? 

This flyer is an easy way of tapping into the pastel-neon gradient trend. In this tutorial suitable for beginners to InDesign, we’ll look at how to create gradient swatches and apply them to a simple layout that can be adapted for print or online. 

Looking for easy-to-edit club flyers? These flyer templates on GraphicRiver and Envato Elements come in a huge range of customisable styles.

Ready to dance? Let’s go!

What You’ll Need to Create Your Flyer

As well as access to Adobe InDesign, you’ll also need to download Charlevoix Pro in ExtraBold, Bold, SemiBold, Medium, and Regular.

Once you’ve installed the font files onto your computer, you’re ready to get started.

1. How to Set Up a Flyer Layout in InDesign

Step 1

Open InDesign and go to File > New > Document. 

Set the Width of the page to 4 in and Height to 6 in, to create a standard size flyer. 

Set the Margins to 0.4 in and add a Bleed of 0.25 in.

new document

Then go ahead and click OK

new document

Step 2

Expand the Layers panel (Window > Layers) and double-click on the Layer 1 name. Rename it Background and click OK

Choose New Layer from the panel’s drop-down menu (at top-right), and name this layer Pattern, before clicking OK.

Then add a further three new layers in this order: Type Behind, Circle and, at the top, Type in Front.

layer options

Lock all the layers except the bottom one, Background

layers panel

2. How to Create Gradient Swatches in InDesign

You can create the equivalent of Photoshop’s ‘gradient maps’ in InDesign by tweaking the settings of gradient swatches. First, you’ll need to create a base group of standard swatches, to use as building blocks for your gradient swatches.

Step 1

Expand the Swatches panel (Window > Color > Swatches) and choose New Color Swatch from the panel’s drop-down menu. 

new color swatch

Name this first swatch Neon Mint, and set the Type to Process. You can choose either RGB (for online) or CMYK (for print) depending on your intention to share the flyer in hard or soft copy. Here I’m going for RGB, as I’m planning to share the flyer on social media. 

Set the values to R=140 G=249 B=208, and click Add and then OK

neon mint

Step 2

Repeat the process described in the previous step, to create a palette of nine more swatches, with the following names and values:

  • Blue: R=61 G=177 B=252
  • Pastel Pink: R=250 G=200 B=253
  • Rose: R=244 G=136 B=170
  • Neon Lime: R=145 G=255 B=142
  • Purple: R=110 G=89 B=190
  • Neon Pink: R=255 G=84 B=232
  • Pastel Lime: R=234 G=247 B=201
  • Neon Yellow: R=248 G=255 B=81
  • Deep Rose: R=240 G=88 B=171
swatch options

Step 3

Now it’s time to create your first gradient swatch. Click on New Gradient Swatch in the Swatch panel’s menu. 

new gradient swatch

Name the swatch Gradient Map 1, set the Type to Linear, and choose Swatches from the Stop Color menu. 

Click on the left-hand stop on the Gradient Ramp below, and select Neon Lime from the swatch menu above. 

Click on the right-hand stop, and choose Purple.

new gradient

You can add more colors to your gradient by clicking anywhere on the Gradient Ramp and adding a new stop. From the left side, add a stop set in Neon Pink. Then one in Pastel Lime. And a third one in Neon Yellow. 

Make sure the stops are spaced relatively evenly across the ramp, before clicking Add and then OK

gradient swatch

Step 4

Working on the Background layer, select the Rectangle Tool (M) from the Tools panel (docked to the left side of the workspace) and drag across the whole page, extending it up to the bleed on all sides. 

Set the Fill of the shape to Purple from the Swatches panel. 

purple shape

Step 5

With the shape selected, go to Object on the main menu, and Effects > Transparency. 

Pull the Opacity down to 10%. 

opacity normal

Click on Inner Glow in the window’s left-hand menu. Increase the Choke to around 4% and Noise to 8%, to add texture across the whole shape. Then click OK

inner glow

Step 6

Create another shape using the Rectangle Tool (M) over the top of this first rectangle. From the Swatches panel, set the Fill to Gradient Map 1.

gradient swatch

Go to Window > Color > Gradient and adjust the Angle of the gradient to 110, so that it extends diagonally from the bottom-right to the top-left corner of the page. You can also adjust the position of the stops to soften the gradient if you need to. 

gradient angle

3. How to Build Up Shapes and Typography on Your Flyer

Step 1

Return to the Layers panel and choose New Gradient Swatch from the drop-down menu. 

Call this swatch Gradient Map 2, and choose Blue and Neon Mint from the swatches list to create a two-color gradient. Click Add, and then OK

gradient swatch

Step 2

Lock the Background layer and unlock the Circle layer.

Select the Ellipse Tool (L), and, holding Shift, drag to create a perfect circle across the center of the page. Set the Fill to Gradient Map 2 and Stroke to [None].

ellipse tool

Step 3

With the circle shape selected, go to Object > Effects > Drop Shadow. 

Click on the colored square to the right of the Mode menu at the top, and change the Effect Color to Pastel Pink. Click OK, and add about 13% Noise to the shadow. Then click OK to exit the window. 

effect color

Step 4

Lock the Circle layer and unlock the layer below, Type Behind. 

type behind

Take the Type Tool (T) and drag to create a square text frame at the top-right corner of the circle shape. 

Type in ‘C’ and, from either the top Controls panel or the Character panel (Window > Type & Tables > Character), set the Font to Charlevoix Pro ExtraBold, Size 130 pt. 

Adjust the Font Color to [Paper] from the Swatches panel. 

charlevoix pro

Step 5

Select the text frame and Edit > Copy, Edit > Paste. Move this second frame to the bottom-right corner of the circle, as shown below. 

text frame

Select both the ‘C’ and ‘B’ text frames and head up to Object > Effects > Drop Shadow. 

Switch the Effect Color to Neon Mint, pull the Opacity down to about 60%, and add 25% Noise. Then click OK

drop shadow

Step 6

Take the Type Tool (T) again and create a smaller, longer text frame next to the ‘B’ frame. 

Type in ‘NIGHT’ and set the Font to Charlevoix Pro Medium, Size 22 pt and increase the Tracking (letter-spacing) to 90. Change the Font Color to Pastel Lime. 

night text

Then Right-Click on the text frame and choose Transform > Rotate 90 Degrees CW.

transform rotate

Move the text frame to sit snugly against the left side of the ‘B’ letter. 

rotated frame

Step 7

Use the Type Tool (T) to create another small text frame up in the right-hand corner of the page. Here you can add an introductory sentence such as ‘RIOT BLVD presents its opening’.

Set the Font to Charlevoix Pro, setting titles in Bold and other text in Medium. You can set most text in [Paper], but pull out key info in a contrasting color like Deep Rose.

deep rose

Step 8

Add more text frames to the bottom-left corner of the page, setting text in Charlevoix Pro Bold, Medium and Regular to create hierarchy, and the Font Color to [Paper].

text frames

Step 9

Head back to the Layers panel and expand the Type Behind layer by clicking on the small arrow symbol to the left of the layer’s name. 

Select the <B> element with your mouse and drag it down onto the Create New Layer button at the bottom of the panel to duplicate it. 

type behind

Unlock the Type in Front layer at the top, before dragging the <B> copy upwards to sit on this layer. Then you can lock the Type Behind layer, and work on the Type in Front layer. 

type in front

Step 10

Edit the ‘B’ letter on the Type in Front layer to read ‘L’ instead and move it to sit above the ‘B’.

text frame

Select the ‘L’ text frame and Edit > Copy, Edit > Paste, adjusting the letter of the copy to read ‘U’. Move so that it sits below the ‘C’, as shown below. 

text frame

4. How to Add a Retro Pattern to Your Flyer

Step 1

Lock the Type in Front layer and unlock the Pattern layer.

Switch to the Pen Tool (P) and click onto the page or pasteboard three times to create a triangle shape, before uniting the shape at its first anchor point. Use the Direct Selection Tool (A) to select anchor points individually and move them to create a symmetrical triangle shape.

pen tool

Step 2

Set the Fill of the triangle shape to Rose and Stroke Color to [None].

pink shape

Move the triangle over to the top-left corner of the page, and scale it down and rotate it a little. 

rotate

With the shape selected, go to Object > Effects > Drop Shadow. Switch the Effect Color to Neon Lime and add about 10% Noise, before clicking OK

effect color

Step 3

Copy and Paste the triangle repeatedly, scattering shapes around the page and rotating them to different angles to create a jaunty, jumpy effect. 

Your flyer’s finished! Awesome work! 

All that’s left to do now is File > Save your hard work, and then File > Export to export it as either a print-ready PDF file (choose Adobe PDF [Print] from the Format menu) or online image file (choose JPEG or PNG). 

pattern layer

Conclusion: Your Finished Flyer

Pastel-neon gradients are a big trend for this year, and this colorful flyer is a great way to tap into the style. It works perfectly for club or party flyers—but why not try using gradient swatches on different designs too?

In this tutorial, you’ve picked up some handy skills for applying to InDesign and other layout projects in the future. You now know how to:

  • Create gradient swatches (or ‘gradient maps’) in Adobe InDesign.
  • Layer color, shapes, patterns and type for a 3D look in your designs.
  • Format typography to a high standard.
  • Apply sophisticated effects to graphics, like glows, shadows, and transparencies.

Looking for more club flyer designs? These easy-to-edit templates on GraphicRiver and Envato Elements come in a huge range of styles and customisable designs.

final flyer

Les Producteurs de lait du Québec: Soccer, Tennis, Boxing

Post pobrano z: Les Producteurs de lait du Québec: Soccer, Tennis, Boxing
Print
Les Producteurs de lait du Québec

Chocolate milk is known to replenish energy and repair muscle tissue, so you can get back to training faster.

Recharge. Restart.

Advertising Agency:Lg2, Montréal, Canada
Creative Director:Francois Sauve
Art Directors:Patrick Rochon, Patrick Seymour, Marc Guilbaut
Copywriters:Patrick Rochon, Luc Dupéré, Guillaume Bergeron
Illustrators:Patrick Seymour, Jean Landry, Maurice Gervais

Onitsuka Tiger: Mexico 66

Post pobrano z: Onitsuka Tiger: Mexico 66

Film
Onitsuka Tiger

Advertising Agency:The Adventures Of, Berlin, Germany
Executive Creative Director:Leila El-Kayem
Creative Director:Gustavo Vieira Dias
Creative:Sol Oh
Managing Director:Sophie Mayer
Executive Producer:Chris Seegel, Ezra Xenos
Business Strategist:Thomas Eon
Production Company:Halal
Line Producer:Job Sanders
DoP:Noel Schoolderman
Illustrator:Karan Singh
Art Director:Grietje Schepers
Stylist:Lisa Anne Stuyfzand
Editor:Faith Tura
Postproduction:Darlings Post
Music Composition:Niels den Otter, Audentity

BBC: The Fearless are Here

Post pobrano z: BBC: The Fearless are Here

Film
BBC

Y&amp;R London has created the latest campaign for BBC Sport to launch the 2018 Winter Olympics.

Advertising Agency:Y&R, London, United Kingdom
Producer:Katherine Maidment, Tracey Cooper
Executive Creative Director:Mark Roalfe
Creatives:Jim Bolton, Gavin Mcgrath, Psembi Kinstan
Business Director:David Pomfret
Account Manager:Tom Lamming
Production Company:Nexus Studios
Director:Smith & Foulkes
Sound House:Factory
Lead Sound:Anthony Moore
Music Company:Native

How to Create a Glittering, Festive, 3D Text Effect in Adobe Photoshop

Post pobrano z: How to Create a Glittering, Festive, 3D Text Effect in Adobe Photoshop

Final product image
What You’ll Be Creating

This tutorial will show you how to use Photoshop’s 3D Tools, adjustment layers, and a couple of textures to create a dazzling, glittery, festive text effect. Let’s get started!

This text effect was inspired by the many Layer Styles available on GraphicRiver.

Tutorial Assets

The following assets were used during the production of this tutorial.

1. How to Create a Text Shape

Step 1

Create a new 3500 x 2000 px document.

Then, create the text using the font HWT Artz. Set the Size to 600 pt and the Tracking to 150 pt.

Create the Text

Step 2

Rename the text layer to Text, and then right-click it and choose Convert to Shape.

Convert to Shape

2. How to Create Stroke Layers

Step 1

Duplicate the Text layer and rename the copy to Stroke 1.

Create the Stroke 1 Layer

Step 2

Pick the Direct Selection Tool (A) to get the shape options in the Options bar.

Change the Fill to None, the Stroke Color to Black, and its Size to 25, and then click the Set shape stroke type icon, and change the Align to Outside.

Stroke Settings

Step 3

Duplicate the Stroke 1 layer, rename the copy to Stroke 2, and change the Stroke Size to 35.

Stroke 2 Settings

Step 4

Duplicate the Stroke 2 layer, rename the copy to Stroke 3, and change the Stroke Size to 50.

Stroke 3 Settings

3. How to Create 3D Layers

Step 1

For each shape layer you have, select it, and then go to 3D > New 3D Extrusion from Selected Path.

Convert to 3D Layers

Step 2

Select all 3D layers you have, and go to 3D > Merge 3D Layers.

Merge 3D Layers

4. How to Work With a 3D Scene

Step 1

To access the 3D mesh settings and properties, you’ll need to open two panels: the 3D panel and the Properties panel (both found under the Window menu).

The 3D panel has all the components of the 3D scene, and when you click the name of any of those, you’ll be able to access its settings in the Properties panel. So make sure to always select the tab of the element you want to modify in the 3D panel before you change its settings in the Properties panel.

3D and Properties Panels

Step 2

If you select the Move Tool, you’ll find a set of 3D Modes for it to the right of the Options bar.

When you choose one of those, you can then click and drag to perform changes (on the selected element in the 3D panel).

Use those modes to change the Current View into an angle you like.

3D Move Tool Modes

5. How to Modify 3D Mesh Settings

Step 1

Select the Text mesh tab in the 3D panel, and then, in the Properties panel, change the Extrusion Depth to 200.

Text Extrusion Depth

Step 2

Select all the Stroke mesh tabs, and change their Extrusion Depth to 35.

Stroke Extrusion Depth

6. How to Modify 3D Cap Settings

Step 1

Select the Text tab again. Then click the Cap icon at the top of the Properties panel.

Set the Sides to Front and Back, and change the Bevel Width to 5%, the Contour to Half Round, and the Inflate Strength to 10%.

Text Cap Settings

Step 2

Select the Stroke tabs, set the Sides to Front and Back, and then change the Bevel Width to 20% and the Contour to Ring.

Stroke Cap Settings

7. How to Reposition 3D Meshes

Step 1

Select all the mesh tabs in the 3D panel, and then click the 3D panel menu icon, and choose Move Object to Ground Plane.

Move Object to Ground Plane

Step 2

Pick the Move Tool, and use the 3D Axis to move the Stroke meshes apart from each other, and spread them over the 3D text you have.

The arrows at the ends of the axis move the mesh, the part below them is used for rotation, and the cubes are used for scaling. The cube in the center is used to scale the object uniformly. All you need to do is click and drag the part you want.

You can also open the 3D Secondary View window (View > Show > 3D Secondary View), and then click the little arrow to the left and choose the Top view, to better see what you are doing.

Move the Stroke Meshes

Step 3

Make sure that the biggest stroke is at the back and the smallest is in the front.

Repositioned Stroke Meshes

8. How to Create a 3D Text Front Inflation Material

Step 1

Select the Text Front Inflation Material tab in the 3D panel, and then, in the Properties panel, click the Diffuse texture icon, and choose Edit Texture.

Edit Texture

Step 2

Place the Silver Glitter Texture Stock image on top of the Text shape layer, and resize it to the text’s width.

Add the Glitter Texture

Step 3

Press Command-U to get the Hue/Saturation window, check the Colorize box, and change the Hue value to 37.

Go to File > Save, and then File > Close to go back to the 3D Scene.

HueSaturation

9. How to Adjust 3D Text Inflation and Bevel Material Settings

Step 1

Select the Text Front and Bevel Material tabs, and then use these material settings:

  • Specular: (221, 161, 32)
  • Shine: 50
  • Reflection: 20
  • Bump: 3
  • Refraction: 1.3
Text Front and Bevel Material Settings

Step 2

Select the Text Front Inflation Material tab, click the Bump folder icon, click Load Texture, and then load the Metallic_Silver image.

Load the Bump Texture

Step 3

Click the Bump texture icon, and choose Edit UV Properties.

Edit UV Properties

Step 4

Set both Tile values to 1.

Tile Values

Step 5

Select the rest of the Text Inflation and Bevel Material tabs, click the Bump folder icon, and choose the Metallic_Silver texture name from the list.

Apply the Bump Texture

10. How to Create a 3D Text Extrusion Material

Step 1

Select the Text Extrusion Material tab, click the Diffuse texture icon, and choose Remove Texture.

Remove Texture

Step 2

Change the rest of the values as below:

  • Diffuse: (232, 226, 211)
  • Specular: (153, 151, 137)
  • Shine: 20
  • Reflection: 20
  • Roughness: 31
  • Refraction: 1.2
Text Extrusion Material Settings

11. How to Create 3D Stroke Materials

Step 1

Select all the Stroke Inflation and Bevel Material tabs, remove their Diffuse texture, and change the rest of the settings as below:

  • Diffuse: (92, 90, 83)
  • Specular: (170, 168, 152)
  • Shine: 50
  • Reflection: 20
  • Refraction: 1.2
Stroke Inflation and Bevel Material Settings

Step 2

Select all the Stroke Extrusion Material tabs, remove their Diffuse texture, and change the rest of the settings as below:

  • Diffuse: (228, 183, 63)
  • Specular: (51, 51, 51)
  • Shine: 20
  • Reflection: 20
  • Refraction: 1.2
Stroke Extrusion Material Settings

12. How to Adjust a 3D Scene’s Lighting

Step 1

Select the Infinite Light tab, and change the Intensity to 50% and the Shadow Softness to 30%.

Infinite Light Settings

Step 2

You can then use the Move Tool to move the light, or click the Coordinates icon at the top of the Properties panel to enter numerical values.

Infinite Light Coordinates

Step 3

Select the Environment tab, click the IBL texture icon, choose Replace Texture, and then load the Room image.

Replace Texture

Step 4

Click the IBL texture icon again, choose Edit Texture, then press Command-U, and change the Saturation value to -65.

Save and close the file.

Environment Texture HueSaturation

Step 5

Change the IBL light’s Intensity to 50%.

IBL Intensity

Step 6

You can use the Move Tool to move the texture until you get a result you like.

Move the IBL Texture

13. How to Modify a Rendered 3D Layer

Step 1

Once you’re done modifying the 3D scene, go to 3D > Render to render it. The rendering might take a while, but you can stop it any time by pressing the Esc key.

Render the 3D Scene

Step 2

Once the rendering is finished, right-click the 3D layer, and choose Convert to Smart Object.

Convert to Smart Object

Step 3

Go to Image > Image Size, and set the Width to 1500 px.

Resize Image

14. How to Use Adjustment Layers

Step 1

Click the Create new fill or adjustment layer icon at the bottom of the Layers panel, and choose Selective Color.

Selective Color

Step 2

Clip the Selective Color layer to the 3D layer, and then modify these channels as below:

Yellows:

  • Cyan: 9
  • Magenta: 6
  • Yellow: 13
  • Black: 3

Greens:

  • Black: -80

Cyans:

  • Black: -50
Yellows Greens and Cyans

Whites:

  • Cyan: -15
  • Magenta: 10
  • Yellow: 20
  • Black: -90

Neutrals:

  • Cyan: -2
  • Yellow: 5

Blacks:

  • Cyan: -5
  • Magenta: 5
  • Yellow: –20
  • Black: 5
Whites Neutrals and Blacks

This will enhance the coloring of the text.

Enhanced Coloring

Step 3

Add a Levels adjustment layer, clip it to the 3D layer, and then change the Highlights to 27, the Gamma to 1.03, and the Shadows to 231.

This will enhance the contrast.

Levels Settings

15. How to Create a Background

Step 1

Add a Gradient Fill layer on top of the Background layer, and create the Gradient using the colors #8f8e8e to the right, #ebeaea in the center, and #8f8e8e to the left.

Change the Angle to 105, and the Scale to 250. You can then click-drag the gradient fill inside the document to position it behind the text.

Add a Gradient Fill

Step 2

Place the Glitter Bokeh texture on top of the Gradient Fill layer, resize it as needed, rename its layer to Glitter BG, and change its Blend Mode to Soft Light.

Add the Glitter Texture

Step 3

Add a Hue/Saturation adjustment layer, clip it to the Glitter BG layer, check the Colorize box, and change the Hue to 40.

HueSaturation

Step 4

Place the hybrid3 image from the Salomdi hybrid c4d pack on top of the Glitter BG layer, and rename its layer to BG Texture 01.

Change the BG Texture 01 layer’s Blend Mode to Screen, and resize it as needed.

BG Texture 01

Step 5

Add a Hue/Saturation adjustment layer, clip it to the BG Texture 01 layer, check the Colorize box, and change the Hue to 38.

HueSaturation

Step 6

Place the Platinafx4 image from the C4d Pack 12 By Platina set on top of the BG Texture 01 layer, and rename its layer to BG Texture 02.

Change the BG Texture 02 layer’s Blend Mode to Screen, and resize it as needed.

BG Texture 02

Step 7

Add a Hue/Saturation adjustment layer, clip it to the BG Texture 02 layer, check the Colorize box, and change the Hue to 35.

HueSaturation

16. How to Add Sparkles

Step 1

Pick the Brush Tool, and open the Brush panel (Window > Brush).

Choose a brush tip you like from the Stars and Flares Brush Set, and then, under the Shape Dynamics tab, change the Size Jitter to 50%, and the Angle Jitter to 100%.

Shape Dynamics Settings

Step 2

Set the Foreground Color to #d6d6d6, create a new layer on top of all layers, call it Sparkles, and change its Blend Mode to Overlay.

Decrease the brush tip Size to a value that you think looks good for the text, and start clicking over some bright areas of the text to add the sparkles.

Add the Sparkles

17. How to Modify a Gradient Map

Step 1

Add a Gradient Map adjustment layer, and change its Blend Mode to Soft Light and its Opacity to 15%.

Check the Dither box, and then create the Gradient fill using the colors #5a5871 to the left, #b79787 in the center, and #fdcd90 to the right.

Gradient Map Colors

Step 2

You can try different colors and Opacity values to get different results if you like.

Gradient Map Effect

Congratulations! You’re Done

In this tutorial, we created a text layer, converted it into a shape layer, and created the stroke layers.

Then, we converted the shape layers into 3D layers, and modified their settings. After that, we created the 3D materials, worked on the lighting of the scene, and rendered it.

Finally, we worked on the coloring and the background, using adjustment layers and textures, as well as adding some sparkles to finish off the effect.

Please feel free to leave your comments, suggestions, and outcomes below.

Final Result

Creating Vue.js Component Instances Programmatically

Post pobrano z: Creating Vue.js Component Instances Programmatically

This article assumes basic understanding of Vue.js framework and how to create components in it. If you are new to Vue, then this CSS-Tricks series is a good place to start.

I have been on a Vue.js project that required the ability to create components programmatically. By programmatically, I mean you create and insert the components completely from JavaScript, without writing anything in the template. This article aims to illustrate how different aspects of using components in a template, such as instantiation, props passing, slots, mounting, translate to JavaScript code.

Normally if you are working with the recommended Single File Component style, you would have a Button component like so:

<template>
 <button :class="type"><slot /></button>
</template>
<script>
 export default {
   name: 'Button',
   props: [ 'type' ],
 }
</script>

To use it in another component, all you have to do is import the Button component and insert its tag in the template:

<template>
 <Button type="primary">Click me!</Button>
</template>
<script>
 import Button from 'Button.vue'
 export default {
   name: 'App',
   components: { Button }
 }
</script>

In my case, I don’t know which component to insert in the template and also where to insert it. This information is only available at runtime. So I needed a way to dynamically create component instance for any passed component and insert it in the DOM, during runtime.

Creating the Instance

The very first idea I had to create a dynamic instance of a given component was to pass it to new and it would give me the actual instance. But if you notice carefully the script block in any of the above component code, they are all exporting a simple object, and not a class (constructor function). If I do this:

import Button from 'Button.vue'
var instance = new Button()

…it fails. We need a class. Or, in simple terms, a constructor function. The way to do that is to pass the component object to Vue.extend to create a subclass of the Vue constructor. Now we can create an instance out of it with the new keyword:

import Button from 'Button.vue'
import Vue from 'vue'
var ComponentClass = Vue.extend(Button)
var instance = new ComponentClass()

Hooray! Step 1 cleared! Now we need to insert it in the DOM.

Inserting in DOM

Every Vue instance has a method called $mount on it which mounts the component instance on the element you pass to it (i.e. it replaces the passed element with the component instance). This is not a behavior I wanted. I wanted to insert my component instances inside some DOM element. There is a way to do that too. From the official docs:

If elementOrSelector argument is not provided, the template will be rendered as an off-document element, and you will have to use native DOM API to insert it into the document yourself.

That’s what I did:

import Button from 'Button.vue'
import Vue from 'vue'
var ComponentClass = Vue.extend(Button)
var instance = new ComponentClass()
instance.$mount() // pass nothing
this.$refs.container.appendChild(instance.$el)

There are a couple of things to note in the code above.

First, $refs is the recommended way to get reference to a DOM element in Vue.js. You specify an attribute on the DOM element you want to reference (<div ref="container"></div> in this case) and then that element is available on the set key on component’s $refs property.

Second, to get the native DOM element reference from a Vue component instance, you can use the $el property.

Passing Props to the Instance

Next, I had to pass some props to my Button instance. Specifically, the type prop. The Vue constructor function accepts an options object that we can use to pass in and initialize related things. For passing props, there is a key called propsData which we can use, like so:

import Button from 'Button.vue'
import Vue from 'vue'
var ComponentClass = Vue.extend(Button)
var instance = new ComponentClass({
    propsData: { type: 'primary' }
})
instance.$mount() // pass nothing
this.$refs.container.appendChild(instance.$el)

We are almost done, with one final remaining bit. With the normal template method, we used button like: <Button>Click me!</Button>;. We simply wrote the inner text between the tags and it rendered inside the final button tag with the help of slot. But now how do we pass it?

Setting the Slot

If you have used slots in Vue.js, you might be aware that the slots are accessible on any instance on the $slots property. And if named slots are not used, then slots are available on $slots.default as an array. That is the exact key we’ll modify on the instance to set our button’s inner text. Remember, this needs to be done before mounting the instance. Note that in our case we just put a simple string in the slot because that is all we required. But you can pass more complex DOM to it in form for Virtual nodes or VNode using the createElement function. You can read about creating Virtual nodes in the Vue.js documentation. Thanks to a Vue core team member, Rahul, for suggesting this technique.

import Button from 'Button.vue'
import Vue from 'vue'
var ComponentClass = Vue.extend(Button)
var instance = new ComponentClass({
    propsData: { type: 'primary' }
})
instance.$slots.default = [ 'Click me!' ]
instance.$mount() // pass nothing
this.$refs.container.appendChild(instance.$el)

Final Demo

View Demo

Hope you liked this article. Follow me on Twitter where I share more articles and side projects of mine.


Creating Vue.js Component Instances Programmatically is a post from CSS-Tricks