One Invalid Pseudo Selector Equals an Entire Ignored Selector

Post pobrano z: One Invalid Pseudo Selector Equals an Entire Ignored Selector

Perhaps you know this one: if any part of a selector is invalid, it invalidates the whole selector. For example:

div, span::butt {
  background: red;
}

Even though div is a perfectly valid selector, span:butt is not, thus the entire selector is invalidated — neither divs nor span::butt elements on the page will have a red background.

Normally that's not a terribly huge problem. It may even be even useful, depending on the situation. But there are plenty of situations where it has kind of been a pain in the, uh, <code>:butt.

Here’s a classic:

::selection {
  background: lightblue;
}

For a long time, Firefox didn’t understand that selector, and required a vendor prefix (::-moz-selection) to get the same effect. (This is no longer the case in Firefox 62+, but you take the point.)

In other words, this wasn’t possible:

/* would break for everyone */
::selection, ::-moz-selection {
  background: lightblue;
}

That would break for browsers that understood ::selection and break for Firefox that only understood ::-moz-selection. It made it ripe territory for a preprocessor @mixin, that’s for sure.

That was annoying enough that browsers have apparently fixed it. In a conversation with Estelle Weyl, I learned that this is being changed. She wrote in the MDN docs:

Generally, if there is an invalid pseudo-element or pseudo-class within in a chain or group of selectors, the whole selector list is invalid. If a pseudo-element (but not pseudo-class) has a -webkit- prefix, As of Firefox 63, Blink, Webkit and Gecko browsers assume it is valid, not invalidating the selector list.

This isn’t for any selector; it’s specifically for pseudo-elements. That is, double colons (::).

Here’s a test:

See the Pen Ignored Invalid Selecotrs??? by Chris Coyier (@chriscoyier) on CodePen.

I’d call that a positive change.

The post One Invalid Pseudo Selector Equals an Entire Ignored Selector appeared first on CSS-Tricks.

How to Animate a Creative Reveal Animation in Toon Boom

Post pobrano z: How to Animate a Creative Reveal Animation in Toon Boom

Final product image
What You’ll Be Creating

Learn how to transform your drawing from one look to another in this tutorial. With a few drawings and some Toon Boom tricks, give your character that awesome magical reveal!

1. How to Set Up the Scene

Step 1

Let’s begin by starting up Toon Boom.

I like to customize my resolution settings by clicking the + button and filling in my preferred dimensions. For this project, I set the Width and Height to 850, and the Frame Rate to 12.

When all the boxes are filled in, go ahead and click Create.

Scene settings

Step 2

Next, create the before and after images. It’s best that they have the same pose. Here, their difference is their hair and outfits.

Poses

Step 3

On your Timeline, create your before image on a layer named pose1.

Then create the after image on a new layer named pose2.

Make sure that pose2 is on top of pose1, and make sure they are perfectly aligned with each other.

Pose1 and pose2 layers

Step 4

Create a new layer, and name it rough_path. This will serve as our guide for the effects we will be adding later on.

To animate the path, draw loops around the character from top to bottom.

Rough_path layer

Step 5

Play your animation.

Now, we have a rough idea of what our output will look like. As demonstrated below, larger spaces between drawings result in faster movement, and narrower spaces result in slower movement.

Rough path animation

2. How to Mask Drawings

Step 1

Next, we’re going to create a mask for the transformation effect from pose1 to pose2.

Create a new layer and name it mask. Go to the frame where the drawing from the rough_path layer first makes contact with the pose1 and pose2 layers—in this case, Frame 4.

Mask layer

Step 2

Using the Polyline, create a new shape. The bottom of the shape should conform to the drawing from the rough_path layer. The top of the shape should be able to cover the rest of the character.

Using the Paint tool, fill the shape. The color used isn’t important.

Polyline and paint

Step 3

Do the same for the next frames, until the pose1 and pose2 layers are completely covered.

Extend the last frame by dragging the Playhead to the end of the Timeline and pressing F5.

Complete mask layer

Step 4

Create a new layer named mask2, and Copy and Paste the frames from mask onto this layer.

Copy and paste mask

Step 5

Now, we go to the Network tab. To find it, simply click the downward arrow symbol on your right-side panel, and select Network from the drop-down list.

You’ll see a bunch of nodes that are named according to our layers on the Timeline, and these nodes are connected to a rectangle labelled Composite.

