Showing posts with label HTML. Show all posts
Showing posts with label HTML. Show all posts

Wednesday, February 2, 2022

CSS Clock

 Here I created clock using CSS and HTML.


CSS:

body{
    background-color: aquamarine;
}
.clock{
  height: 150px;
  width: 150px;
  border-radius: 150px;
  left: 38%;
  top: 24%;
  position: absolute;
}

.hand{
    position: absolute;
    height: 30vmin;
    left: 49%;
    top: 15%;
    transform-origin: 50% 80%;
    box-shadow: 0px 0px 4px 0px rgba(0,0,0,0.4);

  animation-name: moving;
 
  animation-iteration-count: infinite;
  animation-timing-function: linear;
}
.hour{
   
    width: 6px;
    background: whitesmoke;
   
  animation-duration: 43200s;
}
.second{
    width: 4px;
    background: rgb(189, 144, 144);
  animation-duration: 3600s;
 
}
.minute{
   
    background-color: hsl(0, 72%, 47%);
      width: 2px;
     
  animation-duration: 60s;
}

.hour12,
.hour1,
.hour2,
.hour3,
.hour4,
.hour5 {
    height: 10px;
    width: 375px;
    background: transparent;
    border-left: 70px solid #000;
    border-right: 70px solid #000;
    transform: translate(-50%, -50%);
    top: 75%;
    left: 50%;
    position: absolute;
}
.hour12{
  left:110px;
}
.hour3 {
  transform: rotate(90deg) translate(0, 34vmin);
 }

.hour1 {
  transform: rotate(120deg) translate(17vmin, 30vmin);
}

.hour2 {
  transform: rotate(150deg) translate(29vmin, 18vmin);
}

.hour4 {
  transform: rotate(210deg) translate(30vmin, -17vmin);
}

.hour5 {
  transform: rotate(240deg) translate(17vmin, -30vmin);
}


@keyframes moving {
    to {
      transform: rotate(360deg);
    }
}

HTML:

<div class="clock">
    <div class="hour12"></div>
    <div class="hour1"></div>
    <div class="hour2"></div>
    <div class="hour3"></div>
    <div class="hour4"></div>
    <div class="hour5"></div>
</div>
<div class="hand hour"></div>
<div class="hand second"></div>
<div class="hand minute"></div>

CLOCK:






The clock is running one, but I couldn't save them as supporting format. If u want to see the running clock, copy the code and try it in your machine.

Sunday, January 30, 2022

My Work Desk using CSS.

 Hello!, I just tried to create my work desk using CSS and HTML. Here all I used is<div>. 


CSS : 

body{
    background-color: white;
}

.mydesk{
    position: absolute;
    height: 10px;
    width: 500px;
    background-color: burlywood;
    top: 425px;
    left: 313px;
    box-shadow: 20px 20px 20px 20px;
}

.left-stand{
    position: absolute;
    height: 150px;
    width: 5px;
    left: 350px;
    top: 465px;
    background-color: black;

}
.right-stand{
    position: absolute;
    height: 150px;
    width: 5px;
    left: 750px;
    top: 466px;
    background-color: black;
}
.desktop {
    position: absolute;
    width: 200px;
    height: 150px;
    border-radius: 10px 10px 10px 10px;
    background-color: black;
    top: 44%;
    left: 72%;
    transform: translate(-50%, -50%);
    box-shadow: 0px 0px 20px -7px;
}

.monitor {
    border:double;
    background-color: darkgray;
    height: 130px;
    width: 180px;
    margin-left: 6px;
    margin-top: 5px;
}

.power{
    height: 5px;
    width: 5px;
    border-radius: 5px;
    background-color: white;
    margin-top: 1px;
    margin-left: 190px;
}

.power-on{
    height: 3px;
    width: 3px;
    background-color: white;
    margin-top: 0px;
    margin-left: 189px;
}

.stand{
    height: 25px;
    width: 30px;
    background-color: black;
    left: 89px;
    top: 152px;
    position: absolute;
    box-shadow: 0 0 5px 0px;
}

.flat{
    position: absolute;
    width: 80px;
    height: 12px;
    background-color: black;
    left: 65px;
    top: 207px;
    box-shadow: 0 0 5px 3px;
}
.monitor-power-supply{
    border-left: solid black;
    height: 65px;
    margin-left: 150px;
}

.laptop-outer{
    position: absolute;
    width: 150px;
    height: 100px;
    border-radius: 5px;
    background-color: black;
    top: 57%;
    left: 40%;
    transform: translate(-50%, -50%);
    box-shadow: 0px 0px 14px -2px;
}

