forked from jrdndj/CP2preps
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request jrdndj#22 from Danilo-R/master
Computer Practicum II - submission
- Loading branch information
Showing
74 changed files
with
3,953 additions
and
0 deletions.
There are no files selected for viewing
102 changes: 102 additions & 0 deletions
102
Student Works/Danilo-R/Assignments/EighthAssignment/formA.html
This file contains 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,102 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<title>Validating Forms</title> | ||
<style type = "text/css"> | ||
|
||
button { | ||
width: 92px; | ||
margin: 3px; | ||
cursor: pointer; | ||
} | ||
|
||
.myForm { | ||
width: 200px; | ||
margin: 1px; | ||
box-sizing: border-box; | ||
} | ||
|
||
.center { | ||
text-align: center; | ||
} | ||
|
||
</style> | ||
<script type = "text/javascript"> | ||
var entries = []; | ||
// we declared an array with the name entries. The capacity is "unlimited" | ||
entries["Cool Kids"] = []; | ||
entries["Emo Kids"] = []; | ||
entries["Others"] = []; | ||
|
||
function entryChanged() { | ||
var name = document.getElementById("entry").value; | ||
var button = document.getElementById("addButton"); | ||
button.disabled = !(/^[A-ZŠČŽ][a-zščž]+(\s[A-ZŠČŽ][a-zščž]+){1,2}$/.test(name)); | ||
// '!' makes it false; if disabled is false, it is enabled | ||
} | ||
|
||
function addEntry() { | ||
var name = document.getElementById("entry").value; | ||
var group = document.getElementById("group").value; | ||
entries[group].push(name); // saves it in the array | ||
updateEntries(); // allows us to display it in the list of names | ||
} | ||
|
||
function updateEntries() { | ||
var group = document.getElementById("group").value; | ||
var names = document.getElementById("names"); | ||
while (names.length > 0) | ||
names.remove(0); // this cleans the array before it saves (removes duplicates) | ||
for (var entry of entries[group]) { | ||
var option = document.createElement("option"); | ||
option.text = entry; // this adds text to the option | ||
names.add(option); // this displays the text as an option in the list of names | ||
} // end of for loop | ||
|
||
selectionChange(); | ||
} // end of function | ||
|
||
function selectionChange() { | ||
var names = document.getElementById("names"); | ||
var button = document.getElementById("removeButton"); | ||
button.disabled = (names.selectedIndex == -1); | ||
} | ||
|
||
|
||
function removeEntry() { | ||
var group = document.getElementById("group").value; | ||
var names = document.getElementById("names"); | ||
var index = names.selectedIndex; // gets the index of the selection | ||
if (index == -1) return; // do nothing if nothing is selected | ||
entries[group].splice(index, 1); // remove from array the element, based on index | ||
updateEntries(); // updates the list | ||
} | ||
|
||
</script> | ||
|
||
</head> | ||
<body> | ||
|
||
<form> | ||
<div> | ||
<select name = "group" id = "group" class = "myForm" onchange = "updateEntries()"> | ||
<option>Cool Kids</option> | ||
<option>Emo Kids</option> | ||
<option>Others</option> | ||
</select> | ||
</div> | ||
<div> | ||
<select id = "names" size = "10" class = "myForm" onchange = "selectionChange()"></select> | ||
</div> | ||
<div> | ||
<input type = "text" id = "entry" class = "myForm" oninput = "entryChanged()"> | ||
</div> | ||
<div class = "center myForm"> | ||
<button type = "button" id = "addButton" onclick = "addEntry()" disabled>Add</button> | ||
<button type = "button" id = "removeButton" onclick = "removeEntry()" disabled>Remove</button> | ||
</div> | ||
|
||
</form> | ||
|
||
</body> | ||
</html> |
98 changes: 98 additions & 0 deletions
98
Student Works/Danilo-R/Assignments/EighthAssignment/pageA.html
This file contains 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,98 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<title>Timer</title> | ||
</head> | ||
|
||
<style type = "text/css"> | ||
|
||
table, tr { | ||
border: 1px solid black; | ||
border-collapse: collapse; | ||
width: 446px; | ||
margin-top: 5px; | ||
text-align: center; | ||
} | ||
|
||
th { | ||
background-color: yellow; | ||
} | ||
|
||
button { | ||
background-color: whitesmoke; | ||
margin: 4px; | ||
width: 140px; | ||
height: 30px; | ||
border: none; | ||
border-radius: 4px; | ||
cursor: pointer; | ||
} | ||
|
||
</style> | ||
|
||
<script type = "text/javascript"> | ||
|
||
var counting = false; | ||
var number = 1; | ||
var timer; | ||
var sum = 0; | ||
|
||
function increaseTimer() { | ||
var tableOne = document.getElementById("myTable"); | ||
var row = tableOne.insertRow(); | ||
row.innerHTML = number; | ||
number++; | ||
} | ||
|
||
function startAndStop() { | ||
var button = document.getElementById("startAndStop"); | ||
if (counting) { | ||
clearInterval(timer); | ||
button.innerHTML = 'Start'; | ||
counting = false; | ||
} else { | ||
timer = setInterval(increaseTimer, 1000); | ||
button.innerHTML = 'Stop'; | ||
counting = true; | ||
} | ||
} | ||
|
||
function clearTimer() { | ||
var x = document.getElementById("myTable").rows.length; | ||
var tableOne = document.getElementById("myTable"); | ||
for (var i = 1; i < x; i++) { | ||
tableOne.deleteRow(1); | ||
} | ||
number = 1; | ||
sum = 0; | ||
|
||
} | ||
|
||
function foldTimer() { | ||
var x = document.getElementById("myTable").rows.length; | ||
var tableOne = document.getElementById("myTable"); | ||
for (var i = 1; i < x; i++) { | ||
tableOne.deleteRow(1); | ||
} | ||
for (var i = 1; i < x - 1; i++) { | ||
sum = sum + (number - i); | ||
} | ||
var row = tableOne.insertRow(); | ||
row.innerHTML = sum; | ||
} | ||
|
||
</script> | ||
|
||
<body> | ||
|
||
<button id = "startAndStop" onclick = "startAndStop()">Start</button> | ||
<button onclick = "clearTimer()">Clear</button> | ||
<button onclick = "foldTimer()">Fold</button> | ||
<br> | ||
|
||
<table id = "myTable"> | ||
<th>Numbers</th> | ||
</table> | ||
|
||
</body> | ||
</html> |
51 changes: 51 additions & 0 deletions
51
Student Works/Danilo-R/Assignments/FifthAssignment/aboutPage.html
This file contains 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,51 @@ | ||
<!DOCTYPE html> | ||
<html lang = "en-US"> | ||
<head> | ||
<title>Home Page</title> | ||
<meta charset = "UTF-8"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
<link href = "https://fonts.googleapis.com/css?family=Montserrat" rel = "stylesheet"> | ||
<link href = "styles.css" rel = "stylesheet"> | ||
<script src="https://kit.fontawesome.com/a076d05399.js"></script> | ||
</head> | ||
<body> | ||
|
||
<nav> | ||
<a href = "homePage.html"><button class = "navigationBarClass">Home page</button></a> | ||
<a href = "registerAccountPage.html"><button class = "navigationBarClass">Register Account</button></a> | ||
<a href = "uploadMemePage.html"><button class = "navigationBarClass">Upload meme</button></a> | ||
<a href = "rateMemePage.html"><button class = "navigationBarClass">Rate meme</button></a> | ||
<button class = "currentPageClass">About</button> | ||
</nav> | ||
<header> | ||
<h1>Meet our Team</h1> | ||
<p>A perfect blend of creativity and technical wizardy.</p> | ||
</header> | ||
<section> | ||
<article> | ||
<ul class = "ulClass"> | ||
<li>UI/UX Designer</li> | ||
<li>Full-stack Developer</li> | ||
<li>Cybersecurity Administrator</li> | ||
<li>Data Analyst</li> | ||
<li>Database Administrator</li> | ||
</ul> | ||
<ul class = "namesClass"> | ||
<li>Ira Turguckle</li> | ||
<li>Joed Shordouse</li> | ||
<li>Velma Yompunt</li> | ||
<li>Gage Frunthull</li> | ||
<li>Cecilia Sonkinch</li> | ||
</ul> | ||
<ul> | ||
<li><i class="fas fa-palette" style = "font-size: 80px; padding-left: 30px; color: #2a7886;"></i></li> | ||
<li><i class="fas fa-code" style = "font-size: 80px; padding-left: 50px; color: #2a7886;"></i></li> | ||
<li><i class="fas fa-lock" style = "font-size: 80px; padding-left: 100px; color: #2a7886;"></i></li> | ||
<li><i class="far fa-chart-bar" style = "font-size: 80px; padding-left: 90px; color: #2a7886;"></i></li> | ||
<li><i class="fas fa-database" style = "font-size: 80px; padding-left: 60px; color: #2a7886;"></i></li> | ||
</ul> | ||
</article> | ||
</section> | ||
|
||
</body> | ||
</html> |
31 changes: 31 additions & 0 deletions
31
Student Works/Danilo-R/Assignments/FifthAssignment/homePage.html
This file contains 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,31 @@ | ||
<!DOCTYPE html> | ||
<html lang = "en-US"> | ||
<head> | ||
<title>Home Page</title> | ||
<meta charset = "UTF-8"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
<link href = "https://fonts.googleapis.com/css?family=Montserrat" rel = "stylesheet"> | ||
<link href = "styles.css" rel = "stylesheet"> | ||
</head> | ||
<body> | ||
|
||
<nav> | ||
<button class = "currentPageClass">Home page</button> | ||
<a href = "registerAccountPage.html"><button class = "navigationBarClass">Register Account</button></a> | ||
<a href = "uploadMemePage.html"><button class = "navigationBarClass">Upload meme</button></a> | ||
<a href = "rateMemePage.html"><button class = "navigationBarClass">Rate meme</button></a> | ||
<a href = "aboutPage.html"><button class = "navigationBarClass">About</button></a> | ||
</nav> | ||
<header> | ||
<h1>Welcome to the website dedicated to memes!</h1> | ||
<p>Upload your favorite memes, and don't forget<br> to rate our 'top 3' collection.</p> | ||
<a href = "registerAccountPage.html"><button class = "registerNowClass">Register now</button></a> | ||
<br> | ||
<p align = "center">You can also upload memes by pressing <a href = "uploadMemePage.html">here</a></p> | ||
</header> | ||
<footer style = "margin-top: 300px;"> | ||
<p>© 2020 Computer Practicum II Course. All rights reserved.</p> | ||
</footer> | ||
|
||
</body> | ||
</html> |
Oops, something went wrong.