Tuesday, October 6, 2020

TODO LIST APP PART1 (HTML)

 <!DOCTYPE html>

<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Mywork.com</title>
    <link rel="stylesheet" href="style.css">
</head>
<body>
    <header class="header">
        <h1>Welcome to <span id="colorChange">Mywork</span> </h1>
        <input type="text" placeholder="Search your Work Here" id="search">
    </header>

    <div class="main-container">
        <div class="container1">
            <input type="text" id="head">
            <textarea name="desc" id="desc" cols="30" rows="10"></textarea>
            <button id="addTask">+</button>
        </div>

        <div id="container2">
            <!-- <div class="card">
                <h1>This is first Task</h1>
                <p>This is first description</p>
                <button onclick="deletTask()">-</button>
            </div>
            <div class="card">
                <h1>This is Second Task</h1>
                <p>This is Second description</p>
                <button onclick="deletTask()">-</button>
            </div> -->
        </div>
    </div>
    <script src="index.js"></script>
</body>
</html>

Thursday, October 1, 2020

Search filter using html css and javascript

 <!DOCTYPE html>

<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Search filter</title>
    <link rel="stylesheet" href="style.css">
</head>
<body>
    <div class="container">
        <div class="container1">
            <input type="text" class="search" id="search">
        </div>
        <div class="container2">
            <div class="name" id="name1">
                <p>Harry</p>
            </div>
            <div class="name" id="name2">
                <p>Sheeta</p>
            </div>
            <div class="name" id="name3">
                <p>Mosh</p>
            </div>
            <div class="name" id="name4">
                <p>Aries</p>
            </div>
            <div class="name" id="name5">
                <p>Bob</p>
            </div>
            <div class="name" id="name6">
                <p>Lucky</p>
            </div>
            <div class="name" id="name7">
                <p>Peter</p>
            </div>
            <div class="name" id="name8">
                <p>Rohit</p>
            </div>
            <div class="name" id="name9">
                <p>Raj</p>
            </div>
            <div class="name" id="name10">
                <p>Rose</p>
            </div>
        </div>
    </div>
    <script src="index.js"></script>
</body>
</html>


CSS code:

body{
    displayflex;
    justify-contentcenter;
    align-itemscenter;
}

.container{
    displayflex;
    align-itemscenter;
    justify-contentcenter;
    flex-directioncolumn;
    background-colorblack;
    width50%;
    border-radius20px;
    margin-top30px;
}

.container1{
    margin-top20px;
    width500px;
    displayflex;
    align-itemscenter;
    justify-contentcenter;
}

.container1 input{
    margin-top20px;
    border2px solid gold;
    border-radius10px;
    font-size20px;
    font-weight500;
    colorwhite;
    outlinenone;
    text-aligncenter;
    background-colorblack;
}

.container2{
    width600px;
    margin-top20px;
    background-colorblack;
    colorwhite;
    border-radius20px;
}

.name{
    borderyellow;
    background-colorgreen;
    border-radius10px;
    font-size24px;
    text-aligncenter;
    width500px;
    marginauto;
}

Javascript Code:

let search = document.getElementById('search');

search.addEventListener('input',()=>{
    let search = document.getElementById('search').value.toLowerCase();
    console.log(search);
    let name = document.getElementsByClassName('name');
    // console.log(name);
    Array.from(name).forEach((element,index)=>{
        let text = document.getElementsByTagName('p')[index].innerText.toLowerCase();
        console.log(text);
        if(text.includes(search)){
            element.style.display = 'block'
        }
        else{
            element.style.display = 'none'

        }
    })
    
    
})

Wednesday, September 16, 2020

Calculator Web App

 Index.html

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Calculator</title>
    <link rel="stylesheet" href="style.css">
</head>
<body>
    <header id="header">
        <h1>Welcome to MyCalci</h1>
    </header>
    <div id="section">
        <input type="text" id="screen" readonly>
        <table>
            <tr>
                <td><button>(</button></td>
                <td><button>)</button></td>
                <td><button>C</button></td>
                <td><button>%</button></td>
            </tr>
            <tr>
                <td><button>7</button></td>
                <td><button>8</button></td>
                <td><button>9</button></td>
                <td><button>X</button></td>
            </tr>
            <tr>
                <td><button>4</button></td>
                <td><button>5</button></td>
                <td><button>6</button></td>
                <td><button>+</button></td>
            </tr>
            <tr>
                <td><button>1</button></td>
                <td><button>2</button></td>
                <td><button>3</button></td>
                <td><button>-</button></td>
            </tr>
            <tr>
                <td><button>0</button></td>
                <td><button>.</button></td>
                <td><button>\</button></td>
                <td><button>=</button></td>
            </tr>
        </table>
    </div>
    <script src="index.js"></script>
</body>
</html>







style.css:

#header{
    displayblock;
    width50%;
    marginauto;
    colorpurple;
    text-aligncenter;
    border2px solid yellow;
    background-colorgold;
    border-radius10px;
    border2px solid black;
}

#section{
    text-aligncenter;
    margin-top30px;
    backgroundlinear-gradient(to bottom,purple,pink);
    widthfit-content;
    margin30px auto;
    padding30px;
    border-radius20px;

}


