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
Empty file.
69 changes: 69 additions & 0 deletions css/advanced/Assignment-1/style.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@

* {
margin: 0;
padding: 0;
box-sizing: border-box;
}

body {
font-family: Arial, sans-serif;
line-height: 1.6;
}

header {
background: #0d0a99;
color: #fff;
padding: 20px;
text-align: center;
}

nav ul {
list-style: none;
display: flex;
justify-content: center;
gap: 20px;
margin-top: 10px;
}

nav a {
color: #fff;
text-decoration: none;
}

main {
display: flex;
padding: 20px;
gap: 20px;
}

article {
flex: 3;
background: #2c13a8;
color: #fff;
padding: 20px;
border-radius: 8px;
}

aside {
flex: 1;
background: #4d119b;
color: #fff;
padding: 20px;
border-radius: 8px;
}

footer {
background: #3f12ba;
color: #fff;
text-align: center;
padding: 15px;
margin-top: 20px;
bottom: auto;
}

@media (max-width: 768px) {
main {
flex-direction: column;
flex:1;
}
}
60 changes: 60 additions & 0 deletions css/advanced/Assignment-2/animations.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>CSS Animation & Media Queries</title>
<style>
body {
font-family: Arial, sans-serif;
margin: 0;
padding: 0;
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
background: #f0f0f0;
}
.box {
width: 150px;
height: 150px;
background: #3498db;
border-radius: 10px;
display: flex;
justify-content: center;
align-items: center;
color: white;
font-weight: bold;
animation: bounce 2s infinite;
}
@keyframes bounce {
0%, 100% {
transform: translateY(0);
}
50% {
transform: translateY(-50px);
}
}
@media (max-width: 768px) {
.box {
width: 120px;
height: 120px;
font-size: 14px;
background: #e67e22;
}
}

@media (max-width: 480px) {
.box {
width: 90px;
height: 90px;
font-size: 12px;
background: #2ecc71;
}
}
</style>
Comment on lines +7 to +55
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The CSS for this page is embedded within a <style> tag in the HTML file. According to the best practices outlined in the PR description, it's better to move CSS to external files. This improves code organization, reusability, and maintainability by separating concerns.

</head>
<body>
<div class="box">Hello Guys..!</div>
</body>
</html>
23 changes: 23 additions & 0 deletions javascript/9-window-storage/Assignment-1/browserinfo.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Browser Information - Navigation</title>
<link rel="stylesheet" href="style.css">
</head>
<body>
<h2>🌐 Browser Navigation Example</h2>

<input type="text" id="urlInput" placeholder="Enter URL (e.g., https://google.com)" />
<br>
<button id="goBtn">Go</button>
<button id="backBtn">Go Back</button>
<button id="forwardBtn">Go Forward</button>
<button id="reloadBtn">Reload</button>

<p id="info"></p>

<script src="script.js"></script>
</body>
</html>
24 changes: 24 additions & 0 deletions javascript/9-window-storage/Assignment-1/script.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@

document.getElementById("info").innerText = "Current URL: " + window.location.href;

document.getElementById("goBtn").addEventListener("click", () => {
const url = document.getElementById("urlInput").value.trim();
if (url) {

window.location.assign(url);
} else {
alert("Please enter a valid URL!");
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Using alert() for user input validation provides a poor user experience because it's a blocking dialog. A better approach is to display the error message directly in the UI, for example, by updating the content of the <p id="info"></p> element.

Suggested change
alert("Please enter a valid URL!");
document.getElementById("info").innerText = "Please enter a valid URL!";

}
});

document.getElementById("backBtn").addEventListener("click", () => {
window.history.back();
});

document.getElementById("forwardBtn").addEventListener("click", () => {
window.history.forward();
});

document.getElementById("reloadBtn").addEventListener("click", () => {
window.location.reload();
});
39 changes: 39 additions & 0 deletions javascript/9-window-storage/Assignment-1/style.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
body {
font-family: Arial, sans-serif;
text-align: center;
margin-top: 50px;
background-color: #f9f9f9;
}

h2 {
color: #333;
}

input {
padding: 10px;
width: 320px;
border: 1px solid #ccc;
border-radius: 5px;
}

button {
padding: 8px 15px;
margin: 5px;
cursor: pointer;
border: none;
border-radius: 5px;
background-color: #0078d7;
color: white;
font-size: 15px;
transition: background-color 0.2s;
}

button:hover {
background-color: #005ea6;
}

#info {
margin-top: 20px;
font-weight: bold;
color: #555;
}
20 changes: 20 additions & 0 deletions javascript/9-window-storage/Assignment-2/script.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@

