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
42 changes: 42 additions & 0 deletions answers/Javascript/@nedyudombat/index.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
.index-list {
display: flex;
flex-wrap: wrap;
}

.index-list div {
max-width: 150px;
min-width: 150px;
max-height: 150px;
min-height: 150px;
border-radius: 100%;
background: green;
display: flex;
justify-content: center;
align-items: center;
margin: 3% 1%;
text-align: center;
}

a {
color: white!important;
text-decoration: none;
width: 100%;
height: 100%;
padding: 5%;
display: flex;
justify-content: center;
align-items: center;
}

* {
margin: 0;
}

a, h1, p {
font-family: 'Raleway', sans-serif;
}

.text-center {
text-align: center;
margin-top: 4%;
}
66 changes: 66 additions & 0 deletions answers/Javascript/@nedyudombat/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<title>20 Solutions</title>
<meta name="viewport" content="width=device-width, initial-scale=1" />
<link href="https://fonts.googleapis.com/css?family=Raleway:400,900&display=swap" rel="stylesheet">
<link rel="stylesheet" href="index.css">
</head>
<body>
<header>
<h1 class="text-center">16 solutions to 20 Questions</h1>
</header>
<div class="index-list">
<div>
<a href="modules/nameConcatenation/name-concatenation.html">Name concantenation</a>
</div>
<div>
<a href="modules/lottery/lottery.html">Lottery</a>
</div>
<div>
<a href="modules/reversePhrase/reversePhrase.html">Reverse Phrase</a>
</div>
<div>
<a href="modules/typeReverse/typeReverse.html">Type Reverse</a>
</div>
<div>
<a href="modules/temperatureConversion/temperatureConversion.html">Temperature Unit Conversion</a>
</div>
<div>
<a href="modules/multiplicationTable/multiplicationTable.html">Multiplication Table</a>
</div>
<div>
<a href="modules/readLineByLine/readLineByLine.html">Read Line by Line</a>
</div>
<div>
<a href="modules/combineTwoFiles/combineTwoFiles.html">Combine Two Files</a>
</div>
<div>
<a href="modules/RGBColorGenerator/RGBColorGenerator.html">RGB Color Generator</a>
</div>
<div>
<a href="modules/HexColorGenerator/HexColorGenerator.html">Hex Color Generator</a>
</div>
<div>
<a href="modules/salaryClassifier/salaryClassifier.html">Salary Classifier</a>
</div>
<div>
<a href="modules/taxClassifier/taxClassifier.html">Tax Classifier</a>
</div>
<div>
<a href="modules/numberInWords/numberInWords.html">Number In Words</a>
</div>
<div>
<a href="modules/compountInterestCalculator/compountInterestCalculator.html">Compound Interest Calculator</a>
</div>
<div>
<a href="modules/convertToDecimal/convertToDecimal.html">Convert To Decimal</a>
</div>
<div>
<a href="modules/convertDecimalToBaseN/convertDecimalToBaseN.html">Convert Decimal TO Base N</a>
</div>
</div>
</body>
</html>
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
a, h1, p {
font-family: 'Raleway', sans-serif;
}

.nav {
margin-bottom: auto;
}

.color-sample {
min-width: 50px;
max-width: 50px;
min-height: 50px;
max-height: 50px;
margin: 0 auto;
}

