Monday, July 20, 2026

Professional Trigonometric Calculator 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>Trigonometric Calculator</title>


<style>

*{

    margin:0;

    padding:0;

    box-sizing:border-box;

    font-family:Arial,Helvetica,sans-serif;

}


body{

    background:#0f172a;

    display:flex;

    justify-content:center;

    align-items:center;

    height:100vh;

}


.container{

    width:400px;

    background:#fff;

    border-radius:15px;

    padding:25px;

    box-shadow:0 10px 30px rgba(0,0,0,.3);

}


h2{

    text-align:center;

    margin-bottom:20px;

    color:#1e293b;

}


label{

    font-weight:bold;

    display:block;

    margin-top:15px;

}


input,select{

    width:100%;

    padding:12px;

    margin-top:8px;

    border:1px solid #ccc;

    border-radius:8px;

    font-size:16px;

}


button{

    width:100%;

    padding:12px;

    margin-top:18px;

    border:none;

    border-radius:8px;

    font-size:17px;

    cursor:pointer;

    color:#fff;

}


.calculate{

    background:#2563eb;

}


.calculate:hover{

    background:#1d4ed8;

}


.clear{

    background:#dc2626;

}


.clear:hover{

    background:#b91c1c;

}


.result{

    margin-top:20px;

    padding:15px;

    background:#f1f5f9;

    border-radius:10px;

    text-align:center;

    font-size:20px;

    font-weight:bold;

    color:#0f172a;

}

</style>


</head>

<body>


<div class="container">


<h2>Trigonometric Calculator</h2>


<label>Angle</label>

<input type="number" id="angle" placeholder="Enter Angle">


<label>Select Function</label>

<select id="function">

<option value="sin">Sin</option>

<option value="cos">Cos</option>

<option value="tan">Tan</option>

<option value="cot">Cot</option>

<option value="sec">Sec</option>

<option value="cosec">Cosec</option>

</select>


<label>Mode</label>

<select id="mode">

<option value="deg">Degree</option>

<option value="rad">Radian</option>

</select>


<button class="calculate" onclick="calculateTrig()">Calculate</button>


<button class="clear" onclick="clearAll()">Clear</button>


<div class="result" id="result">

Result : 0

</div>


</div>


<script>


function calculateTrig(){


let angle=parseFloat(document.getElementById("angle").value);


if(isNaN(angle))

{

    alert("Please enter an angle.");

    return;

}


let mode=document.getElementById("mode").value;

let func=document.getElementById("function").value;


if(mode=="deg")

{

    angle=angle*Math.PI/180;

}


let ans;


switch(func)

{

    case "sin":

        ans=Math.sin(angle);

        break;


    case "cos":

        ans=Math.cos(angle);

        break;


    case "tan":

        ans=Math.tan(angle);

        break;


    case "cot":

        ans=1/Math.tan(angle);

        break;


    case "sec":

        ans=1/Math.cos(angle);

        break;


    case "cosec":

        ans=1/Math.sin(angle);

        break;

}


document.getElementById("result").innerHTML="Result : "+ans.toFixed(10);


}


function clearAll(){


document.getElementById("angle").value="";

document.getElementById("result").innerHTML="Result : 0";


}


</script>


</body>

</html> 



Saturday, July 18, 2026

Make music player using HTML CSS and JAVASCRIPT


 

Index.html

<!DOCTYPE html>

<html lang="en">

<head>

<meta charset="UTF-8">

<meta name="viewport" content="width=device-width, initial-scale=1.0">

<title>Music Player</title>


<link rel="stylesheet" href="style.css">


<link rel="stylesheet"

href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.2/css/all.min.css">


</head>

<body>


<div class="player">


    <img src="cover.jpg" class="cover">


    <h2 id="title">Music Title</h2>

    <p id="artist">Artist Name</p>


    <audio id="audio">

        <source src="music.mp3" type="audio/mpeg">

    </audio>


    <input type="range"

    id="progress"

    value="0"

    min="0"

    max="100">


    <div class="time">

        <span id="current">0:00</span>

        <span id="duration">0:00</span>

    </div>


    <div class="controls">


        <button id="back">

            <i class="fas fa-backward"></i>

        </button>


        <button id="play">

            <i class="fas fa-play"></i>

        </button>


        <button id="next">

            <i class="fas fa-forward"></i>

        </button>


    </div>


    <div class="volume">


        <i class="fas fa-volume-up"></i>


        <input type="range"

        id="volume"

        min="0"

        max="1"

        step="0.1"

        value="1">


    </div>


