Convert Figma logo to code with AI

nzbin logothree-dots

🔮 CSS loading animations made with single element.

1,323
131
1,323
5

Top Related Projects

19,349

A collection of loading indicators animated with CSS

A collection of loading spinners animated with CSS

Delightful, performance-focused pure css loading animations.

3,516

This could take a while

Quick Overview

Three Dots is a CSS loading animation library that provides a collection of lightweight, customizable loading indicators. It offers a variety of animated dots and spinners that can be easily integrated into web projects to enhance user experience during loading or processing times.

Pros

  • Lightweight and minimal, with no dependencies
  • Easy to implement and customize
  • Wide variety of animation styles
  • Cross-browser compatible

Cons

  • Limited to dot and spinner animations
  • May require additional CSS for positioning and sizing in some layouts
  • No built-in JavaScript functionality for dynamic control

Code Examples

Basic dot animation:

<div class="dot-elastic"></div>

Customized dot color and size:

<div class="dot-typing" style="color: #ff0000; font-size: 20px;"></div>

Spinner animation:

<div class="dot-spin"></div>

Getting Started

  1. Include the CSS file in your HTML:
<link rel="stylesheet" href="https://unpkg.com/three-dots@0.3.3/dist/three-dots.min.css">
  1. Add the desired animation class to an element:
<div class="dot-flashing"></div>
  1. Optionally, customize the appearance with inline styles or additional CSS:
<div class="dot-pulse" style="color: #0077be;"></div>

Competitor Comparisons

19,349

A collection of loading indicators animated with CSS

Pros of SpinKit

  • Offers a wider variety of loading animations (11 types)
  • Includes SASS source files for easier customization
  • Provides better browser compatibility, including support for older versions

Cons of SpinKit

  • Larger file size due to more complex animations
  • Requires more markup for some animations, potentially increasing HTML complexity
  • Less focused on minimalism compared to Three Dots

Code Comparison

SpinKit (HTML):

<div class="sk-chase">
  <div class="sk-chase-dot"></div>
  <div class="sk-chase-dot"></div>
  <div class="sk-chase-dot"></div>
  <div class="sk-chase-dot"></div>
  <div class="sk-chase-dot"></div>
</div>

Three Dots (HTML):

<div class="dot-pulse"></div>

SpinKit focuses on providing a wide range of complex loading animations with extensive browser support. It offers more customization options through SASS files but requires more markup for some animations. Three Dots, on the other hand, emphasizes simplicity and minimalism, with fewer animation options but cleaner HTML structure. The code comparison demonstrates the difference in markup complexity between the two libraries for similar loading animations.

A collection of loading spinners animated with CSS

Pros of css-loaders

  • Offers a wider variety of loader styles (11 different types)
  • Includes more complex animations like rotating squares and pulsing circles
  • Provides single-element CSS solutions for each loader type

Cons of css-loaders

  • Less customization options for individual loaders
  • Larger file size due to more complex animations and variety
  • Some loader styles may be more resource-intensive

Code Comparison

css-loaders:

.loader {
  border: 16px solid #f3f3f3;
  border-top: 16px solid #3498db;
  border-radius: 50%;
  width: 120px;
  height: 120px;
  animation: spin 2s linear infinite;
}

three-dots:

.dot-pulse {
  position: relative;
  left: -9999px;
  width: 10px;
  height: 10px;
  border-radius: 5px;
  background-color: #9880ff;
  color: #9880ff;
  box-shadow: 9999px 0 0 -5px;
  animation: dot-pulse 1.5s infinite linear;
  animation-delay: 0.25s;
}

Both repositories provide CSS-based loading animations, but they differ in approach and complexity. css-loaders offers a wider range of styles with more intricate animations, while three-dots focuses on simpler, customizable dot-based loaders. The code comparison shows that css-loaders tends to use more straightforward CSS properties, while three-dots employs more advanced techniques like box-shadow and relative positioning for its animations.

Delightful, performance-focused pure css loading animations.

Pros of loaders.css

  • Offers a wider variety of loader animations (42 different types)
  • Includes both CSS and Sass versions for flexibility
  • Provides a live demo page for easy visualization of all loaders

Cons of loaders.css

  • Larger file size due to more animations
  • Less focused on a specific style, which may lead to inconsistency in design
  • Hasn't been updated since 2016, potentially outdated

Code Comparison

three-dots:

.dot-elastic {
  position: relative;
  width: 10px;
  height: 10px;
  border-radius: 5px;
  background-color: #9880ff;
  animation: dotElastic 1s infinite linear;
}

loaders.css:

.ball-pulse > div {
  width: 15px;
  height: 15px;
  border-radius: 100%;
  margin: 2px;
  animation-fill-mode: both;
  display: inline-block;
  animation: scale 0.75s 0.12s infinite cubic-bezier(.2,.68,.18,1.08);
}

Both repositories provide CSS-based loading animations, but they differ in scope and implementation. three-dots focuses on simple, minimalistic dot animations, while loaders.css offers a broader range of loader styles. The code snippets show that three-dots uses a single element for animation, whereas loaders.css often employs multiple elements for more complex animations.

3,516

This could take a while

Pros of loading

  • Simpler and more lightweight, with fewer dependencies
  • Offers a wider variety of loading animations (8 types)
  • Easier to customize and integrate into React projects

Cons of loading

  • Less actively maintained (last update in 2018)
  • Fewer customization options for individual animations
  • Limited to React applications, while three-dots is more versatile

Code Comparison

loading:

import Loading from 'react-loading'

<Loading type="spin" color="#000000" height={20} width={20} />

three-dots:

<div class="dot-elastic"></div>
@import 'three-dots/dist/three-dots.min.css';

Summary

loading is a React-specific library offering simple, lightweight loading animations with various styles. It's easy to use but less actively maintained. three-dots provides CSS-based loading animations that can be used in any web project, offering more customization options and regular updates. The choice between them depends on your project's requirements and preferred technology stack.

Convert Figma logo designs to code with AI

Visual Copilot

Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.

Try Visual Copilot

README

Three Dots

Build Status npm license Financial Contributors on Open Collective

Three Dots is a set of CSS loading animations made with just single element. I think the project can not only enhance your CSS skills but also improve your imagination.

Installation

npm install three-dots --save

Usage

  1. Import the styles in your Sass file:
@use 'three-dots';
  1. Add just one div tag:
<div class="dot-elastic"></div>

Here’s the list of three-dots classes you can choose from:

dot-elastic
dot-pulse
dot-flashing
dot-collision
dot-revolution
dot-carousel
dot-typing
dot-windmill
dot-bricks
dot-floating
dot-fire
dot-spin
dot-falling
dot-stretching

Customization

Customize the dot's size ( color, spacing, etc. ) with Dart Sass API.

@use 'three-dots' with (
  $dot-width: 20px,
  $dot-height: 20px,
  ...
);

The available variables and their default values.

$dot-width: 10px;
$dot-height: 10px;
$dot-radius: $dot-width/2;

$dot-color: #9880ff;
$dot-bg-color: $dot-color;
$dot-before-color: $dot-color;
$dot-after-color: $dot-color;

$dot-spacing: $dot-width + $dot-width/2;

Contributors

Code Contributors

This project exists thanks to all the people who contribute. [Contribute].

Financial Contributors

Become a financial contributor and help us sustain our community. [Contribute]

Individuals

Organizations

Support this project with your organization. Your logo will show up here with a link to your website. [Contribute]

License

MIT

NPM DownloadsLast 30 Days