diff --git a/CHANGELOG.md b/CHANGELOG.md index 57b44b7..791007b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,16 +1,21 @@ # 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 native webstie scrollbar - Add command retyping using up and down arrows -## v2.0.1 +## 2.0.1 - Fix "unkown" typo - Add version tag to page header -## v2.0.0 +## 2.0.0 - Initial version 2.x.y release diff --git a/assets/js/script.js b/assets/js/script.js index ce69732..fd4a1dc 100644 --- a/assets/js/script.js +++ b/assets/js/script.js @@ -1,10 +1,11 @@ const input = document.querySelector('#cmd'); const cmdHistoryElement = document.querySelector('#cmd-history'); const today = new Date(); +const currentYear = today.getFullYear(); const cmdHistory = []; let cmdIndex = 0; -document.querySelector('#currentYear').textContent = today.getFullYear(); +document.querySelector('#currentYear').textContent = currentYear; input.focus(); input.addEventListener('blur', (evt) => input.focus()); @@ -24,11 +25,18 @@ window.addEventListener('keypress', (evt) => { output.textContent = `ERROR: Unknown command '${command}'`; break; 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. 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. - 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; case 'contact': output.innerHTML = `Email address: @@ -43,7 +51,7 @@ window.addEventListener('keypress', (evt) => {

github - shows Maciej's Github profile

help - displays a list of available commands

skills - presents a set of current skills

-

Use up and down arrows to retype previous commands

`; +

Use up and down arrows to retype commands

`; break; case 'skills': output.innerHTML = `

Frontend: HTML, CSS, JavaScript, TypeScript, Vue.js

diff --git a/index.html b/index.html index 3a0abac..f3f3781 100644 --- a/index.html +++ b/index.html @@ -12,7 +12,7 @@