first commit

This commit is contained in:
Lukáš
2024-02-28 16:47:11 +01:00
commit d71da296b2
66 changed files with 7363 additions and 0 deletions

121
index/projects/index.html Executable file
View File

@ -0,0 +1,121 @@
<!DOCTYPE html>
<html lang="en-US">
<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>My Projects</title>
<link rel="stylesheet" href="../../style/style.css" />
<link
rel="icon"
type="image/x-icon"
href="../../res/site/icons/favicon.ico"
/>
</head>
<body>
<header class="page-header" role="banner">
<h1 class="project-name">My Projects</h1>
<h2 class="project-tagline">
Programs and apps that I have coded and random ideas that I fabricated.
</h2>
<a href="../../" class="btn">Home</a>
</header>
<main id="content" class="main-content" role="main">
<table>
<thead>
<tr>
<th>Project</th>
<th>Description</th>
<th>Link (local)</th>
</tr>
</thead>
<tbody>
<tr>
<td>Dark New Roman</td>
<td>A custom serif font based off of Times New Roman.</td>
<td>
<a href="../../res/downloads/DarkNewRoman.ttf"
>Download font (truetype 28.9 KiB)</a
>
</td>
</tr>
<tr>
<td>Number System Converter (web)</td>
<td>Converts decimal numbers into other bases!</td>
<td>
<a href="./nsc-web/">nsc-web<sup></sup></a>
</td>
</tr>
</tbody>
</table>
<br />
<br />
<table>
<thead>
<tr>
<th>Project</th>
<th>Description</th>
<th>Link (external)</th>
</tr>
</thead>
<tbody>
<tr>
<td>Firefox black & red triangle theme</td>
<td>A red and black theme for firefox tabs.</td>
<td>
<a
href="https://addons.mozilla.org/en-US/firefox/addon/black-red-triangle-theme"
>https://addons.mozilla.org/en-US/firefox/addon/black-red-triangle-theme/</a
>
</td>
</tr>
<tr>
<td>RGB Progress Bar</td>
<td>Makes progress bars cycle through different RGB colors.</td>
<td>
<a href="https://addons.mozilla.org/addon/rgb-progress-bar/"
>https://addons.mozilla.org/addon/rgb-progress-bar/</a
>
</td>
</tr>
</tbody>
</table>
<br />
<br />
<table>
<thead>
<tr>
<th>Github contribution</th>
<th>Description</th>
<th>Repository link</th>
<th>Language</th>
</tr>
</thead>
<tbody id="userRepo">
<script src="./script/script.js"></script>
</tbody>
</table>
<!-- <tr>
<td>Project</td>
<td>
Description
</td>
<td>
<a href="#">Link</a>
</td>
</tr> -->
<footer class="site-footer">
You have reached the end of the page. (ノ◕ヮ◕)ノ*:・゚✧
</footer>
</main>
</body>
</html>

View File

@ -0,0 +1,84 @@
<!DOCTYPE html>
<html lang="en-US">
<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>Number System Converter</title>
<link rel="stylesheet" href="../../../style/style.css" />
<link
rel="icon"
type="image/x-icon"
href="../../../res/site/icons/favicon.ico"
/>
<script src="./script/script.js"></script>
<style>
input {
width: 40%;
}
</style>
</head>
<body>
<header class="page-header" role="banner">
<h1 class="project-name">Number System Converter</h1>
<h2 class="project-tagline">Web version.</h2>
<a href="../../../" class="btn">Home</a>
<a href="../" class="btn">Projects</a>
</header>
<main id="content" class="main-content" role="main">
<section>
<h3>Enter a decimal number to convert and a base.</h3>
<form>
<label for="number">Number:</label><br />
<input
name="number"
id="number"
type="text"
step="1"
onChange="numberSystemConverter();"
/>
<br />
<label for="base">Base (Range 2-36):</label><br />
<input
name="base"
id="base"
type="number"
value="10"
step="1"
min="2"
max="36"
onChange="numberSystemConverter();"
/>
<br />
<label for="new-base">New base (Range 2-36):</label><br />
<input
name="new-base"
id="new-base"
type="number"
value="2"
step="1"
min="2"
max="36"
onChange="numberSystemConverter();"
/>
<br />
<label for="converted">Converted number:</label><br />
<input
name="converted"
id="converted"
type="text"
disabled="true"
onChange="numberSystemConverter();"
/>
</form>
</section>
<footer class="site-footer">
You have reached the end of the page. (ノ◕ヮ◕)ノ*:・゚✧
</footer>
</main>
</body>
</html>

View File

@ -0,0 +1,19 @@
numberSystemConverter();
function numberSystemConverter() {
let num = document.getElementById("number").value;
let base = document.getElementById("base").value;
let new_base = document.getElementById("new-base").value;
base = parseInt(base);
new_base = parseInt(new_base);
try {
let dec_num = parseInt(num, base);
let new_num = dec_num.toString(new_base);
document.getElementById("converted").value = new_num;
console.log(`BASE ${base}: ${num} ==> BASE ${new_base}: ${new_num}`);
} catch (RangeError) {
console.log(`One or more bases is not in the range of 2 to 36.`);
}
}

38
index/projects/script/script.js Executable file
View File

@ -0,0 +1,38 @@
requestUserRepos();
function requestUserRepos() {
const xhr = new XMLHttpRequest();
const url = `https://api.github.com/users/array-in-a-matrix/repos`;
xhr.open("GET", url, true);
xhr.onload = function () {
const data = JSON.parse(this.response);
let root = document.getElementById("userRepo");
while (root.firstChild) {
root.removeChild(root.firstChild);
}
let tbody = document.getElementById("userRepo");
for (let i in data) {
let tr = document.createElement("tr");
tr.classList.add("list-group-item");
function removeNull(disc) {
if (disc === null) {
const disc = "-";
return disc;
} else {
return data[i].description;
}
}
tr.innerHTML = `
<td>${data[i].name}</td>
<td>${removeNull(data[i].description)}</td>
<td><a href="${data[i].html_url}">${data[i].html_url}</a></td>
<td>${data[i].language}</td>
`;
tbody.appendChild(tr);
}
};
xhr.send();
}