Full Stack New Programs
Full Stack New Programs
HTML:
<!DOCTYPE html>
<html>
<head>
<title>Simple Calculator</title>
</head>
<body>
<div class="calculator">
<button onclick="clearDisplay()">C</button>
<button onclick="appendToDisplay('7')">7</button>
<button onclick="appendToDisplay('8')">8</button>
<button onclick="appendToDisplay('9')">9</button>
<button onclick="appendToDisplay('/')">/</button>
<button onclick="appendToDisplay('4')">4</button>
<button onclick="appendToDisplay('5')">5</button>
<button onclick="appendToDisplay('6')">6</button>
<button onclick="appendToDisplay('*')">*</button>
<button onclick="appendToDisplay('1')">1</button>
<button onclick="appendToDisplay('2')">2</button>
<button onclick="appendToDisplay('3')">3</button>
<button onclick="appendToDisplay('-')">-</button>
<button onclick="appendToDisplay('0')">0</button>
<button onclick="appendToDisplay('.')">.</button>
<button onclick="calculate()">=</button>
<button onclick="appendToDisplay('+')">+</button>
</div>
<script src="./script.js"></script>
</body>
</html>
CSS:
body {
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
height: 100vh;
margin: 0;
.calculator {
display: grid;
grid-gap: 10px;
max-width: 300px;
input {
grid-column: span 4;
padding: 10px;
font-size: 20px;
button {
padding: 10px;
font-size: 20px;
cursor: pointer;
background-color: #f1f1f1;
button:hover {
background-color: #ddd;
JAVASCRIPT:
let display = document.getElementById('display');
function appendToDisplay(value) {
display.value += value;
function calculate() {
try {
display.value = eval(display.value);
} catch (error) {
display.value = 'Error';
function clearDisplay() {
display.value = '';
OUTPUT:
E-mail validation using HTML, CSS and JAVA SCRIPT
HTML:
<!DOCTYPE html>
<html>
<head>
<title>Email Validation</title>
</head>
<body>
<div class="container">
<button type="submit">Submit</button>
<p id="errorText"></p>
</form>
</div>
<script src="./script.js"></script>
</body>
</html>
CSS:
body {
background-color: #f7f7f7;
margin: 0;
padding: 0;
.container {
max-width: 400px;
margin: 0 auto;
padding: 20px;
h1 {
text-align: center;
input[type="email"] {
width: 100%;
padding: 10px;
margin-bottom: 10px;
button {
background-color: #4CAF50;
color: #fff;
border: none;
cursor: pointer;
p#errorText {
color: red;
text-align: center;
margin-top: 10px;
JAVASCRIPT:
function validateEmail() {
if (!emailRegex.test(email)) {
return false;
// If email is valid, clear the error message and submit the form
errorText.textContent = '';
return true;
OUTPUT:
Temperature Conversion using HTML, CSS and JAVA SCRIPT
HTML:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Temperature Converter</title>
</head>
<body>
<div class="container">
<h1>Temperature Converter</h1>
<div class="input-container">
<label for="celsius">Celsius:</label>
</div>
<div class="input-container">
<label for="fahrenheit">Fahrenheit:</label>
</div>
<button id="convertBtn">Convert</button>
</div>
<script src="temp3.js"></script>
</body>
</html>
CSS:
body {
margin: 0;
padding: 0;
background-color: #f4f4f4;
.container {
max-width: 500px;
padding: 20px;
background-color: #fff;
text-align: center;
.input-container {
margin-bottom: 10px;
label {
display: inline-block;
width: 120px;
text-align: left;
input {
width: 80%;
padding: 8px;
border-radius: 4px;
button {
background-color: #007bff;
color: #fff;
border: none;
border-radius: 4px;
cursor: pointer;
}
button:hover {
background-color: #0056b3;
.result {
margin-top: 20px;
font-weight: bold;
JAVASCRIPT:
const celsiusInput = document.getElementById('celsius');
convertBtn.addEventListener('click', () => {
fahrenheitInput.value = fahrenheit.toFixed(2);
celsiusInput.value = celsius.toFixed(2);
} else {
});
OUTPUT:
Button Loading Animation using HTML, CSS and JAVASCRIPT
HTML:
<!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="styles.css">
<title>Button Loading Animation</title>
</head>
<body>
<button id="loading-btn" class="btn">Click me</button>
<script src="script.js"></script>
</body>
</html>
CSS:
.btn {
padding: 10px 20px;
font-size: 16px;
background-color: #007bff;
color: white;
border: none;
cursor: pointer;
transition: background-color 0.3s;
}
.btn.loading {
background-color: #ccc;
cursor: not-allowed;
}
JAVASCRIPT:
const button = document.getElementById('loading-btn');
button.addEventListener('click', () => {
button.classList.add('loading');
button.innerHTML = 'Loading...';
// Simulate a task delay (e.g., fetching data)
setTimeout(() => {
button.classList.remove('loading');
button.innerHTML = 'Click me';
}, 2000); // Change this delay as needed
});
OUTPUT:
Stop Watch Monitoring using HTML, CSS and JAVASCRIPT
PROGRAM:
<!DOCTYPE html>
<html>
<head>
<style>
.stopwatch {
font-size: 2em;
margin: 20px;
text-align: center;
}
</style>
</head>
<body>
<div class="stopwatch" id="stopwatch">00:00:00</div>
<button onclick="startStopwatch()">Start</button>
<button onclick="stopStopwatch()">Stop</button>
<button onclick="resetStopwatch()">Reset</button>
<script>
let startTime;
let intervalId;
function startStopwatch() {
startTime = Date.now() - (startTime ? startTime : 0);
intervalId = setInterval(updateStopwatch, 1000);
}
function stopStopwatch() {
clearInterval(intervalId);
}
function resetStopwatch() {
clearInterval(intervalId);
startTime = null;
document.getElementById('stopwatch').textContent = '00:00:00';
}
function updateStopwatch() {
const elapsedTime = Date.now() - startTime;
const hours = Math.floor(elapsedTime / 3600000);
const minutes = Math.floor((elapsedTime % 3600000) / 60000);
const seconds = Math.floor((elapsedTime % 60000) / 1000);
const hoursStr = hours.toString().padStart(2, '0');
const minutesStr = minutes.toString().padStart(2, '0');
const secondsStr = seconds.toString().padStart(2, '0');
document.getElementById('stopwatch').textContent = `${hoursStr}:${minutesStr}:$
{secondsStr}`;
}
</script>
</body>
</html>
OUTPUT:
START
STOP
<html lang="en">
<head>
<meta charset="UTF-8">
</head>
<body>
<div class="container">
<div id="strength-indicator"></div>
</div>
<script src="script.js"></script>
</body>
</html>
CSS:
body {
background-color: #f4f4f4;
margin: 0;
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
.container {
text-align: center;
background-color: #fff;
border-radius: 10px;
padding: 20px;
input[type="password"] {
width: 100%;
padding: 10px;
margin: 10px 0;
border-radius: 5px;
font-size: 16px;
#strength-indicator {
margin-top: 10px;
JAVASCRIPT:
const passwordInput = document.getElementById('password');
passwordInput.addEventListener('input', updatePasswordStrength);
function updatePasswordStrength() {
strengthIndicator.textContent = strengthText;
strengthIndicator.style.color = getColorForStrength(strength);
function calculatePasswordStrength(password) {
// You can implement your own password strength calculation logic here
// For simplicity, let's just count the characters for this example
const minLength = 6;
return 2;
function getStrengthText(strength) {
return strengthTexts[strength];
function getColorForStrength(strength) {
return colors[strength];
OUTPUT:
To-do list using HTML, CSS and JAVASCRIPT
HTML:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>To-Do List</title>
</head>
<body>
<div class="todo-container">
<h1>To-Do List</h1>
<ul id="taskList"></ul>
</div>
<script src="script.js"></script>
</body>
</html>
CSS:
body {
margin: 0;
padding: 0;
background-color: #f4f4f4;
.todo-container {
max-width: 400px;
background-color: #fff;
padding: 20px;
border-radius: 5px;
box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
h1 {
text-align: center;
input[type="text"] {
width: 100%;
padding: 10px;
margin-bottom: 10px;
border-radius: 3px;
button {
display: block;
width: 100%;
padding: 10px;
background-color: #007bff;
color: #fff;
border: none;
border-radius: 3px;
cursor: pointer;
button:hover {
background-color: #0056b3;
ul {
list-style-type: none;
padding: 0;
}
li {
display: flex;
justify-content: space-between;
align-items: center;
background-color: #f9f9f9;
padding: 10px;
margin-bottom: 5px;
border-radius: 3px;
.delete-button {
background-color: #ff4136;
color: #fff;
border: none;
border-radius: 3px;
cursor: pointer;
JAVASCRIPT:
const addTaskButton = document.getElementById('addTask');
addTaskButton.addEventListener('click', addTask);
function addTask() {
listItem.innerHTML = `
<span>${taskText}</span>
<button class="delete-button">Delete</button>
taskList.appendChild(listItem);
taskInput.value = '';
deleteButton.addEventListener('click', () => {
taskList.removeChild(listItem);
});
OUTPUT:
Palindrome Checker using HTML,CSS and JAVASCRIPT
HTML:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Palindrome Checker</title>
</head>
<body>
<div class="container">
<h1>Palindrome Checker</h1>
<button onclick="checkPalindrome()">Check</button>
<p id="result"></p>
</div>
<script src="palidrome.js"></script>
</body>
</html>
CSS:
body {
background-color: #f4f4f4;
margin: 0;
padding: 0;
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
.container {
background-color: #ffffff;
padding: 20px;
border-radius: 5px;
h1 {
font-size: 24px;
margin-bottom: 10px;
}
input {
padding: 10px;
width: 100%;
border-radius: 5px;
margin-bottom: 10px;
button {
background-color: #007bff;
color: #ffffff;
border: none;
border-radius: 5px;
cursor: pointer;
button:hover {
background-color: #0056b3;
JAVASCRIPT:
function checkPalindrome() {
} else {
}
OUTPUT:
HTML:
<!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="drop.css">
<title>Item Selector</title>
</head>
<body>
<div class="dropdown">
<button class="dropdown-btn">Select an Item</button>
<ul class="dropdown-list">
<li>Item 1</li>
<li>Item 2</li>
<li>Item 3</li>
<li>Item 4</li>
</ul>
</div>
<script src="drop.js"></script>
</body>
</html>
CSS:
body {
font-family: Arial, sans-serif;
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
margin: 0;
}
.dropdown {
position: relative;
display: inline-block;
}
.dropdown-btn {
padding: 10px 20px;
background-color: #3498db;
color: #fff;
border: none;
cursor: pointer;
}
.dropdown-list {
display: none;
position: absolute;
list-style: none;
margin: 0;
padding: 0;
background-color: #f1f1f1;
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}
.dropdown-list li {
padding: 10px;
border-bottom: 1px solid #ccc;
cursor: pointer;
}
.dropdown-list li:last-child {
border-bottom: none;
}
JAVASCRIPT:
document.addEventListener('DOMContentLoaded', function() {
const dropdownBtn = document.querySelector('.dropdown-btn');
const dropdownList = document.querySelector('.dropdown-list');
dropdownBtn.addEventListener('click', function() {
dropdownList.style.display = dropdownList.style.display === 'block' ? 'none' : 'block';
});
dropdownList.addEventListener('click', function(event) {
if (event.target.tagName === 'LI') {
dropdownBtn.textContent = event.target.textContent;
dropdownList.style.display = 'none';
}
});
document.addEventListener('click', function(event) {
if (!dropdownBtn.contains(event.target)) {
dropdownList.style.display = 'none';
}
});
});
OUTPUT:
Traffic signal creation using HTML,CSS and JAVASCRIPT
HTML:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Traffic Signal Simulation</title>
<link rel="stylesheet" href="traffic.css">
</head>
<body>
<div class="traffic-signal">
<div class="light red"></div>
<div class="light yellow"></div>
<div class="light green"></div>
</div>
<script src="traffic.js"></script>
</body>
</html>
CSS:
body {
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
margin: 0;
background-color: #f0f0f0;
}
.traffic-signal {
display: flex;
flex-direction: column;
align-items: center;
background-color: #333;
padding: 10px;
border-radius: 8px;
}
.light {
width: 80px;
height: 80px;
border-radius: 50%;
margin: 5px;
transition: background-color 0.3s;
}
.red {
background-color: red;
}
.yellow {
background-color: yellow;
}
.green {
background-color: green;
}
JAVASCRIPT:
const redLight = document.querySelector('.red');
const yellowLight = document.querySelector('.yellow');
const greenLight = document.querySelector('.green');
function switchLights() {
setTimeout(() => {
redLight.style.backgroundColor = 'red';
yellowLight.style.backgroundColor = 'gray';
greenLight.style.backgroundColor = 'gray';
setTimeout(() => {
redLight.style.backgroundColor = 'gray';
yellowLight.style.backgroundColor = 'yellow';
greenLight.style.backgroundColor = 'gray';
setTimeout(() => {
redLight.style.backgroundColor = 'gray';
yellowLight.style.backgroundColor = 'gray';
greenLight.style.backgroundColor = 'green';
switchLights(); // Repeat the cycle
}, 2000);
}, 1000);
}, 2000);
}
switchLights();
OUTPUT:
Random Quotes Generator using HTML,CSS and JS
HTML:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
</head>
<body>
<div class="container">
<div class="quote">
</div>
</div>
<script src="script.js"></script>
</body>
</html>
CSS:
body {
background-color: #f4f4f4;
margin: 0;
display: flex;
justify-content: center;
align-items: center;
min-height: 100vh;
.container {
text-align: center;
background-color: #fff;
padding: 20px;
border-radius: 5px;
h1 {
color: #333;
.quote {
margin: 20px 0;
#generateBtn {
font-size: 16px;
background-color: #007bff;
border: none;
color: #fff;
border-radius: 5px;
cursor: pointer;
JAVASCRIPT:
const quotes = [
"The only way to do great work is to love what you do. - Steve Jobs",
"Success is not final, failure is not fatal: It is the courage to continue that counts. -
Winston Churchill",
"The future belongs to those who believe in the beauty of their dreams. - Eleanor
Roosevelt",
"Life is what happens when you're busy making other plans. - John Lennon"
];
function generateRandomQuote() {
quoteText.textContent = quotes[randomIndex];
generateBtn.addEventListener("click", generateRandomQuote);
OUTPUT:
Captcha Generation and Validation using HTML,CSS and JS
HTML:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>CAPTCHA Example</title>
</head>
<body>
<div class="captcha-container">
<div class="captcha-box">
<span id="captcha-operation"></span>
<button id="captcha-submit">Submit</button>
</div>
<p id="captcha-feedback"></p>
</div>
<script src="script.js"></script>
</body>
</html>
CSS:
body {
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
margin: 0;
.captcha-container {
text-align: center;
.captcha-box {
margin-top: 10px;
#captcha-feedback {
margin-top: 10px;
JAVASCRIPT:
document.addEventListener("DOMContentLoaded", function () {
generateCaptcha();
captchaSubmit.addEventListener("click", function () {
captchaFeedback.style.color = "green";
} else {
captchaFeedback.style.color = "red";
generateCaptcha();
});
});
function generateCaptcha() {
document.getElementById("captcha-operation").textContent = captchaOperation;
document.getElementById("captcha-input").value = "";
document.getElementById("captcha-feedback").textContent = "";
OUTPUT:
Api Methods using nodejs and expressjs
const express =
require("express") const app =
express()
const port = 5000
app.use(express.json())
app.get("/data", (req, res)=>{
res.json({message : "Get Method"})
})
<style>
.main{
width: 100vw;
height: 100vh;
display: flex;
flex-direction: column;
align-items: center;
justify-content:
center;
font-family: 'Poppins', sans-serif;
font-family: 'Quicksand', sans-
serif;
}
.logcomp{ padd
ing: 30px;
border-radius: 6px;
width: 250px;
height: 300px;
gap: 20px;
background: linear-gradient(to bottom right, #ff2ab7, #7522a1);
/* background-color: grey;
*/ color: white;
}
.form{ displa
y: flex;
flex-direction: column;
gap: 10px;
}
input{
padding: 10px;
border-radius:
2px; border: none;
}
.btn{
width: 70px;
padding: 10px;
border-radius:
6px; border: none;
margin-top: 25px;
margin-left: 80px;
}
.login{
color: orange;
}
.in{
color: yellow;
}
.Angular{ c
olor: red;
}
</style>
const app =
express() const port
= 5000
app.use(express.json())
app.get("/data", async(req,
res)=>{
const data = await
use.find()
res.status(200).json(data)
})
con()
if(con){
app.listen( port, (req, res)=>{
console.log("server started !...");
})
}
Output :