Version 2.1.1 release

This commit is contained in:
Maciej Pędzich 2020-12-31 11:56:56 +01:00
parent 761638ebb0
commit 786092f433
3 changed files with 21 additions and 8 deletions

View File

@ -1,16 +1,21 @@
# Changelog # Changelog
## v2.1.0 ## 2.1.1
- Minor punctuation and wording changes
- Fix calculation of time difference between current date and my date of birth
## 2.1.0
- Remove unnecessary "exit" command - Remove unnecessary "exit" command
- Remove native webstie scrollbar - Remove native webstie scrollbar
- Add command retyping using up and down arrows - Add command retyping using up and down arrows
## v2.0.1 ## 2.0.1
- Fix "unkown" typo - Fix "unkown" typo
- Add version tag to page header - Add version tag to page header
## v2.0.0 ## 2.0.0
- Initial version 2.x.y release - Initial version 2.x.y release

View File

@ -1,10 +1,11 @@
const input = document.querySelector('#cmd'); const input = document.querySelector('#cmd');
const cmdHistoryElement = document.querySelector('#cmd-history'); const cmdHistoryElement = document.querySelector('#cmd-history');
const today = new Date(); const today = new Date();
const currentYear = today.getFullYear();
const cmdHistory = []; const cmdHistory = [];
let cmdIndex = 0; let cmdIndex = 0;
document.querySelector('#currentYear').textContent = today.getFullYear(); document.querySelector('#currentYear').textContent = currentYear;
input.focus(); input.focus();
input.addEventListener('blur', (evt) => input.focus()); input.addEventListener('blur', (evt) => input.focus());
@ -24,11 +25,18 @@ window.addEventListener('keypress', (evt) => {
output.textContent = `ERROR: Unknown command '${command}'`; output.textContent = `ERROR: Unknown command '${command}'`;
break; break;
case 'about': case 'about':
const age = today.getFullYear() - new Date('2005-05-08').getFullYear(); const daysOfThisYear =
currentYear % 400 === 0 ||
(currentYear % 100 !== 0 && currentYear % 4 === 0)
? 366
: 365;
const timeDiff = today.getTime() - new Date('2005-05-08').getTime();
const age = Math.floor(timeDiff / (3600 * 24 * daysOfThisYear * 1000));
output.textContent = `Maciej Pedzich is a ${age}-year-old high school student from Kielce, Poland. output.textContent = `Maciej Pedzich is a ${age}-year-old high school student from Kielce, Poland.
He makes web applications using Vue.js, Node.js, Express and MongoDB/PostgreSQL, but he likes experimenting with other solutions too. He makes web applications using Vue.js, Node.js, Express and MongoDB/PostgreSQL, but he likes experimenting with other solutions too.
He believes that by being creative and cooperating with others, you can achieve success. He believes that by being creative and cooperating with others, you can achieve success.
When not coding he is probably watching an F1 race or playing retro video games.`; When not coding, he is probably watching an F1 race, or playing retro video games.`;
break; break;
case 'contact': case 'contact':
output.innerHTML = `Email address: output.innerHTML = `Email address:
@ -43,7 +51,7 @@ window.addEventListener('keypress', (evt) => {
<p>github - shows Maciej's Github profile</p> <p>github - shows Maciej's Github profile</p>
<p>help - displays a list of available commands</p> <p>help - displays a list of available commands</p>
<p>skills - presents a set of current skills</p> <p>skills - presents a set of current skills</p>
<p>Use up and down arrows to retype previous commands</p>`; <p>Use up and down arrows to retype commands</p>`;
break; break;
case 'skills': case 'skills':
output.innerHTML = `<p>Frontend: HTML, CSS, JavaScript, TypeScript, Vue.js</p> output.innerHTML = `<p>Frontend: HTML, CSS, JavaScript, TypeScript, Vue.js</p>

View File

@ -12,7 +12,7 @@
</head> </head>
<body> <body>
<div id="header"> <div id="header">
<p>maciejpedzi.ch [Version 2.1.0]</p> <p>maciejpedzi.ch [Version 2.1.1]</p>
<p>(c) Maciej Pedzich, 2020-<span id="currentYear"></span></p> <p>(c) Maciej Pedzich, 2020-<span id="currentYear"></span></p>
<p id="hint">Welcome! Type 'help' for more information</p> <p id="hint">Welcome! Type 'help' for more information</p>
</div> </div>