Network

Step 6

If the nodes on your network are all clumped into one spot, simply select all the nodes and click the button with the symbol of three rectangles. If you can’t find this button on your interface, go to Windows > Toolbars and make sure Scripting is checked.

Once the button is clicked, the Order Network Settings tab pops up. Simply click OK, and your nodes will become evenly spaced.

Order network settings

Step 7

On the panel where your camera view is, click the downward arrow symbol and select the Module Library from the drop-down menu.

Look for the Cutter and drag it onto the Network.

Repeat, so that you’ll have two Cutter nodes on the Network.

Cutter

Step 8

Take a look at the Network.

For more consistency, double-click mask and rename it to mask1.

Arrange your network such that the mask1 and pose1 nodes are beside each other, and likewise with the mask2 and pose2 nodes. Then drag a Cutter node right underneath each pair.

Arrange nodes

Step 9

Click the cable of mask2 and drag it to the left-side port of the Cutter.

Click the cable of pose2 and drag it to the right-side port of the Cutter.

Click the bottom port of the Cutter and drag the cable to the Composite.

Click the yellow box on the Cutter node. When the Layer Properties box pops up, make sure the Inverted check box is checked.

Rearrange cables

Step 10

Do the same for the mask1 and pose1 nodes.

On the Layer Properties of the Cutter, make sure the Inverted check box is unchecked.

Repeat

Step 11

Go back to the camera view and play the animation. Now, pose1 and pose2 are properly masked!

Play masked animation

3. How to Add a Blur Effect

Step 1

Go to the Module Library again and look for Matte-Blur. Drag it onto the Network, and then return to the Camera view.

Matte-blur

Step 2

Disable the rough_path layer by clicking the check mark aligned under the eye symbol.

Enable the Render View by clicking the button indicated below. This gives you a preview of what your frame would look like when rendered.

Render view

Step 3

On your Network, take the cable of mask2 and connect it to the Matte-Blur. Connect the Matte-Blur to the left-side port of the Cutter.

Connect matte-blur

Step 4

Click the yellow box on the Matte-Blur node to bring out the Layer Properties settings.

Make the following changes:

  • Blur Type: Directional
  • Radius: 70
  • Directional Angle: 90
  • Directional Falloff Rate: 1
Matte-blur layer properties

Now you have a blur effect on your animation!

Note: You can only see this effect on the Render View or once your project is rendered into video format.

Animation with blur

4. How to Create a Ring of Sparkles

Step 1

Animate three variations of sparkles. We’ll just be using these over and over again.

To animate a sparkle, start by drawing a small dot, and then expand it into a bigger and bigger shape. The shape could be a diamond, or an eight-pointed star, or whatever you like.

Then break the shape apart into several smaller shapes. Make them smaller and spread them apart.

Sparkle variations

Step 2

On the timeline, create new layers for the sparkle animations, namely spark1, spark2, and spark3.

Situate the first drawings of these layers on Frame 2.

Select these three layers, and click the Add Peg button indicated below. This will add pegs to your layers, which helps make the animating easier.

Sparkle layers

Step 3

Make sure the rough_path layer is enabled again.

On Frame 2 of the spark3 peg (or spark3-p), use the Transform tool to drag the drawing to the loop from the rough_path guide.

This creates a Keyframe, which you can see as a red dot that appears on the peg layer.

Keyframe sparkle

Step 4

At the end of the animation, which is on Frame 8, use the Transform tool again to drag the drawing along the guide.

This creates another Keyframe. Now, an animation has been created between the two Keyframes, where the drawings are moving from the first position to the second.

Next keyframe

Step 5

Do the same on spark2-p and spark1-p, and set Keyframes on the start and end of the animations.

You just want to make the sparkle animations follow the loop guides.

Make more keyframes

Step 6

On spark3, copy and paste the frame animation. Basically, select Frame 2 to 8, press Control-C, and then go to Frame 9 and press Control-P.

Copy and paste frame animation

Step 7

Since the animation on the rough_path is quite inconsistent from here, we’re going to set the Keyframes one by one.

Starting on Frame 9, drag the drawing along the loop guide. Then go to the next frame and drag again, and then keep repeating.

Set keyframes

Step 8

Copy and paste the frame animation again up to the end of the scene.

Copy and paste frame animation again

Step 9

Continue dragging the drawing along the loop guide.

