Author: Rita

  • Grayscale Backdrop Filter: What It Is and How to Use It

    Grayscale Backdrop Filter: What It Is and How to Use It

    Hello there! 😃 In CSS, we have a really helpful property called backdrop-filter. It’s like a special filter that applies grayish shades to the backgrounds. A useful tool when we want to focus on a part of the webpage without changing the actual element itself. Mm… 🤔 that is a little bit tricky! Isn’t it? Let’s grab a cup of coffee ☕ and move forward! We will clarify everything in this post about using a grayscale backdrop filter. 👩‍💻

    How the backdrop filter works

    So, how does this property really work? We will begin by setting the backdrop-filter property to grayscale(percentage), where the percentage determines the intensity of the grayscale effect, ranging from 0% to 100%. A value of 100% turns the color into a complete grayscale color, while a value of 0% will keep the element’s original color shades without any grayscale effect.

    This CSS property is not quite noticeable on black or white backgrounds because it adds shades of gray, and black is already the darkest shade while white is the lightest one. In simpler words, black and white will not get converted to grayscale because it already belongs to the darkest side of grayscale.

    For the filter to work properly, as a first step, we need to set the background-color property of the parent element. Afterward, we add the backdrop filter to the child elements we want to apply the grayscale effect. The backdrop filter will only affect the child element’s background color but not its content, text, images, etc.

    As a result, the parent element maintains its original background color, while the child element’s background is desaturated, creating a monochromatic, grayscale effect.

    Create a grayscale backdrop filter effect

    This HTML and CSS code above creates a <section> element (father) with a <p> element (child) inside. The section has a background color in a shade of pinkish peach, defined by the hex color code #f99bab. Initially, the paragraph inherits the same background color.

    <section>
      <p>...</p>
    </section
    HTML
    /* PARENT ELEMENT */
    section {
      background-color: #f99bab; // a shade of pinkish peach
    }
    
    /* CHILD ELEMENT */  
    p {
      backdrop-filter: grayscale(50%);
    }
    CSS

    We continue with the <p> element styled by a backdrop-filter with a grayscale value of 50%. This effect visually desaturates the paragraph’s background (the paragraph inherits its background from its parent, the section). This means that the colors where the backdrop filter is applied (the area behind the element) will be desaturated to 50%. As a result, a grayscale effect will be applied where the colors are halfway between their original color and grayscale while leaving the content unaffected.

    In simple terms, by setting this code, we create a parent element with a shade of pinkish peach-colored background, and its child element has a somewhat muted, desaturated appearance while at the same time retaining some of the original pink color.

    Α p html element inside a section element.  They both have the same background color, a shade of pinkish peach (#f99bab).
    without grayscale
    Α p html element inside a section element. Its background color is a shade of pinkish peach (#f99bab). The child emelent had the backdrop-filter: grayscale(50%) CSS property which means the background color is a shade of pinkish peach desaturated  by 50%.
    with grayscale(50%)

    A grayscale-themed table

    Below, I have included a table that visually presents some possible variations of the grayscale backdrop filter effect. 😃

    Α table with different grayscales in each row. We have a zero grayscale, a 20%, 40%, 60% and finally 100%.
  • How To Calculate CSS Line Height

    How To Calculate CSS Line Height

    Hello there! 😃 Today, we’ll explore how we can calculate the CSS line height property, which defines the height of a line on a webpage. Each line contains the main content (text) as well as the space above and below the content ↕ (line-height). While the default value for desktop browsers is 1.2, we should keep in mind that it can vary depending on the font family. We can also set a custom line-height according to our preferences.

    ⛔ Please note that the system does not accept negative values. The default value will be automatically used if a negative value is entered.

    Below, I have drafted a plan that might help you understand things better. Check it out:

    Below is an example to explain this CSS property more analytically.

    HTML structure for CSS line height

    We create an HTML document with four headings <h1> . All headings have the same content (text) but different classes, each with unique characteristics concerning the line-height.

    <h1 class="line-height-normal">Hello World</h1>
    <h1 class="line-height-1">Hello World</h1>
    <h1 class="line-height-2">Hello World</h1>
    <h1 class="line-height-negative-value">Hello World</h1>
    HTML

    CSS structure for CSS line height

    We will move forward with our CSS code and add the necessary characteristics. The first heading has a class with line-height: normal, the second one has a class with line-height: 200px, the third one has a class with line-height: 300px, and the fourth has a class with line-height: -300px (⛔ negative value). 

    I am using different background-color for each class to easily distinguish them and notice the results clearly. 😉

    .line-height-normal {
      background-color: #ffe6cc;
      line-height: normal;
    }
    
    .line-height-1 {
      background-color: #ffcc99;
      line-height: 200px;
    }
    
    .line-height-2 {
      background-color: #ffb366;
      line-height: 300px;
    }
    
    .line-height-negative-value {
      background-color: #E2964A;
      line-height: -300px;
    }
    CSS

    In the image that follows, we can see the differences between the four headings regarding their line-height ↕.

    Utilizing the line-height CSS property can significantly improve text clarity and visual appeal, creating a comfortable reading experience for users. ✨ 😃

  • All You Need to Know About the CSS nth child Selector

    All You Need to Know About the CSS nth child Selector

    The CSS nth child selector is an extremely useful tool for targeting and styling the nth element within a group of similar HTML elements on a webpage. It’s really handy for organizing your code and helps you pick elements based on their position in a sequence. It’s also part of a larger group of selectors.

    You can apply specific styles like color or size to just that nth item or to combinations with the nth item in a list or group, making it different from all the others.

    The “nth” is a mathematical term that refers to any position in a list or sequence, such as the first, second, third, and so on. A sequence is a set of numbers or elements that follow a particular pattern or rule.

    Below are examples of utilizing this selector. Let’s proceed and explore its uses in more detail. 🧐

    We will use the same HTML code snippet for all instances. We have seven child elements inside our body element. Each one represents an ice cream cone. Yes! You read correctly! An ice cream cone! Let’s make our learning a bit fun! The empty cones remain unaffected, while the cones that have ice cream strawberry 🍓 flavor 🍦 on top are styled based on the nth-child() selector.

    <div>First child element</div>
    <div>Second child element</div>
    <div>Third child element</div>
    <div>Fourth child element</div>
    <div>Fifth child element</div>
    <div>Sixth child element</div>
    <div>Seventh child element</div>
    HTML

    Let’s imagine that what you see below would be rendered on the screen if each div child element was actually a cone.

    The CSS nth-child() selector. Seven ice cream cones side by side.

    Styling the first element with nth-child(1)

    The nth-child(1) selector targets and styles only the first element. So, in our case, we add ice cream strawberry 🍓 flavor 🍦 only to the top of the first cone. All the other cones remain unaffected.

    div:nth-child(1) {
      background-color: pink;
    }
    CSS
    Seven ice cream cones one next to other. The first cone has ice cream strawberry flavor.  All the others remain unaffected. We set the css nth-child(1) selector.

    * If we want to target the third child, use :nth-child(3), and similarly for other positions.

    Seven ice cream cones one next to other. The third cone has ice cream strawberry flavor.  All the others remain unaffected. We set the css nth-child(3) selector.

    Styling only the last element with nth-last-child(1)

    The nth-last-child(1) selector targets and styles only the last element as it counts backward. That’s why we added the word last in our selector. So that it will pick the first (1) element from the end of the list.

    div:nth-last-child(1) {
      background-color: pink;
    }
    CSS
    Seven ice cream cones one next to other. The last cone has ice cream strawberry flavor.  All the others remain unaffected. We set the css nth-last-child(1) selector.

    * If we want to pick the fourth child from the end, we set the :nth-last-child(4), etc.

    Seven ice cream cones one next to other. The fourh cone counting backward has ice cream strawberry flavor.  All the others remain unaffected. We set the css nth-last-child(4) selector.

    Select all elements apart from the last one

    Combing the nth-last-child selector with the not pseudoclass, we can target and style all elements apart from the last one. That’s why, in this example, we added the word :not and then the word last in our selector, indicating we wanted all but not the last one (1). 🤔

    div:not(:nth-last-child(1)) {
      background-color: pink;
    }
    CSS
    Seven ice cream cones one next to other. The last one remain unaffected.  All the others have ice cream strawberry flavor. We set the css :not(:nth-last-child(1)) selector.

    *If we want to pick all elements apart from the first one we can erase the last word and set the :not(:nth-child(1)) etc.

    Seven ice cream cones one next to other. The first one remain unaffected.  All the others have ice cream strawberry flavor. We set the css :not(:nth-child(1)) selector.

    Target every odd child element

    Using the word “odd” in our nth-child selector we can target and style every other element, specifically the 1st, 3rd, 5th, 7th and so on

    *Odd numbers are those that, when divided by 2, always leave a remainder of 1.

    div:nth-child(odd) {
      background-color: pink;
    }
    CSS
    Seven ice cream cones one next to other. The 1st, 3rd, 5th and last have ice cream strawberry flavor.  All the others remain unaffected. We set the css nth-child(odd) selector.

    Target every even child element

    Just as we did for odd elements, we can also target even elements by using the keyword “even” in our nth-child selector. This allows us to style every second element, specifically the 2nd, 4th, 6th, and so on

    *Even numbers are those that can be divided by 2 and leave no remainder.

    div:nth-child(even) {
      background-color: pink;
    }
    CSS
    Seven ice cream cones one next to other. The 2nd, 4th and 6th clouds  have ice cream strawberry flavor. All the others remain unaffected. We set the css nth-child(even) selector.

    Advanced math tricks with CSS nth child selector

    The nth-child() selector offers great flexibility, allowing us to create combinations that target multiple child elements simultaneously.

    Selecting elements based on multiplying by the nth-child()

    By using nth-child(3n) we target every third element. In this example, the 3rd element is the first one selected. From there, we move three steps forward forward to the next target, which is the 6th element.

    The n in 3n starts at 0 and increases incrementally with each integer (0, 1, 2, 3…).
    By multiplying n by 3 we target elements at positions that are multiples of 3 (0, 3, 6, 9…).

    div:nth-child(3n) {
      background-color: pink;
    }
    CSS
    Seven ice cream cones one next to other. The 3rd and 6th have ice cream strawberry flavor. All the others remain unaffected. We set the css nth-child(3n) selector.

    Select elements based on multiplies with the nth-child(), counting backward

    When using the nth-last-child(3n)selector we target every third element, but this time, it starts counting from the end. In our case, we have seven elements. Starting counting from the 7th one, the 5th element is the first we pick. Then we continue by taking three steps backward to the second choice, which is the 2nd element.

    The n in 3n starts at 0 and increases incrementally with each integer (0, 1, 2, 3…).
    The number 3 we assign to n shows multiplies of it, but we also have the last word in our selector, which indicates we start counting from the last child towards the first one.

    div:nth-last-child(3n) {
      background-color: pink;
    }
    
    
    CSS
    Seven ice cream cones one next to other. The 3rd and 6th have ice cream strawberry flavor. All the others remain unaffected. We set the css nth-child(3n) selector.

    Pick elements that appear after a specific point

    This one seems more complicated. 😰 Let’s analyze it a bit more! 🧐

    When using the nth-child(n + 3) selector, we are targeting the third element and all subsequent elements. If we use n + 5, it would start counting from the fifth element onward, including the fifth element itself, and continue until the end.

    The (n) starts at 0 and increases incrementally with each integer (0, 1, 2, 3…).
    The (+ 3) means that the selector starts matching from the 3rd element onward.

    Here’s how n works under the hood:

    n=0 selects the 3rd element (0 + 3 = 3).
    n=1 selects the 4th element (1 + 3 = 4).
    n=2 selects the 5th element (2 + 3 = 5).
    n=3 selects the 6th element (3 + 3 = 6).
    n=4 selects the 7th element (4 + 3 = 7).

    div:nth-child(n + 3) {
      background-color: pink;
    }
    
    
    CSS
    Seven ice cream cones one next to other. The two first remain unaffected.  From the third all the others till the end have ice cream strawberry flavor. We set the css nth-child(n + 3) selector.

    Select elements that appear up to a specific point

    Using nth-child(-n+3), the selector targets elements up to a specific point, setting a limit to which element will stop. In our case, it picks and styles all the elements up to and including the third element.

    The (n) represents 0.
    The (-n) by itselft is not used in CSS selectors because it does not correspond to any valid child positions. However when combined with a positive number (e.g. :nth-child(-n + 3)), it allows to select the child elements up to and including the specified position, such as the 3rd child.
    The (+ 3) part of the selector means that the selector matches elements up to and including the 3rd element..

    Here’s how n works in practice:

    n=0 selects the 3rd element (-0 + 3 = 3).
    n=1 selects the 2nd element (-1 + 3 = 2).
    n=2 selects the 1st element (-2 + 3 = 1).
    n=3 selects no child element (-3 + 3 = 0). 😮

    div:nth-child(-n + 3) {
      background-color: pink;
    }
    
    
    CSS
    Seven ice cream cones one next to other. The three first have ice cream strawberry flavor.  From the fourth and all the other cones till the end remain unaffected. We set the css nth-child(n - 3) selector.

    :nth-child(n + X) targets every element from the Xth onward, ensuring the Xth element is also included.
    WHILE
    :nth-child(-n + X) targets every element up to and including the Xth element.

    Pick a range of elements

    If we combine the previous two types of the nth-child selector, we can pick and style a portion of elements. In our example, all elements between the 3rd and the 6th element. Both the start (3rd element) and the end (6th element) are included.

    The :nth-child(n + 3) selector targets all children starting from the third element onward.

    The :nth-child(-n + 6) selector targets all children up to the sixth element.

    div:nth-child(n + 3):nth-child(-n + 6) {
      background-color: pink;
    }
    
    
    CSS
    Seven ice cream cones one next to other. From the third cone up to sixth first have ice cream strawberry flavor. All the other cones (1st, 2nd, 7th) remain unaffected. We set the css nth-child(n + 3):nth-child(-n + 6) selector.

    Select the first element and then every third element

    The n starts at 0 and increases by 1 with each step, representing all integer values (0, 1, 2, 3, …)

    Using the expression (n + 1) we determine which elements we want to pick.

    By applying the multiplier 3n, we instruct CSS to target every third element in the sequence.

    Combining all those charectistics we get:

    When n is 03n + 1 => 3 * 0 + 1 = 1, so it selects the 1st child.
    When n is 13n + 1 => 3 * 1 + 1 = 4, so it selects the 4th child.
    When n is 23n + 1 => 3 * 2 + 1 = 7, so it selects the 7th child, etc.

    div:nth-child(3n + 1) {
      background-color: pink;
    }
    
    
    CSS
    Seven ice cream cones one next to other. From the third cone up to sixth first have ice cream strawberry flavor. All the other cones (1st, 2nd, 7th) remain unaffected. We set the css nth-child(n + 3):nth-child(-n + 6) selector.

    Choose the first element and then every third element, counting backward

    Same as before, but this time, we start picking elements from the end, as indicated by the word last in our selector.

    The n starts at 0 and increases by 1 with each step, representing all integer values (0, 1, 2, 3, …)

    Using the expression (n + 1) we determine which elements we want to pick.

    By applying the multiplier 3n, we instruct CSS to target every third element in the sequence.

    Let’s see how that works:

    When n is 03n + 1 => 3 * 0 + 1 = 1, so it selects the 1st child from the end which is the 7th child.
    When n is 13n + 1 => 3 * 1 + 1 = 4, so it selects the 4th child.
    When n is 23n + 1 => 3 * 2 + 1 = 7, so it selects the 7th child from the end which is the 1th child.

    div:nth-last-child(3n + 1) {
      background-color: pink;
    }
    
    
    CSS
    Seven ice cream cones one next to other. From the third cone up to sixth first have ice cream strawberry flavor. All the other cones (1st, 2nd, 7th) remain unaffected. We set the css nth-child(n + 3):nth-child(-n + 6) selector.

    Choose the second element and then every third element

    The same logic applies as in the previous example, except that in this case, we are using subtraction with the selector 3n-1

    The n starts at 0 and increases by 1 with each step, representing all integer values (0, 1, 2, 3, …)

    Using the expression (n - 1) we determine which elements we want to pick.

    By applying the multiplier 3n, we instruct CSS to target every third element in the sequence.

    Now that we know what each part does, let’s dive in and see how CSS works when using this selector:

    When n is 0 then 3n - 1 => 3 * 0 - 1 = -1, so it selects no child. (I know 🥱)
    When n is 1 then 3n - 1 => 3 * 1 - 1 = 2, so it selects the 2nd child.
    When n is 2 then 3n - 1 => 3 * 2 - 1 = 5, so it selects the 5th child, etc.

    div:nth-child(3n - 1) {
      background-color: pink;
    }
    
    
    CSS
    Seven ice cream cones one next to other. The 2nd and 5th have ice cream strawberry flavor. All the other cones (1st, 3rd, 4th, 6th and 7th) remain unaffected. We set the css nth-child(3n + 1) selector.

    Using + or - in the selector may sometimes result in the same outcome. In our example, doing 3n+2 or 3n-1, ends up targeting the second element and then every third element onward. However, it’s important to understand that the underlying logic is different.

    Select the second element and then every third element, counting backward

    Same as before, but this time, we start picking from the end since we have the word last in our selector.

    The n starts at 0 and increases by 1 with each step, representing all integer values (0, 1, 2, 3, …)

    Using the expression (n - 1) we determine which elements we want to pick.

    By applying the multiplier 3n, we instruct CSS to target every third element in the sequence.

    Let’s dive in and see whats happening:

    When n is 0 then 3n - 1 => 3 * 0 - 1 = -1, so it selects no child.
    When n is 1 then 3n - 1 => 3 * 1 - 1 = 2, so it selects the 2nd child from the end.
    When n is 2 then 3n - 1 => 3 * 2 - 1 = 5, so it selects the 5th child from the end, etc.

    div:nth-last-child(3n - 1) {
      background-color: pink;
    }
    
    CSS
    Seven ice cream cones one next to other. The 3rd and 6th have ice cream strawberry flavor. All the others remain unaffected. We set the css nth-child(3n) selector.

    Select all elements

    Although the nth-child() selector is made in order to target specific positions or patterns among children, we can also use it to match all child elements at once by assigning the n inside the parenthesis ().

    The n lets the selector match elements at any position inside the parent element. This flexibility allows us to pick elements and apply styles without specifying an exact position. As a result, we can target all possible positions. 😎
    Additionally, we have all our cones full of delicious strawberry 🍓 flavor 🍦 ice cream! So, this is by far the sweetest choice!

    div:nth-child(n) {
      background-color: pink;
    }
    
    
    CSS
    Seven ice cream cones one next to other. All of them have ice cream strawberry flavor. We set the css nth-child(n) selector.

    I hope you enjoyed our little trip to the “ice cream CSS nth child” land!! 🎉 🎉 Keep going till next time!! 🍓 🍦 ✨

  • Introduction To The Powerful CSS Blur Effect

    Introduction To The Powerful CSS Blur Effect

    Hello everybody 😃 Today, we will discover the art of the powerful CSS blur effect. Get ready to meet the amazing backdrop-filter CSS property. We’ll dive 🤿 into the world of adding visual elegance and depth to our web design, and we will learn to create captivating and stunning web elements. Let’s get started!

    Adding basic HTML structure

    Let’s get started with the HTML setup. We create a parent div named custom-container for the background and a child div named blurry-container where we will apply the CSS blur effect. Follow along for the step-by-step process.

    <div class="custom-container">
      <div class="blurry-container"></div>
    </div>
    HTML

    Adding the background image

    We move forward with the CSS structure by preparing the background. I opted for a striking and colorful background image as it is more impressive and gives prominence to our effect, setting background-image. I also add background-repeat which determines how the background image is shown, and background-size which sets the size of the image, in our case we want to fill the entire display. Completing it with height: 100vh for full-screen coverage.

    .custom-container {
      background-image: url(https://images.unsplash.com/photo-1540959733332-eab4deabeeaf?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=1194&q=80);
      background-repeat: no-repeat;
      background-size: cover;
      height: 100vh;
    }
    CSS

    The next step is to create a “place” where we can accommodate our blur, I believe a box would serve this need. To begin, I create one by setting the appropriate width and height along with its border and border-radius. I utilized borders to ensure my box remains visible. Whether to keep them or not is entirely up to you. The design can still look great in both cases. Feel free to choose whichever option suits your preference or the project’s requirements. 😃

    .blurry-container {
      border: 2px solid white;
      border-radius: 5px;
      width: 400px;
      height: 500px;
    }
    CSS

    If we want our box to share the same image as its background, and not just be transparent, it is crucial to add the background: inherit CSS property.

    In the following image, we can see clearly that our box now has the exact same image as its background.

    .blurry-container {
      ...
      background: inherit;
    }
    CSS

    Now it’s time to center our box. We do so by applying the flex CSS property to the parent HTML element which is the custom-container.

    .custom-container {
      ...
      display: flex;
      align-items: center;
      justify-content: center;
    }
    CSS

    Adding the blur effect (backdrop-filter)

    We create the blur effect using the pseudo-element :before. To manage this, we have to set position:relative to the parent element and position: absolute to the child. The child element needs the content CSS property to be assigned an empty string value in order to be displayed. Despite the recent code adjustments, you won’t notice any visible changes on the screen just yet. 😭

    .custom-container {
      ...
      position: relative;
      .blurry-container {
        ...
        &:before {
          position: absolute;
          content: "";
        } /* end of before */
      } /* end of blurry-container */
    } /* end of custom-container */
    SCSS

    Let’s proceed with our effect. 🥁 We do so by adding the backdrop-filter CSS property to :before pseudoelement. Increasing the pixel value intensifies the blur effect by creating a stronger visual impact. I’ve applied a 12px blur effect, but you have the flexibility to adjust it according to your preferences. If you desire a clearer look, feel free to reduce ⬇ the pixels. Alternatively, for a stronger fade effect, you can increase ⬆ the pixel value.

    &:before {
      ...
      backdrop-filter: blur(12px);
    }
    SCSS

    🔖 What to avoid when applying the blur effect

    Remember that the blur effect can sometimes get out of control on a web page because of how it’s applied to an element. When you use the blur effect, it makes the element bigger, like it’s expanded, depending on how much blur you want. So, the more blur you add, the larger the element becomes. Because of that, the element might grow so big that it spills out of its box or crashes into nearby elements. 😟

    Observe how the blur CSS property overflows in the current setup above. To correct that, apply the overflow: hidden CSS property to the PARENT element custom-container. With this modification, you can control the blur effect and prevent it from causing a mess on your web page.

    .custom-container {
      ...
      overflow: hidden;
    }
    SCSS

    … and boom 🥳 here it is! Our blur effect displayed flawlessly, as intended!

    Complete code solution

    Below is the full code referenced in this blog post. Feel free to copy and use it in your own projects. If you have any questions or encounter any issues, don’t hesitate to reach out for assistance. You can easily copy the desired code snippet by clicking on the copy icon, located in the top-right corner of each snippet.

    <section class="custom-container">
      <div class="blurry-container">
        <div class="title">Hello World</div>
      </div> <!-- end of blurry-container -->
    </section> <!-- end of customer-container -->
    HTML
    * {
      box-sizing: border-box;
      padding: 0;
      margin: 0;
    }
    
    .custom-container {
      height: 100vh;
      display: flex;
      align-items: center;
      justify-content: center;
      background-image: url(https://images.unsplash.com/photo-1540959733332-eab4deabeeaf?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=1194&q=80);
      background-repeat: no-repeat;
      background-size: cover;
    
      .blurry-container {
        position: relative;
        border: 2px solid white;
        border-radius: 5px;
        width: 400px;
        height: 500px;
        padding: 100px 50px;
        display: flex;
        align-items: center;
        justify-content: center;
        background: inherit;
        overflow: hidden;
        &:before {
          content: "";
          position: absolute;
          top: -20px;
          left: -20px;
          bottom: -20px;
          right: -20px;
          box-shadow: inset 0 0 300px rgba(25, 100, 128, 0.5);
          backdrop-filter: blur(12px);
        }
        .title {
          font-size: 50px;
          color: #132216;
          font-weight: bold;
          padding: 5px 20px;
          border: 2px solid #364739;
          border-radius: 50px;
          backdrop-filter: blur(8px);
        }
      } /* end of blurry-container */
    } /* end of customer-container */
    SCSS
    Expand

    Complete code solution for post’s cover

    Below, I include the code for my post’s cover. I also added a title to see how we add text over the blur effect. 😎

    <section class="custom-container">
      <div class="blurry-container">
        <div class="title">Hello World</div>
      </div> <!-- end of blurry-container -->
    </section> <!-- end of customer-container -->
    HTML
    * {
      box-sizing: border-box;
      padding: 0;
      margin: 0;
    }
    
    .custom-container {
      height: 100vh;
      display: flex;
      align-items: center;
      justify-content: center;
      background-image: url(https://images.unsplash.com/photo-1440342359743-84fcb8c21f21?w=800&auto=format&fit=crop&q=60&ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxzZWFyY2h8MTJ8fGZvcmVzdHxlbnwwfDB8MHx8fDA%3D);
      background-repeat: no-repeat;
      background-size: cover;
      .blurry-container {
        position: relative;
        border: 2px solid #364739;
        border-radius: 20px;
        width: 500px;
        height: 300px;
        padding: 100px 50px;
        display: flex;
        align-items: center;
        justify-content: center;
        background: inherit;
        overflow: hidden;
        &:before {
          content: "";
          position: absolute;
          top: -20px;
          left: -20px;
          bottom: -20px;
          right: -20px;
          box-shadow: inset 0 0 100px rgba(100, 200, 100, 0.8);
          backdrop-filter: blur(2px);
        }
      } /* end of blurry-container */
      .title {
        font-size: 50px;
        color: #132216;
        font-weight: bold;
        padding: 5px 20px;
        border: 2px solid #364739;
        border-radius: 50px;
        backdrop-filter: blur(8px);
      }
    } /* end of customer-container */
    SCSS
    Expand
  • The Burnout Syndrome – How to Identify and Overcome It

    The Burnout Syndrome – How to Identify and Overcome It

    In today’s fast world, especially in web development and programming, the pressure to continuously deliver elevated code can be really stressful. Long hours spent in front of laptops and tough deadlines. Additionally, the persistent dream of perfection and leadership can negatively affect even the most passionate and devoted developers.
    This intense environment often leads to burnout syndrome, a state of emotional, physical, and mental exhaustion that can significantly impact your personal and professional life.

    Signs that Indicate You Are Experiencing Burnout Syndrome

    Burnout can be incredibly challenging, especially in programming. It is often caused by long hours, high pressure of time, and a constantly changing technological landscape that requires continuous learning and adaptation. Below are some ways to recognize burnout syndrome. Identifying these signs early can help you take action to manage and prevent this situation, ensuring you stay healthy and productive.

    Battling (or Paddling) Against the Tide of Decreased Productivity

    We begin with the strongest and most obvious sign of burnout. You are not productive anymore. Your energy for work drops, and you feel unable to cope with continuous demands. You find it hard to concentrate, and eventually, you find yourself making more mistakes than usual. Occasionally, it’s hard to finish tasks on time.
    Additionally, meetings can be confusing, sometimes you might feel like you are not really there. Working with others can also be tricky because you constantly feel that you are not good enough for this job and can’t cope with your work duties.

    Lack of Motivation and Interest

    Another clear indicator of burnout is that stress can result in a lack of interest and motivation in things that were previously meaningful to you. Tasks that once excited you now feel like enemies that only push you and cower 🥊 you to the corner.
    There is a lack of motivation. Although you want to be creative and productive, you always feel tired and lazy, making it difficult to start new projects or complete things you’ve already taken on.
    As time goes by, this becomes more and more intense, and eventually, you lose interest at all. You don’t care about work, life, activities, or, worse, about people. Everything seems stressful and meaningful.

    The Awful, Never-Ending Exhaustion

    A further prominent signal of burnout is the persistent feeling of exhaustion, which encloses both physical and mental tiredness. This condition appears as a constant sense of tiredness, accompanied by feelings of frustration and despair that may become part of your daily experience.
    Additionally, you may experience difficulties with memory retention and problem-solving, and you may lack the ability to concentrate and think creatively or critically. Moreover, this level of exhaustion usually leads to physical symptoms such as headaches, sleep disorders, and various stress-related health issues.

    Struggling with Negativity and Loneliness

    Eventually, you develop extremely negative and critical feelings about yourself, your work, and those around you. It’s hard to find pleasure and happiness in your accomplishments and in your relationships with colleagues or other people outside of your working environment.
    Also, you seem to be experiencing a noticeable emotional disconnect. You appear to feel detached from your work and associates, and as a result, you find yourself seeking isolation on a frequent basis.

    How to overcome Burnout Syndrome

    When things get tough, it’s really important to take care of yourself first. Adopting the following methods can help you overcome burnout and maintain a healthier, more balanced work and life approach.

    Set Boundaries: Saying No and Prioritizing Tasks

    The most important factor in avoiding burnout is to educate yourself to say no. Refuse to take on additional work if you are already busy, and don’t feel obligated to do things you are not responsible for. It is crucial to respect your working environment, but it’s equally important for your working environment to respect you.
    Furthermore, prioritize your tasks. Break your projects into small, manageable pieces. In addition, create a diary with clear work hours and guard your personal time by avoiding reviewing emails or working late into the night or on weekends. Also, it is really critical to understand that you have to stop using your personal mobile phone or social media for work.

    Recharge with Self-Care, Breaks and Hobbies

    One effective way to maintain productivity and mental well-being during work is to ensure you get enough sleep, eat healthy food, and aim for balanced meals consumed regularly throughout the day. Taking care of your body helps your mind stay sharp.
    Additionally, include regular breaks on a daily basis. Taking short breaks, such as going for a short walk, can significantly contribute to refreshing your mind and re-energizing your body.
    Dedicate time to engaging in both cognitive and physical activities that fill you with joy and satisfaction beyond your work duties. For example, enjoy cognitive and creative activities such as painting and making puzzles or physical activities like volleyball and running. Hobbies can improve a relaxing and vital break, allowing you to restore energy and also enhance your mental and physical health.

    Build a supporting network

    Remember to seek support from others when you need it. Talk to friends, family, or colleagues about your situation and express your feelings. Sometimes, just sharing can relieve some stress. Count on your loved ones for advice in order to simplify your thoughts and discover other viewpoints.
    If you continue to feel crushed by burnout, seeking assistance from a therapist or counselor could be beneficial. They can suggest techniques for facing your difficulties and propose strategies to help you cope and recover.

    From Stress to Serenity – One Free Afternoon for Yourself

    Finally, keep at least one afternoon inside the week for yourself and schedule Nothing. Yes, you read it correctly. Nothing. React spontaneously. Think. What do you really need at this moment? What are your thoughts right now? Don’t think of anyone else. Just yourself. Turn an afternoon into a mini vacation and spend it focusing only on you.
    What do you miss most? Is it a walk? 👟 Maybe shopping therapy? 🛍 No? So, what is it? Something more relaxing? Reading a book 📗 close to your cat? 🐈 Still no? Oh! I found it! You just need to grab a coffee, a donut, your skateboard and play in the park! Oh, yes! That’s it for today!
    Something brand new is coming your way next week! Get ready and enjoy every moment!

    Recognizing and handling burnout syndrome is crucial for having a sustainable and also satisfying career in web development and programming. By setting boundaries and realistic goals, prioritizing self-care, fostering a healthy work-life balance, surrounding yourself with people and activities you prefer, and ensuring free time, you can protect yourself from the harmful effects of burnout. Remember, you are as important as the code you write. Take time to rest and recharge, and you’ll find yourself not only more productive but also more passionate about your work. See you around! 🎈✨

    Cute happy astronaut.
    Image by catalyststuff on Freepik
  • How to Make a Transparent Button Using HTML and CSS

    How to Make a Transparent Button Using HTML and CSS

    Hey there! 😃 In today’s technology-driven world, it’s super important to learn how to create an awesome transparent button. A well-designed button not only adds to the product’s aesthetic appeal but also enhances the user experience. Therefore, it’s essential to create buttons that are both visually appealing and functionally efficient.

    Let’s work together, utilizing only HTML and CSS, to design the perfect button that stands out and enhances your app’s user-friendliness.

    HTML basic structure

    First, we prepare our HTML code snippet. We need to create a parent element with the class .wrapper that acts as the base of the button. Next, we add a child element within the parent element that will serve as the clickable part of the button. This child element has the class .custom-button . Doing so will help us create an interactive button that users can click on, to perform an action. How amazing is this! 😎

    <div class="wrapper">
      <button class="custom-button"></button>
    </div>
    HTML

    CSS foundation

    Let’s continue by using our CSS magic and making our button look cool! For this post, I am writing CSS using Sass syntax. If you would like to convert it to vanilla CSS and don’t already know how, I’d suggest you use an online Sass —CSS converter.

    Create the base for the transparent button

    First of all, we set the background-color of the body to dark grey and also add some extra positioning properties in order for our button to be centered. We will be using the same color for our button, by applying the background: transparent CSS property, along with some width and height of our choice in the .wrapper class.

    We are also applying a border-radius of 80 pixels and a box-shadow with carefully selected shades of grey. It is important to select the appropriate shades to ensure the desired outcome. 😉

    For our example, we are placing the clickable part of the button in the center of the base. For that reason, we are using the flex method.

    body {
      background-color: darkgrey;
      height: 100vh;
      
      display: flex;
      align-items: center;
      justify-content: center;
    }
    
    .wrapper {
      width: 500px;
      height: 140px;
      background: transparent;
      border-radius: 80px;
      box-shadow: inset 0px 3px 5px #c6c2c2,
        0px 5px 5px #727070;
    
      display: flex;
      align-items: center;
      justify-content: center;
    } 
    SCSS

    Take a look at the image below to see what’s currently rendered on screen.

    Create the clickable part of the transparent button

    We proceed with the clickable area of our button. After applying some basic dimensions, we need to make sure the background is set to transparent as we did before, with the base part of the button. After that, we adjust the border-radius and box-shadow to inherit, so that these attributes would be identical to the base. To remove any natively applied border styling we use border: none.

    .custom-button {
      width: 460px;
      height: 100px;
      background: transparent;
      border-radius: inherit;
      box-shadow: inherit;
      border: none;
    }
    SCSS

    Below, you see what’s on the screen now, with the clickable (top) part of our button added.

    Add the button text

    To begin, we use the flex method to center the button’s text appropriately. Then we add the text using the :before CSS pseudoselector, adding “hover me” as the content. I used a bold, 45-pixel blue text with a black shadow effect. For enhanced readability, I opted for the Arial font-family as it is really legible. 🆒 ✨

    .custom-button {
      ...
      font-family: 'Arial';
      font-size: 45px;
      color: #12528e; /* a shade of blue */
      font-weight: bold;
      display: flex;
      align-items: center;
      justify-content: center;
      &:before {
        position: absolute;
        content: "hover me";
        text-shadow: -2px -1px black;
      }
    }
    SCSS

    In the following image, we can see what’s displayed on the screen now.

    Apply the hover effect of the transparent button

    Now, is the appropriate time to implement the hover effect. We can achieve this by adding the :hover CSS pseudo-class with the cursor set to pointer. After that, we will use :before again to modify the text content to display “click me”.

    .custom-button {
      ...
      &:hover {
        cursor: pointer;
        &:before {
          content: "click me";
        }
      }
    }
    SCSS

    Below, we can observe 🔎 the hover effect in action. Moving the cursor over the button, immediately transforms from arrow ⬆ into pointer 👆(hand), and the text content changes. The hover effect is a widely used design technique that adds interactivity and visual interest to a webpage.

    Apply the active effect of the transparent button

    Now, we can add the :active state to the button to finish our work. Once we click on the button, the active state will be triggered. To make it look more realistic and impressive, we adjust the box-shadow CSS property.

    Additionally, we will modify the text content using the :before CSS property and change it to be inspiring and display the text “Good Job!” in indigo color with white text-shadow.

    .custom-button {
      ...
      &:active {
        box-shadow: 0px -1px 3px #969393,  /* top side */
          inset 0px 5px 3px #b7b5b5, /* inset top side */
          inset 1px 0px 3px #969393, /* inset left side */
          inset -1px 0px 3px #969393, /* inset right side */
          inset 0px -4px 3px #969393; /* inset bottom side */
        &:before {
          content: "Good Job!";
          color: indigo;
          text-shadow: -2px -1px white;
        }
      }
    }
    SCSS

    At this moment, you can witness 🧐 the active effect in action. Take a moment to observe and analyze how the effect is taking place and what impact it has. This will help you gain a better understanding of the process and its outcomes, which can be useful for future reference and decision-making. 😇 So, good luck with your work!

    Complete code solution

    Below is the full code referenced in this blog post. Feel free to copy and use it in your own projects. If you have any questions or encounter any issues, don’t hesitate to reach out for assistance. You can easily copy the desired code snippet by clicking on the copy icon, located in the top-right corner of each snippet.

    <div class="wrapper">
      <button class="custom-button"></button>
    </div>
    HTML
    body {
      background-color: darkgrey;
      height: 100vh;
      
      display: flex;
      align-items: center;
      justify-content: center;
    }
    
    .wrapper {
      width: 500px;
      height: 140px;
      background: transparent;
      border-radius: 80px;
      box-shadow: inset 0px 3px 5px #c6c2c2,
        0px 5px 5px #727070;
    
      display: flex;
      align-items: center;
      justify-content: center;
    }
    
    .custom-button {
      width: 460px;
      height: 100px;
      background: transparent;
      border-radius: inherit;
      box-shadow: inherit;
      border: none;
      font-family: 'Arial';
      font-size: 45px;
      color: #12528e; /* a shade of blue */
      font-weight: bold;
      display: flex;
      align-items: center;
      justify-content: center;
      &:before {
        position: absolute;
        content: "hover me";
        text-shadow: -2px -1px black;
      }
      &:hover {
        cursor: pointer;
        &:before {
          content: "click me";
        }
      }
      &:active {
        box-shadow: 0px -1px 3px #969393,  /* top side */
          inset 0px 5px 3px #b7b5b5, /* inset top side */
          inset 1px 0px 3px #969393, /* inset left side */
          inset -1px 0px 3px #969393, /* inset right side */
          inset 0px -4px 3px #969393; /* inset bottom side */
        &:before {
          content: "Good Job!";
          color: indigo;
          text-shadow: -2px -1px white;
        }
      }
    }
    SCSS
    Expand
  • How To Make A CSS Text Reflection Effect

    How To Make A CSS Text Reflection Effect

    Hi there! 😃 In this post, we’ll learn bit by bit how to create a CSS text reflection effect. When we say reflection, we’re referring to a mirror-like effect that looks like the text reflects on a surface, much like the way we see our reflection in a mirror.

    This is a simple yet amazing way to enhance the appearance of your text. Let’s analyze our effect so that you can easily follow along.

    HTML structure

    We will begin with our HTML structure. As you can see below, I prepared a div with the class .reflection-text , this is where our effect will take place.

    <div class="reflection-text">HELLO WORLD</div>
    CSS

    CSS foundation

    Let’s move forward with the CSS basic structure. We start with defining the background. It’s worth noting that using radial-gradient can make our effect more impressive. 😃

    body {
      background: radial-gradient(lightgreen, darkgreen);
      height: 100vh;
    }
    CSS

    Below, we can see the background we just created.

    In web development, we use the flex method in order to center our text. Then we will enhance its appearance, by making some adjustments. We will set the font-size to 100 pixels, select the “Roboto” font-family, and choose white as the text color.

    body {
      ...
      display: flex;
      align-items: center;
      justify-content: center;
    }
    
    .reflection-text {
      font-size: 100px;
      font-family: 'Roboto', sans-serif;
      color: white;
    }
    CSS

    This is what is rendered on the screen for now. A perfectly centered, 🎯 white text.

    Adding the CSS structure for the reflection effect

    Creating a reflection can be achieved by using pseudoelements like :before and :after. To ensure this works properly, we need to include position: relative in our .reflection-text class.

    .reflection-text {
      ...
      position: relative;
    }
    CSS

    Now, we are ready to proceed and create our reflection by adding the :before pseudoelement with all the necessary properties, as shown in the following code snippet.

    .reflection-text:before {
      content: "HELLO WORLD";
      position: absolute;
      top: 65px;
      transform: rotate(180deg) scaleX(-1);
      background: linear-gradient(
        to bottom, 
        rgba(255, 255, 255, 0) 20%, 
        rgba(255, 255, 255, 0.5) 60%, 
        rgba(255, 255, 255, 2) 100%
      );
      background-clip: text;
      color: transparent;
      opacity: 0.3;
    }
    CSS

    Breaking down the process

    🟢 To begin, we add the text “HELLO WORLD” to create another text element with the same content. This new text will serve as our reflection. Then, we set position: absolute so that we can move our reflected text below the original text. We use the top property to move the reflected text 65 pixels from the top, but you can always move the reflection in any direction you prefer. It is important to position the text and its reflection closely together for a more realistic reflection effect. 😉

    🟢 We move forward and use the transform CSS property to rotate the text by 180 degrees

    and then flip it horizontally using scaleX(-1). Now we have the perfect reflection! Let’s continue and make it more realistic.

    🟢 In the next step, we will adjust the color of our reflected text. To achieve this, we will utilize the linear-gradient CSS property and specify the direction as downwards. This will create white gradients, with the top appearing more intense and gradually fading towards the bottom of the text.

    🟢 It is commonly known that gradients cannot be directly applied to texts. Don’t worry! 🤔 We already have the solution to this problem. For now, let’s give a quick explanation. To create a clipped linear background pattern for text, first, we add the -webkit-background-clip: text property, and at the same time, we set the color to transparent, and our text automatically turns to transparent. In that way, our text takes the background: linear-gradient as its real color.

    🟢 For a more transparent text, we can adjust the opacity. The lower the opacity, the more transparent our text becomes. So, here we are! Our reflection is ready! 🥳

    Exploring different colors

    🔖 It is always an option to use black or any other color in our work. Below, I’ve included examples of texts with black, purple, and green colors. It’s important to remember that the key factor is to set the correct gradients at the linear-gradient property. That way, we can create respective shades. Therefore, please give extra attention to that! 😊

    Black text

    .reflection-text {
      position: relative;
      font-size: 100px;
      font-family: 'Roboto', sans-serif;
      color: black; /* default color */
    }
    CSS
    .reflection-text:before {
      content: "HELLO WORLD";
      position: absolute;
      top: 65px;
      transform: rotate(180deg) scaleX(-1);
      background: linear-gradient(to bottom, 
      rgba(0, 0, 0, 0) 20%, 
      rgba(0, 0, 0, 0.5) 60%, 
      rgba(0, 0, 0, 2) 100%);
      background-clip: text;
      color: transparent;
      opacity: 0.3;
    }
    CSS

    Purple Text

    .reflection-text {
      position: relative;
      font-size: 100px;
      font-family: 'Roboto', sans-serif;
      color: purple;
    }
    CSS
    .reflection-text:before {
      content: "HELLO WORLD";
      position: absolute;
      top: 65px;
      transform: rotate(180deg) scaleX(-1);
      background: linear-gradient(to bottom, 
      rgba(255, 55, 205, 0) 20%, 
      rgba(255, 55, 205, 0.5) 60%, 
      rgba(255, 55, 205, 2) 100%);
      background-clip: text;
      color: transparent;
      opacity: 0.3;
    }
    CSS

    Green Text

    .reflection-text {
      position: relative;
      font-size: 100px;
      font-family: 'Roboto', sans-serif;
      color: green;
    }
    CSS
    .reflection-text2:before {
      content:"HELLO WORLD";
      position: absolute;
      top: 65px;
      transform: rotate(180deg) scaleX(-1);
      background: linear-gradient(to bottom, 
      rgba(20, 150, 20, 0) 20%, 
      rgba(20, 150, 20) 60%, 
      rgba(20, 150, 20, 2) 100%);
      background-clip: text;
      color: transparent;
      opacity: 0.3;
    }
    CSS
  • CSS Linear Gradient Techniques: Create Colorful Line Drawings

    CSS Linear Gradient Techniques: Create Colorful Line Drawings

    Hey there! 😃 Exploring CSS linear gradient techniques is a fantastic approach to fashion vibrant, colorful mixtures. Gradients give us the flexibility to choose any desired direction, defined by their starting and ending points. Mixing a minimum of two colors is fundamental, yet the potential for blending expands further, enabling us to achieve seamless transitions or pronounced shifts based on our design requirements.

    Today, let’s dive into the exciting world of CSS linear gradient techniques. 🌈✨ Picture a smooth transition of colors in a straight line, adding a sleek and dynamic touch to your web design. With linear gradients, you can smoothly transition between colors. You have the power to guide the eye seamlessly from one color to another. Whether it’s a subtle shift or a striking contrast, mastering linear gradients empowers you to enhance the visual appeal of your web projects.

    Ready to discover 🔍 the art and versatility behind linear gradients? Let’s get started! 💻

    Definition of a radial gradient

    A linear gradient is a visual effect that allows us to smoothly shift between colors in a straight line inside any shape we want. It’s like blending multiple colors together in a straight line pattern, allowing us to create colorful and visually appealing backgrounds or effects for elements on our website.

    A linear gradient is a visual effect that allows us to smoothly shift between colors in a straight line inside any shape we want

    The default CSS linear gradient

    We will begin our exploration with the default linear gradient, characterized by its top-to-bottom direction. The following code snippet and image provide a clear representation.

    .linear-default {
      background-image: linear-gradient(red, green);
    }
    
    /* we are free to use "deg" too */
    .linear-default {
      background-image: linear-gradient(180deg, red, green);
    }
    CSS

    From side to side

    We can adjust the direction of our gradients whenever we need to. To help you understand this better, take a look at the example below, where we changed the default direction to to right.

    We are also free to choose any direction we want to top , to right , to bottom (the default direction), to left.

    .linear-to-top {
      background-image: linear-gradient(to right, red, green, blue);
    }
    CSS

    From corner to corner

    At any point, we also have the flexibility to alter the orientation of our gradients along the diagonal path. To illustrate this concept, consider the following example with the to bottom right direction.

    Here colors would spread from the top-left corner to the bottom-right corner. We can combine any corner with its adjacent sides, to top left, to top right, to bottom left, and to bottom right.

    .linear-to-corner {
      background-image: linear-gradient(to bottom right, red, green, blue);
    }
    CSS

    CSS Linear gradient using percentages %

    With less blend

    If we want to create a linear gradient with less blending (colors have more distinct limits this way) and maintain the same space for each color, we can use equal specific stops in the gradient by adding % percentages.

    .linear-less-blend {
      background-image: linear-gradient(
        red 0%, red 18%,
        green 22%, green 38%,
        blue 42%, blue 58%,
        purple 62%, purple 78%,
        orange 82%, orange 100%
      );
    }
    CSS

    🕵️‍♂️ In this example, I’ve divided the space into 5 segments, but I left a 4% blend among each space in order to create a smooth but small transition.

    The percentages between the color stops determine how smooth the transition between colors is.

    • Red (0% – 18%): defines a red color stop that starts at 0% and ends at 18% of the gradient.
    • Between 18% and 22%, there is no specific color stop defined. This gap represents a transition zone where the gradient transitions smoothly from red to green.
    • Green 22%, green 38%): defines a green color stop that starts at 22% and ends at 38% of the gradient.
    • Between 38% and 42%, there is no specific color stop defined. This gap represents a transition zone where the gradient transitions smoothly from green to blue.
    • Blue (42% – 58%): defines a blue color stop that starts at 42% and ends at 58% of the gradient.
    • Between 58% and 62%, there is no specific color stop defined. This gap represents a transition zone where the gradient transitions smoothly from blue to purple.
    • Purple (62% – 78%): defines a purple color stop that starts at 62% and ends at 78% of the gradient.
    • Between 78% and 82%, there is no specific color stop defined. This gap represents a transition zone where the gradient transitions smoothly from purple to orange.
    • Orange (82% – 100%): defines an orange color stop that starts at 82% and ends at 100% of the gradient.
    A colorful css linear gradient technique. Setting the background-image: linear-gradient( red 0%, red 18%, green 22%, green 38%, blue 42%, blue 58%, purple 62%, purple 78%, orange 82%, orange 100% );

    Without blend

    Finally, it is really useful to know that we are able to create non-smooth transitions. In the following example, we will see a gradient with distinct color stops at specific percentage intervals, resulting in a distinct color transition from red to orange. Each color stop abruptly changes to the next color at the defined percentage points.

    .linear-no-blend {
      background-image: linear-gradient(
        red 0%, red 20%, 
        green 20%, green 40%, 
        blue 40%, blue 60%, 
        purple 60%, purple 80%, 
        orange 80%, orange 100%
      );
    }
    CSS

    🕵️‍♂️ In this example, I’ve divided the space into 5 equal segments without blending among each other. So, we create multiple color stops without transitions.

    • Red (0% – 20%): defines a red color stop that starts at 0% and ends at 20% of the gradient.
    • Green (20% – 40%): defines a green color stop that starts at 20% and ends at 40% of the gradient.
    • Blue (40% – 60%): defines a blue color stop that starts at 40% and ends at 60% of the gradient.
    • Purple (60% – 80%): defines a purple color stop that starts at 60% and ends at 80% of the gradient.
    • Orange (80% – 100%): defines an orange color stop that starts at 80% and ends at 100%
  • How To Make a CSS Shine Effect Animation

    How To Make a CSS Shine Effect Animation

    Welcome to this post! Today, I will share with you how to create a fascinating CSS shine effect animation. To make it more interesting and attractive, I have already prepared an avatar (using only HTML and CSS) and added the animation to it. If you’re curious about how I made the avatar, you can find the complete avatar code at the end of this post. Please feel free to enclose it in your animation if you wish. Remember, the most important thing is to have fun and let your creativity shine. 😉 ✨

    For the moment, let’s focus on making this astonishing animation!

    HTML structure

    To begin, we need to create the base for our project by adding the HTML structure. We’ll start by creating our avatar-container , which will serve for our manipulations. I will carefully guide you through the following steps to achieve the desired results. Once we have a good structure in place, we can build upon it our CSS shine effect.

    <div class="avatar-container">
     ... Here goes my avatar
    </div> <!-- end of avatar-container -->
    HTML

    CSS basic structure

    Moving forward, let’s focus on organizing our project’s visual appeal by adding the CSS structure. Our first step will be to center the avatar-container on the screen, therefore, we can take advantage of the display: flex property of the body element. This will help us align it along the horizontal and vertical axes, creating a perfectly centered layout. With this basic structure in place, we can then proceed to add styles and create everything we have in mind. 😊

    $body-color: #6e87ef;
    
    * {
      margin: 0;
      padding: 0;
      box-sizing: border-box;
    }
    
    html,
    body {
      height: 100%;
    }
    
    body {
      width: 100%;
      display: flex;
      align-items: center;
      justify-content: center;
      background: $body-color;
    }
    SCSS

    CSS avatar container

    In order to place the avatar inside the container, it is essential to set it position: relative. Then we can place the components we want to include for our avatar, just by adding position: absolute to them.

    .avatar-container {
      position: relative;
      min-width: 320px;
      height: 320px;
      background-color: transparent;
      box-shadow: inset 0 0 20px;
      border-radius: 50%;
    } /* end of avatar-container */
    SCSS

    CSS Shine Effect

    All the necessary preparations have been completed. Let’s now move forward and make the shine 🥳 effect.

    Create the shine

    • Firstly, we use :before pseudo-element which allows styling specific parts of an element without adding extra content to HTML. It behaves as a child of the chosen CSS element. In our case, avatar-container takes extra data only by using :before CSS property.
    • Next, we set width: 30% and height: 100% as this is a proper space in our example.
    • We also set background-color: rgba(255, 255, 255, 0.4) as it is the most suitable for the CSS shine effect.
    • We continue with z-index which overlaps the stack order of an HTML element. In simple words, it manages which HTML element should appear on top of others. The higher the stack order, the higher the element will be placed at the top of the stacking order. A really useful CSS property that is responsible for layering. To achieve the desired effect over my avatar, I have specified a z-index: 4 as my avatar has multiple layers. Without multiple layers applied to it (in simple words without the avatar), z-index CSS property is not necessary. It’s good practice when we use z-index to count close numbers. We can set positive and negative integer values.
    .avatar-container {
        position: relative;
        width: 320px;
        height: 320px;
        background-color: transparent;
        box-shadow: inset 0 0 20px;
        border-radius: 50%;
        overflow: hidden;
        &:before {
          position: absolute;
          content: "";
          width: 30%;
          height: 100%;
          background-color: rgba(255, 255, 255, 0.4);
          transform: skewX(-20deg);
          left: -120px;
          z-index: 3;
        } /* end of before */
      } /* end of avatar-container */
    SCSS

    The image below displays a preview of the code mentioned above.

    Transform the CSS shine effect

    • Afterward is necessary to add overflow: hidden to avatar-container, as we want to hide the content that flows over our container’s bounds.
    • We continue with transform: skew as a way to add inclination to our shine.
    • Finally left: -120px keeps our effect in the appropriate place, -120px left out of the avatar-container , in order to be invisible. As we previously used, overflow: hidden anything outside of the avatar-container is not visible, that’s why in this pick, below, we can’t see our effect. It’s still there though! 😄

    HINT

    💡 Well, maybe at this point it might be a good idea to temporarily disable the CSS property overflow: hidden and observe the current position of the effect. By doing so, one can see if the effect is working as intended and make any necessary adjustments. The effect is now positioned -120 pixels to the left, as this is the starting point from where the effect will begin to move.

    Create an animation for the CSS shine effect

    • To finalize my work, firstly, I’m adding the animation CSS property animation: <animation-name> <animation-duration> <animation-iteration-count> which is responsible for the way our animation behaves.
    • Secondly, I add CSS @keyframes which is used to control the style of the animation at different points in time. In this post, we want our shine to move rightwards, starting from -120px left to 350px left and then turning back to -120px left again.
    • By combining these 2 properties we end up having the desired animation result, that is, moving our shine every 5 seconds, forever (infinite), from -120px to 350px and back.

    🚫 It is required to connect these two properties. We do so by giving a name to the @keyframes and putting the same name on the animation property. In our case, this name is “shine”.

    .avatar-container {
      ...
      &:before {
        ...
        animation: shine 5s infinite;
      } /* end of before */
    } /* end of avatar-container */
      
      
    /* My animation */
    @keyframes shine {
      0% {
        left: -120px;
      }
      50% {
        left: 350px;
      }
      0% {
        left: -120px;
      }
    }
    SCSS

    💡 If you want to see the whole move of the CSS shine effect you can once again disable the CSS property overflow: hidden to avatar-container and observe the effect. Isn’t it great? 😄

    🔖 Please be informed that you have the flexibility to modify the background-color: rgba(..., ..., ..., ...) CSS property at any point to adjust both the color and opacity of your shine effect. In this context, I have chosen to generate a grey shine, as this shade is widely recognized and utilized.

    Below, I add some examples with different shades. You are free to try them, or you can experiment and create some from scratch! 🛠

    Yellow shade -> background-color:rgba(255, 255, 0, 0.2)

    🧨 Blue shade -> background-color:rgba(100, 100, 250, 0.5) always remember to make contrasts. Avoid using the same color for backgrounds and shades.

    You can also try to change both the container’s and shades’ background-color.

    Pink shade -> background-color:rgba(238, 130, 238, 0.3)

    Container’s color -> background-color: #c4c0c0 (grey)

    Complete avatar code

    Below, I include my HTML and CSS avatar code.

    <div class="avatar-container">
      <div class="hair-long"></div>
      <div class="face">
        <div class="ear ear--left">
          <div class="earing earing--left"></div>
        </div>
        <div class="ear ear--right"></div>
        <div class="hair-front"></div>
        <div class="eyebrow eyebrow--left"></div>
        <div class="eyebrow eyebrow--right"></div>
        <div class="eye eye--left">
          <div class="eyelash eyelash--left"></div>
          <div class="eyelash eyelash--left1"></div>
          <div class="eyelash eyelash--left2"></div>
          <div class="eyelash eyelash--left3"></div>
          <div class="eyelash eyelash--left4"></div>
        </div> <!-- end of left eye -->
        <div class="eye eye--right">
          <div class="eyelash eyelash--right"></div>
          <div class="eyelash eyelash--right1"></div>
          <div class="eyelash eyelash--right2"></div>
          <div class="eyelash eyelash--right3"></div>
          <div class="eyelash eyelash--right4"></div>
        </div> <!-- end of right eye -->
        <div class="nose"></div>
        <div class="lips"></div>
      </div> <!-- end of face -->
      <div class="body-avatar">
        <div class="neck"></div>
        <div class="t-shirt"></div>
        <div class="dungarees">
          <div class="pocket"></div>
          <div class="strap strap--left">
            <div class="button button--left"></div>
          </div>
          <div class="strap strap--right">
            <div class="button button--right"></div>
          </div>
        </div> <!-- end of dungarees -->
      </div> <!-- end of body -->
    </div> <!-- end of avatar-container -->
    HTML
    Expand
    $body-color: #6e87ef;
    $skin-color: #fac8b9;
    $hair-color: #36272a;
    $hair-ombre-color: linear-gradient(#36272a 50%, #1616ee);
    $eyebrow-color: #36272a;
    $eye-color: #6d84c0;
    $eye-base-color: #f1f1f1;
    $eyeline-color: #472a2a;
    $eyelash-color: #171616;
    $iris-color: #000;
    $earing-color: red;
    $nose-color: #2b2a2a;
    $lips-color: #f50000;
    $t-shirt-color: #2c171b;
    $dungarees-color: #6d84c0;
    $strap-color: #6d84c0;
    $button-color: #2d2c2c;
    
    
    * {
      margin: 0;
      padding: 0;
      box-sizing: border-box;
    }
    
    html,
    body {
      height: 100vh;
    }
    
    body {
      width: 100%;
      display: flex;
      align-items: center;
      justify-content: center;
      background: $body-color;
    }
    
    .avatar-container {
      position: relative;
      min-width: 320px;
      height: 320px;
      background-color: transparent;
      box-shadow: inset 0 0 20px;
      border-radius: 50%;
      overflow: hidden;
    
      .hair-long {
        position: absolute;
        width: 130px;
        height: 170px;
        border-radius: 44% 44% 10px 10px;
        top: 30px;
        left: 50%;
        transform: translate(-50%);
        background: $hair-ombre-color;
        filter: drop-shadow(0 0 3px);
      }
    
      .face {
        position: absolute;
        width: 100px;
        height: 110px;
        border-radius: 100% / 50% 50% 160% 160%;
        background-color: $skin-color;
        top: 58px;
        left: 50%;
        transform: translate(-50%);
        z-index: 2;
        box-shadow: 0 0.5px 2px darken($skin-color, 10%);
        .ear {
          position: absolute;
          width: 10px;
          height: 22px;
          background-color: $skin-color;
          border-radius: 40%;
          top: 40px;
          z-index: 3;
          &--left {
            left: -6px;
            transform: rotate(-8deg);
            &:before {
              content: "";
              position: absolute;
              width: 6px;
              height: 12px;
              background-color: $skin-color;
              border-radius: 40% 40% 50% 50%;
              box-shadow: -1px -1px 1px darken($skin-color, 10%);
              top: 3px;
              left: 2px;
            }
          }
          &--right {
            right: -6px;
            transform: rotate(8deg);
            &:before {
              content: "";
              position: absolute;
              width: 6px;
              height: 10px;
              background-color: $skin-color;
              border-radius: 40% 40% 50% 50%;
              box-shadow: 1px -1px 1px darken($skin-color, 10%);
              top: 3px;
              right: 2px;
            }
          }
          .earing {
            position: absolute;
            width: 4px;
            height: 4px;
            background-color: $earing-color;
            filter: drop-shadow(0 0 1px);
            border-radius: 50%;
            transform: rotate(4deg);
            &:before {
              content: "";
              position: absolute;
              width: 2px;
              height: 16px;
              background-color: $earing-color;
            }
            &:after {
              content: "";
              position: absolute;
              width: 6px;
              height: 6px;
              background-color: $earing-color;
              border-radius: 50%;
            }
            &--left {
              top: 15px;
              left: 4px;
              &:before {
                top: 3px;
                right: 1px;
              }
              &:after {
                top: 15px;
                left: -1px;
              } 
            }
          } // end of earing
        } // end of ear
        .hair-front {
          position: absolute;
          width: 104px;
          height: 30px;
          top: -2px;
          left: -2px;
          border-radius: 5px;
          background-color: $hair-color;
          &:before {
            content: "";
            position: absolute;
            width: 28px;
            height: 6px;
            background-color: $hair-color;
            border-radius: 50%;
            top: 34px;
            left: -11px;
            transform: rotate(-90deg);
          }
          &:after {
            content: "";
            position: absolute;
            width: 28px;
            height: 6px;
            background-color: $hair-color;
            border-radius: 50%;
            top: 34px;
            right: -11px;
            transform: rotate(-90deg);
          }
        }  // end of hair-front
    
        .eye {
          position: absolute;
          width: 20px;
          height: 20px;
          top: 39px;
          background-color: $eye-base-color;
          border: 2px solid $eyeline-color;
          border-radius: 85% 10%;
          transform: rotate(45deg);
          &:before {
            content: "";
            position: absolute;
            width: 10px;
            height: 10px;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
            background-color: $eye-color;
            border-radius: 50%;
            box-shadow: inset 1px 1px 1px 1px #17460d;
          }
          &--left {
            left: 17px;
            box-shadow: -1px 0 2px darken($eyeline-color, 50%);
          }
          &--right {
            right: 17px;
            box-shadow: 0 -1px 2px darken($eyeline-color, 50%);
          }
          &:after {
            content: "";
            position: absolute;
            width: 4px;
            height: 4px;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
            background-color: $iris-color;
            border-radius: 50%;
          }
          .eyelash {
            position: absolute;
            width: 1px;
            height: 5px;
            background-color: $eyelash-color;
            &--left,
            &--left1,
            &--left2,
            &--left3,
            &--left4 {
              transform: rotate(90deg);
            }
            &--left {
              top: -2px;
              left: 1px
            }
            &--left1 {
              top: 1px;
              left: -2px
            }
            &--left2 {
              top: 5px;
              left: -5px
            }
            &--left3 {
              top: 9px;
              left: -6px
            }
            &--left4 {
              top: 13px;
              left: -6px
            }
            &--right {
              top: -2px;
              right: 14px;
            }
            &--right1 {
              top: -5px;
              right: 10px;
            }
            &--right2 {
              top: -7px;
              right: 6px;
            }
            &--right3 {
              top: -8px;
              right: 2px;
            }
            &--right4 {
              top: -8px;
              right: -1px;
            }
          }  // end of eyelash
        }  // end of eye
    
        .eyebrow {
          position: absolute;
          width: 35px;
          height: 7px;  
          border: solid 4px $hair-color;
          border-color: $hair-color transparent transparent transparent;
          border-radius: 50%/10px 10px 0 0;
          top: 32px;
          &--left {
            left: 7px;
          }
          &--right {
            right: 7px;
          }
        } // end of eyebrows
    
        .nose {
          position: absolute;
          width: 2px;
          height: 18px;
          border: 2px solid $nose-color;
          border-left: 0px;
          border-top-right-radius: 80% 40%;
          border-bottom-right-radius: 80% 60%;
          top: 50px;
          left: 46px;
          &:before {
            position: absolute;
            content: "";
            width: 1px;
            height: 3px;
            background-color: $nose-color;
            top: 19px;
            transform: rotate(-30deg);
          }
          &:after {
            position: absolute;
            content: "";
            width: 2px;
            height: 2px;
            border-radius: 50%;
            background-color: $nose-color;
            top: 20px;
            left: 5px;
          }
        } // end of nose
    
        .lips {
          position: absolute;
          width: 24px;
          height: 10px;
          border-radius: 50%;
          background-color: $lips-color;
          top: 86px;
          left: 50%;
          transform: translate(-50%);
          box-shadow: inset 0 0 7px;
          &:after {
            content: "";
            position: absolute;
            width: 0;
            height: 0;
            border-left: 6px solid transparent;
            border-right: 6px solid transparent;
            border-top: 3px solid $skin-color;
            border-radius: 60%;
            top: -1px;
            left: 6px;
          }
        } // end of lips
      } // end of face
    
      .body-avatar {
        .neck {
          position: absolute;
          width: 34px;
          height: 50px;
          background-color: $skin-color;
          filter: drop-shadow(0 0 2px);
          top: 152px;
          left: 50%;
          transform: translate(-50%);
          z-index: 1;
          &:before {
            content: "";
            position: absolute;
            width: 60px;
            height: 30px;
            background-color: $skin-color;
            border-radius: 50%;
            top: 35px;
            left: 50%;
            transform: translate(-50%);
          }
        }
    
        .t-shirt {
          position: absolute;
          width: 160px;
          height: 140px;
          background-color: $t-shirt-color;
          border-radius: 100% / 40% 40% 20% 20%;
          top: 190px;
          left: 50%;
          transform: translate(-50%);
          filter: drop-shadow(0 0 3px);
        } // end of t-shirt
    
        .dungarees {
          position: absolute;
          width: 100px;
          height: 100px;
          background-color: $dungarees-color;
          border-radius: 5%;
          box-shadow: inset 0 0 5px;
          top: 240px;
          left: 50%;
          transform: translate(-50%);
          .pocket {
            position: absolute;
            width: 50px;
            height: 50px;
            background-color: $dungarees-color;
            border: 1px dashed black;
            box-shadow: 0 0 5px;
            top: 25px;
            left: 50%;
            transform: translate(-50%);
          }
          .strap {
            position: absolute;
            width: 10px;
            height: 64px;
            background-color: $strap-color;
            box-shadow: inset 0 0 5px;
            top: -47px;
            .button {
              position: absolute;
              width: 5px;
              height: 5px;
              background-color: $button-color;
              border-radius: 50%;
              top: 52px;
              &--left {
                left: 50%;
                transform: translate(-50%);
              }
              &--right {
                left: 50%;
                transform: translate(-50%);
              }
            } // end of button
            &--left {
              left: 5px;
              border-radius: 6px 0 10px 0;
            }
            &--right {
              right: 5px;
              border-radius: 0 6px 0 10px;
            }
          } // end of strap
        } // end of dungarees
      } // end of body-avatar
    } // end of avatar-container
    SCSS
    Expand
  • Learn How to Select Only the CSS First Child

    Learn How to Select Only the CSS First Child

    Hello everybody! In this post, we will analyze the CSS first child selector, one of the most useful selectors in CSS. We utilize the CSS first-child selector when we want to target and manipulate only the first element among a variety of elements of the same type. Note that when we refer to types of elements, we mean HTML tags like paragraphs (<p>), headings (<h1>, <h2> …), lists (<li>), and so on.

    We often apply the CSS first child selector to list items (<li>), but it can be used with any type of element. Below, I have prepared some examples to help you understand how to use the CSS first child selector depending on your needs.

    Alternatively, we can use the CSS nth child selector like this :nth-child(1) for the same purpose, but it’s more generic as it allows the selection of any child based on its position.

    In addition to providing all the necessary CSS syntax for each first child case we describe, we have also included Sass syntax under each code snippet if you are using a Sass pre-processor.

    CSS first child selector: List element

    In the following example, the HTML structure consists of an ordered list (<ol>) with three list items (<li>), all colored indigo.

    <ol>
      <li>First item</li>
      <li>Second item</li>
      <li>Third item</li>
    </ol>
    HTML
    An ordered list with three items all colored indigo.

    Then, we add the CSS rule, which selects only the first item and applies a red color to it.

    /* Applies indigo color to all list items */
    li {
      color: indigo; 
    }
    
    
    /* Applies red color only to the first list item */
    li:first-child {
      color: red; 
    }
    
    
    /*       OR       */
    
    li:nth-child(1) {
      color: red;
    }
    CSS

    🔖 When we work with Sass, our code will be structured as follows:

    li {
      color: indigo;
    
      &:first-child {
        color: red;
      }
    }
    
    /*       OR       */
    
    li {
      color: indigo;
      
      &:nth-child(1) {
        color: red; 
      }
    }
    SCSS
    An ordered list with three items all colored indigo apart from the first one which has color red as we used the: CSS first child selector. :first-child OR :nth-child(1)

    When using the :first-child selector in CSS, it targets the very first element within its parent. When we add a new item to the beginning of the list, this new item becomes the first child of the list, and the previous first item now becomes the second one. This change causes the :first-child selector to now target the newly added item instead.

    CSS first child selector: Non-list element

    In the example below, we set the first child selector for paragraphs. The HTML structure consists of a <div> containing three paragraph (<p>) elements. By default, all HTML elements have black text color, so paragraphs will appear in black.

    <div>
      <p>First paragraph</p>
      <p>Second paragraph</p>
      <p>Third paragraph</p>
    </div>
    HTML
    Three paragraphs all colored by default black.

    By applying the CSS first child selector, it selects the first <p> element and apply the text color red to a white background. As a result, the first paragraph appears in red with a white background, while the subsequent paragraphs maintain their default styling.

    /* Applies red color and background white
       to the first paragraph
    */
    p:first-child {
      color: red;
      background-color: white;
    }
    
    /*       OR       */
    
    p:nth-child(1) {
      color: red;
      background: white;
    }
    
    CSS

    🔖 When working with Sass, our code will be structured as follows:

    p {
      &:first-child {
        color: red;
        background: white;
      }
    }
    
    /*       OR       */
    
    p {
      &:nth-child(1) {
        color: red;
        background: white;
      }
    }
    
    SCSS
    Three paragraphs all colored by default black, apart from the first one which has color red and background color white as we used the first child css selector.

    First child CSS selector applied across multiple parent containers

    In this example, we can see a different approach, as most times, we have multiple HTML elements to manipulate within a document. In our case, we have two div elements, each containing two paragraph (<p>) elements colored black.

    <div>
      <p>First paragraph inside the first div</p>
      <p>Second paragraph inside the first div</p>
    </div>
    <div>
      <p>First paragraph inside the second div</p>
      <p>Second paragraph inside the second div</p>
    </div>
    HTML
    Four paragraphs all colored black

    The CSS rule div p:first-child selects the first <p> element within any <div> and applies the specified styles to it. As a result, the first paragraph within each <div> will display in red with a white background, while the remaining paragraphs will retain their default styles. This demonstrates how the :first-child selector can be used to style the first element within a number of parent containers. 😉

    /* Applies red color and white background
       to the first paragraph inside each div
    */
    div p:first-child {
      color: red;
      background-color: white;
    }
    
    /*       OR       */
    
    div p:nth-child(1) {
      color: red;
      background-color: white;
    }
    
    CSS

    🔖 When using Sass, our code will look like this:

    div {
      p:first-child {
        color: red;
        background-color: white;
      }
    }
    
    /*       OR       */
    
    div {
      p:nth-child(1) {
        color: red;
        background-color: white;
      }
    }
    
    SCSS
    Four paragraphs colored black. The first paragraphs are colored red with white background as we set the first child css selector.

    First child CSS selector targeting the first element of the first parent

    In the following example, we have two div elements, each containing two paragraph (<p>) elements colored black.

    <div>
      <p>First paragraph in the first div</p>
      <p>Second paragraph in the first div</p>
    </div>
    <div>
      <p>First paragraph in the second div</p>
      <p>Second paragraph in the second div</p>
    </div>
    HTML
    Four paragraphs all colored by default black.

    the CSS rule div:first-child p:first-child selects only the first paragraph (<p>) within the first div and applies the specified styles to it. Thus, the first paragraph in the first div will be displayed in red with a white background, while the second paragraph will remain in its default black color.

    The second div, remains unaffected by the styles applied to the first div, showcasing how to apply specific styles selectively. 😉 This approach is really helpful for applying specific styles to elements in complex layouts.

    /* Applies red color and white background
       to the first paragraph of the first div
    */
    
    div:first-child p:first-child {
      color: red;
      background-color: white;
    }
    
    /*       OR       */
    
    div:nth-child(1) p:nth-child(1) {
      color: red;
      background-color: white;
    }                    
    CSS

    🔖 When we work with Sass, we will write our code as follows:

    div:first-child {
      p:first-child {
        color: red;
        background-color: white;
      }
    }
    
    /*       OR       */
    
    div:nth-child(1) {
      p:nth-child(1) {
        color: red;
        background-color: white;
      }
    }
    SCSS
    Four paragraphs colored black. The first paragraph is colored red with white background as we have set the

    Using the :not(:first-child) selector

    In our last example, we have the opposite case. How not to select the CSS first child. The HTML structure consists of an ordered list <ol> containing three list <li> elements.

    <ol>
      <li>First item</li>
      <li>Second item</li>
      <li>Third item</li>
    </ol>
    HTML
    An ordered list with three items all colored by default, black.

    The CSS rule ol li:not(:first-child) selects all <li> elements within the ol apart from the first one and applies the specified styles to them. Because of that, all list items apart from the first one will be displayed in red, while the first list item will retain its default color, black.

    /* Applies red color to all paragraphs
       except for the first one
    */
    
    ol li:not(:first-child) {
      color: red;
    }
    
    /*       OR       */
    
    ol li:not(:nth-child(1)) {
      color: red;
    }
    
    CSS

    🔖 When we work with Sass, we will write our code as follows:

    ol {
      li:not(:first-child) {
        color: red;
      }
    }
    
    /*       OR       */
    
    ol {
      li:not(:nth-child(1)) {
        color: red;
      }
    }
    SCSS
    An ordered list with three items. The first item has by default color black while the other two items have color red as we used the css  not first child selector.
  • Unmasking Impostor Syndrome In Tech: Watch Out For These Signs

    Unmasking Impostor Syndrome In Tech: Watch Out For These Signs

    Impostor syndrome, also known as impostorism, is the feeling that you’re not as good as others think you are, even when you have proof of your success. In simple words, lack of confidence. It is often accompanied by the fear of being exposed as a fraud.

    It can affect anyone, regardless of their accomplishments. It can make you doubt yourself and believe that your achievements are due to luck rather than your own skills. This feeling can impact everyone, from students and professionals to famous people.

    In our competitive world, many people struggle with these thoughts. Realizing impostor syndrome and learning how to deal with it is essential for building confidence, maintaining a healthy and positive mind, and, by extension, enhancing one’s quality of life.

    How to recognize if you suffer from impostor syndrome?

    Recognizing impostor syndrome can be the first step toward managing it. Below, I will outline some of the most important signs to watch out for.

    Shadows of yesterday

    It often originates from our childhood and the way we grew up. It is widely accepted that many parents can either overly compliment or criticize their children, sending mixed signals that can confuse them. They hesitate to let their children try new things, fearing others will criticize failure and cause ridicule. In that way, children get used to the idea that they are not worth the opportunity to try.
    These behaviors leave imprints 🐾 on children’s minds and get deeper and deeper day by day. Eventually, they end up feeling like pawns, these lowest-value ♟ pieces, on a chessboard.
    Instead, they should encourage their children to try new things and welcome failure as a valuable learning experience, regardless of others’ thoughts.

    Keep bearing your challenging past

    Later, as an adult, impostor syndrome affects you as you have convinced yourself that you are a “broken vessel” and not well prepared for real life. You may even notice that you tend to set extremely high standards for yourself. You struggle to overcome the past and prove that you deserve something like everyone around you.
    You might feel disappointed when you don’t complete some goals, even if, many times, those plans are utopian.
    On the other hand, when you complete your goals, you will catch yourself downplaying your victories as you continue feeling that you are not capable of handling things.

    Masquerade – The False Sense of Deception

    Another clear indicator that you might struggle with this awful syndrome is that you often feel exhausted from over-preparing or overworking to cover up your falsely claimed lack of skills. You feel like you’re “faking it” at any moment, doubting and challenging yourself about your own abilities. Deep down, it seems like hiding your real self and wearing a mask that doesn’t fit right.
    I have to note that it’s a really confusing situation. It’s as though you repeatedly place hurdles in your own path and sabotage yourself.

    Frozen by Fear – How It Holds You Back

    Finally, the fear of failure. This fear can be so strong that it literally makes you feel stuck. You become anti-social. It stops you from being creative and taking risks that could help you learn and grow. It prevents you from taking on new challenges, seeking opportunities, or making decisions.
    You may constantly compare yourself to others, feeling that you’re not as talented or capable despite evidence to the contrary.
    Eventually, it can make you feel really unhappy and even affect your mental health. You will soon start feeling lonely, helpless, anxious, and weak, and occasionally depression and isolation can take you down.

    How to deal with impostor syndrome

    Handling impostor syndrome involves reconsidering, which means changing how you think and react to yourself and your plans for life, whether they are accomplishments or failures.

    Embracing Self-Love: Accepting Your Situation and Valuing Yourself

    Start by accepting your feelings. Keep in mind that many people experience these same thoughts. You are not alone. It’s just a common reaction to high pressure and expectations.
    Practice self-compassion by treating yourself with the kindness and understanding you would offer a friend. Be kinder to yourself. Try to avoid negative thoughts and replace them with more balanced and positive thinking.

    Setting Achievable Goals: A Pathway to Success

    Setting realistic goals. This can be the most crucial decision. Breaking down big tasks into smaller, manageable steps will help you handle them better, feel less stressed, and keep moving steadily toward your goals.
    Also, believe it or not, it’s important to celebrate each achievement along the way. Whether small or big, each step signifies a victory on the journey toward your goals. Do not underestimate it!

    Creating Effective Programs with Smart Planning

    Start keeping notes. It serves as a powerful tool for self-reflection. Write down your personal accomplishments as a strong reminder of your capabilities and successes. Maintaining a diary with plans is substantial evidence of your growth, boosting you to dive into future challenges with faith and enthusiasm.
    Checking ✅ your notes is always a good idea! Celebrate your successes with pride and take time to examine your failures. By understanding what went wrong, you pave the way for future triumphs. Be confident! You will blossom in your next attempt.

    Discovering Strength Through Support

    Reaching out support from others is absolutely essential, too. Let it be ingrained in your memory that you are incredibly valuable to some people. This unique sense of being heard and understood can be extremely comforting and validating for you.
    Talk to friends, family, or mentors about your feelings. Trust them and lean on their shoulders. You can count on their love and help. They can offer honest opinions and critiques, multiple perspectives, and, most importantly, remind you of your worth!
    After all, they are connections that can open doors to new opportunities and experiences. How calming is that?

    Confident Endurance – Continuing the Journey with Determination

    Eventually, it’s time to fight with your ghosts! Build self-confidence. If impostor syndrome persists and affects your life significantly on a daily basis, consider professional help from a therapist or consultant. They can provide invaluable guidance and propose techniques to empower you.
    Furthermore, they will help you overcome these feelings and reveal your strengths and skills. Always remember you belong to yourself and you are free to live your life as you wish!

    Overcoming impostor syndrome requires time and persistence. It involves regularly reminding your own value, celebrating your accomplishments, and sometimes getting help from others to change how you think. By recognizing it, you have to take steps and fight it. You will start to believe in yourself and appreciate your achievements. Remember that occasional doubts are normal, but they do not define who you are. Sooner or later, understanding and fighting impostor syndrome helps us reach our full potential and enjoy life to the fullest.

    Are you ready to go? 🧨✨ Wishing you all the best! 💖💖

    Astronaut riding space rocket
    Image by catalyststuff on Freepik
  • Make Amazing CSS 2D Card With Flipping Animation On Hover

    Make Amazing CSS 2D Card With Flipping Animation On Hover

    Hello! In this post, I will show you how to create a visually appealing CSS 2d card with flipping animation that activates when you hover over it. To enhance the design, I have added an avatar and integrated the animation with it. If you are interested in how I created the avatar, you can check out the complete avatar code at the end of this post. You are free to use it in your animation or customize it to your liking. Enjoy! 😉

    For now, let’s move forward and create this incredible animation!

    CSS Flipping card animation on hover

    The following HTML and SCSS (Sass) code makes a card flip around. Using the X-axis and Y-axis which are two lines that intersect, helps us determine the position of a point in a two-dimensional area.

    Let’s analyze our code one step at a time:

    HTML structure

    We will begin with the HTML structure. We create a parent container called .flip-wrapper. This container acts as the parent element for our animation. Inside it, we have a child element with the .flip-card class, this is where our animation happens. Next, we divide the child element into two parts: the front side and the back side. On the front side, we’ll add the .avatar-container and place the avatar inside while on the back side, we’ll add the .text-container class and add some text.

    <div class="flip-wrapper">
      <div class="flip-card">
        <div class="avatar-container"></div>
        <div class="text-container">
          <h1>Hello</h1>
          <div><i>How are you today?</i></div>
        </div>
      </div>
    </div>
    HTML

    CSS Basic structure

    In our CSS code snippet, first of all, we set the background of our whole page to pink. 🐷🐷

    Moving on to the .flip-wrapper container, we specify its dimensions, giving it a fixed width and height of 300 pixels. To make a circular appearance, we apply a border-radius of 50%. If you desire, you can maintain the square ⬜ shape. I chose this rounded ⚪ design because it makes it easier for us to observe the effect we’re aiming for. 😉

    Next, we focus on the .flip-card element. We set the position: relative property and then its witdh and height to 100% to ensure it covers the entire available space. We also add a white background-color and a subtle gray shadow effect. To maintain the circular theme, we apply a border-radius of 50% to this container too.

    Finally, we set the position: absolute property in both .avatar-container and .text-container classes. In that way we will be ready to place the content we want on both, the front and the back, sides of our card.

    body {
      background: pink;
    }
    
    .flip-wrapper {
      width: 300px;
      height: 300px;
      border-radius: 50%;
      .flip-card {
        position: relative;
        width: 100%;
        height: 100%;
        background-color: white;
        box-shadow: inset 0 0 15px grey;
        border-radius: 50%;
      }
    }
    
    .avatar-container,
    .text-container {
      position: absolute;
    }
    SCSS

    This is what’s rendered on our screen at the moment.

    Adding the hover effect

    In order for our effect to function as intended we have to work with both the parent and the child element. We begin with the parent element, where we apply the :hover effect and change the cursor to a pointer (you can pick any cursor style you prefer).

    .flip-wrapper {
      ...
      &:hover {
        cursor: pointer;
      }
    }
    SCSS

    Preparing the front side of my flipping card

    I added an avatar on the front side of my flipping card. You can add whatever you want (some text, maybe, or an emoticon ✏️) or you can leave it empty, though it is not really useful for observing the flipping.

    .avatar-container {
      ...
    }
    SCSS

    In the following image, we can see how the front side of our flipping card would be. Nice! Isn’t it? 😃

    Preparing the back side of my flipping card

    Here we prepare our text’s style. We keep the default black color and we centered our text based on the display: flex method.

    .text-container {
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
    }
    SCSS

    Below we can see how the back side of our flipping card would be. Cool huh! 😃

    Now we are ready to connect these two parts and finally create our amazing animation.

    Adding the flipping animation at the 2D card

    We are free to create flipping animations on both axis X and Y. Below, I prepared two examples. The first one is for axis-Y while the second one is for axis-X. Let’s break it down and see them analytically. 🧐

    Flipping animation on axis-Y

    In order to achieve our goal we have to combine the following CSS properties.

    1. transform: rotateY(180deg) We begin by setting the transform property, which is responsible for the flipping, inside the hover effect. It is also necessary to add it to the class that represents the back side of our card, in our case the .text-container class, otherwise, our text won’t be rendered on the screen when we hover over the card.
    2. transition: transform 6s & transform-style: preserve-3d We continue by combining these two properties inside the .flip-card class. The first one shows us the exact, time in seconds (s), our effect will take place while the second one makes the children of an element appear as if they are positioned in a 3D space. So this property gives us the impression that the descendants (children) of our element are located within a three-dimensional space.
    3. backface-visibility: hidden We finalize our work with the backface-visibility property that defines whether or not the back side of an element should be visible when facing the user. The back face of an element is a mirror image of the front face being displayed.
    .flip-wrapper {
      ...
      &:hover {
        cursor: pointer;
        .flip-card {
          transform: rotateY(180deg);
        }
      }
      .flip-card {
        ...
        transition: transform 6s;
        transform-style: preserve-3d;
      }
    }
    
    .avatar-container,
    .text-container {
      ...
      backface-visibility: hidden;
    }
    
    .text-container {
      transform: rotateY(180deg);
    }
    SCSS

    Voila!! Here is our amazing flipping 2d card animation for the Y-axis!! 🥳

    Flipping animation on axis-X

    We do as previously but in this case, we set the transform: rotateX as we want our animation to move along the X-axis.

    .flip-wrapper {
      ...
      &:hover {
        cursor: pointer;
        .flip-card {
          transform: rotateX(180deg);
        }
      }
      .flip-card {
        ...
        transition: transform 6s;
        transform-style: preserve-3d;
      }
    }
    
    .avatar-container,
    .text-container {
      ...
      backface-visibility: hidden;
    }
    
    .text-container {
      transform: rotateX(180deg);
    }
    SCSS

    Boom! 🎉 This is our wonderful flipping 2d card animation for the X-axis!!

    Complete avatar code

    Below, I include my HTML and CSS avatar code.

    <div class="avatar-container">
      <div class="hair-back"></div>
      <div class="hair hair--left"></div>
      <div class="hair hair--right"></div>
      <div class="hair-clip hair-clip--left"></div>
      <div class="hair-clip hair-clip--right"></div>
      <div class="ear ear--left"></div>
      <div class="ear ear--right"></div>
      <div class="face">
        <div class="eyebrow1 eyebrow1--left"></div>
        <div class="eyebrow1 eyebrow1--right"></div>
        <div class="eyebrow2 eyebrow2--left"></div>
        <div class="eyebrow2 eyebrow2--right"></div>
        <div class="eye-glasses eye-glasses-left"></div>
        <div class="eye-glasses eye-glasses-right"></div>
        <div class="eye eye--left">
          <div class="eyelash eyelash--left"></div>
          <div class="eyelash eyelash--left1"></div>
          <div class="eyelash eyelash--left2"></div>
          <div class="eyelash eyelash--left3"></div>
          <div class="eyelash eyelash--left4"></div>
        </div> <!-- end of left eye -->
        <div class="eye eye--right">
          <div class="eyelash eyelash--right"></div>
          <div class="eyelash eyelash--right1"></div>
          <div class="eyelash eyelash--right2"></div>
          <div class="eyelash eyelash--right3"></div>
          <div class="eyelash eyelash--right4"></div>
        </div> <!-- end of right eye -->
        <div class="nose"></div>
        <div class="lips"></div>
      </div> <!-- end of face -->
      <div class="neck"></div>
      <div class="t-shirt"></div>
      <div class="neckless"></div>
    </div> <!-- end of avatar-container -->
    HTML
    Expand
    $body-color: #ff9aab;
    $container-color: white;
    $skin-color: #eabcb4;
    $primary-color: #2d2a2a;
    $secondary-color: #f1f1f1;
    $eye-color: #17884e;
    $eyeline-color: #5b3a3a;
    $eyelash-color: #6d4646;
    $iris-color: #000;
    $hair-color: #dfc2ae;
    $hair-clip-color1: green;
    $hair-clip-color2: #b3498d;
    $hair-clip-color: linear-gradient($hair-clip-color1, $hair-clip-color2, $hair-clip-color1, $hair-clip-color2, $hair-clip-color1);
    $eye-glasses-color: #a32a80;
    $eyebrow-color: #5b3a3a;
    $nose-color: #646363;
    $lips-color: #cd0b87;
    $t-shirt-color: #0b443c;
    $neckless-color: #0b443c;
    
    * {
      margin: 0;
      padding: 0;
      box-sizing: border-box;
    }
    
    html,
    body {
      height: 100vh;
    }
    
    body {
      width: 100%;
      display: flex;
      align-items: center;
      justify-content: center;
      background: $body-color;
    }
    
    .avatar-container {
      position: relative;
      width: 320px;
      height: 320px;
      border-radius: 50%;
      background-color: $container-color;
      box-shadow: inset 0 0 15px grey;
      overflow: hidden;
      .hair-back {
        position: absolute;
        width: 140px;
        height: 200px;
        border-radius: 44% 44% 20px 20px;
        top: 30px;
        left: 50%;
        transform: translate(-50%);
        background-color: $hair-color;
        filter: drop-shadow(0 0 2px #bc9b83);
        z-index: 2;
        &:before {
          content: "";
          position: absolute;
          width: 0.5px;
          height: 28px;
          background-color: #bc9b83;
          filter: drop-shadow(0 0 4px #69660f);
          top: 0px;
          left: 50%;
          transform: translate(-50%);
        }
        &:after {
          content: "";
          position: absolute;
          width: 100px;
          height: 110px;
          border-radius: 20%;
          background-color: #d8baa4;
          top: 70px;
          left: 50%;
          transform: translate(-50%);
        }
      }
      
      .hair {
          position: absolute;
          width: 40px;
          height: 40px;
          background-color: $hair-color;
          filter: drop-shadow(0 0 2px #bc9b83);
          z-index: 1;
          &--left {
            border-radius: 50% 50% 70% 70%;
            top: 22px;
            left: 80px;
            transform: rotate(-50deg);
          }
          &--right {
            border-radius: 50% 50% 60% 60%;
            top: 22px;
            right: 80px;
            transform: rotate(50deg);
          }
        }
      
      .hair-clip {
        position: absolute;
        width: 28px;
        height: 6px;
        background: $hair-clip-color;
        box-shadow: 0 0 2px #037203;
        border-radius: 20%;
        z-index: 10;
        &--left {
          transform: rotate(-50deg);
          top: 48px;
          left: 98px;
        }
        &--right {
          transform: rotate(50deg);
          top: 48px;
          right: 98px;
        }
      }
    
      .ear {
        position: absolute;
        width: 10px;
        height: 20px;
        background-color: $skin-color;
        filter: drop-shadow(0 0 1px #7e7a1f);
        border-radius: 40%;
        top: 95px;
        z-index: 3;
        &--left {
          left: 104px;
          transform: rotate(-5deg);
          &:before {
            content: "";
            position: absolute;
            width: 6px;
            height: 12px;
            background-color: $skin-color;
            border-radius: 40% 40% 50% 50%;
            box-shadow: -1px -1px 1px darken($skin-color, 10%);
            top: 3px;
            left: 2px;
          }
        }
        &--right {
          right: 104px;
          transform: rotate(5deg);
          &:before {
            content: "";
            position: absolute;
            width: 6px;
            height: 10px;
            background-color: $skin-color;
            border-radius: 40% 40% 50% 50%;
            box-shadow: 1px -1px 1px darken($skin-color, 10%);
            top: 3px;
            right: 2px;
          }
        }
      } // end of ear
    
      .face {
        position: absolute;
        width: 100px;
        height: 110px;
        border-radius: 100% / 70% 70% 160% 160%;
        background-color: $skin-color;
        top: 54px;
        left: 50%;
        transform: translate(-50%);
        box-shadow: 0 0.5px 2px #b37865;
        z-index: 10;
            
        .eye-glasses {
        position: absolute;
        width: 40px;
        height: 32px;
        border: 3px solid $eye-glasses-color;
        top: 32px;
        z-index: 10;
        &.eye-glasses-left {
          border-radius: 12px 18px 18px 18px;
          left: 5px;
          &:before {
            content: "";
            position: absolute;
            width: 14px;
            height: 3px;
            background-color: $eye-glasses-color;
            top: 10px;
            left: 35px;
          }
          &:after {
            content: "";
            position: absolute;
            width: 6px;
            height: 3px;
            background-color: $eye-glasses-color;
            top: 8px;
            left: -8px;
          }
        }
        &.eye-glasses-right {
          border-radius: 18px 12px 18px 18px;
          right: 5px;
          &:before {
            content: "";
            position: absolute;
            width: 15px;
            height: 3px;
            background-color: $eye-glasses-color;
            top: 6px;
            left: -15px;
          }
          &:after {
            content: "";
            position: absolute;
            width: 6px;
            height: 3px;
            background-color: $eye-glasses-color;
            top: 8px;
            right: -8px;
          }
        }
      }  // end of eye-glasses
    
        .eye {
        position: absolute;
        width: 20px;
        height: 20px;
        top: 38px;
        background-color: $secondary-color;
        border: 2px solid $eyeline-color;
        border-radius: 75% 0%;
        transform: rotate(45deg);
        &:before {
          content: "";
          position: absolute;
          width: 10px;
          height: 10px;
          top: 50%;
          left: 50%;
          transform: translate(-50%, -50%);
          background-color: $eye-color;
          border-radius: 50%;
          box-shadow: inset 1px 1px 1px 1px #17460d;
        }
        &--left {
          left: 16px;
          box-shadow: -1px 0 2px darken($eyeline-color, 50%);
        }
        &--right {
          right: 16px;
          box-shadow: 0 -1px 2px darken($eyeline-color, 50%);
        }
        &:after {
          content: "";
          position: absolute;
          width: 4px;
          height: 4px;
          top: 50%;
          left: 50%;
          transform: translate(-50%, -50%);
          background-color: $iris-color;
          border-radius: 50%;
        }
          .eyelash {
          position: absolute;
          Width: 1px;
          height: 5px;
          background-color: $eyelash-color;
          &--left,
          &--left1,
          &--left2,
          &--left3,
          &--left4 {
            transform: rotate(90deg);
          }
          &--left {
            top: -2px;
            left: 1px
          }
          &--left1 {
            top: 1px;
            left: -2px
          }
          &--left2 {
            top: 5px;
            left: -5px
          }
          &--left3 {
            top: 9px;
            left: -6px
          }
          &--left4 {
            top: 13px;
            left: -6px
          }
          &--right {
            top: -2px;
            right: 14px;
          }
          &--right1 {
            top: -5px;
            right: 10px;
          }
          &--right2 {
            top: -7px;
            right: 6px;
          }
          &--right3 {
            top: -8px;
            right: 2px;
          }
          &--right4 {
            top: -8px;
            right: -1px;
          }
        } // end of eye-lash
      } // end of eye
         
        .eyebrow1 {
          position: absolute;
          width: 20px;
          height: 3px;
          background-color: $eyebrow-color;
          border-radius: 50%;
          top: 28px;
          &--left {
            transform: rotate(10deg);
            left: 16px;
          }
          &--right {
            transform: rotate(-10deg);
            right: 16px;
          }
        } // end of eyebrow1 //
        .eyebrow2 {
            position: absolute;
            content: "";
            width: 14px;
            height: 2px;
            background-color: $eyebrow-color;
            border-radius: 50%;
            top: 28px;
            &--left {
              transform: rotate(-12deg);
              left: 9px;
            }
            &--right {
              transform: rotate(12deg);
              right: 9px;
            }
          } // end of eyebrow2 //
        
        .nose {
          position: absolute;
          width: 5px;
          height: 2px;
          background-color: $nose-color;
          border-radius: 50%;
          transform: rotate(45deg);
          top: 70px;
          left: 44px;
          &:before {
            content: "";
            position: absolute;
            width: 5px;
            height: 2px;
            background-color: $nose-color;
            border-radius: 50%;
            transform: rotate(90deg);
            top: -6px;         
            left: 6px;
            }
        } // end of nose
    
        .lips {
        position: absolute;
        width: 18px;
        height: 18px;
        border-radius: 90% 0;
        background-color: darken($lips-color, 1%);
        top: 90px;
        left: 50%;
        transform: rotate(45deg) translate(-60%);
        &:before {
          content: "";
          position: absolute;
          width: 0;
          height: 0;
          border-left: 3px solid transparent;
          border-right: 3px solid transparent;
          border-top: 3px solid $skin-color;
          border-radius: 60%;
          transform: rotate(-45deg);
          top: 24%;
          left: 12%;
        }
      }  // end of lips
    } // end of face 
    
      .neck {
        position: absolute;
        width: 34px;
        height: 50px;
        background-color: $skin-color;
        filter: drop-shadow(0 0 2px #865748);
        top: 149px;
        left: 50%;
        transform: translate(-50%);
        z-index: 9;
        &:before {
          content: "";
          position: absolute;
          width: 60px;
          height: 40px;
          background-color: $skin-color;
          border-radius: 50%;
          top: 40px;
          left: 50%;
          transform: translate(-50%);
        }
      } // end of neck
    
      .t-shirt {
        position: absolute;
        width: 166px;
        height: 140px;
        background-color: $t-shirt-color;
        border-radius: 100% / 50% 50% 20% 20%;
        top: 190px;
        left: 50%;
        transform: translate(-50%);
        filter: drop-shadow(0 0 2px);
        z-index: 4;
      } // end of t-shirt
      
      .neckless {
        content: "";
        position: absolute;
        width: 36px;
        height: 10px;
        background-color: $neckless-color;
        border-radius: 2px 2px 0 0;
        z-index: 10;
        top: 183px;
        left: 50%;
        transform: translate(-50%);
      } // end of neckless
    } // end of avatar-container
    SCSS
    Expand
  • Gray vs Grey in CSS. What Is the Right Choice?

    Gray vs Grey in CSS. What Is the Right Choice?

    Gray VS grey? Is there a right choice between these two? It is well known that both gray and grey in CSS are considered equivalent with no impact on functionality. We can use either of them without any issues. In the context of web development and CSS, they are both recognized and accepted. CSS specifications and web browsers accommodate both equally.

    Why 🤔 do web designers and programmers use both gray and grey in CSS?

    Because they wanted to add a little color to the spelling debate!

    Below we can see an example of two elements. We set gray for the first element while the second element has grey:

    /* Using "gray" (American English) */
    .first-element {
      color: gray;
    }
    
    /* Using "grey" (British English) */
    .second-element {
      color: grey;
    }
    CSS

    Both examples are correct, and your CSS should be functional, .first-element and .second-element classes will share the same color, as CSS treats gray and grey interchangeably.

    It turns out that the choice between gray and grey in CSS is primarily a matter of personal preference and doesn’t affect how web browsers interpret your code. You are free to use either.

    Similarly, there are other color names with variations in spelling that are recognized by most modern browsers, for example, “lightgray” and “lightgrey” or “darkgray” and “darkgrey” are all valid. 😃

  • CSS Rainbow Text: How To Make Astonishing And Vibrant Fonts

    CSS Rainbow Text: How To Make Astonishing And Vibrant Fonts

    Imagine infusing your web typography (fonts) with the vibrant hues of a dazzling 🌈✨ rainbow! Cascading Style Sheets (CSS) empower designers and developers to bring this captivating vision to life. A colorful font like the CSS rainbow effect is more than just a spectrum of colors; it’s a creative and dynamic way to enhance your website’s visual appeal and make a lasting impression on your visitors.

    Today, with this post, 😃 we’ll dive into the exciting world of creating a rainbow effect, unlocking the magic of colors and typography to elevate your web design. Enjoy! 💻

    Prepare basic HTML and CSS structure

    We begin with our HTML and CSS structure. We create an HTML <div> element that has a class called rainbow-effect. Then, we set some rules in CSS that are applied to our HTML element. So, let’s move forward and analyze our CSS code snippet.

    <body>
      <div class="raibow-effect">rainbow effect</div>
    </body>
    HTML
    body {
      background-color: #050c20; /* deep blue */
    }
    
    .rainbow-effect {
      text-align: center;
      color: white;
      font-size: 180px;
      font-weight: bold;
      font-family: 'Roboto', sans-serif;
    }
    CSS

    First of all, we set the background color of our body to be a deep blue. Then, we proceed with our text. We create a center aligned, white 180px text with bold and highly legible fonts, as we specifically seek a font with excellent readability.

    Once set, we can then proceed with our tweaks in order to infuse the text with the enchanting hues of a rainbow. The following image shows what is rendered on the screen for the time being. 😃

    This image shows our text with its basic characteristics.

    Apply the rainbow effect

    Within the style rules of the .rainbow-effect, we find specific directives regarding our rainbow effect:

    
    .rainbow-effect {
      ...
      background-image: linear-gradient(
        to right, red, orange, yellow, green, blue, indigo, violet
      );
      background-clip: text;
      color: transparent;
    }
    
    CSS

    background-image: linear-gradient
    The first thing we need to know is that by using the background-image CSS property we are able to create a background with more than one color.

    We do so by setting the linear-gradient value, and we are free to choose any color and any direction we want for our text. In our case, we use the to right direction and the gradient starts with the color red on the left and smoothly transitions through orange, yellow, green, blue, indigo, and violet as it moves from left to right. So, it gives a colorful, horizontal stripe-like background.

    The rainbow effect word with a rainbow effect as a background. This happens as we set the CSS background-image property to linear-gradient(to right, red, orange, yellow, green, blue, indigo, violet)

    You are always free to choose any direction of the linear-gradient you like! 👍

    background-clip: text
    We continue our work with the background-clip property which is used to define how the background should be clipped or masked. In our case, it’s set to text, which tells the browser to apply the background gradient only to the text inside our div.

    The rainbow effect word after setting the -webkit-background-clip CSS property to text. We can see that for now our text is white with the body's background.

    What? Nothing happened yet? Why? Using this property, the colorful background is applied to the text, but the effect is not visible yet because it is necessary to proceed to our next step 🧐 ⬇ in order to achieve the final and desired results. So, let’s move on!

    color: transparent
    Finally, adding the color property to transparent renders the text itself invisible, allowing the colorful background to show through the text. And there it is! 🥳

    The rainbow effect word with the css rainbow effect after setting color CSS property to transparent. We are able now to see that our text inherits the colors of the rainbow. So, now we can see a completely colorful text.

    So, in summary, putting it all together, when you use this code, you’ll have a text with a colorful gradient background (rainbow colors) that appears within the text. The text itself is invisible, creating a striking and colorful text effect. 🎉

  • How To Decide If Programming Is Right For You?

    How To Decide If Programming Is Right For You?

    Imagine an astronaut floating in space, laptop in hand, surrounded by twinkling ✨ stars. It’s a scene that mirrors the adventure of programming—exploring the unknown, solving 🧩 puzzles, and pushing boundaries. Just as astronauts 👨‍🚀 👩‍🚀 embark on missions into space, programmers journey into the digital 💻 frontier.

    With the rise of remote work, programmers have the freedom to code from anywhere on 🏖 🏰 🏕 earth. Remote work opens doors to global collaboration, while continuous learning keeps them ahead in a rapidly evolving landscape. So, whether you’re reaching for the stars or diving into code, remember that programming is a journey of discovery and innovation.

    Are you considering a career in the world of programming? It’s a wild but also exciting ride, with twists, turns, and plenty of code to go around. But why do people choose this path, you ask? Let me break it down for you, along with some pros and cons to consider. 🤔 In other words, food for thought.

    Pros: Why Programming Might Be the Perfect Career for You

    Programming is an incredible profession that offers a wide range of opportunities. It allows you to create, innovate, and solve problems in ways that can have a significant impact on the world. Additionally, it offers attractive salaries and the flexibility of remote work. Furthermore, what a great satisfaction it is to bring ideas to life through code.

    Plenty of 🎉🎉 Opportunities

    To start, programmers have a plethora of job opportunities in a world that provides us with low budget prospects. Skilled coders are in high demand, from big tech companies to small startups. If you’re looking for a career with many options and a really good salary, programming might be your jam.

    Flex Your Creative 🧠 Muscles

    Believe it or not, coding isn’t just about numbers and logic – it’s an art form, too. Whether you’re crafting a well-designed app or solving a tricky bug, there’s a ton of room for creativity in programming. So, if you’re the type who loves to create and furthermore experiment, you’ll feel right behind your keyboard.

    Problem-Solving 🧨 Superpowers

    Ever feel like you’re the master of puzzles? If you love cracking enigmas, programming is your playground. Whether you are dealing with messy code or making a slow algorithm faster, programming is all about finding solutions. And trust me, there’s nothing quite like the satisfaction of overcoming a challenge and seeing your code in action.

    Always Something Fresh to 🔎 Discover

    Forget about getting bored. The field is constantly evolving whether it’s new languages, frameworks, or technologies. It’s like embarking on a never-ending journey of learning. If you thrive on exploration and discovery, programming will definitely keep you engaged.

    Remote 🛵 Work

    The beauty of remote work! With programming skills in your toolkit, you’re not tied to any particular location. Whether you’re coding from your cozy home office or enjoying a latte at your favorite café, your workspace is everywhere as long as you’ve got an internet connection.

    Spectrum of 💰 Salaries

    If you are dreaming of hooking 🪝 high-paying opportunities such as freelance projects, contract work, or even full-time positions, improving your English skills can open doors to remote positions in countries offering generous salaries. 🤑 So, now it’s the right time to freshen them up.

    Cons: Challenges You Might Face in a Programming Career

    Programming comes with its challenges. It demands continuous learning and dedication, which can sometimes be truly stressful. Long hours at the computer can lead to health issues, and the solitary nature of the work can be isolating. Balancing these demands is crucial if you desire to maintain your position in this sector.

    Learning Curve 📈 Alert

    Programming may be challenging at first. Learning all those languages, algorithms, and frameworks can feel like trying to solve a Rubik’s cube blindfolded. Keep patience and stick with it. Before you know it, you’ll be coding 👩‍💻 like a pro. So, keep going!

    The Dreaded 🪲 Bugs

    Undoubtedly, the curse of every programmer’s existence – bugs. Those pesky little gremlins that sneak into your code and fill you with exhaustion and devastation. Tracking them down can be a real headache! But hey, don’t give up! Every bug you squash is a victory in your hands, and at the end of the day, it feels soo goood!! 🥇🏆

    Maintenance 🤯 Madness

    Creating software is only the start. Once it’s out there, you’ve got to keep it running according to plan. That means updating it, fixing security issues, and improving it again and again—all while handling your other tasks. It’s like juggling 🤹‍♀️ but with computer stuff. It’s not easy, but keeping your code running smoothly is one of the most crucial things to do. Believe me, you can do it, and you will!

    Work-Life ⚖ Balance Struggle

    Maintaining a healthy work-life balance can be a real challenge in a world where we’re all glued to screens. It’s easy to get sucked into the endless abyss of code. Separate work life from home life it’s crucial. Don’t forget to take breaks, get fresh air, exercise, start a new hobby, travel, go back in time when reading books 📖 was a must, or spend time with loved ones. After all, life’s too short to spend it all behind a screen.

    Isolation 😑 Factor

    While programming offers the freedom to work remotely and independently, it can also lead to isolation. Spending long hours in front of a computer screen and troubleshooting code solo can sometimes lead to loneliness. Without the colleagues of a traditional office environment, programmers may miss out on all the social interactions and spontaneous collaborations that can spark creativity and association.
    However, this isolation can be a welcome aspect of the job for people who blossom in solitary environments, allowing them to focus deeply on their work without distractions. Ultimately, whether isolation in programming is seen as good or bad depends on individual preferences and working styles. Some may find comfort in solitude, while others may desire more social interaction.

    It’s completely up to you where to place it, on the pros or cons list. In the end, it’s a reflection of your character. ☔ 🌈 🌞

    Impostor 😰 Syndrome Warning

    Huh, this awful self-doubt phenomenon. Impostor syndrome or impostorism is common among programmers, where skilled developers feel inadequate and fear being revealed as frauds despite their abilities. This lack of self-confidence can prevent their professional growth by discouraging them from participating in projects, speaking at conferences, or applying for advanced roles.
    Always remember that you won’t know if you can do it unless you try. So, do not hesitate! Take the shot! 🥁

    Burnout 😵‍💫

    Last but not least – burnout. Arising from long stress and imbalance between work and personal life. Symptoms include exhaustion and reduced productivity, which can lead to physical health issues and mental health problems like depression.
    We can prevent this by setting boundaries, organizing workloads, discussing it with our colleagues, asking for support, and taking breaks. Loong ☕ loong 💤 breaks! These techniques will help to maintain health and sustain enthusiasm for coding.
    Are all part of the journey. So, roll up your sleeves and dive into work. But always remember that burnout is not an option. Get out of your computer when you need a break!!

    So, go ahead! Begin this programming journey and picture yourself as our courageous astronaut exploring new boundaries. Equipped with the tools of the trade—a laptop, determination, and a thirst for discovery. Whether you’re dreaming of distant 🌌 galaxies or lines of 📜 code, remember: this path is one of endless possibilities.
    So, what are you waiting for? Embark on your own adventure.
    Conquer the skies of coding!
    Bon voyage! 🪐 ✨

    Astronaut holding a flag at the top of the moon
    Image by catalyststuff on Freepik