input{
    font-size30px;
    border2px solid red;
    backgroundlinear-gradient(to right,#000,#434343);
    border-radius10px;
    text-aligncenter;
    box-shadow2px red;
    colorwhite;
    outlinenone;
}

input:focus{
    width220px;
    background-coloryellowgreen;
}


table{
    margin20px auto;

}

button{
    font-size24px;
    backgroundlinear-gradient(#000,#434343);
    colorwhite;
    height52px;
    width52px;
    border2px solid gold;
    border-radius20px;
    outlinenone;
}

button:hover{
    backgroundgray;
}



Index.js:

let screen = document.getElementById('screen');

let buttons = document.querySelectorAll('button');

let screenValue = '';
let stackValue = '';

for(item of buttons){
    item.addEventListener('click',(e)=>{
        let buttonText = e.target.innerText;
        console.log(buttonText);

        if(buttonText == 'X'){
            buttonText = '*';
            screenValue = buttonText;
            stackValue += buttonText;
            screen.value +=screenValue;
        }
        else if(buttonText == '%'){
            buttonText = '/';
            screenValue = buttonText;
            stackValue += buttonText;
            screen.value += screenValue;
            
        }
        else if(buttonText == 'C'){
            screenValue = "";
            stackValue = "";
            screen.value = screenValue;
        }
        else if(buttonText == '='){
            screen.value = eval(stackValue);
        }
        else{
            screenValue = buttonText;
            stackValue += buttonText;
            screen.value += screenValue;
        }
        
    })
}







 

Thursday, July 9, 2020

Dance Website Using Pug and Node js(For Backened)

Dance Website

Pug code ( generally pug is a template engine used in place of html , because it make the scripting easier as compared to html)

base.pug;

doctype html
html
  head
    title Pratik Dance Website
    block scripts
      script(src='../static/script.js')
    block style
      style
        include ../static/style.css
  body
    nav#navbar
        #logo
            img(src="/static/2.png"alt="")
        ul
            li #[a(href='/') Home]
            li #[a(href='/') About Us ]
            li #[a(href='/') Services]
            li #[a(href='/contact') Contact Info]
    block content
    block foot


      home.pug:

extends base.pug

block scripts
  script(src='../static/script.js')
block style
  style
    include ../static/style.css 
    include ../static/response.css 

block content
    

    section#introSection
        div Welcome to My Dance Academy
        .small Eat sleep Dance Repeat
    
    section#missionSection
        h2 Our Mission
        .mission
            .card
                h3 Dance perfection
                .card-box
                    .card-img
                        img(src="/static/card1.jpg"alt="")
                        p we will train in your best way
            .card
                h3 Removing your best dancer
                .card-box
                    .card-img
                        img(src="/static/logo1.png"alt="")
                        p we will train in your best way
            .card
                h3 Versatile Dancer
                .card-box
                    .card-img
                        img(src="/static/card2.png"alt="")
                        p we will train in your best way
    
    section#sponsorSection
        h2 Our Sponsors
        #sponsors
            img(src="/static/logo.jpg"alt="")
            img(src="/static/logo2.png"alt="")
            img(src="/static/logo3.jpg"alt="")

    footer#footer
        | this is footer

contact.pug:

extends base.pug

block scripts
  script(src='../static/script.js')
block style
  style
    include ../static/contact.css
    include ../static/style.css 
block content
  h3 Contact Us
  form(action="/contact"method="post")
    input(type="text"class="myInput",name="name",placeholder="enter your name")
    input(type="number"class="myInput",name="number",placeholder="enter your number")
    input(type="number"class="myInput",name="age",placeholder="enter your age")
    textarea(name="address",class="myInput"cols="30"rows="10",placeholder="Give your description")
    button(class="btn")
      | Submit

style.css
#navbar ul{
    displayflex;
    flex-directionrow;
    justify-contentcenter;
}

#navbar li{
    list-stylenone;

}

#logo{
    displayinline-block;
    /* align-items: center; */
    height40px;
}
#navbar #logo img{
    /* display: flex; */
    /* align-items: center; */
    height40px
}

@import url('https://fonts.googleapis.com/css2?family=Baloo+Bhaina+2&display=swap');

*{
    margin0px;
    box-sizingborder-box;
    padding0px;
    font-family'Baloo Bhaina 2'cursive;
}

#navbar{
    display:flex ;
    background-colorrgb(2304646);
    padding10px;
    font-size22px;
    font-family'Baloo Bhaina 2'cursive;
    positionsticky;
    
    
}
#navbar li a{
    text-decorationnone;
    padding10px 30px;
    colorwhite;
}

#navbar li a:hover{
    colorblack;
}

#introSection{
    displayflex;
    justify-contentcenter;
    align-itemscenter;
    font-family'Baloo Bhaina 2'cursive;
    backgroundurl('/static/dance2.jpg'center center/cover no-repeat;
    height600px;
    /* background-color: red; */
    colorwhite;
    font-size35px;
    flex-directioncolumn;
    padding-bottom40px;

}

.small{
    font-size1.3rem;
}

#missionSection{
    height330px;
    displayblock;
    width100%;
    marginauto;
    /* display: flex;
    justify-content: center;
    align-items: center; */
}
#missionSection .mission{
    height300px;
    /* width: 80%; */
    displayflex;
    justify-contentcenter;
    align-itemscenter;
}

#missionSection h2{
    text-aligncenter;
    padding5px;

}

.card{
    border2px solid black;
    border-radius15px;
    width30%;
    height70%;
    margin10px;
    displayinline-block;
    background-colorlemonchiffon;

}
.card h3{
    text-aligncenter;
    /* text-align: center; */
    margin10px;

}

.card-box{
    displayflex;
    justify-contentcenter;
    align-itemscenter;
    heightinherit;
}

.card-img{
    height100px
    
}

.card-img img{
    height100px
}
#sponsorSection{
    height300px;
    background-colorwhite;
    
}

#sponsorSection h2{
    text-aligncenter;
    padding5px;
    background-colorwheat;

}

#sponsors{
    displayflex;
    align-itemscenter;
    justify-contentcenter;
    padding-top20px;
}

#sponsors img{
    margin20px;
    padding1px;
    height150px;
    border2px solid;
    border-radius10px;
}
#footer{
    height100px;
    background-colorblack;

}