When you’ve reached the end of the loop guide or the rough_path animation, drag the sparkle drawing to different parts of the scene.

Continue keyframing

Step 10

Play the animation. Here, we have a few animated sparkles on our scene. 

Now, the goal is to make a whole ring of sparkles surrounding the transformation. 

Play animation

Step 11

Keep Copy and Pasting the three variations of the sparkle animation onto new layers and keep setting Keyframes along the loop guide.

This is the most tedious and repetitive process. Just keep getting creative with the Transform tool, the Reposition All Drawings tool, and Copy and Pasting. Then just keep filling the curve of the loop with as many sparkles as you can manage.

Fill the loop with sparkles

5. How to Set the Background Color

Click the + symbol on the Timeline and select the Colour-Card from the drop-down list. A white color comes out by default.

Double-click the Colour-Card layer so the Layer Properties tab pops up. Click the color on the tab so that a color wheel pops up. Select the color you like, and then close the tabs.

Colour-card

6. How to Export the Scene

When you’re satisfied with your animation, go to File > Export > Movie. Browse where you want to save your animation, and then click OK.

When your animation finishes rendering, you’ll have a .MOV file of your scene.

Export

And We’re Finished! Awesome Job!

Hope you learned a few neat tricks from this tutorial! There’s a lot you can do once you’ve gotten the hang of some basics and learned some cool techniques.

So keep practicing and experimenting to unleash all that creativity inside you!

Finished animation

Looking for more tutorials? Why not try these:

How to Animate a Creative Reveal Animation in Toon Boom

Post pobrano z: How to Animate a Creative Reveal Animation in Toon Boom

Final product image
What You’ll Be Creating

Learn how to transform your drawing from one look to another in this tutorial. With a few drawings and some Toon Boom tricks, give your character that awesome magical reveal!

1. How to Set Up the Scene

Step 1

Let’s begin by starting up Toon Boom.

I like to customize my resolution settings by clicking the + button and filling in my preferred dimensions. For this project, I set the Width and Height to 850, and the Frame Rate to 12.

When all the boxes are filled in, go ahead and click Create.

Scene settings

Step 2

Next, create the before and after images. It’s best that they have the same pose. Here, their difference is their hair and outfits.

Poses

Step 3

On your Timeline, create your before image on a layer named pose1.

Then create the after image on a new layer named pose2.

Make sure that pose2 is on top of pose1, and make sure they are perfectly aligned with each other.

Pose1 and pose2 layers

Step 4

Create a new layer, and name it rough_path. This will serve as our guide for the effects we will be adding later on.

To animate the path, draw loops around the character from top to bottom.

Rough_path layer

Step 5

Play your animation.

Now, we have a rough idea of what our output will look like. As demonstrated below, larger spaces between drawings result in faster movement, and narrower spaces result in slower movement.

Rough path animation

2. How to Mask Drawings

Step 1

Next, we’re going to create a mask for the transformation effect from pose1 to pose2.

Create a new layer and name it mask. Go to the frame where the drawing from the rough_path layer first makes contact with the pose1 and pose2 layers—in this case, Frame 4.

Mask layer

Step 2

Using the Polyline, create a new shape. The bottom of the shape should conform to the drawing from the rough_path layer. The top of the shape should be able to cover the rest of the character.

Using the Paint tool, fill the shape. The color used isn’t important.

Polyline and paint

Step 3

Do the same for the next frames, until the pose1 and pose2 layers are completely covered.

Extend the last frame by dragging the Playhead to the end of the Timeline and pressing F5.

Complete mask layer

Step 4

Create a new layer named mask2, and Copy and Paste the frames from mask onto this layer.

Copy and paste mask

Step 5

Now, we go to the Network tab. To find it, simply click the downward arrow symbol on your right-side panel, and select Network from the drop-down list.

You’ll see a bunch of nodes that are named according to our layers on the Timeline, and these nodes are connected to a rectangle labelled Composite.

Network

Step 6

If the nodes on your network are all clumped into one spot, simply select all the nodes and click the button with the symbol of three rectangles. If you can’t find this button on your interface, go to Windows > Toolbars and make sure Scripting is checked.

Once the button is clicked, the Order Network Settings tab pops up. Simply click OK, and your nodes will become evenly spaced.

Order network settings

Step 7

