Skip to content

Commit

Permalink
Made some modifycations on the project Git and GitHub trouble shooting
Browse files Browse the repository at this point in the history
  • Loading branch information
Davy committed May 17, 2023
0 parents commit 6b441a9
Show file tree
Hide file tree
Showing 32 changed files with 1,795 additions and 0 deletions.
130 changes: 130 additions & 0 deletions Design a website to trick people/index.html

Large diffs are not rendered by default.

198 changes: 198 additions & 0 deletions English Vocabulary/allinoneIndex.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,198 @@
<!DOCTYPE html>
<html lang="en">

<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Davy's Vocabulary Tool</title>
<style>
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}

body {
background-color: rgb(115, 173, 223);
}

div {
padding: 0px;
margin: 0px;
display: flex;
justify-content: center;
}

h1 {
text-align: center;
margin: 50px;
}

table {
display: flex;
justify-content: center;
text-align: center;
margin: 20px;
padding: 20px;
border: 20px;
border-collapse: collapse;
border-color: black;
}

td {
padding-left: 20px;
padding-right:20px;
padding-top: 5px;
padding-bottom: 5px;
text-align: center;
}

#deleteButton,#editButton{
text-align: center;
padding:2px;
}

#addWords{
margin-right:5px;
padding-left: 3px;
padding-top:1px;
padding-bottom: 1px;
}

#addWordsButton{
text-align: center;
padding:2px;
}


</style>
<script>
'use strict';

function addWords() {
let table = document.getElementById("myTable01");
let row = table.insertRow(-1);
let cell1 = row.insertCell(0);
let cell2 = row.insertCell(1);
let cell3 = row.insertCell(2);
let cell4 = row.insertCell(3);
let cell5 = row.insertCell(4);
let cell6 = row.insertCell(5);
let cell7 = row.insertCell(6);

let input = document.getElementById("addWords").value;
cell1.innerHTML = input;
cell6.innerHTML = "<button id='editButton' onclick='editRow(this)'>Edit</button>";
cell7.innerHTML = "<button id='deleteButton' onclick='deleteRow(this)'>Delete</button>";
saveTable();
}

function loadTable() {
let html = localStorage.getItem("myTable01");
if (html) {
document.getElementById("myTable01").outerHTML = html;
}
}

function saveTable() {
let table = document.getElementById("myTable01");
let html = table.outerHTML;
localStorage.setItem("myTable01", html);
}

function editRow(row) {
let rowIndex = row.parentNode.parentNode.rowIndex;
let cell0 = document.getElementById("myTable01").rows[rowIndex].cells[0];
let cell1 = document.getElementById("myTable01").rows[rowIndex].cells[1];
let cell2 = document.getElementById("myTable01").rows[rowIndex].cells[2];
let cell3 = document.getElementById("myTable01").rows[rowIndex].cells[3];
let cell4 = document.getElementById("myTable01").rows[rowIndex].cells[4];
let originalWord0 = cell0.innerHTML;
let originalWord1 = cell1.innerHTML;
let originalWord2 = cell2.innerHTML;
let originalWord3 = cell3.innerHTML;
let originalWord4 = cell4.innerHTML;
let input0 = document.createElement("input");
let input1 = document.createElement("input");
let input2 = document.createElement("input");
let input3 = document.createElement("input");
let input4 = document.createElement("input");

input0.setAttribute("type", "text",);
input0.setAttribute("value", originalWord0);
input1.setAttribute("type", "text",);
input1.setAttribute("value", originalWord1);
input2.setAttribute("type", "text",);
input2.setAttribute("value", originalWord2);
input3.setAttribute("type", "text",);
input3.setAttribute("value", originalWord3);
input4.setAttribute("type", "text",);
input4.setAttribute("value", originalWord4);
cell0.innerHTML = "";
cell1.innerHTML = "";
cell2.innerHTML = "";
cell3.innerHTML = "";
cell4.innerHTML = "";
cell0.appendChild(input0);
cell1.appendChild(input1);
cell2.appendChild(input2);
cell3.appendChild(input3);
cell4.appendChild(input4);
let editButton = cell1.parentNode.cells[5].getElementsByTagName("button")[0];
editButton.setAttribute("onclick", `saveWords(${rowIndex})`);
editButton.innerHTML = "Save";
}

