Skip to content

Hyperskill frontend developer solutions #258

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

Merged
merged 31 commits into from
Feb 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
e6567bc
feat: solve Hyperskill project "Case Converter"
sswietoniowski Jan 30, 2024
2fa7099
fix: correct hyperlinks
sswietoniowski Jan 30, 2024
3b86c11
refactor: change workspace name
sswietoniowski Jan 30, 2024
846681a
feat: solve Hyperskill project "Flashcards (Frontend)"
sswietoniowski Jan 31, 2024
bf3da9b
feat: solve Hyperskill project "To-Do List (JavaScript)"
sswietoniowski Jan 31, 2024
2e9d460
feat: solve 1st stage of the Hyperskill project "Hypergram"
sswietoniowski Jan 31, 2024
bafb08f
docs: update README.md
sswietoniowski Jan 31, 2024
8457808
feat: solve 2nd stage of the Hyperskill project "Hypergram"
sswietoniowski Feb 2, 2024
5410e6b
Merge branch 'hyperskill_frontend_developer_solutions' of https://git…
sswietoniowski Feb 2, 2024
994a814
feat: solve 3rd stage of the Hyperskill project "Hypergram"
sswietoniowski Feb 2, 2024
af08475
fix: correct implementation
sswietoniowski Feb 3, 2024
a3e6d2f
refactor: format code
sswietoniowski Feb 3, 2024
f26bc1f
feat: solve 4th stage of the Hyperskill project "Hypergram"
sswietoniowski Feb 3, 2024
78ae2f3
feat: add starter code for the new project
sswietoniowski Feb 3, 2024
482b071
fix: correct link
sswietoniowski Feb 3, 2024
ff2d832
fix: try to use citation
sswietoniowski Feb 3, 2024
e4d09f2
docs: update the documentation
sswietoniowski Feb 3, 2024
ff61c0c
feat: solve 1st stage of the Hyperskill project "Minesweeper"
sswietoniowski Feb 5, 2024
8a0ac37
feat: solve 2nd stage of the Hyperskill project "Minesweeper"
sswietoniowski Feb 7, 2024
9853075
feat: partially solve 3rd stage of the project
sswietoniowski Feb 7, 2024
8d7d7f0
feat: add starter code for the new project
sswietoniowski Feb 7, 2024
41d5908
fix: add README.md for completed projects
sswietoniowski Feb 7, 2024
032e47c
docs: update the documentation
sswietoniowski Feb 7, 2024
cdb9a77
feat: solve 1st stage of the Hyperskill project "Open Space"
sswietoniowski Feb 7, 2024
c517803
refactor: add some screenshots for the projects
sswietoniowski Feb 7, 2024
00285e8
feat: solve 2nd stage of the Hyperskill project "Open Space"
sswietoniowski Feb 8, 2024
f80428b
feat: solve 3rd stage of the Hyperskill project "Open Space"
sswietoniowski Feb 8, 2024
d458acb
feat: solve 4th stage of the Hyperskill project "Open Space"
sswietoniowski Feb 8, 2024
dcb5a34
feat: solved 5th stage of the Hyperskill project "Open Space"
sswietoniowski Feb 8, 2024
ce1989d
docs: update the documentation
sswietoniowski Feb 8, 2024
f3833f7
docs: update the documentation
sswietoniowski Feb 8, 2024
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
9 changes: 5 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,11 @@ This repository contains numerous examples helping to grasp concepts related to:

This repository contains the following sub-directories:

