CSS Animation Events in JavaScript

Learn how to detect animation events in JavaScript Photo by Pankaj Patel onĀ Unsplash In JavaScript we can detect animation eventsĀ . The list of available animation events are animationstart → Triggered when an animation is started animationiteration → Triggered on each iteration of animation animationend → Triggered at the end of animation animationcancel → Triggered when …

Detecting the End of CSS Transition Events in JavaScript

An overview of properĀ chaining Image by Hello I’m NikĀ šŸ‡¬šŸ‡§ Before CSS transition and animation (keyframes), to animate, we needed to code in JavaScript. But once these two properties were introduced, we can achieve complex animations with only CSS. In JavaScript, we can call the callback function once the animation is done. But in CSS, there …

Creating Dice in Flexbox in CSS

Learn how to create dice in CSS usingĀ flexbox Dice created with flexbox inĀ CSS First Face First face of theĀ div Our first-face of the die will have one dot at the center. <div class=”dice first-face”> <span class=”dot”> </span> </div> Here, we have the dice– and dot-classed elements. Now we can add some CSS to the die. …

A short introduction to CSS variables

Using CSS variables we can set a value to a property and reuse it in our CSS code. This can be thought of almost exactly how we use variables in JavaScript. When do we need CSS variables? When we are working on a project, and we need to use the same value (text color, background, …

Create beautiful boxes using the outline CSS property

outline is a line outside the border of a container. Let’s create a simple rectangle and apply an outline and see how cool šŸ˜Ž it is. The syntx for ourline is outline: size type color; The above code will create a beautiful frame šŸ–¼Ā . The available values are outline: auto → Permits the user agent …

Css selector for element which have numbers as class name.

Learn how to select the element which has the class name starting with number. HTML5 supports numbers as id and class nameĀ , but css selector have some rulesĀ , A valid name should start with a letter (a-z)[A-Z]Ā , an underscore (_), or a hyphen (-) which is followed by any numbers, hyphens, underscores, letters. A name …

Remove All children šŸ‘¶ of the node in Javascript.

Learn how to delete all the nodes inside a div or any node in Javascript. You can do it in three ways 1Ā . Set the node innerHTML as empty-string(ā€œā€). var node = document.getElementById(‘parent’); node.innerHTML = “”; This method removes all the text and nodes inside the parent node. If you need to delete only the …

Creating a simple loader only using CSS

Loader are the impressing part of the websiteĀ , which needs to be simple and funĀ , So we will build an elegant loaderĀ . This loader is inspired from here. Create a container which is going to hold the loader <html> <body> <div class=”container”> </div> </body> </html> Set the width and height of the body to 100%Ā , …

Best Resources to find select the beautiful gradient for front-end developers.

List of websites where you can select gradient for your websites. Gradient for frontend developers. UIGradient UIGradient is a community contributed collection of beautiful multi-color gradients. You can easily generate gradientsĀ , rotate and download the gradient as imageĀ . They also provide some open source libraries for iOS, react, etc.,Ā .Link to their repo is here 2.ColorSpace …

Creating a toggle switch in CSS.

Awesome people build awesome šŸ˜Ž things using css. Let’s create an input checkbox with label, so that we can change the label as switch and turn on the switch when the checkbox is checked and turn off when it is unchecked. <input type=”checkbox” id=”toggle” class=”checkbox” /> <label for=”toggle” class=”switch”></label> The label is placed below the …

Design a site like this with WordPress.com
Get started