function deleteRow(row) {
let d = row.parentNode.parentNode.rowIndex;
document.getElementById("myTable01").deleteRow(d);
saveTable();
}

function saveWords(rowIndex) {
let cell0 = document.getElementById("myTable01").rows[rowIndex].cells[0];
let cell1 = document.getElementById("myTable01").rows[rowIndex].cells[1];
let cell2 = document.getElementById("myTable01").rows[rowIndex].cells[2];
let cell3 = document.getElementById("myTable01").rows[rowIndex].cells[3];
let cell4 = document.getElementById("myTable01").rows[rowIndex].cells[4];

let input0 = cell0.getElementsByTagName("input")[0];
let input1 = cell1.getElementsByTagName("input")[0];
let input2 = cell2.getElementsByTagName("input")[0];
let input3 = cell3.getElementsByTagName("input")[0];
let input4 = cell4.getElementsByTagName("input")[0];

cell0.innerHTML = input0.value;
cell1.innerHTML = input1.value;
cell2.innerHTML = input2.value;
cell3.innerHTML = input3.value;
cell4.innerHTML = input4.value;

let saveButton = cell1.parentNode.cells[5].getElementsByTagName("button")[0];
saveButton.setAttribute("onclick", `editRow(this)`);
saveButton.innerHTML = "Edit";
saveTable();
}
</script>
</head>

<body onload="loadTable()">
<h1>Davy's Vocabulary Tool</h1>
<div>
<input type="text" id="addWords">
<button id="addWordsButton" onclick="addWords()">Add Word</button>
</div>
<table id="myTable01" border="1">
<tr>
<td>Words</td>
<td>Properties of Word</td>
<td>First Attempt</td>
<td>Second Attempt</td>
<td>Third Attempt</td>
<td>Edit</td>
<td>Delete</td>
</tr>
</table>
</body>
</html>
31 changes: 31 additions & 0 deletions English Vocabulary/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<!DOCTYPE html>
<html lang="en">

<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Davy's Vocabulary Tool</title>
<link href="style.css" rel="stylesheet" />
<script src="script.js"></script>
</head>

<body onload="loadTable()">
<h1>Davy's Vocabulary Tool</h1>
<div>
<input type="text" id="addWords">
<button id="addWordsButton" onclick="addWords()">Add Word</button>
</div>
<table id="myTable01" border="1">
<tr>
<td>Words</td>
<td>Properties of Word</td>
<td>First Attempt</td>
<td>Second Attempt</td>
<td>Third Attempt</td>
<td>Edit</td>
<td>Delete</td>
</tr>
</table>
</body>
</html>
106 changes: 106 additions & 0 deletions English Vocabulary/script.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
'use strict';

function addWords() {
let table = document.getElementById("myTable01");
let row = table.insertRow(-1);
let cell1 = row.insertCell(0);
let cell2 = row.insertCell(1);
let cell3 = row.insertCell(2);
let cell4 = row.insertCell(3);
let cell5 = row.insertCell(4);
let cell6 = row.insertCell(5);
let cell7 = row.insertCell(6);

let input = document.getElementById("addWords").value;
cell1.innerHTML = input;
cell6.innerHTML = "<button id='editButton' onclick='editRow(this)'>Edit</button>";
cell7.innerHTML = "<button id='deleteButton' onclick='deleteRow(this)'>Delete</button>";
saveTable();
}

function loadTable() {
let html = localStorage.getItem("myTable01");
if (html) {
document.getElementById("myTable01").outerHTML = html;
}
}

function saveTable() {
let table = document.getElementById("myTable01");
let html = table.outerHTML;
localStorage.setItem("myTable01", html);
}