- [css](https://github.com/sswietoniowski/learning-html-and-css-and-javascript/tree/master/css) the CSS examples,
- [html](https://github.com/sswietoniowski/learning-html-and-css-and-javascript/tree/master/html) the HTML examples,
- [javascript](https://github.com/sswietoniowski/learning-html-and-css-and-javascript/tree/master/javascript) the JavaScript examples,
- [projects](https://github.com/sswietoniowski/learning-html-and-css-and-javascript/tree/master/projects) demo projects created using aforementioned technologies & more :-).
- [css](./css) the CSS examples,
- [html](./html) the HTML examples,
- [javascript](./javascript) the JavaScript examples,
- [projects](./projects) demo projects created using aforementioned technologies & more :-),
- [hyperskill](./hyperskill/) my solutions to [Hyperskill](https://hyperskill.org) projects from the [Frontend Developer](https://hyperskill.org/tracks/5) track.

## Learning Resources

Expand Down
40 changes: 40 additions & 0 deletions hyperskill/01_case_converter/01/index.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
* {
box-sizing: border-box;
}

body {
font-family: "Times New Roman", serif;
}

.title {
font-size: 32px;
font-weight: bold;
}

.text {
margin-top: 16px;
float: left;
width: 100%;
}

#textarea {
font-size: 16px;
padding: 16px;
border: 1px solid black;
width: 100%; max-width: 100%;
height: 100px;
}

button {
margin-top: 16px;
font-size: 16px;
background-color: white;
color: black;
border: 2px solid lightcoral;
border-radius: 8px;
}

button:hover {
background-color: lightcoral;
color: white;
}
74 changes: 74 additions & 0 deletions hyperskill/01_case_converter/01/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Case Converter</title>
<link rel="stylesheet" type="text/css" href="index.css">
</head>
<body>
<div class="title">Case Converter</div>
<div class="text">
<label for="textarea"></label>
<textarea id="textarea" onkeyup="adjustHeight(this)"></textarea>
</div>
<div class="buttons">
<button id="upper-case" onclick="upperCase()">Upper Case</button>
<button id="lower-case" onclick="lowerCase()">Lower Case</button>
<button id="proper-case" onclick="properCase()">Proper Case</button>
<button id="sentence-case" onclick="sentenceCase()">Sentence Case</button>
<button id="save-text-file" onclick="saveTextFile()">Save Text File</button>
</div>
<script>
const element = document.getElementById("textarea");

const upperCase = () => {
element.value = element.value.toUpperCase();
}
const lowerCase = () => {
element.value = element.value.toLowerCase();
}

String.prototype.toProperCase = function() {
return this.replace(
/\w\S*/g,
word => word.charAt(0).toUpperCase() + word.substr(1).toLowerCase()
);
}

const properCase = () => {
element.value = element.value.toProperCase();
}

String.prototype.toSentenceCase = function() {
return this.toLowerCase().replace(
/(^\w|\.\s*\w)/gi,
firstLetterOfASentence => firstLetterOfASentence.toUpperCase()
);
}

const sentenceCase = () => {
element.value = element.value.toSentenceCase();
}

const download = (filename, text) => {
let element = document.createElement('a');
element.setAttribute('href', 'data:text/plain;charset=utf-8,' + encodeURIComponent(text));
element.setAttribute('download', filename);
element.style.display = 'none';
document.body.appendChild(element);
element.click();
document.body.removeChild(element);
}

const saveTextFile = () => {
const textFileName = "text.txt";
download(textFileName, element.value);
}

const adjustHeight = (element) => {
element.style.height = "25px";
element.style.height = (element.scrollHeight) + "px";
}
</script>
</body>
</html>
40 changes: 40 additions & 0 deletions hyperskill/01_case_converter/02/index.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
* {
box-sizing: border-box;
}

body {
font-family: "Times New Roman", serif;
}

.title {
font-size: 32px;
font-weight: bold;
}

.text {
margin-top: 16px;
float: left;
width: 100%;
}

#textarea {
font-size: 16px;
padding: 16px;
border: 1px solid black;
width: 100%; max-width: 100%;
height: 100px;
}

button {
margin-top: 16px;
font-size: 16px;
background-color: white;
color: black;
border: 2px solid lightcoral;
border-radius: 8px;
}

button:hover {
background-color: lightcoral;
color: white;
}
74 changes: 74 additions & 0 deletions hyperskill/01_case_converter/02/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Case Converter</title>
<link rel="stylesheet" type="text/css" href="index.css">
</head>
<body>
<div class="title">Case Converter</div>
<div class="text">
<label for="textarea"></label>
<textarea id="textarea" onkeyup="adjustHeight(this)"></textarea>
</div>
<div class="buttons">
<button id="upper-case" onclick="upperCase()">Upper Case</button>
<button id="lower-case" onclick="lowerCase()">Lower Case</button>
<button id="proper-case" onclick="properCase()">Proper Case</button>
<button id="sentence-case" onclick="sentenceCase()">Sentence Case</button>
<button id="save-text-file" onclick="saveTextFile()">Save Text File</button>
</div>
<script>
const element = document.getElementById("textarea");

const upperCase = () => {
element.value = element.value.toUpperCase();
}
const lowerCase = () => {
element.value = element.value.toLowerCase();
}

String.prototype.toProperCase = function() {
return this.replace(
/\w\S*/g,
word => word.charAt(0).toUpperCase() + word.substr(1).toLowerCase()
);
}

const properCase = () => {
element.value = element.value.toProperCase();
}

String.prototype.toSentenceCase = function() {
return this.toLowerCase().replace(
/(^\w|\.\s*\w)/gi,
firstLetterOfASentence => firstLetterOfASentence.toUpperCase()
);
}

const sentenceCase = () => {
element.value = element.value.toSentenceCase();
}

const download = (filename, text) => {
let element = document.createElement('a');
element.setAttribute('href', 'data:text/plain;charset=utf-8,' + encodeURIComponent(text));
element.setAttribute('download', filename);
element.style.display = 'none';
document.body.appendChild(element);
element.click();
document.body.removeChild(element);
}

const saveTextFile = () => {
const textFileName = "text.txt";
download(textFileName, element.value);
}

const adjustHeight = (element) => {
element.style.height = "25px";
element.style.height = (element.scrollHeight) + "px";
}
</script>
</body>
</html>
40 changes: 40 additions & 0 deletions hyperskill/01_case_converter/03/index.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
* {
box-sizing: border-box;
}

body {
font-family: "Times New Roman", serif;
}

.title {
font-size: 32px;
font-weight: bold;
}

.text {
margin-top: 16px;
float: left;
width: 100%;
}

#textarea {
font-size: 16px;
padding: 16px;
border: 1px solid black;
width: 100%; max-width: 100%;
height: 100px;
}

button {
margin-top: 16px;
font-size: 16px;
background-color: white;
color: black;
border: 2px solid lightcoral;
border-radius: 8px;
}

button:hover {
background-color: lightcoral;
color: white;
}
74 changes: 74 additions & 0 deletions hyperskill/01_case_converter/03/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Case Converter</title>
<link rel="stylesheet" type="text/css" href="index.css">
</head>
<body>
<div class="title">Case Converter</div>
<div class="text">
<label for="textarea"></label>
<textarea id="textarea" onkeyup="adjustHeight(this)"></textarea>
</div>
<div class="buttons">
<button id="upper-case" onclick="upperCase()">Upper Case</button>
<button id="lower-case" onclick="lowerCase()">Lower Case</button>
<button id="proper-case" onclick="properCase()">Proper Case</button>
<button id="sentence-case" onclick="sentenceCase()">Sentence Case</button>
<button id="save-text-file" onclick="saveTextFile()">Save Text File</button>
</div>
<script>
const element = document.getElementById("textarea");

const upperCase = () => {
element.value = element.value.toUpperCase();
}
const lowerCase = () => {
element.value = element.value.toLowerCase();
}

String.prototype.toProperCase = function() {
return this.replace(
/\w\S*/g,
word => word.charAt(0).toUpperCase() + word.substr(1).toLowerCase()
);
}

const properCase = () => {
element.value = element.value.toProperCase();
}

String.prototype.toSentenceCase = function() {
return this.toLowerCase().replace(
/(^\w|\.\s*\w)/gi,
firstLetterOfASentence => firstLetterOfASentence.toUpperCase()
);
}

const sentenceCase = () => {
element.value = element.value.toSentenceCase();
}

const download = (filename, text) => {
let element = document.createElement('a');
element.setAttribute('href', 'data:text/plain;charset=utf-8,' + encodeURIComponent(text));
element.setAttribute('download', filename);
element.style.display = 'none';
document.body.appendChild(element);
element.click();
document.body.removeChild(element);
}

const saveTextFile = () => {
const textFileName = "text.txt";
download(textFileName, element.value);
}

const adjustHeight = (element) => {
element.style.height = "25px";
element.style.height = (element.scrollHeight) + "px";
}
</script>
</body>
</html>
7 changes: 7 additions & 0 deletions hyperskill/01_case_converter/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Case Converter

My solution to the project [Case Converter](https://hyperskill.org/projects/193?track=5) on [Hyperskill](https://hyperskill.org).

Each stage of the project is in a separate folder.

![Case Converter](./img/case_converter.png)
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading