Wszystkie wpisy, których autorem jest admin

Meet the New Dialog Element

Post pobrano z: Meet the New Dialog Element

Keith Grant discusses how HTML 5.2 has introduced a peculiar new element: <dialog>. This is an absolutely positioned and horizontally centered modal that appears on top of other content on a page. Keith looks at how to style this new element, the basic opening/closing functionality in JavaScript and, of course, the polyfills that we’ll need to get cross-browser support right.

Also, I had never heard of the ::backdrop pseudo element before. Thankfully the MDN documentation for this pseudo element digs into it a little bit more.

Direct Link to ArticlePermalink


Meet the New Dialog Element is a post from CSS-Tricks

Simplifying the Apple Watch Breathe App Animation With CSS Variables

Post pobrano z: Simplifying the Apple Watch Breathe App Animation With CSS Variables

When I saw the original article on how to recreate this animation, my first thought was that it could all be simplified with the use of preprocessors and especialy CSS variables. So let’s dive into it and see how!

Animated gif. Shows the result we want to get: six initially coinciding circles move out from the middle of the screen while the whole assembly scales up and rotates.
The result we want to reproduce.

The structure

We keep the exact same structure.

In order to avoid writing the same thing multiple times, I chose to use a preprocessor.

My choice of preprocessor always depends on what I want to do, as, in a lot of cases, something like Pug offers more flexibility, but other times, Haml or Slim allow me to write the least amount of code, without even having to introduce a loop variable I wouldn’t be needing later anyway.

Until recently, I would have probably used Haml in this case. However, I’m currently partial to another technique that lets me avoid setting the number of items both in the HTML and CSS preprocessor code, which means I avoid having to modify it in both if I need to use a different value at some point.

To better understand what I mean, consider the following Haml and Sass:

- 6.times do
  .item
$n: 6; // number of items

/* set styles depending on $n */

In the example above, if I change the number of items in the Haml code, then I need to also change it in the Sass code, otherwise things break. In a more or less obvious manner, the result is not the intended one anymore.

So we can go around that by setting the number of circles as the value of a CSS variable we later use in the Sass code. And, in this situation, I feel better using Pug:

- var nc = 6; // number of circles

.watch-face(style=`--nc: ${nc}`)
  - for(var i = 0; i < nc; i++)
    .circle(style=`--i: ${i}`)

We’ve also set the index for every .circle element in a similar manner.

The basic styles

We keep the exact same styles on the body, no change there.

Just like for the structure, we use a preprocessor in order to avoid writing almost the same thing multiple times. My choice is Sass because that’s what I’m most comfortable with, but for something simple like this demo, there’s nothing in particular about Sass that makes it the best choice – LESS or Stylus do the job just as well. It’s just faster for me to write Sass code, that’s all.

But what do we use a preprocessor for?

Well, first of all, we use a variable $d for the diameter of the circles, so that if we want to make them bigger or smaller and also control how far out they go during the animation, we only have to change the value of this variable.

In case anyone is wondering why not use CSS variables here, it’s because I prefer to only take this path when I need my variables to be dynamic. This is not the case with the diameter, so why write more and then maybe even have to come up with workarounds for CSS variable bugs we might run into?

$d: 8em;

.circle {
  width: $d; height: $d;
}

Note that we are not setting any dimensions on the wrapper (.watch-face). We don’t need to.

In general, if the purpose of an element is just to be a container for absolutely positioned elements, a container on which we apply group transforms (animated or not) and this container has no visible text content, no backgrounds, no borders, no box shadows… then there’s no need to set explicit dimensions on it.

A side effect of this is that, in order to keep our circles in the middle, we need to give them a negative margin of minus the radius (which is half the diameter).

$d: 8em;
$r: .5*$d;

.circle {
  margin: -$r;
  width: $d; height: $d;
}

We also give them the same border-radius, mix-blend-mode and background as in the original article and we get the following result:

Chrome screenshot. Shows the expected result we get at this point after applying these properties.
The expected result so far (live demo).

Well, we get the above in WebKit browsers and Firefox, as Edge doesn’t yet support mix-blend-mode (though you can vote for implementation and please do that if you want to see it supported because your votes do count), so it shows us something a bit ugly:

Edge screenshot. No mix-blend-mode support means the overlapping regions don't look any different from the non-overlapping ones and the result is uglyish.
The Edge result doesn’t look that good.

To get around this, we use @supports:

.circle {
  /* same styles as before */
  
  @supports not (mix-blend-mode: screen) {
    opacity: .75
  }
}

Not perfect, but much better:

Edge screenshot. Shows the result we get when we use partial transparency to get a result that's more like the mix-blend-mode one in other browsers.
Using @supports and opacity to fix the lack of mix-blend-mode support in Edge (live demo).

Now let’s look a bit at the result we want to get:

Screenshot of the desired circular distribution with annotations. The whole thing is split into two halves (a left one and a right one) by a vertical midline. The first three circles are in the right half and have a bluish green background, while the last three of the six circles are in the left half and have a yellowish green background. The circles are numbered starting from the topmost one in the right half and then they go clockwise.
The desired result.

We have six circles in total, three of them in the left half and three others in the right half. They all have a background that’s some kind of green, those in the left half a bit more towards yellow and those in the right half a bit more towards blue.

If we number our circles starting from the topmost one in the right half and then going clockwise, we have that the first three circles are in the right half and have a bluish green background and the last three are in the left half and have a yellowish green background.

At this point, we’ve set the background for all the circles to be the yellowish blue one. This means we need to override it for the first half of the six circles. Since we cannot use CSS variables in selectors, we do this from the Pug code:

- var nc = 6; // number of circles

style .circle:nth-child(-n + #{.5*nc}) { background: #529ca0 }
.watch-face(style=`--nc: ${nc}`)
  - for(var i = 0; i < nc; i++)
    .circle(style=`--i: ${i}`)

In case you need a refresher on this, :nth-child(-n + a) selects the items at the valid indices we get for n ≥ 0 integer values. In our case, a = .5*nc = .5*6 = 3, so our selector is :nth-child(-n + 3).

If we replace n with 0, we get 3, which is a valid index, so our selector matches the third circle.

If we replace n with 1, we get 2, also a valid index, so our selector matches the second circle.

If we replace n with 2, we get 1, again valid, so our selector matches the first circle.

If we replace n with 3, we get 0, which isn’t a valid index, as indices are not 0-based here. At this point, we stop as it becomes clear we won’t be getting any other positive values if we continue.

The following Pen illustrates how this works – the general rule is that :nth-child(-n + a) selects the first a items:

See the Pen by thebabydino (@thebabydino) on CodePen.

Returning to our circular distribution, the result so far can be seen below:

See the Pen by thebabydino (@thebabydino) on CodePen.

Positioning

First off, we make the wrapper relatively positioned and its .circle children absolutely positioned. Now they all overlap in the middle.

See the Pen by thebabydino (@thebabydino) on CodePen.

In order to understand what we need to do next, let’s take a look at the following illustration:

SVG Illustration. Shows the circles in their initial (overlapping dead in the middle) and final positions (with the rightmost one being highlighted in its final position). The segment between the central point of this circle in the initial position and in the final position is a horizontal segment of length equal to the circle radius.
The rightmost circle going from its initial to its final position (live).

The central points of the circles in the initial position are on the same horizontal line and a radius away from the rightmost circle. This means we can get to this final position by a translation of a radius $r along the x axis.

But what about the other circles? Their central points in the final position are also a radius away from their initial position, only along other lines.

SVG Illustration. Shows the circles in their initial (overlapping dead in the middle) and final positions. The segments connecting the initial position of their central points (all dead in the middle) and the final positions of the same points are highlighted. They're all segments of length equal to the circle radius.
All circles: initial position (dead in the middle) is a radius away from the final one for each and every one of them (live).

This means that, if we first rotate their system of coordinates until their x axis coincides with the line between the initial and final position of the central points and then translate them by a radius, we can get them all in the correct final position in a very similar manner.

See the Pen by thebabydino (@thebabydino) on CodePen.

Alright, but rotate each of them by what angle?

Well, we start from the fact that we have 360° on a circle around a point.

See the Pen by thebabydino (@thebabydino) on CodePen.

We have six circles distributed evenly, so the rotation difference between any two consecutive ones is 360°/6 = 60°. Since we don’t need to rotate the rightmost .circle (the second one), that one’s at , which puts the one before (the first one) at -60°, the one after (the second one) at 60° and so on.

See the Pen by thebabydino (@thebabydino) on CodePen.

Note that -60° and 300° = 360° - 60° occupy the same position on the circle, so whether we get there by a clockwise (positive) rotation of 300° or by going 60° the other way around the circle (which gives us the minus sign) doesn’t matter. We’ll be using the -60° option in the code because it makes it easier to spot a convenient pattern in our case.

So our transforms look like this:

.circle {
  &:nth-child(1 /* = 0 + 1 */) {
    transform: rotate(-60deg /* -1·60° = (0 - 1)·360°/6 */) translate($r);
  }
  &:nth-child(2 /* = 1 + 1 */) {
    transform: rotate(  0deg /*  0·60° = (1 - 1)·360°/6 */) translate($r);
  }
  &:nth-child(3 /* = 2 + 1 */) {
    transform: rotate( 60deg /*  1·60° = (2 - 1)·360°/6 */) translate($r);
  }
  &:nth-child(4 /* = 3 + 1 */) {
    transform: rotate(120deg /*  2·60° = (3 - 1)·360°/6 */) translate($r);
  }
  &:nth-child(5 /* = 4 + 1 */) {
    transform: rotate(180deg /*  3·60° = (4 - 1)·360°/6 */) translate($r);
  }
  &:nth-child(6 /* = 5 + 1 */) {
    transform: rotate(240deg /*  4·60° = (5 - 1)·360°/6 */) translate($r);
  }
}

This gives us the distribution we’ve been after:

See the Pen by thebabydino (@thebabydino) on CodePen.

However, it’s very repetitive code that can easily be compacted. For any of them, the rotation angle can be written as a function of the current index and the total number of items:

.circle {
  /* previous styles */
  
  transform: rotate(calc((var(--i) - 1)*360deg/var(--nc))) translate($r);
}

This works in WebKit browsers and Firefox 57+, but fails in Edge and older Firefox browsers due to the lack of support for using calc() inside rotate() functions.

Fortunately, in this case, we have the option of computing and setting the individual rotation angles in the Pug code and then using them as such in the Sass code:

- var nc = 6, ba = 360/nc;

style .circle:nth-child(-n + #{.5*nc}) { background: #529ca0 }
.watch-face
  - for(var i = 0; i < nc; i++)
    .circle(style=`--ca: ${(i - 1)*ba}deg`)
.circle {
  /* previous styles */
  
  transform: rotate(var(--ca)) translate($r);
}

We didn’t really need the previous custom properties for anything else in this case, so we just got rid of them.

We now have a compact code, cross-browser version of the distribution we’ve been after:

See the Pen by thebabydino (@thebabydino) on CodePen.

Good, this means we’re done with the most important part! Now for the fluff…

Finishing up

We take the transform declaration out of the class and put it inside a set of @keyframes. In the class, we replace it with the no translation case:

.circle {
  /* same as before */
  
  transform: rotate(var(--ca))
}

@keyframes circle {
  to { transform: rotate(var(--ca)) translate($r) }
}

We also add the @keyframes set for the pulsing animation on the .watch-face element.

@keyframes pulse {
  0% { transform: scale(.15) rotate(.5turn) }
}

Note that we don’t need both the 0% (from) and 100% (to) keyframes. Whenever these are missing, their values for the animated properties (just the transform property in our case) are generated from the values we’d have on the animated elements without the animation.

In the circle animation case, that’s rotate(var(--ca)). In the pulse animation case, scale(1) gives us the same matrix as none, which is the default value for transform so we don’t even need to set it on the .watch-face element.

We make the animation-duration a Sass variable, so that, if we ever want to change it, we only need to change it in one place. And finally, we set the animation property on both the .watch-face element and the .circle elements.

$t: 4s;

.watch-face {
  position: relative;
  animation: pulse $t cubic-bezier(.5, 0, .5, 1) infinite alternate
}

.circle {
  /* same as before */
  
  animation: circle $t infinite alternate
}

Note that we’re not setting a timing function for the circle animation. This is ease in the original demo and we don’t set it explicitly because it’s the default value.

And that’s it – we have our animated result!

We could also tweak the translation distance so that it’s not exactly $r, but a slightly smaller value (something like .95*$r for example). This can also make the mix-blend-mode effect a bit more interesting:

See the Pen by thebabydino (@thebabydino) on CodePen.

Bonus: the general case!

The above is for six .circle petals in particular. Now we’ll see how we can adapt it so that it works for any number of petals. Wait, do we need to do more than just change the number of circle elements from the Pug code?

Well, let’s see what happens if we do just that:

Screenshots. They show the result we get for nc equal to 6, 8 and 9. When nc is 6, we have the previous case: splitting the whole thing into two halves with a vertical line, we have the first three (bluish green) circles in the right half and the last three (yellowish green) circles in the left half. When nc is 8, we also have the first half of the circles (the first four, bluish green) on one side of a line splitting the assembly into two geometrically symmetrical halves and the last four circles (yellowish green) on the other side of the same line. This line however isn't vertical anymore. In the nc = 9 case, all circles are yellowish green.
The result for nc equal to 6 (left), 8 (middle) and 9 (right).

The results don’t look bad, but they don’t fully follow the same pattern – having the first half of the circles (the bluish green ones) on the right side of a vertical symmetry line and the second half (yellowish green) on the left side.

We’re pretty close in the nc = 8 case, but the symmetry line isn’t vertical. In the nc = 9 case however, all our circles have a yellowish green background.

So let’s see why these things happen and how we can get the results we actually want.

Making :nth-child() work for us

First off, remember we’re making half the number of circles have a bluish green background with this little bit of code:

.circle:nth-child(-n + #{.5*nc}) { background: #529ca0 }

But in the nc = 9 case, we have that .5*nc = .5*9 = 4.5, which makes our selector :nth-child(-n + 4.5). Since 4.5 is not an integer, the selector isn’t valid and the background doesn’t get applied. So the first thing we do here is floor the .5*nc value:

style .circle:nth-child(-n + #{~~(.5*nc)}) { background: #529ca0 }

This is better, as for a nc value of 9, the selector we get is .circle:nth-child(-n + 4), which gets us the first 4 items to apply a bluish green background on them:

See the Pen by thebabydino (@thebabydino) on CodePen.

However, we still don’t have the same number of bluish green and yellowish green circles if nc is odd. In order to fix that, we make the circle in the middle (going from the first to the last) have a gradient background.

By „the circle in the middle” we mean the circle that’s an equal number of circles away from both the start and the end. The following interactive demo illustrates this, as well as the fact that, when the total number of circles is even, we don’t have a middle circle.

See the Pen by thebabydino (@thebabydino) on CodePen.

Alright, how do we get this circle?

Mathematically, this is the intersection between the set containing the first ceil(.5*nc) items and the set containing all but the first floor(.5*nc) items. If nc is even, then floor(.5*nc) and ceil(.5*nc) are equal and our intersection is the empty set . This is illustrated by the following Pen:

See the Pen by thebabydino (@thebabydino) on CodePen.

We get the first ceil(.5*nc) items using :nth-child(-n + #{Math.ceil(.5*nc)}), but what about the other set?

In general, :nth-child(n + a) selects all but the first a - 1 items:

See the Pen by thebabydino (@thebabydino) on CodePen.

So in order to get all but the first floor(.5*nc) items, we use :nth-child(n + #{~~(.5*nc) + 1}).

This means we have the following selector for the middle circle:

:nth-child(n + #{~~(.5*nc) + 1}):nth-child(-n + #{Math.ceil(.5*nc)})

Let’s see what this gives us.

  • If we have 3 items, our selector is :nth-child(n + 2):nth-child(-n + 2), which gets us the second item (the intersection between the {2, 3, 4, ...} and {2, 1} sets)
  • If we have 4 items, our selector is :nth-child(n + 3):nth-child(-n + 2), which doesn’t catch anything (the intersection between the {3, 4, 5, ...} and {2, 1} sets is the empty set )
  • If we have 5 items, our selector is :nth-child(n + 3):nth-child(-n + 3), which gets us the third item (the intersection between the {3, 4, 5, ...} and {3, 2, 1} sets)
  • If we have 6 items, our selector is :nth-child(n + 4):nth-child(-n + 3), which doesn’t catch anything (the intersection between the {4, 5, 6, ...} and {3, 2, 1} sets is the empty set )
  • If we have 7 items, our selector is :nth-child(n + 4):nth-child(-n + 4), which gets us the fourth item (the intersection between the {4, 5, 6, ...} and {4, 3, 2, 1} sets)
  • If we have 8 items, our selector is :nth-child(n + 5):nth-child(-n + 4), which doesn’t catch anything (the intersection between the {5, 6, 7, ...} and {4, 3, 2, 1} sets is the empty set )
  • If we have 9 items, our selector is :nth-child(n + 5):nth-child(-n + 5), which gets us the fifth item (the intersection between the {5, 6, 7, ...} and {5, 4, 3, 2, 1} sets)

Now that we can select the item in the middle when we have an odd number of them in total, let’s give it a gradient background:

- var nc = 6, ba = 360/nc;

style .circle:nth-child(-n + #{~~(.5*nc)}) { background: var(--c0) }
  | .circle:nth-child(n + #{~~(.5*nc) + 1}):nth-child(-n + #{Math.ceil(.5*nc)}) {
  |   background: linear-gradient(var(--c0), var(--c1))
  | }
.watch-face(style=`--c0: #529ca0; --c1: #61bea2`)
  - for(var i = 0; i < nc; i++)
    .circle(style=`--ca: ${(i - 1)*ba}deg`)

The reason why we use a top to bottom gradient is that, ultimately, we want this item to be at the bottom, split into two halves by the vertical symmetry line of the assembly. This means we first need to rotate it until its x axis points down and then translate it down along this new direction of its x axis. In this position, the top of the item is in the right half of the assembly and the bottom of the item is in the left half of the assembly. So, if we want a gradient from the right side of the assembly to the left side of the assembly, this is a top to bottom gradient on that actual .circle element.

See the Pen by thebabydino (@thebabydino) on CodePen.

Using this technique, we have now solved the issue of the backgrounds for the general case:

See the Pen by thebabydino (@thebabydino) on CodePen.

Now all that’s left to do is make the symmetry axis vertical.

Taming the angles

In order to see what we need to do here, let’s focus on the desired positioning in the top part. There, we want to always have two circles (the first in DOM order on the right and the last in DOM order on the left) symmetrically positioned with respect to the vertical axis that splits our assembly into two halves that mirror each other.

See the Pen by thebabydino (@thebabydino) on CodePen.

The fact that they’re symmetrical means the vertical axis splits the angular distance between them ba (which is 360° divided by the total number of circles nc) into two equal halves.

SVG Illustration. Shows the circles distributed around a central point with the two at the top (symmetrical with respect to the vertical axis that splits the whole assembly into two mirrored halves) being highlighted. This middle axis splits the angular distance between the central points of these two circles into two equal halves.
Angles formed by vertical symmetry line and the radial lines to the central points of the top angles are both equal to half a base angle (live).

So both are half a base angle (where the base angle ba is 360° divided by the total number of circles nc) away from the vertical symmetry axis, one in the clockwise direction and the other one the other way.

The upper half of the symmetry axis is at -90° (which is equivalent to 270°).

SVG Illustration. Shows degrees around a circle in 90° steps. We start from the right (3 o'clock). This is the 0° and, in general, any multiple of 360° angle. Going clockwise, we have 90° down (at 6 o'clock), 180° on the left (at 9 o'clock) and 270° at the top (12 o'clock). Going the other way from 0°, we have -90° at the top (12 o'clock), -180° on the left (9 o'clock) and so on.
Degree values around the circle (live).

So in order to get to the first circle in DOM order (the one at the top on the right), we start from , go by 90° in the negative direction and then by half a base angle back in the positive direction (clockwise). This puts the first circle at .5*ba - 90 degrees.

SVG Illustration. Shows graphically how to get the angular position of the first circle. Starting from 0° (3 o'clock), we go in the negative direction by 90° (getting at 12 o'clock). Afterwards, we go back in the positive direction by half a base angle.
How to get the angle the first circle is placed at (live).

After that, every other circle is at the angle of the previous circle plus a base angle. This way, we have:

  • the first circle (index 0, selector :nth-child(1)) is at ca₀ = .5*ba - 90 degrees
  • the second circle (index 1, selector :nth-child(2)) is at ca₁ = ca₀ + ba = ca₀ + 1*ba degrees
  • the third circle (index 2, selector :nth-child(3)u) is at ca₂ = ca₁ + ba = ca₀ + ba + ba = ca₀ + 2*ba degrees
  • in general, the circle of index k is at caₖ = caₖ₋₁ + ba = ca₀ + k*ba degrees

So the the current angle of the circle at index i is .5*ba - 90 + i*ba = (i + .5)*ba - 90 degrees:

- var nc = 6, ba = 360/nc;

//- same as before
.watch-face(style=`--c0: #529ca0; --c1: #61bea2`)
  - for(var i = 0; i < nc; i++)
    .circle(style=`--ca: ${(i + .5)*ba - 90}deg`)

This gives our final Pen, where we only need to change nc from the Pug code to change the result:

See the Pen by thebabydino (@thebabydino) on CodePen.


Simplifying the Apple Watch Breathe App Animation With CSS Variables is a post from CSS-Tricks

Trend Watch: Floral, Tropical, and Botanical Design

Post pobrano z: Trend Watch: Floral, Tropical, and Botanical Design

Tropical and botanical design is one of the most popular trends in the industry right now. Let’s find out why below!

Trend Watch: Floral, Tropical, & Botanical Design

There is nothing more cathartic than nature. It has a serene, calming effect that is both enjoyable and soothing.

For creatives, nature is one of our biggest inspirations. Not only do we tend to capture the beauty of the natural world around us, but we can also bring the same calm feeling we experience to the observer.

Today we’ll take a look at one of the most popular trends to hit the industry: floral, botanical, and tropical design. Let’s take a look at its key features and a few of our favorite resources!

Prosto Brochure
Prosto Tropical Brochure

What We Love About This Trend

Designers everywhere love this trend! Here are just a few of its key features:

  • Vibrant colors. Green is the color of vitality, wealth, and nature. And this natural trend instantly freshens up any design with a joyful, vibrant look. Try out bold, vibrant colors for an instant happy design.
  • Stunning leaves and flowers. Areca Palms, Split-Leaf Philodendrons, and Banana Leaves are a few of the most popular plants seen in tropical designs, while floral designs usually stick with blooming roses and daises. Integrate both into your work for a fresh, minimalist-friendly alternative.
  • Inspiring seasonal themes. You can couple your designs with a fun seasonal theme. Try out a summer sunset idea for a beautiful color palette!

Fun Floral & Tropical-Themed Lessons

Do you love this trend too? Check out these tutorials for more inspiration. Learn how to incorporate beautiful botanical leaves and flowers into your work.

20 Amazing Botanical-Themed Design Assets

Can’t get enough sunshine? Download these premium resources from Envato Market and Envato Elements to aid in your nature-inspired designs.

Dive into this high-quality collection of incredible assets, from botanical backgrounds to print templates and more!

Tropical Background

Let’s start with this stunning tropical background. You can drape it around you as a lovely fabric design or incorporate it into a website header. And since it’s a vector file, you’ll be able to enjoy the natural watercolor appearance with a completely lossless design!

Tropical Background

The Floral Alphabet

Spell out your favorite quotes with this awesome floral alphabet. This amazing collage of letters includes gray and pink flowers made into a decorative font. Download it today to create inspiring messages and more.

The Floral Alphabet

Tropical Summer Flyer

Summer-themed flyers are one of the hottest ways to show off your love for the tropics. This design incorporates a mixture of botanical leaves with a vibrant green color palette that your party-goers will definitely love. Enjoy high-quality graphics on a pristine 4×6 inch template.

Tropical Summer Flyer

Abstract Floral Seamless Pattern

Need a few floral elements to complete your work? Then try out this pretty pack of abstract floral patterns. Inspired by a warm summer theme, this pack contains four total patterns available in several standard formats.

Abstract Floral Seamless Pattern

Classy Tropical Invitation

This classy invite set is simply divine! It’s inspired by traditional tropical leaves and incorporates a few into the design. Included in this set is a massive pack of dazzling invites, RSVP cards, and so much more!

Classy Tropical Invitation

Tropical Palm Logo Template

Or celebrate your love for the tropics with an inspiring, chic logo. A perfect companion to any luxury brand, this logo template is simple and easy to use. It’s available in 100% vector format and can be easily adapted to any business with the help of Adobe Illustrator.

Tropical Palm Logo Template

Watercolor & Elements Toolkit

Sometimes a toolkit of the essentials is just what you need to kick-start a new project. Try out this watercolor and elements toolkit for a fun alternative to design burnout. Enjoy 75 custom shapes, 90 watercolor brushes, and 12 unique styles of patterns.

Watercolor  Elements Toolkit

Botanical Magazine Template

If this is the year you’ve ignited your passion for writing, then consider a calming botanical-themed magazine template. Designed with a crisp, clean appearance, this template offers two industry sizes all wrapped up in a 40-page InDesign document.

Botanical Magazine Template

Wild Flower Business Card Template

A stunning business card always leaves a great first impression! This stylish package offers an attractive wild flower theme with plenty of room for your contact details. Download it today for a fun, professional alternative.

Wild Flower Business Card Template

Vintage Floral Wedding Invitation

Weddings are a time for love and fresh, lively flowers! So check out this vintage floral invitation set, perfect for the next bride to be. Aside from a phenomenal collection of colorful invites, you’ll also get access to this stylish black set! Make your invites pop with super pretty flowers!

Vintage Floral Wedding Invitation

Botanical Resume & Letterhead Template

There’s no better way to stand out than with a creative resume. This professional suite includes not only an elegant resume, but an accompanying letterhead template as well. You’ll love the fresh botanical accents like palm leaves and a cute office plant!

Botanical Resume  Letterhead Template

Sepia Flowers Pack

Every designer should have at least one pack of flower assets. This amazing pack of floral clipart includes 20 PNG files of individual flowers and six flower combinations. They’re ideal for wedding invites, handmade crafts, and scrapbooking projects.

Sepia Flowers Pack

Tropical Foliage Pattern

If minimalism is your forte, consider a delightful foliage pattern. This tropical leaf design features hand-drawn patterns that are organic-looking and simple. Use it for a package design or to help your interior spaces shine!

Tropical Foliage Pattern

Floral Faces – Photoshop Action

This cool effect is achieved in just a few moments with the help of a Photoshop action. Floral Faces lets you transform your face into a beautiful tropical garden by working with premade colors and layout orientations. You’ll love this effect!

Floral Faces - Photoshop Action

Summer Unplugged Flyer

Invite your friends to a fun luau with this striking summer flyer. Featuring a creative guitar design covered in tropical flowers, this flyer comes available in two standard sizes. Switch out the details for your own, and even get access to free fonts!

Summer Unplugged Flyer

Floral Breeze Photoshop Action

Green isn’t the only color you’re stuck with for the tropical/botanical trend. This floral breeze Photoshop action applies colorful flowers to your photos with just a few steps. Choose from four different flower types to freshen up your portraits.

Floral Breeze Photoshop Action

75 Photoshop Brushes Watercolor Collection

Photoshop brushes take the work out of creating certain shapes and textures by hand. This massive pack contains 75 high-resolution watercolor brushes with wonderful styles to choose from. Enjoy 60 impressive flowers with helpful extras like wreaths and garlands.

75 Photoshop Brushes Watercolor Collection

Rose Flowers Gold Text Effect

You can, of course, go full on glam with this rose and flowers text effect. A Photoshop action that does all the work for you, this action transforms your text with just one click. It’s super easy to use, so beginners to Photoshop will love the simple process!

Rose Flowers Gold Text Effect

Tropical Island Illustration

Still
working on your Illustrator skills? Then complete your designs with a
vibrant island illustration like the one below. Featuring two palm
trees, an energetic ocean, and a beaming sun in the background, this 100% vector illustration is perfect for brochures and more.

Tropical Island Illustration

Spring Flyer Template

Lastly, we have this delightful spring flyer great for any tropical-themed party. Featuring jungle leaves and an exotic flowers pattern, this template also offers a creative double exposure effect. Enjoy a neat twist on the botanical theme and download it today!

Spring Flyer

Show Us Your Designs!

If you’re as fond of the tropical and floral trend as we are, show us your work! Post a result showing us how you work with the tropical/botanical theme, and let us know your favorite styles in the comments below.

This has been a collection of tutorials and premium resources perfect for the avid designer. For more trendy botanical design assets, check out Envato Market and Envato Elements. Happy Designing!

How to Create an Easter Egg Flyer in Adobe InDesign

Post pobrano z: How to Create an Easter Egg Flyer in Adobe InDesign

Final product image
What You’ll Be Creating

Celebrate the Easter weekend with this cheerful flyer design. Inspired by mid-century style, this would make a lovely promotional flyer for an Easter egg hunt or other spring-themed event.

We’ll put together the flyer layout in Adobe InDesign, and dip into Illustrator to create our egg graphics. This is a simple design that would be a great introduction to print design for beginners.

If you’re looking for an instant flyer fix, these easy-to-edit flyer templates on GraphicRiver and Envato Elements might fit the bill. Make sure to take a look!

Let’s get started!

What You’ll Need to Create Your Flyer

As well as access to InDesign and Illustrator, you’ll also need to download the following image and font files:

Save the texture file to a folder you can easily come back to, and install the font files on your system. Then you’re ready to start designing your flyer.

1. How to Create a Color Palette for Your Flyer

Step 1

Open up InDesign and go to File > New > Document.

Make sure the Intent is set to Print and uncheck the Facing Pages box. Set the Width of the page to 8.5 in and Height to 11 in

Keep the Margins to their default value, and add a Bleed of 0.25 in to all edges of the page. Then click OK.

new document

Step 2

Expand the Layers panel (Window > Layers) and double-click on the Layer 1 name to open the Options window. Rename the layer Background and click OK

Choose New Layer from the panel’s drop-down menu (accessible at the top-right corner), and rename this second layer Shadows. Click OK.

Create a further three new layers in this order: Eggs, Typography, and finally Texture at the top of the sequence. 

layer options

Then lock all layers except Background at the bottom. 

layers panel

Step 3

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

new color swatch

Name this new swatch Sky Blue, and set the Type to Process and the Mode to CMYK. Then adjust the percentage levels below to C=62 M=4 Y=13 K=0.

sky blue swatch

Step 4

Repeat the process, building up a palette of 17 CMYK swatches in total:

  • Mink: C=33 M=33 Y=44 K=14
  • Orange: C=0 M=68 Y=75 K=0
  • Lime: C=19 M=10 Y=81 K=1
  • Pink: C=0 M=51 Y=20 K=0
  • Mustard: C=3 M=13 Y=93 K=0
  • Blush: C=3 M=27 Y=25 K=0
  • Chocolate: C=33 M=70 Y=92 K=40
  • Yolk Yellow: C=3 M=36 Y=92 K=0
  • Tomato: C=0 M=93 Y=83 K=0
  • Pea Green: C=68 M=0 Y=88 K=0
  • Burnt Red: C=0 M=85 Y=94 K=0
  • Sage: C=58 M=17 Y=50 K=2
  • Green: C=58 M=17 Y=85 K=2
  • Pink White: C=0 M=5 Y=0 K=0
  • Slate: C=65 M=50 Y=44 K=36
  • Brown Black: C=52 M=53 Y=56 K=52
brown black swatch

Step 5

With the Background layer still unlocked, take the Rectangle Tool (M) and drag across the whole page, extending the shape up to the edge of the bleed on all sides. 

From the Swatches panel, set the Fill Color to Slate.

background layer

2. How to Create Colorful Easter Eggs for Your Flyer

Step 1

For this stage, we’ll need to move over to Illustrator for a moment. Minimize but don’t close your InDesign window, and open up Illustrator

Go to File > New, and create a new document at any size. 

Take the Arc Tool (from the Line Segment Tool pop-out menu), and draw a rough ‘C’-shaped curve onto the page. Try to make the lower part of the curve more generous than the top, to mimic the shape of a half-egg. 

arc tool

Step 2

Right-Click > Copy the curved line and Edit > Paste it. Right-Click on the copy and Transform > Reflect.

reflect

In the Reflect window, check Vertical to flip the curve and click OK to exit.

reflect

Then position the curve perfectly against the original, to create a whole egg shape. Select both curves and Right-Click > Join to unite the lines into a single vector shape.

Then Copy the egg shape, and minimize Illustrator.

join

Step 3

Head back to your InDesign document and lock the Background layer. Unlock the layer above, Eggs.

Edit > Paste to drop the egg vector directly onto the page. Holding Shift while you resize it, scale it to a width of around 1.77 in (visible in the Controls panel running along the top of your workspace), and position it in the top-left corner of the page.

egg shape

From the Swatches panel, change the Fill Color of the egg to Sky Blue.

sky blue egg

Step 4

Expand the Stroke panel (Window > Stroke). With the egg selected, set the Width of the stroke to 0.75 pt and choose Dashed from the Type drop-down menu. This will add a little bit of texture to the edge of the shape, softening it. 

From the Stroke panel, set the Stroke Color of the egg to Sky Blue to match the fill.

stroke dashed

Step 5

Edit > Copy, Edit > Paste the egg shape, moving the copy over to the right of the original. Adjust the Fill and Stroke Color to Mink

mink swatch

Paste two more eggs, moving them over to the right, creating a row of four eggs in total. Tweak the spacing and position to ensure they are evenly spaced. 

Set the Fill and Stroke Color of the third egg to Orange, and the fourth to Yolk Yellow. 

yolk yellow swatch

Step 6

Select all four eggs, and Right-Click > Copy, and Paste.

copied eggs

Position the four copies in a row below the first, adjusting the color of each, from left to right, to Lime, Pink, Mustard, and Sky Blue. 

second row

Repeat, creating a third row, set in Blush, Chocolate, Yolk Yellow, and Tomato.

third row

Paste in a final row, setting the colors to Pea Green, Burnt Red, Sage, and Green.

flyer with eggs

3. How to Format Retro-Inspired Typography on Your Flyer

Step 1

Lock the Eggs layer and unlock the layer above, Typography

Take the Type Tool (T), and drag to create a text frame over the top of the egg shape in the top-left corner of the page. 

Type in ‘e’, and from the Character panel (Window > Type & Tables > Character), set the Font to Compass Rose CPC Bold, Size 140 pt.

compass rose

From the Swatches panel, set the Font Color to Pink White. 

pink white text

Step 2

Select the text frame and Right-Click > Copy, and Paste

copy

Edit the text to read ‘a’, and position it over the top of the second egg along. 

pasted frame

Paste another copy of the text frame, adjusting the text to ‘s’, and placing it over the top of the third egg in the row. 

text frame

Step 3

Select all three text frames and Copy and Paste

copy

Move over the second row of eggs, adjusting the letters to read ‘t’, ‘e’, and ‘r’.

text frames

Then Paste another row of text frames onto the third row, shifting them to the right, with the pale pink egg blank. Edit the text to read ‘e’, ‘g’, and ‘g’.

And Paste another sequence of frames over the top of the final row, adding an extra text frame, and changing the text to read ‘h’, ‘u’, ‘n’, and ‘t’.

text frames

Step 4

Use the Type Tool (T) to create another text frame over the top of the egg in the top-right of the flyer. 

Type in the day, date, and time of the event, and set the Font to Compass Rose CPC Bold, Size 23 pt. 

Set the text to Align Center from the Controls panel at the top, and adjust the Font Color to Brown Black.

You can separate lines of text, such as the time shown here, by highlighting a line and increasing the Leading (line-spacing) in the Character panel. 

leading

Click on the Superscript button in the Controls panel to make the ‘st’ or ‘nd’ of a date smaller, as shown below. 

superscript

Step 5

Copy and Paste the date text frame, moving it over the blank blue egg below. Adjust the text to read the location of your event, and tweak the Font Size so that the text is large and legible. 

location text

You can also add another text frame, perhaps listing the price of the event, over the top of the pale pink egg on the third row. 

entry fee

4. How to Add Collage Effects and Vintage Texture to Your Flyer

Step 1

Lock the Typography layer and unlock the Shadows layer. Zoom in on the top-left corner of the flyer, and switch to the Pen Tool (P).

We’re going to create a collage-style vintage effect behind each egg, which will give the shapes a rough cut-out pale shadow. Trace very roughly around the perimeter of the blue egg…

pen tool

… taking it around the whole shape and meeting at the beginning. 

shadows layer

Step 2

Set the Stroke Color of the shadow to [None] and the Fill to Pink White. 

pen tool

Repeat the process for the next egg, looping a rough shadow around the shape and setting the Fill to Pink White.

pink white

Do the same for the third egg along, too, and the fourth as well.

pen tool

Step 3

Copy and Paste the shadows, moving them behind each egg. Vary the scale and position of them slightly to add variation. 

shadows
shadows

Step 4

Lock the Shadows layer and unlock the top layer, Texture

Take the Rectangle Frame Tool (F) and drag over the top of the whole flyer. Go to File > Place, and choose the PNG version of ‘Texture-8’ in the vintage textures pack you downloaded earlier. Click Open, and allow the texture to fill the whole image frame. 

texture

Step 5

Click on the texture image frame and head up to Object > Effects > Transparency. Set the Mode to Screen and click OK

screen

Select the image frame and Edit > Copy, Edit > Paste in Place. 

With the copy of the frame selected, head back to Object > Effects > Transparency, and pull down the Opacity to 45%, before clicking OK

screen

Your flyer artwork is finished—great job! All that’s left to do now is export it as a PDF ready for printing. 

5. How to Export Your Flyer for Print

Step 1

First, make sure to File > Save all of your hard work. Then go to File > Export. Name your file, and choose Adobe PDF (Print) from the Format drop-down menu. Then click Save.

In the Export Adobe PDF window that opens, choose [Press Quality] from the Preset menu at the top. 

press quality

Step 2

Click on Marks and Bleeds in the window’s left-hand menu.

Check All Printer’s Marks and Use Document Bleed Settings.

export pdf

Then click Export to create your PDF. 

pdf exported

Conclusion: Your Finished Flyer

Your PDF file is ready to send off for professional printing—great job! All you need to do now is post it up on noticeboards and spread the word about your fun Easter event. 

In this tutorial, we’ve covered several techniques for creating print designs in InDesign, including how to set up a flyer layout and format typography. We’ve also looked at how to use fonts, textures, and colors to bring a vintage, mid-century vibe to your design. 

If you’re looking for more help with flyers, these easy-to-edit flyer templates on GraphicRiver and Envato Elements will suit a wide range of occasions and look fantastic too!

easter flyer

Design deals for the week

Post pobrano z: Design deals for the week

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

The Delightful Bundle Vol II

Jam-packed with 25 fonts from 20 different font families, this amazing font bundle comes in at JUST $0.80 per font.

$19 instead of $299 – Get it now!

Beautiful Handwritten Madelyn Script Family

Time to extend your family! With the Madelyn Handwritten Script Font Family, you’ll be bringing home two unique font styles: Madelyn Script and Madelyn Black. These handwritten script fonts is a masterful blend of calligraphy pen and casual dry strokes. Packed with 500+ letters, over 100 ligatures and 70+ ornaments, Madelyn can bring your latest designs to a whole new level.

$17 instead of $37 – Get it now!

Designer’s Dream: 8 Premium Fonts & 575+ Fabulous Graphic Resources

Whether you’re starting from scratch or looking to bolster your artistic toolbox, this Mighty Deal is just magnificent! A Designer’s Dream, you’ll start with 8 premium fonts ranging from the curvaceously glamorous to the quirky and cool. But you’ll also get 8 graphic resource packs full to the brim with more than 575 professional floral elements, frames, arrows, wreaths, patterns, clipart, icons and so much more.

$17 instead of $239 – Get it now!

MOTOPRESS: WordPress Page Builder with Premium Extensions

Thousands of customers already use WordPress the MotoPress way. MotoPress is a powerful WordPress Page Builder plugin, which makes it possible to create and customize websites for diverse niches, with no coding skills. Assemble a full-blown WordPress website with just one Page Builder plugin – MotoPress Content Editor and its highly-functional addons. No need to compare and choose extra plugins for different purposes for you or your client, no need to wait for updates from dozens of providers, no need to fuss with compatibility issues.

$19 instead of $119 – Get it now!

6 Tips for Getting Web Design Right

Post pobrano z: 6 Tips for Getting Web Design Right

Source: Pixabay

Whether you’ve been a web designer for a decade or just a couple of months, the early days of getting started on a web development and design project can be nerve-wracking. There are numerous moving parts and clients, no matter their size or budget, expect high quality of work.

The design lifecycle incorporates requirement specification, scope definition, wireframe and sitemap creation, content development, interface design and testing (including penetration testing as provided by firms such as CBI). So much could go wrong. Yet, it doesn’t have to as long as there’s robust planning and preparation.

The following design tips will help you stay the course and deliver to the customer’s satisfaction.

1.   Define Expectations

You cannot really meet the client’s expectations unless you know what those expectations are. If you are working with a client who has commissioned one or more websites before, defining targets and outcomes will be a fairly straightforward process. However, if your client has no previous experience, they may find it difficult to articulate exactly what they need.

When it comes to web design, few things are more depressing than a client realizing halfway that what you are building is not what they wanted. That’s why setting expectations and goals is the single most important phase of the entire project. Develop a simple questionnaire that you’ll use to extract the requisite information from the client.

Questions should seek to establish the purpose of the website, who its target audience is, what it aims to achieve and how its success will be measured. With these answers, prepare a document outlining your understanding of the client’s expectations and share it with them for final verification. Going through this process will drastically reduce the likelihood of surprises later on.

2.   Prioritize Content

One of the biggest mistakes web designers make is to take the word ‘design’ as a license to concentrate on aesthetics. Content is still king. No amount of beautiful design can replace great content. Good content stimulates engagement while engagement triggers action.

Find out what content the client would like to share on the site and then design with the intention of making the content stand out and appeal to the target audience. For instance, if you are creating an e-commerce store, focus on highlighting the products as opposed to blending them in with everything else on the page.

3.   Adhere to Web Standards

Being unconventional is fun, but when it comes to web standards, that’s not something you can afford to do. Your client’s audience has already gotten used to existing standards and you do not want to make things difficult for them. Successful websites are intuitive and following convention is one way to achieve that.

There’s no reason for users to have to learn a new design model in order to navigate the site. For example, nearly every e-commerce store places the shopping cart in the top right corner of the page. It’s not because that’s the most attractive place to put it. Rather, visitors have grown accustomed to finding the shopping cart there.

Other examples of web design convention include placing the logo in the top left corner, contact in the top right, the search box in the header and consistent branding throughout the website.

4.   Make it Easy to Navigate

If visitors cannot quickly move from one section to another, they’re likely to lose enthusiasm and this means the website will have failed to achieve its goals. Navigation design must minimize the amount of information and steps required for users to move between sections and pages.

You have to put yourself in the shoes of the audience and lay out the most logical steps a typical visitor would follow in their journey across the site. Help them do what they want to do as opposed to forcing them along a path they aren’t interested in. Familiarize yourself with navigation best practices, including the most common patterns of mobile navigation.

5.   Prioritize Mobile

The way the average person accesses the internet has changed radically over the last decade. Desktop PCs have lost their dominance. The exponential growth of smartphones and tablets means the majority of the world’s population today accesses the web primarily through a mobile device.

From watching videos, posting on social media, shopping and just general searches, mobile is where it’s all happening now. Optimizing a website for the mobile experience used to be an afterthought. Nowadays, it’s a critical requirement. The site must be fully operational on mobile which means text, images, calls to action and shopping carts must work as flawlessly on mobile as they do on a desktop browser.

6.   Integrate Social Media

Just like mobile, social media has moved from the early days of MySpace when it was on the fringes of internet conversations to a colossus that has its tentacles in every nook and cranny of the world wide web. Facebook, the behemoth in this space, has more than 2 billion active users.

Social media is where the bulk of internet users spend the most time on the internet. The website must leverage that to its advantage. By integrating the site with social media, you increase the likelihood of visitors sharing the product and contents with their network thus increasing visitor traffic.

The above tips are useful in getting you moving in the right direction, but do not cover everything you need to build a successful website. Web design is an art and there’s only so much you can learn from books or on the web. In reality, you’ll make some mistakes and experiment with different options before you eventually perfect your craft.

Stephen is an influencer marketing pro with brownboxbranding.com who is passionate about building authentic relationships and helping businesses connect with their ideal online audience. She keeps her finger on the pulse of the ever-evolving digital marketing world by writing on the latest marketing advancements and focuses on developing customized blogger outreach plans based on industry and competition.

“Stop Using CSS Selectors for Non-CSS”

Post pobrano z: “Stop Using CSS Selectors for Non-CSS”

I saw Nicole Dominguez tweet this the other day:

say it louder for the people in the backhttps://t.co/prDKo5QaZi

— nicole (@sodevious) January 11, 2018

I wasn’t at this conference, so I have very little context. Normally, I’d consider it a sin to weigh in on a subject brought up by looking at two out-of-context slides, but I’m only weighing in out of interest and to continue the conversation.

The idea seems to be that if you need to select an element in the DOM with JavaScript, don’t use the same selector as you would in CSS.

So if you have…

<article class="article">
</article>

…and you need to apply an event listener to that article for some reason, then don’t use…

$(".article")

(or querySelector or whatever, I assume.)

Instead, apply an attribute intended just for the JavaScript to target, like…

<article class="article" data-hoverable>
</article>

…and target that like…

$("[data-hoverable]")

The idea is that you can separate jobs. The class has the job of styling, and the data attribute has the job of JavaScripting. Both can change without affecting each other.

Seems reasonable to me.

Also seems like there is plenty to talk about here. Performance, I suppose, but that’s probably the least-interesting thing since selectors are generally pretty damn fast these days. We could continue the conversation by talking about:

  • What naming convention?
  • Should you be naming events?
  • What if it needs to be selected for different reasons multiple times?
  • Can you or should you use IDs?
  • Is it worth avoiding DOM selection at all if you can?
  • What other nuances are part of this discussion?

I saw Michael Scharnagl had some thoughts on his own usage of ID’s, classes, and data-attributes that could help frame things a bit.


“Stop Using CSS Selectors for Non-CSS” is a post from CSS-Tricks