Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 33 additions & 0 deletions Students/Nishan/DOM.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<style>
.fullpage {
height: 100vh; /* full viewport height */
display: flex;
justify-content: center; /* horizontal centering */
align-items: center; /* vertical centering */
}
button {
padding: 15px 30px;
font-size: 18px;
cursor: pointer;
}
</style>
</head>
<body class="fullpage">
<button>Click me</button>
</body>
<script>
const button = document.querySelector('button');
button.addEventListener('click', () => {
alert('Button clicked!');
document.body.style.backgroundColor = 'lightblue'; // Change background color on click
});


</script>
</html>
22 changes: 22 additions & 0 deletions Students/Nishan/dom2.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<body>
<button class="btn">Change Background</button>
</body>
<script>
const colors = ["red","green","blue","yellow","orange"];
const btn = document.querySelector(".btn");
btn.addEventListener("click",()=>{
const random = Math.floor(Math.random()*colors.length);//range 0- 4
console.log(random)
document.body.style.backgroundColor = colors[random];


})
</script>
</html>
11 changes: 11 additions & 0 deletions Students/Nishan/for each.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
//foreach loop is used to iterate over the array and perform a function on each element of the array
const MarbalHeros=["Iron Man","Captain America","Thor","Hulk","Black Widow","Hawkeye"];
MarbalHeros.forEach(function(hero){
console.log(hero);
})

//foreach loop is used to iterate over the array and perform a function on each element of the array
const numbers=[1,2,3,4,5];
numbers.forEach(function(number){
console.log(number*2);
})
42 changes: 42 additions & 0 deletions Students/Nishan/forin & forof.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
// forin give only name of the key
const letslearnUsersArray=[{
name:"saugat Bagale",
age:23,
isLogin:true
},{
name:"Nishant",
age:24,
isLogin:false
},
{
name:"Aakriti",
age:22,
isLogin:true
},
{
name:"subin",
age:19,
isLogin:false
},
{
name:"kamala",
age:19,
isLogin:true
},
{
name:"suman",
age:19,
isLogin:false
},

]
//forin give only name of the key
for(let key in letslearnUsersArray){
console.log(letslearnUsersArray[key].name)
}
//for of give only name
for(let key of letslearnUsersArray){
console.log(key.name)
}


35 changes: 35 additions & 0 deletions Students/Nishan/html+js.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<style>

.btn{
background-color: white;
color: black;
border: 2px solid black;
padding: 10px 20px;
font-size: 16px;
cursor: pointer;
}
</style>
</head>
<body>
<button class="btn" onclick="clicked()" onmouseover="over()" onmouseout="leave()">Click Me </button>
</body>
<script>
function clicked(){
alert("Button Clicked");
}
function over(){
document.querySelector(".btn").style.backgroundColor = "red";
}
function leave(){
document.querySelector(".btn").style.backgroundColor = "white";
}

</script>

</html>
Empty file added Students/Nishan/task 4.html
Empty file.
112 changes: 112 additions & 0 deletions Students/Nishan/task4.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
<!-- Project idea: Quote + Color Generator

Build a tiny page with one button: every click changes background color and shows a random motivational quote.

How you can do it:

Keep 2 arrays: one for colors, one for short quotes.
On button click, generate random index for both.
Update page background and the text content.
Add one small rule: don’t repeat the same color twice in a row (you already know this concept).
Why this boosts confidence:

Super short build time (15-25 min).
Uses DOM + arrays + random + condition in one clean mini-project.
Looks fun and “real”, so students feel progress fast.
If you want, I can give you 5 more “15-minute confidence projects” in the same style.

const quotes = [
"Believe in yourself and all that you are.",
"Small progress is still progress.",
"Discipline beats motivation.",
"Success is the sum of daily efforts.",
"Stay focused and never give up.",
"Your only limit is your mindset.",
"Dream big, start small, act now.",
"Consistency creates confidence."
];

const colors = [
"#FF6B6B",
"#4ECDC4",
"#45B7D1",
"#F7B267",
"#6A4C93",
"#2EC4B6",
"#FF9F1C",
"#1B9AAA"
];-->
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<style>
body {
text-align: center;
padding: 50px;
transition: background-color 0.5s ease;
}
button {
padding: 10px 20px;
font-size: 16px;
cursor: pointer;
background-color: #333;
color: #fff;
border: none;
border-radius: 5px;
}

</style>
</head>
<body>
<button onclick="changeQuoteAndColor()">Change Quote and Color</button>
<p id="quote">Click the button to see a motivational quote!</p>
<script>
const quotes = [
"Believe in yourself and all that you are.",
"Small progress is still progress.",
"Discipline beats motivation.",
"Success is the sum of daily efforts.",
"Stay focused and never give up.",
"Your only limit is your mindset.",
"Dream big, start small, act now.",
"Consistency creates confidence."
];

const colors = [
"#FF6B6B",
"#4ECDC4",
"#45B7D1",
"#F7B267",
"#6A4C93",
"#2EC4B6",
"#FF9F1C",
"#1B9AAA"
];

let lastColorIndex = -1;

function changeQuoteAndColor() {
// Generate a random index for the quote
const quoteIndex = Math.floor(Math.random() * quotes.length);

// Generate a random index for the color, ensuring it's different from the last one
let colorIndex;
do {
colorIndex = Math.floor(Math.random() * colors.length);
} while (colorIndex === lastColorIndex);

// Update the last color index
lastColorIndex = colorIndex;

// Update the quote and background color
document.getElementById("quote").textContent = quotes[quoteIndex];
document.body.style.backgroundColor = colors[colorIndex];

}

</script>
</body>
</html>
Loading