.lap-monitor {
    border: double;
    background-color: darkgray;
    height: 65px;
    width: 135px;
    margin-left: 5px;
    margin-top: 10px;
}

.lenovo{
   
    background-color: grey;
    width: 36px;
    height: 6px;
    margin-top: 7px;
    margin-left: 5px;
}
.lenovo-font {
    font-family: pf lindemann sans;
    font-size: 15px;
}
.key-pad{
    width: 180px;
    height: 10px;
    box-shadow: 0px 0px 20px 0px;
    margin-top: 10px;
    margin-left: -12px;
    background-color: black;
}

.bose{
    width: 45px;
    padding: 8px;
    border: 5px solid gray;
    border-bottom-left-radius: 30%;
    border-bottom-right-radius: 30%;
    border-top-left-radius: 30%;
    border-top-right-radius: 30%;
    box-shadow: 0px 0px 40px -2px;
    background-color: gray;
    margin-left: 67px;
    margin-top: 31px;
}
.lamp{
    position: absolute;
    width: 100px;
    height: 20px;
    top: 394px;
    left: 515px;
    border-radius: 20px 20px 20px 20px;
    background-color: black;
}
.lamp-vetical-pole-1{
    top: -101px;
    left: 45px;
    position: absolute;
    height: 100px;
    width: 10px;
    background-color: black;
}
.lamp-vetical-pole-2{
    top: -148px;
    left: 47px;
    position: absolute;
    height: 46px;
    width: 5px;
    background-color: black;
}
.lamp-circle{
    position: absolute;
    width: 80px;
    height: 80px;
    border-radius: 50px;
    background-color: black;
    top: -229px;
    left: 10px;
}
.lamp-circle-inner{
    position: absolute;
    width: 40px;
    height: 40px;
    border-radius: 20px;
    background-color: white;
    left: 20px;
    top: 20px;
}

HTML: 

<!DOCTYPE html>
<html>
<head>
    <link rel="stylesheet" href="./mydesc.css">
</head>

<body>
    <div class="desktop">
        <div class="monitor"></div>
        <div class="power">
            <div class="power-on"></div>
        </div>
        <div class="stand"></div>
        <div class="flat"></div>
        <!-- <div class="monitor-power-supply">
           
        </div> -->
        <div class="bose">
           
        </div>
    </div>
    <div class="laptop-outer">
        <div class="lap-monitor"></div>
        <div class="lenovo">
           
        </div>
        <div class="key-pad"></div>
    </div>
    <div class="curves-width"></div>
    <div class="lamp">
        <div class="lamp-vetical-pole-1"></div>
        <div class="lamp-vetical-pole-2"></div>
        <div class="lamp-circle">
            <div class="lamp-circle-inner"></div>
        </div>
    </div>
    <div class="mydesk"></div>
    <div class="left-stand"></div>
    <div class="right-stand"></div>
</body>
</html>

OUTPUT:




Thursday, January 27, 2022

Adding Logo on Coffee Cup

 Here I created a coffee cup using css Coffee cup . Added new style to display logo in the cup. 

I am using my previous employer logo. The same cup the given me on my first day of joining. 


Here  css changes

body{
    background-color: tomato;
}

.cup {
    position: fixed;
    height: 110px;
    width: 90px;
    background-color: whitesmoke;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    border-radius: 0 0 20px 20px;
  }

  .cup-bottom {
    width: 90px;
    border-radius: 0 0 45px 45px;
  }

  .cup-hand {
    position: absolute;
    height: 58px;
    width: 32px;
    margin-left: 89px;
    margin-top: -40px;
    background-color: whitesmoke;
    border-top-left-radius: 2px 20px;
    border-top-right-radius: 24px;
    border-bottom-left-radius: 2px 20px;
    border-bottom-right-radius: 24px;
  }
 
  .cup-hand-inside {
    position: absolute;
    height: 35px;
    width: 22px;
    margin-left: 1px;
    margin-top: 11px;
    background-color: tomato;
    border-radius: 0px 25px 25px 0px;
}

.cnsi{
    color: blue;
    font-style: normal;
    font-size: 20px;
    margin-left: 35px;
    margin-top: 36px;
}

