GithubHelp home page GithubHelp logo

withaarzoo / elastic-toggle-switch Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 2.0 5 KB

An elegant and visually appealing toggle switch with elastic animation and dynamic lighting effects.

HTML 5.61% CSS 94.39%
codewithaarzoo css html html-css-project toggle-switch

elastic-toggle-switch's Introduction

Elastic Toggle Switch

An elegant and visually appealing toggle switch with elastic animation and dynamic lighting effects.

Description

This repository contains HTML and CSS code for an Elastic Toggle Switch, a user interface element that provides a toggle functionality with an interactive design. The switch has a unique elastic animation when toggled, and it features dynamic lighting effects to enhance the visual experience.

Features

  • Elastic animation when toggling the switch.
  • Dynamic lighting effects that respond to the switch state.
  • Modern and stylish design.

Usage

  1. Clone this repository or copy the HTML and CSS code to your project.
  2. Include the style.css file in your HTML using the <link> tag.
  3. Add the following HTML code to your desired location:
<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <link rel="stylesheet" href="style.css">
  <title>Elastic Toggle Switch</title>
</head>
<body>
  <div class="content">
    <input type="checkbox" id="btn">
    <label for="btn">
      <span class="thumb"></span>
    </label>
    <div class="lights">
      <span class="light-off"></span>
      <span class="light-on"></span>
    </div>
  </div>
</body>
</html>

Customization

You can easily customize the appearance of the Elastic Toggle Switch by modifying the CSS variables defined in the style.css file. The following are some of the variables you can adjust:

  • --sz: Controls the overall size of the toggle switch.
  • --on: Defines the color for the "on" state.
  • --of: Defines the color for the "off" state.
  • --sp: Controls the speed of animations.

Feel free to explore the CSS code and experiment with different values to achieve the desired visual effects.

Credits

This Elastic Toggle Switch was inspired by creative UI designs and animations found on various design platforms. The code for this toggle switch was written by Aarzoo Islam, based on their interpretation of those design concepts.

License

This code is provided under the MIT License.

Preview

Screenshot 2023-08-15 131300

elastic-toggle-switch's People

Contributors

withaarzoo avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.