function editRow(row) {
let rowIndex = row.parentNode.parentNode.rowIndex;
let cell0 = document.getElementById("myTable01").rows[rowIndex].cells[0];
let cell1 = document.getElementById("myTable01").rows[rowIndex].cells[1];
let cell2 = document.getElementById("myTable01").rows[rowIndex].cells[2];
let cell3 = document.getElementById("myTable01").rows[rowIndex].cells[3];
let cell4 = document.getElementById("myTable01").rows[rowIndex].cells[4];
let originalWord0 = cell0.innerHTML;
let originalWord1 = cell1.innerHTML;
let originalWord2 = cell2.innerHTML;
let originalWord3 = cell3.innerHTML;
let originalWord4 = cell4.innerHTML;
let input0 = document.createElement("input");
let input1 = document.createElement("input");
let input2 = document.createElement("input");
let input3 = document.createElement("input");
let input4 = document.createElement("input");

input0.setAttribute("type", "text",);
input0.setAttribute("value", originalWord0);
input1.setAttribute("type", "text",);
input1.setAttribute("value", originalWord1);
input2.setAttribute("type", "text",);
input2.setAttribute("value", originalWord2);
input3.setAttribute("type", "text",);
input3.setAttribute("value", originalWord3);
input4.setAttribute("type", "text",);
input4.setAttribute("value", originalWord4);
cell0.innerHTML = "";
cell1.innerHTML = "";
cell2.innerHTML = "";
cell3.innerHTML = "";
cell4.innerHTML = "";
cell0.appendChild(input0);
cell1.appendChild(input1);
cell2.appendChild(input2);
cell3.appendChild(input3);
cell4.appendChild(input4);
let editButton = cell1.parentNode.cells[5].getElementsByTagName("button")[0];
editButton.setAttribute("onclick", `saveWords(${rowIndex})`);
editButton.innerHTML = "Save";
}

function deleteRow(row) {
let d = row.parentNode.parentNode.rowIndex;
document.getElementById("myTable01").deleteRow(d);
saveTable();
}

function saveWords(rowIndex) {
let cell0 = document.getElementById("myTable01").rows[rowIndex].cells[0];
let cell1 = document.getElementById("myTable01").rows[rowIndex].cells[1];
let cell2 = document.getElementById("myTable01").rows[rowIndex].cells[2];
let cell3 = document.getElementById("myTable01").rows[rowIndex].cells[3];
let cell4 = document.getElementById("myTable01").rows[rowIndex].cells[4];

let input0 = cell0.getElementsByTagName("input")[0];
let input1 = cell1.getElementsByTagName("input")[0];
let input2 = cell2.getElementsByTagName("input")[0];
let input3 = cell3.getElementsByTagName("input")[0];
let input4 = cell4.getElementsByTagName("input")[0];

cell0.innerHTML = input0.value;
cell1.innerHTML = input1.value;
cell2.innerHTML = input2.value;
cell3.innerHTML = input3.value;
cell4.innerHTML = input4.value;

let saveButton = cell1.parentNode.cells[5].getElementsByTagName("button")[0];
saveButton.setAttribute("onclick", `editRow(this)`);
saveButton.innerHTML = "Edit";
saveTable();
}
58 changes: 58 additions & 0 deletions English Vocabulary/style.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}

body {
background-color: rgb(115, 173, 223);
}

div {
padding: 0px;
margin: 0px;
display: flex;
justify-content: center;
}

h1 {
text-align: center;
margin: 50px;
}

table {
display: flex;
justify-content: center;
text-align: center;
margin: 20px;
padding: 20px;
border: 20px;
border-collapse: collapse;
border-color: black;
}

td {
padding-left: 20px;
padding-right:20px;
padding-top: 5px;
padding-bottom: 5px;
text-align: center;
}

#deleteButton,#editButton{
text-align: center;
padding:2px;
}

#addWords{
margin-right:5px;
padding-left: 3px;
padding-top:1px;
padding-bottom: 1px;
}

#addWordsButton{
text-align: center;
padding:2px;
}

Loading

0 comments on commit 6b441a9

Please sign in to comment.