Loading Dots

Loading Dots

Hard CSS Transitions & Animations 26 views
Explanation Complexity

Problem Statement

Create three dots that move up and down like a loader.

Input Format

No input.

Output Format

Print the HTML+CSS code in one block.

Constraints

Use keyframes and different animation-delay values.

Input / Output Format

Input Format
No input.
Output Format
Print the HTML+CSS code in one block.
Constraints
Use keyframes and different animation-delay values.

Examples

Input:
Output:
(HTML+CSS code)

Example Solution (Public)

CSS
<!doctype html>
<html lang='en'>
<head>
  <meta charset='utf-8'>
  <meta name='viewport' content='width=device-width, initial-scale=1'>
  <title>meetcode</title>
  <style>
    @keyframes jump { 0%, 100% { transform: translateY(0); opacity: 0.6; } 50% { transform: translateY(-6px); opacity: 1; } }
    .dot { width: 10px; height: 10px; border-radius: 50%; background: #0b5; display: inline-block; animation: jump 700ms ease-in-out infinite; }
    .dot:nth-child(2) { animation-delay: 120ms; }
    .dot:nth-child(3) { animation-delay: 240ms; }
  </style>
</head>
<body>
  <div>
    <span class='dot'></span>
    <span class='dot'></span>
    <span class='dot'></span>
    <span>Loading meetcode</span>
  </div>
</body>
</html>

Official Solution Code

<!doctype html>
<html lang='en'>
<head>
  <meta charset='utf-8'>
  <meta name='viewport' content='width=device-width, initial-scale=1'>
  <title>meetcode</title>
  <style>
    @keyframes jump { 0%, 100% { transform: translateY(0); opacity: 0.6; } 50% { transform: translateY(-6px); opacity: 1; } }
    .dot { width: 10px; height: 10px; border-radius: 50%; background: #0b5; display: inline-block; animation: jump 700ms ease-in-out infinite; }
    .dot:nth-child(2) { animation-delay: 120ms; }
    .dot:nth-child(3) { animation-delay: 240ms; }
  </style>
</head>
<body>
  <div>
    <span class='dot'></span>
    <span class='dot'></span>
    <span class='dot'></span>
    <span>Loading meetcode</span>
  </div>
</body>
</html>
Please login to submit solutions.
Editor
Output

                                        
Please login to submit solutions.