On the panel where your camera view is, click the downward arrow symbol and select the Module Library from the drop-down menu.

Look for the Cutter and drag it onto the Network.

Repeat, so that you’ll have two Cutter nodes on the Network.

Cutter

Step 8

Take a look at the Network.

For more consistency, double-click mask and rename it to mask1.

Arrange your network such that the mask1 and pose1 nodes are beside each other, and likewise with the mask2 and pose2 nodes. Then drag a Cutter node right underneath each pair.

Arrange nodes

Step 9

Click the cable of mask2 and drag it to the left-side port of the Cutter.

Click the cable of pose2 and drag it to the right-side port of the Cutter.

Click the bottom port of the Cutter and drag the cable to the Composite.

Click the yellow box on the Cutter node. When the Layer Properties box pops up, make sure the Inverted check box is checked.

Rearrange cables

Step 10

Do the same for the mask1 and pose1 nodes.

On the Layer Properties of the Cutter, make sure the Inverted check box is unchecked.

Repeat

Step 11

Go back to the camera view and play the animation. Now, pose1 and pose2 are properly masked!

Play masked animation

3. How to Add a Blur Effect

Step 1

Go to the Module Library again and look for Matte-Blur. Drag it onto the Network, and then return to the Camera view.

Matte-blur

Step 2

Disable the rough_path layer by clicking the check mark aligned under the eye symbol.

Enable the Render View by clicking the button indicated below. This gives you a preview of what your frame would look like when rendered.

Render view

Step 3

On your Network, take the cable of mask2 and connect it to the Matte-Blur. Connect the Matte-Blur to the left-side port of the Cutter.

Connect matte-blur

Step 4

Click the yellow box on the Matte-Blur node to bring out the Layer Properties settings.

Make the following changes:

  • Blur Type: Directional
  • Radius: 70
  • Directional Angle: 90
  • Directional Falloff Rate: 1
Matte-blur layer properties

Now you have a blur effect on your animation!

Note: You can only see this effect on the Render View or once your project is rendered into video format.

Animation with blur

4. How to Create a Ring of Sparkles

Step 1

Animate three variations of sparkles. We’ll just be using these over and over again.

To animate a sparkle, start by drawing a small dot, and then expand it into a bigger and bigger shape. The shape could be a diamond, or an eight-pointed star, or whatever you like.

Then break the shape apart into several smaller shapes. Make them smaller and spread them apart.

Sparkle variations

Step 2

On the timeline, create new layers for the sparkle animations, namely spark1, spark2, and spark3.

Situate the first drawings of these layers on Frame 2.

Select these three layers, and click the Add Peg button indicated below. This will add pegs to your layers, which helps make the animating easier.

Sparkle layers

Step 3

Make sure the rough_path layer is enabled again.

On Frame 2 of the spark3 peg (or spark3-p), use the Transform tool to drag the drawing to the loop from the rough_path guide.

This creates a Keyframe, which you can see as a red dot that appears on the peg layer.

Keyframe sparkle

Step 4

At the end of the animation, which is on Frame 8, use the Transform tool again to drag the drawing along the guide.

This creates another Keyframe. Now, an animation has been created between the two Keyframes, where the drawings are moving from the first position to the second.

Next keyframe

Step 5

Do the same on spark2-p and spark1-p, and set Keyframes on the start and end of the animations.

You just want to make the sparkle animations follow the loop guides.

Make more keyframes

Step 6

On spark3, copy and paste the frame animation. Basically, select Frame 2 to 8, press Control-C, and then go to Frame 9 and press Control-P.

Copy and paste frame animation

Step 7

Since the animation on the rough_path is quite inconsistent from here, we’re going to set the Keyframes one by one.

Starting on Frame 9, drag the drawing along the loop guide. Then go to the next frame and drag again, and then keep repeating.

Set keyframes

Step 8

Copy and paste the frame animation again up to the end of the scene.

Copy and paste frame animation again

Step 9

Continue dragging the drawing along the loop guide.

When you’ve reached the end of the loop guide or the rough_path animation, drag the sparkle drawing to different parts of the scene.

Continue keyframing

Step 10

Play the animation. Here, we have a few animated sparkles on our scene. 

Now, the goal is to make a whole ring of sparkles surrounding the transformation. 

Play animation

Step 11

Keep Copy and Pasting the three variations of the sparkle animation onto new layers and keep setting Keyframes along the loop guide.

