-
Notifications
You must be signed in to change notification settings - Fork 32
Durga controlstructure js #535
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
Saidurgasatturi
wants to merge
5
commits into
aptyInc:main
Choose a base branch
from
Saidurgasatturi:durga-controlstructure-js
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
aa636fa
durga-html-advancedtags
Saidurgasatturi f9c65b2
durga-controlstructure-js
Saidurgasatturi 227382d
durga-controlstructure-js
Saidurgasatturi ff1a7b0
durga-controlstructure-js
Saidurgasatturi 0231f49
durga-controlstructure-js
Saidurgasatturi File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Empty file.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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; | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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> | ||
| </head> | ||
| <body> | ||
| <div class="box">Hello Guys..!</div> | ||
| </body> | ||
| </html> | ||
28 changes: 28 additions & 0 deletions
28
javascript/4-control-structures-loops/Assignment-1/conditions.html
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,28 @@ | ||
| <!DOCTYPE html> | ||
| <html lang="en"> | ||
| <head> | ||
| <meta charset="UTF-8"> | ||
| <meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
| <title>Grading System Assignment</title> | ||
| <link rel="stylesheet" href="style.css"> | ||
| </head> | ||
| <body> | ||
|
|
||
| <div class="container"> | ||
| <h2>Grading System</h2> | ||
|
|
||
| <div class="row"> | ||
| <label for="marks">Enter Marks:</label> | ||
| <input type="number" id="marks" placeholder="Enter your marks"> | ||
| </div> | ||
|
|
||
| <div class="row"> | ||
| <button onclick="calculateGrade()">Get Grade</button> | ||
| </div> | ||
|
|
||
| <div id="result">Result will appear here...</div> | ||
| </div> | ||
|
|
||
| <script src="script.js"></script> | ||
| </body> | ||
| </html> |
20 changes: 20 additions & 0 deletions
20
javascript/4-control-structures-loops/Assignment-1/script.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,20 @@ | ||||||||||||||||||||||||||||||||||||||||||||||
| function calculateGrade() { | ||||||||||||||||||||||||||||||||||||||||||||||
| let marks = Number(document.getElementById("marks").value); | ||||||||||||||||||||||||||||||||||||||||||||||
| let grade = ""; | ||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||
| if (marks >= 90) { | ||||||||||||||||||||||||||||||||||||||||||||||
| grade = "A"; | ||||||||||||||||||||||||||||||||||||||||||||||
| } else if (marks >= 75 && marks <= 89) { | ||||||||||||||||||||||||||||||||||||||||||||||
| grade = "B"; | ||||||||||||||||||||||||||||||||||||||||||||||
| } else if (marks >= 50 && marks <= 74) { | ||||||||||||||||||||||||||||||||||||||||||||||
| grade = "C"; | ||||||||||||||||||||||||||||||||||||||||||||||
| } else if (marks < 50) { | ||||||||||||||||||||||||||||||||||||||||||||||
| grade = "F"; | ||||||||||||||||||||||||||||||||||||||||||||||
| } else { | ||||||||||||||||||||||||||||||||||||||||||||||
| grade = "Invalid Input"; | ||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+6
to
+16
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The grading logic has a few issues:
These issues can lead to incorrect grades for certain inputs.
Suggested change
|
||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||
| document.getElementById("result").innerHTML = `Grade: <strong>${grade}</strong>`; | ||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||
63 changes: 63 additions & 0 deletions
63
javascript/4-control-structures-loops/Assignment-1/style.css
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,63 @@ | ||
| body { | ||
| font-family: "Segoe UI", Arial, sans-serif; | ||
| background: #f8f9fa; | ||
| display: flex; | ||
| justify-content: center; | ||
| align-items: center; | ||
| height: 100vh; | ||
| } | ||
|
|
||
| .container { | ||
| background: #fff; | ||
| padding: 25px 30px; | ||
| border-radius: 15px; | ||
| box-shadow: 0 0 10px rgba(0,0,0,0.2); | ||
| width: 350px; | ||
| text-align: center; | ||
| } | ||
|
|
||
| h2 { | ||
| color: #ff5722; | ||
| margin-bottom: 20px; | ||
| } | ||
|
|
||
| .row { | ||
| margin-bottom: 15px; | ||
| } | ||
|
|
||
| label { | ||
| display: block; | ||
| margin-bottom: 8px; | ||
| font-weight: bold; | ||
| } | ||
|
|
||
| input { | ||
| padding: 8px; | ||
| width: 80%; | ||
| border: 1px solid #ccc; | ||
| border-radius: 5px; | ||
| } | ||
|
|
||
| button { | ||
| background: linear-gradient(90deg, #ff5722, #ff007f); | ||
| border: none; | ||
| color: white; | ||
| padding: 10px 15px; | ||
| border-radius: 8px; | ||
| font-weight: bold; | ||
| cursor: pointer; | ||
| width: 60%; | ||
| } | ||
|
|
||
| button:hover { | ||
| opacity: 0.85; | ||
| } | ||
|
|
||
| #result { | ||
| margin-top: 20px; | ||
| background: #f0f0f0; | ||
| padding: 10px; | ||
| border-radius: 8px; | ||
| font-weight: bold; | ||
| color: #333; | ||
| } |
30 changes: 30 additions & 0 deletions
30
javascript/4-control-structures-loops/Assignment-10/arraysum.html
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,30 @@ | ||
| <!DOCTYPE html> | ||
| <html lang="en"> | ||
| <head> | ||
| <meta charset="UTF-8" /> | ||
| <meta name="viewport" content="width=device-width, initial-scale=1.0" /> | ||
| <title>Array Sum and Average</title> | ||
| <link rel="stylesheet" href="style.css" /> | ||
| </head> | ||
| <body> | ||
|
|
||
| <div class="container"> | ||
| <h2>Array Sum & Average Calculator</h2> | ||
|
|
||
| <div class="row"> | ||
| <label for="numbers">Enter numbers (comma-separated):</label> | ||
| <input type="text" id="numbers" placeholder="e.g. 10, 20, 30, 40"> | ||
| </div> | ||
|
|
||
| <div class="row"> | ||
| <button onclick="calculateArray()">Calculate</button> | ||
| </div> | ||
|
|
||
| <div id="result"> | ||
| Results will appear here... | ||
| </div> | ||
| </div> | ||
|
|
||
| <script src="script.js"></script> | ||
| </body> | ||
| </html> |
30 changes: 30 additions & 0 deletions
30
javascript/4-control-structures-loops/Assignment-10/script.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,30 @@ | ||
| function calculateArray() { | ||
| const input = document.getElementById("numbers").value.trim(); | ||
| const result = document.getElementById("result"); | ||
|
|
||
| if (input === "") { | ||
| result.innerHTML = "⚠️ Please enter some numbers separated by commas!"; | ||
| return; | ||
| } | ||
|
|
||
| const numArray = input.split(",").map(item => Number(item.trim())); | ||
|
|
||
| if (numArray.some(isNaN)) { | ||
| result.innerHTML = "⚠️ Please enter only valid numbers separated by commas!"; | ||
| return; | ||
| } | ||
|
|
||
| let sum = 0; | ||
|
|
||
| for (let num of numArray) { | ||
| sum += num; | ||
| } | ||
|
|
||
| const average = sum / numArray.length; | ||
|
|
||
| result.innerHTML = ` | ||
| ✅ Entered Numbers: [${numArray.join(", ")}] <br> | ||
| ➕ Sum: <strong>${sum}</strong><br> | ||
| ➗ Average: <strong>${average.toFixed(2)}</strong> | ||
| `; | ||
| } |
65 changes: 65 additions & 0 deletions
65
javascript/4-control-structures-loops/Assignment-10/style.css
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,65 @@ | ||
| body { | ||
| font-family: "Poppins", sans-serif; | ||
| background: #f7f9fb; | ||
| display: flex; | ||
| justify-content: center; | ||
| align-items: center; | ||
| height: 100vh; | ||
| } | ||
|
|
||
| .container { | ||
| background: #fff; | ||
| padding: 30px; | ||
| border-radius: 15px; | ||
| box-shadow: 0 0 10px rgba(0,0,0,0.2); | ||
| width: 400px; | ||
| text-align: center; | ||
| } | ||
|
|
||
| h2 { | ||
| color: #ff5722; | ||
| margin-bottom: 20px; | ||
| } | ||
|
|
||
| .row { | ||
| margin-bottom: 15px; | ||
| } | ||
|
|
||
| label { | ||
| display: block; | ||
| margin-bottom: 8px; | ||
| font-weight: bold; | ||
| } | ||
|
|
||
| input { | ||
| padding: 8px; | ||
| width: 80%; | ||
| border: 1px solid #ccc; | ||
| border-radius: 5px; | ||
| } | ||
|
|
||
| button { | ||
| background: linear-gradient(90deg, #ff5722, #ff007f); | ||
| border: none; | ||
| color: white; | ||
| padding: 10px 15px; | ||
| border-radius: 8px; | ||
| font-weight: bold; | ||
| cursor: pointer; | ||
| width: 60%; | ||
| transition: 0.2s ease; | ||
| } | ||
|
|
||
| button:hover { | ||
| opacity: 0.9; | ||
| transform: scale(1.05); | ||
| } | ||
|
|
||
| #result { | ||
| margin-top: 20px; | ||
| background: #f0f0f0; | ||
| padding: 10px; | ||
| border-radius: 8px; | ||
| font-weight: bold; | ||
| line-height: 1.8; | ||
| } |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The CSS rules are placed inside a
<style>block within the HTML file. According to the best practices in the PR description, CSS should be in separate files to avoid mixing it with HTML and to improve maintainability.