function updateDimensions() {
document.getElementById("innerWidth").textContent = window.innerWidth;
document.getElementById("innerHeight").textContent = window.innerHeight;
document.getElementById("outerWidth").textContent = window.outerWidth;
document.getElementById("outerHeight").textContent = window.outerHeight;

document.getElementById("screenWidth").textContent = screen.width;
document.getElementById("screenHeight").textContent = screen.height;
document.getElementById("availWidth").textContent = screen.availWidth;
document.getElementById("availHeight").textContent = screen.availHeight;
document.getElementById("colorDepth").textContent = screen.colorDepth;
}

updateDimensions();

window.addEventListener("resize", () => {
updateDimensions();
console.log("Window resized:", window.innerWidth, "x", window.innerHeight);
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

This console.log statement appears to be for debugging. It's a good practice to remove such statements from the final code to keep the browser console clean for production environments, as mentioned in the PR's best practices checklist.

});
29 changes: 29 additions & 0 deletions javascript/9-window-storage/Assignment-2/style.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
body {
font-family: Arial, sans-serif;
background-color: #f5f7fa;
color: #333;
text-align: center;
margin-top: 50px;
}

h2 {
color: #2c3e50;
}

#infoBox {
display: inline-block;
text-align: left;
background-color: #fff;
padding: 20px 30px;
border-radius: 10px;
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

p {
margin: 8px 0;
font-size: 16px;
}

strong {
color: #0078d7;
}
26 changes: 26 additions & 0 deletions javascript/9-window-storage/Assignment-2/window_dimentions.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Window Dimensions</title>
<link rel="stylesheet" href="style.css">
</head>
<body>
<h2>🖥️ Window & Screen Dimensions</h2>

<div id="infoBox">
<p><strong>Inner Width:</strong> <span id="innerWidth"></span> px</p>
<p><strong>Inner Height:</strong> <span id="innerHeight"></span> px</p>
<p><strong>Outer Width:</strong> <span id="outerWidth"></span> px</p>
<p><strong>Outer Height:</strong> <span id="outerHeight"></span> px</p>
<p><strong>Screen Width:</strong> <span id="screenWidth"></span> px</p>
<p><strong>Screen Height:</strong> <span id="screenHeight"></span> px</p>
<p><strong>Available Screen Width:</strong> <span id="availWidth"></span> px</p>
<p><strong>Available Screen Height:</strong> <span id="availHeight"></span> px</p>
<p><strong>Color Depth:</strong> <span id="colorDepth"></span></p>
</div>

<script src="script.js"></script>
</body>
</html>
13 changes: 13 additions & 0 deletions javascript/9-window-storage/Assignment-3/script.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
function scrollToPosition() {
const x = parseInt(document.getElementById("xInput").value) || 0;
const y = parseInt(document.getElementById("yInput").value) || 0;
window.scrollTo(x, y);
}

function scrollUp() {
window.scrollBy(0, -10);
}

function scrollDown() {
window.scrollBy(0, 10);
}
35 changes: 35 additions & 0 deletions javascript/9-window-storage/Assignment-3/scroll.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>Scroll Example</title>
<link rel="stylesheet" href="style.css">
</head>
<body>
<h2>Scroll to Position</h2>

<div class="controls">
<label for="xInput">X:</label>
<input type="number" id="xInput" placeholder="Enter X value">

<label for="yInput">Y:</label>
<input type="number" id="yInput" placeholder="Enter Y value">

<button onclick="scrollToPosition()">Scroll to (X, Y)</button>
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Using inline onclick attributes mixes HTML structure with JavaScript logic, which goes against modern web development best practices and the guidelines in your PR description. It's better to attach event listeners in your JavaScript file using addEventListener. This improves separation of concerns and makes the code easier to maintain.

</div>

<div class="scroll-buttons">
<button onclick="scrollUp()">Scroll Up 10px</button>
<button onclick="scrollDown()">Scroll Down 10px</button>
</div>

<div class="content">
<p>Scroll this page to test the scrolling feature!</p>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit...</p>
<p style="margin-top:2000px;">You’ve reached the bottom!</p>
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Inline styles should be avoided in favor of external stylesheets to maintain a clean separation of content (HTML) and presentation (CSS). Please move this style to a class in your style.css file.

</div>

<script src="script.js"></script>
</body>
</html>
34 changes: 34 additions & 0 deletions javascript/9-window-storage/Assignment-3/style.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
body {
font-family: Arial, sans-serif;
padding: 20px;
line-height: 1.6;
}

.controls, .scroll-buttons {
margin-bottom: 20px;
}

input {
width: 80px;
margin: 0 10px;
padding: 5px;
}

button {
margin: 5px;
padding: 8px 12px;
cursor: pointer;
border: none;
background-color: #0078d7;
color: white;
border-radius: 5px;
transition: background-color 0.3s;
}

button:hover {
background-color: #005fa3;
}

.content {
height: 2500px; /* So that scrolling works */
}
Loading