.cnsi-logo{
    position: absolute;
    height: 25px;
    width: 25px;
    background-color: blue;
    border-radius: 50%;
    top: 35px;
    left: 4px;
}
.cnsi-logo-ship{
    position: absolute;
    left: 6px;
    top: 5px;
    height: 21px;
    width: 2px;
    background-color: white;
    transform: rotate(
330deg
);
}
.cnsi-logo-horns1{
    position: absolute;
    height: 0px;
    width: 0px;
    left: 2px;
    top: -2px;
    border-top: 1px solid transparent;
    border-left: 15px solid white;
    border-bottom: 5px solid transparent;
    transform: rotate(
350deg
 );
}
.cnsi-logo-horns2{
    position: absolute;
    height: 0px;
    width: 0px;
    left: 2px;
    top: 4px;
    border-top: 1px solid transparent;
    border-left: 15px solid white;
    border-bottom: 5px solid transparent;
    transform: rotate(
350deg
 );
}
.cnsi-logo-horns3{
    position: absolute;
    height: 0px;
    width: 0px;
    left: 2px;
    top: 9px;
    border-top: 1px solid transparent;
    border-left: 15px solid white;
    border-bottom: 5px solid transparent;
    transform: rotate(
350deg
 );
}
.cnsi-logo-horns4{
    position: absolute;
    height: 0px;
    width: 0px;
    left: 2px;
    top: 15px;
    border-top: 1px solid transparent;
    border-left: 15px solid white;
    border-bottom: 5px solid transparent;
    transform: rotate(
350deg
 );
}

HTML changes:

<div class="cup">
    <div class="cnsi-logo">
        <div class="cnsi-logo-ship">
            <div class="cnsi-logo-horns1"></div>
            <div class="cnsi-logo-horns2"></div>
            <div class="cnsi-logo-horns3"></div>
            <div class="cnsi-logo-horns4"></div>
        </div>
    </div>
    <div class="cnsi">CNSI</div>
    <div class="cup-hand">
        <div class="cup-hand-inside"></div>
    </div>
   
</div>

Output: 

Need to add more style to look like exact coffee cup with their logo. Working on it....!

The above CSS works fine, but review it back it seems we are using bilateral code on cnsi-logo-horns1 to cnsi-logo-horns4. Lets fix the CSS code with good standard.

.cnsi-logo-horns1{
    position: absolute;
    height: 0px;
    width: 0px;
    left: 2px;
    top: -2px;
    border-top: 1px solid transparent;
    border-left: 15px solid white;
    border-bottom: 5px solid transparent;
    transform: rotate(
350deg
 );
 
}

if u see above and rest of cnsi-logo-horns* class, rest of top and left element are same for all these 4 selectors. Let make some changes without effecting style. 

Here we split the differing element from classes and make them as different selector,

.cnsi-logo-horn{
    position: absolute;
    height: 0px;
    width: 0px;
    border-top: 1px solid transparent;
    border-left: 15px solid white;
    border-bottom: 5px solid transparent;
    transform: rotate(
350deg
 );
 
}
.horn1{
    left: 2px;
    top: -2px;
}
.horn2{
    left: 2px;
    top: 4px;
}
.horn3{
    left: 2px;
    top: 9px;
}
.horn4{
    left: 2px;
    top: 15px;
}

And HTML changes for that,
            <div class="cnsi-logo-horn horn1"></div>
            <div class="cnsi-logo-horn horn2"></div>
            <div class="cnsi-logo-horn horn3"></div>
            <div class="cnsi-logo-horn horn4"></div>
Output here as same as before and code also looks good.
 

Tuesday, January 25, 2022

My First CSS work!!

CSS:

body{
    background-color: tomato;
}

.cup {
    position: fixed;
    height: 90px;
    width: 70px;
    background-color: whitesmoke;
    border-radius: 0px 0px 24px 24px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);

  }

  .cup-hand {
    position: absolute;
    height: 58px;
    width: 33px;
    margin-left: 68px;
    margin-top: 15px;
    background-color: whitesmoke;
    border-top-left-radius: 2px 20px;
    border-top-right-radius: 24px;
    border-bottom-left-radius: 2px 20px;
    border-bottom-right-radius: 24px;
  }
 
  .cup-hand-inside {
    position: absolute;
    height: 35px;
    width: 22px;
    margin-left: 1px;
    margin-top: 11px;
    background-color: tomato;
    border-radius: 0px 25px 25px 0px;
}

HTML:

<div class="cup">
    <div class="cup-hand">
        <div class="cup-hand-inside"></div>
    </div>
</div>

And My Coffee Cup :

Hope u can see a cup!!. Will be adding more style on the cup further. 

Here I added more style to display logo on coffee cup.