This is the most tedious and repetitive process. Just keep getting creative with the Transform tool, the Reposition All Drawings tool, and Copy and Pasting. Then just keep filling the curve of the loop with as many sparkles as you can manage.

Fill the loop with sparkles

5. How to Set the Background Color

Click the + symbol on the Timeline and select the Colour-Card from the drop-down list. A white color comes out by default.

Double-click the Colour-Card layer so the Layer Properties tab pops up. Click the color on the tab so that a color wheel pops up. Select the color you like, and then close the tabs.

Colour-card

6. How to Export the Scene

When you’re satisfied with your animation, go to File > Export > Movie. Browse where you want to save your animation, and then click OK.

When your animation finishes rendering, you’ll have a .MOV file of your scene.

Export

And We’re Finished! Awesome Job!

Hope you learned a few neat tricks from this tutorial! There’s a lot you can do once you’ve gotten the hang of some basics and learned some cool techniques.

So keep practicing and experimenting to unleash all that creativity inside you!

Finished animation

Looking for more tutorials? Why not try these:

CSS Only Floated Labels with :placeholder-shown pseudo class

Post pobrano z: CSS Only Floated Labels with :placeholder-shown pseudo class

The floated label technique has been around for a good long while and the general idea is this: we have an text input with the placeholder attribute acting as a label. When a user types into that input, the label moves from inside the input to outside of it.

Like so:

Although I don’t see this pattern used on the web all that much, I do think it’s an interesting one! There are different approaches to it, but Nick Salloum describes a new one using a combination of :not and :placeholder-shown:

This UI technique does indeed slightly bend the definitions of label and placeholder listed above, in the sense that we’re giving the placeholder more initial importance in having to explain the input to the user, but it’s a tradeoff for a neat UI component, and one that I’m personally comfortable making.

I wonder if there are other peculiar ways :not and :placeholder-shown could be put to use.

Direct Link to ArticlePermalink

The post CSS Only Floated Labels with :placeholder-shown pseudo class appeared first on CSS-Tricks.

Get started with digital publishing with FlipHTML5

Post pobrano z: Get started with digital publishing with FlipHTML5

The FlipHTML5 editor preview

Nowadays, most companies have both a catalog and a website. Each of these communication tools is useful in its own way, but it also has its flaws. Websites lack the catalog layouts and type of organization of information, while catalogs lack the interactive part.

It is actually possible to get the best of both worlds by creating interactive flipbooks. This way, you get to browse your publication and still get access to videos and other interactive elements. However, until not so long ago, it was difficult to create such flipbooks, it required to either have the technical capabilities to code it, or the money to hire a good developer.

Enters FlipHTML5, the online app that makes creating interactive flipbooks as easy as writing Word documents.

FlipHTML5: the editor

FlipHTML5’s editor is a great piece of technology. It combines powerful features with extreme user-friendliness. Everything is drag-and-drop, whether it’s text, images, audio, or videos. Needless to say the learning curve is about 5 seconds. In fact, you can try it for yourself on the online demo. If you find it good, like I did, just create a free account and you are good to go.

If you are a designer, or simply used to work with image editing or layout software, you will have no problem getting started. Every feature is self-explanatory and comes with a useful contextual panel for settings.

The interactive elements you can include in your flipbooks are:

  • Videos from Youtube or Vimeo.
  • Links to a page or to an URL.
  • Audios from a file or from the Internet.
  • Sliders with various formats and effects.
  • Hotspots to bring attention to places on the page.

On top of that, you can create layers just as you would in InDesign, which is great to work on more advanced layouts.

Publishing your flipbooks

Once your interactive flipbook is ready, FlipHTML5 provides you with great features to publish it and have it seen by plenty of people. You can create a customizable homepage on the platform. Even better, with the Platinum version of the tool, you can get a custom domain name for your homepage.

The service also comes with a useful bookcase that automatically collects and stores your publications, making it easier to find and organize your books.

Flexible & secure

The FlipHTML5 developers were very thoughtful and even thought of these cases where your internet connection goes down. Although all your files are cloud-based and available on any device responsively, your publications are still available to you when you are offline.

On top of that, everything is set up in a secured environment, with a great permission system that allows you to keep some files private.

Try it for yourself

If you are interested in creating interactive flipbooks with this powerful tool, you should simply just try it for yourself!

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