Pure CSS to achieve candle melting (water droplets) sample code

Pure CSS to achieve candle melting (water droplets) sample code

Achieve results

When it rains, collect your clothes

Implementation ideas

The melting effect is achieved using the contrast and blur of the filfilter.
Setting contrast in the parent element and blur in the child element can achieve the effect of blending the two.

Code

<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>Water drop effect</title>
  <link rel="stylesheet" type="text/css" href="css/index.css">
</head>
<body>
  <div class="hpc">Put away your clothes when it rains</div>
</body>
</html>
html,body{
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #000;
  filter:contrast(20);
}


.both{
  left: 0;
  content: "";
  width: 10px;
  height: 20px;
  bottom: -20px;
  border-radius: 50%;
  position: absolute;
  background-color: #fff;
}
.hpc{
  top: 80px;
  left: 100px;
  color: #fff;
  width: 400px;
  height: 107px;
  font-size: 6rem;
  filter: blur(3px);
  font-style: italic;
  position: relative;
  transform: skewY(5deg);
  font-family: "Comic Sans MS";
  border-bottom: 10px solid #fff;

  &::before{
    @extend .both;
    animation: move 6s ease-in-out infinite;
  }

  &::after{
    @extend .both;
    animation: move 6s 1s ease-in-out infinite;
  }

  @keyframes move{
    70%
      bottom: -20px;
      transform: translate(380px, 5px);
    }
    80%
      transform: translate(380px, 3px);
      opacity: 1;
    }
    100%{
      transform: translate(380px, 180px);
      opacity: 0;
    }
  }
}

Just convert SCSS to CSS and import it.

This concludes this article about the sample code for implementing candle melting (water drops) with pure CSS. For more relevant CSS candle melting content, please search 123WORDPRESS.COM’s previous articles or continue browsing the related articles below. I hope you will support 123WORDPRESS.COM in the future!

<<:  A brief discussion on when MySQL uses internal temporary tables

>>:  Hbase installation and configuration tutorial under Linux

Recommend

MySql implements page query function

First of all, we need to make it clear why we use...

How to implement encryption and decryption of sensitive data in MySQL database

Table of contents 1. Preparation 2. MySQL encrypt...

Vue Element front-end application development table list display

1. List query interface effect Before introducing...

A brief discussion on JS packaging objects

Table of contents Overview definition Instance Me...

Solve the problem of forgetting password in MySQL 5.7 under Linux

1. Problem Forgot password for mysql5.7 under lin...

15 Best Practices for HTML Beginners

Here are 30 best practices for HTML beginners. 1....

mysql splits a row of data into multiple rows based on commas

Table of contents Separation effect Command line ...

An example of how to write a big sun weather icon in pure CSS

Effect The effect diagram is as follows Implement...

Introduction to useRef and useState in JavaScript

Table of contents 1. useState hook 2. useRef hook...

JavaScript offsetParent case study

1. Definition of offsetParent: offsetParent is th...

MySQL cursor principle and usage example analysis

This article uses examples to explain the princip...

How to control the proportion of Flex child elements on the main axis

background Flex layout achieves alignment and spa...