</div>


<script src="script.js"></script>


</body>

</html>

Style.css File

<style>
*{
margin:0;
padding:0;
box-sizing:border-box;
font-family:Arial;
}

body{

background:#1d1d1d;
display:flex;
justify-content:center;
align-items:center;
height:100vh;

}

.player{

width:350px;
background:#2f2f2f;
padding:25px;
border-radius:20px;
text-align:center;
color:#fff;
box-shadow:0 10px 30px rgba(0,0,0,.5);

}

.cover{

width:250px;
height:250px;
border-radius:15px;
object-fit:cover;
margin-bottom:20px;

}

h2{
margin-bottom:5px;
}

p{
color:#ccc;
margin-bottom:20px;
}

#progress{

width:100%;
cursor:pointer;

}

.time{

display:flex;
justify-content:space-between;
margin:10px 0;

}

.controls{

display:flex;
justify-content:center;
gap:20px;
margin:20px 0;

}

.controls button{

width:60px;
height:60px;
border:none;
border-radius:50%;
background:#ff3d57;
color:#fff;
font-size:22px;
cursor:pointer;
transition:.3s;

}

.controls button:hover{

transform:scale(1.1);

}

.volume{

display:flex;
align-items:center;
gap:10px;

}

.volume input{

width:100%;

}
</style>

Javascript File

<script>
const audio=document.getElementById("audio");

const play=document.getElementById("play");

const progress=document.getElementById("progress");

const current=document.getElementById("current");

const duration=document.getElementById("duration");

const volume=document.getElementById("volume");

let playing=false;

// Play Pause

play.onclick=function(){

if(playing){

audio.pause();

play.innerHTML='<i class="fas fa-play"></i>';

playing=false;

}
else{

audio.play();

play.innerHTML='<i class="fas fa-pause"></i>';

playing=true;

}

}

// Duration

audio.onloadedmetadata=function(){

progress.max=Math.floor(audio.duration);

duration.innerHTML=format(audio.duration);

}

// Update Progress

audio.ontimeupdate=function(){

progress.value=Math.floor(audio.currentTime);

current.innerHTML=format(audio.currentTime);

}

// Change Position

progress.oninput=function(){

audio.currentTime=progress.value;

}

// Volume

volume.oninput=function(){

audio.volume=volume.value;

}

// Song Finished

audio.onended=function(){

play.innerHTML='<i class="fas fa-play"></i>';

playing=false;

}

// Format Time

function format(time){

let min=Math.floor(time/60);

let sec=Math.floor(time%60);

if(sec<10) sec="0"+sec;

return min+":"+sec;

}
</script>

Thursday, July 16, 2026

Gap in CSS Grid


The gap property in CSS is used to create space between items inside Flexbox, Grid, and Multi-column layouts. It is cleaner than using margins because it only adds spacing between elements, not around the outside.


HTML Code 

<div class="grid-container">

    <div>1</div>

    <div>2</div>

    <div>3</div>

    <div>4</div>

</div>


CSS Code

<style>

.grid-container {

    display: grid;

    grid-template-columns: repeat(2, 150px);

    gap: 20px;

}


.grid-container div {

    background: #4CAF50;

    color: white;

    padding: 20px;

    text-align: center;

}

</style>





Tuesday, July 14, 2026

# 🚀 Coding Classes in Puranpur Have Started! 💻



🌟 **Build Your Future with WDS (Website Development Services)** Admissions are now open for our **Offline Coding Classes in Puranpur**! 📚 **Courses Available:** ✅ Full Stack Web Development ✅ HTML, CSS & JavaScript ✅ PHP & MySQL ✅ Python Programming ✅ Software Development ✅ Website Development ✅ Live Projects & Practical Training ✅ Internship Guidance 👨‍💻 Learn from industry professionals with hands-on projects and real-world experience. 🎯 ** Enroll Today!** **WDS – Website Development Services** *Learn • Build • Grow Your Career* 🚀 Call us - +91-7080234447

Professional Trigonometric Calculator using HTML, CSS, and JavaScript.

<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport...