Code Monkey home page Code Monkey logo

gliding-box's Introduction

EXPERIMENT 10 - Gliding box using CSS application

AIM

To Create a Gliding box using CSS Animation

ALGORITHM

  1. Create an HTML document.
  2. In the head section, link an external CSS file using the tag.
  3. Add a title for the document.
  4. Define CSS styles to set the background color, margins, and positioning for the body.
  5. Create a container div with flexbox properties for vertical centering.
  6. Style the box div with a box-shadow effect and cursor pointer, and add a hover animation to create a shadow wave effect.
  7. Close all the open HTML tags to complete the structure of the document.

PROGRAM:

polaroid.html

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link rel="stylesheet" href="shadow.css"/>
    <title>Document</title>
</head>
<body>
    <div class="container">
       
        <center>
            <div class="box">
                <h4 style="color:white;padding-top: 10px;">Gliding Box using CSS Animation</h4>
            </div>
        </center>
    </div>
</body>
</html>

shadow.css

body{
    background-color: white;
    margin-top: 100px;
    margin-left:250px;
}
.container
{
    background-color: black;
    width:1000px;
    height:500px;
    border-radius: 25px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}
.box
{
    width: 200px;
    height:100px;
    box-shadow: blue 0px 0px 0px 2px inset,black 10px -10px 0px -3px, green 10px -10px, black 20px -20px 0px -3px, yellow 20px -20px, black 30px -30px 0px -3px, orange 30px -30px,black 40px -40px 0px -3px, red 40px -40px;
    cursor: pointer;
}
.box:hover
{
    animation: shadow-wave 1s ease infinite;
}

@keyframes shadow-wave {
    0%{
        box-shadow: blue 0px 0px 0px 2px inset,black 10px -10px 0px -3px, green 10px -10px, black 20px -20px 0px -3px, yellow 20px -20px, black 30px -30px 0px -3px, orange 30px -30px,black 40px -40px 0px -3px, red 40px -40px;
    }
    20% {
        
        box-shadow: red 0px 0px 0px 2px inset,black 10px -10px 0px -3px, blue 10px -10px, black 20px -20px 0px -3px, green 20px -20px, black 30px -30px 0px -3px, yellow 30px -30px,black 40px -40px 0px -3px, orange 40px -40px;
 
      }
    40% {
        
        box-shadow: orange 0px 0px 0px 2px inset,black 10px -10px 0px -3px, red 10px -10px, black 20px -20px 0px -3px, blue 20px -20px, black 30px -30px 0px -3px, green 30px -30px,black 40px -40px 0px -3px,yellow 40px -40px;
    }
    60% {
      
        box-shadow: yellow 0px 0px 0px 2px inset,black 10px -10px 0px -3px, orange 10px -10px, black 20px -20px 0px -3px, red 20px -20px, black 30px -30px 0px -3px, blue 30px -30px,black 40px -40px 0px -3px, green 40px -40px;
    }
    80% {

        box-shadow: green 0px 0px 0px 2px inset,black 10px -10px 0px -3px, yellow 10px -10px, black 20px -20px 0px -3px, orange 20px -20px, black 30px -30px 0px -3px, red 30px -30px,black 40px -40px 0px -3px, blue 40px -40px;
    }
    100% {
      
        box-shadow: blue 0px 0px 0px 2px inset,black 10px -10px 0px -3px, green 10px -10px, black 20px -20px 0px -3px, yellow 20px -20px, black 30px -30px 0px -3px, orange 30px -30px,black 40px -40px 0px -3px, red 40px -40px;
    }
    
}

OUTPUT

image

RESULT

Thus a Gliding box is created using css properties and displayed.

gliding-box's People

Contributors

shavedha 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.