commit 94e5c92f5b1036e47bf7653ea17e99ad5cc55ab3 Author: Maciej Pędzich Date: Fri Nov 27 23:12:38 2020 +0100 Major design overhaul diff --git a/assets/css/style.css b/assets/css/style.css new file mode 100644 index 0000000..46900b8 --- /dev/null +++ b/assets/css/style.css @@ -0,0 +1,62 @@ +@font-face { + font-family: "VGA 437"; + src: url("../fonts/vga437.ttf"); +} + +@media (prefers-color-scheme: dark) { + body, #cmd { + color: whitesmoke; + } + + body { + background-color: black; + } +} + +@media (prefers-color-scheme: light) { + body, #cmd { + color: black; + } + + body { + background-color: whitesmoke; + } +} + +body, #cmd { + font-family: "VGA 437"; + font-size: 1.5rem; +} + +#cmd-history > p { + line-height: 2rem; +} + +#header > p { + margin: 0.5rem auto; +} + +#header > #hint, #input-container, #cmd-history { + margin-top: 1.8rem; +} + +#input-container { + display: flex; +} + +#bracket { + padding-right: 0.75rem; + text-align: center; + vertical-align: middle; + line-height: 1.7rem; +} + +#cmd { + border: none; + background: none; + flex: 1 +} + +#cmd:active, #cmd:focus { + outline: none; +} diff --git a/assets/fonts/vga437.ttf b/assets/fonts/vga437.ttf new file mode 100644 index 0000000..f5cbfc0 Binary files /dev/null and b/assets/fonts/vga437.ttf differ diff --git a/assets/js/script.js b/assets/js/script.js new file mode 100644 index 0000000..569f1f9 --- /dev/null +++ b/assets/js/script.js @@ -0,0 +1,65 @@ +const input = document.querySelector('#cmd'); +const cmdHistoryElement = document.querySelector('#cmd-history'); +const today = new Date(); +const cmdHistory = []; + +let cmdIndex = 0; +document.querySelector('#currentYear').textContent = today.getFullYear(); +input.focus(); + +input.addEventListener('blur', (evt) => input.focus()); + +window.addEventListener('keypress', (evt) => { + const command = input.value.trim(); + + if (evt.key === 'Enter' && command.length > 0) { + const cmdToSave = document.createElement('p'); + const output = document.createElement('p'); + cmdToSave.textContent = `> ${command}`; + cmdHistoryElement.append(cmdToSave); + + switch (command) { + default: + output.style.color = 'red'; + output.textContent = `ERROR: Unkown command '${command}'`; + break; + case 'about': + const age = today.getFullYear() - new Date('2005-05-08').getFullYear() + 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.`; + break; + case 'contact': + output.innerHTML = `Email address: + contact@maciejpedzi.ch`; + break; + case 'exit': + window.close(); + break; + case 'github': + window.open('https://github.com/maciejpedzich'); + break; + case 'help': + output.innerHTML = `

about - shows everything you need to know about Maciej

+

contact - displays contact information

+

exit - closes this page

+

github - shows Maciej's Github profile

+

help - displays a list of available commands

+

skills - presents a set of current skills

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

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

+

Backend: JavaScript, TypeScript, Node.js, Express

+

Database: MongoDB, PostgreSQL

+

Tooling: Git, Visual Studio Code, Linux Bash, Windows PowerShell

+

Hosting/Deployment: Netlify, Amazon Web Services, MongoDB Atlas

`; + break; + } + + cmdHistory.push(command); + cmdHistoryElement.append(output); + input.value = ''; + input.scrollIntoView(); + } +}); diff --git a/index.html b/index.html new file mode 100644 index 0000000..02700b3 --- /dev/null +++ b/index.html @@ -0,0 +1,25 @@ + + + + + + + Maciej Pędzich + + + + +
+
+
>
+ +
+ + +