.text-center {
text-align: center;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<title>20 Solutions || Hex Color Generator</title>
<meta name="viewport" content="width=device-width, initial-scale=1" />
<link rel="stylesheet" href="HexColorGenerator.css">
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.5.0/css/all.css" integrity="sha384-B4dIYHKNBt8Bc12p+WXckhzcICo0wtJAoU8YZTY5qE0Id1GSseTk6S+L3BlXeVIU" crossorigin="anonymous">
</head>
<body>
<div class="content">
<nav class="nav">
<a href="../../index.html">Home</a>
</nav>
<header>
<h1 class="text-center">Hex Color Generator</h1>
</header>
<p class="color-code text-center"></p>
<div class="color-sample">

</div>
</div>

<script src="HexColorGenerator.js"></script>
</body>
</html>
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
window.addEventListener('load', () => {
const hex = Math.floor(Math.random()*16777215).toString(16);
document.querySelector('.color-code').innerHTML = `#${hex}`;
document.querySelector('.color-sample').style.background = `#${hex}`;

console.log(rgbValues);
})
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
a, h1, p {
font-family: 'Raleway', sans-serif;
}

.nav {
margin-bottom: auto;
}

.color-sample {
min-width: 50px;
max-width: 50px;
min-height: 50px;
max-height: 50px;
margin: 0 auto;
}

.text-center {
text-align: center;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<title>20 Solutions || RGB Color Generator</title>
<meta name="viewport" content="width=device-width, initial-scale=1" />
<link rel="stylesheet" href="RGBColorGenerator.css">
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.5.0/css/all.css" integrity="sha384-B4dIYHKNBt8Bc12p+WXckhzcICo0wtJAoU8YZTY5qE0Id1GSseTk6S+L3BlXeVIU" crossorigin="anonymous">
</head>
<body>
<div class="content">
<nav class="nav">
<a href="../../index.html">Home</a>
</nav>
<header>
<h1 class="text-center">RGB Color Generator</h1>
</header>
<p class="color-code text-center"></p>
<div class="color-sample">

</div>
</div>

<script src="RGBColorGenerator.js"></script>
</body>
</html>
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
window.addEventListener('load', () => {
const rgbValues = [];
let numbers = '';
for(let i = 0; i < 3; i +=1 ) {
rgbValues.push(Math.floor(Math.random()* 256) + 0);
}
document.querySelector('.color-code').innerHTML = `rgb(${rgbValues})`;
document.querySelector('.color-sample').style.background = `rgb(${rgbValues})`;

console.log(rgbValues);
})
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
a, h1, p {
font-family: 'Raleway', sans-serif;
}

.nav {
margin-bottom: auto;
}

.form-control {
height: 40px;
width: 485px;
border: 1px solid #c4c4c4;
border-radius: 3px;
margin-bottom: 15px;
box-shadow: none;
padding-left: 10px;
}

.form {
display: block;
width: 500px;
margin: 0 auto;
}

input[type="file"] {
border: 0;
}

.text-center {
text-align: center;
}

.result {
padding: 5px 10px;
border: 2px dashed green;
border-radius: 3px;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<title>20 Solutions || Combine Two Files</title>
<meta name="viewport" content="width=device-width, initial-scale=1" />
<link rel="stylesheet" href="combineTwoFiles.css">
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.5.0/css/all.css" integrity="sha384-B4dIYHKNBt8Bc12p+WXckhzcICo0wtJAoU8YZTY5qE0Id1GSseTk6S+L3BlXeVIU" crossorigin="anonymous">
</head>
<body>
<div class="content">
<nav class="nav">
<a href="../../index.html">Home</a>
</nav>
<header>
<h1 class="text-center">Combine Two Files</h1>
</header>
<form action="" id="fileReaderForm" class="form">
<label for="file">File 1</label>
<input class="form-control" onchange="readFile();" accept=".txt" type="file" id="file">
<label for="file2">File 2</label>
<input class="form-control" onchange="readFile2();" accept=".txt" type="file" id="file2">
<div class="result"></div>
</form>
</div>

<script src="combineTwoFiles.js"></script>
</body>
</html>
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
const readFile = () => {
const file = document.querySelector('#file').files[0];
const reader = new FileReader();
reader.onload = function(progressEvent){
let lines = this.result.split('\n');
lines.forEach(line => {
document.querySelector('.result').innerHTML += `${line}<br>`;
})
};
reader.readAsText(file);
};
const readFile2 = () => {
const file = document.querySelector('#file2').files[0];
const reader = new FileReader();
reader.onload = function(progressEvent){
let lines = this.result.split('\n');
lines.forEach(line => {
document.querySelector('.result').innerHTML += `${line}<br>`;
})
};
reader.readAsText(file);
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
a, h1, p {
font-family: 'Raleway', sans-serif;
}

.nav {
margin-bottom: auto;
}

.form-control {
height: 40px;
width: 485px;
border: 1px solid #c4c4c4;
border-radius: 3px;
margin-bottom: 15px;
box-shadow: none;
padding-left: 10px;
}


.form {
display: block;
width: 500px;
margin: 0 auto;
}

.text-center {
text-align: center;
}

.result {
padding: 5px 10px;
border: 2px dashed green;
border-radius: 3px;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<title>20 Solutions || Compound Interest Calculator</title>
<meta name="viewport" content="width=device-width, initial-scale=1" />
<link rel="stylesheet" href="compountInterestCalculator.css">
</head>
<body>
<div class="content">
<nav class="nav">
<a href="../../index.html">Home</a>
</nav>
<header>
<h1 class="text-center">Compound Interest Calculator</h1>
</header>
<form action="" id="interestForm" class="form">
<input class="form-control" placeholder="Principal" type="number" name="principal" onkeyup="calculateCompoundIterest(event);">
<input class="form-control" placeholder="Rate" type="number" name="rate" onkeyup="calculateCompoundIterest(event);">
<input class="form-control" placeholder="Time in years" type="number" name="years" onkeyup="calculateCompoundIterest(event);">
<div class="result"></div>
</form>
</div>

<script src="compountInterestCalculator.js"></script>
</body>
</html>
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
const calculateCompoundIterest = event => {
event.preventDefault();
const formData = new FormData(document.querySelector('#interestForm'));
const data = {};
for (const [key, value] of formData.entries()) {
data[key] = value;
}
return document.querySelector('.result').innerHTML = `<p> Compund Interest for ${data.years} years = ${(data.principal * data.rate * data.years)/100} </p>`;
}
Loading