Merge pull request #1 from Maathias/cleanup

Cleanup
This commit is contained in:
Mateusz Pstrucha authored and GitHub committed 2021-06-27 19:07:23 +02:00
commit 5eb17003ae
6 files changed
+248 -154

No files matched your search

+60
View File
@@ -0,0 +1,60 @@
var apps = [
{
name: 'plex',
title: 'plex.mtps.pl',
content: "Plex Media Server. Serwer filmów, seriali, zdjęć i muzyki",
link: 'https://plex.mtps.pl/'
},
{
name: 'radio',
title: 'radio-rolnik.mtps.pl',
content: "Strona radia szkolnego Rolnika. Aktualna top lista utworów wybrana przez uczniów.",
link: 'https://radio-rolnik.mtps.pl/'
},
{
name: 'r',
title: 'r.mtps.pl',
content: "Serwer do skracania linków",
link: 'https://r.mtps.pl/'
},
{
name: 'send',
title: 'send.mtps.pl',
content: "Self hostowany serwer Firefox Send. Szyfrowany upload plików, z hasłem i datą wygaśnięcia",
link: 'https://send.mtps.pl/'
}
]
const head = document.querySelector('.pane.index>.head'),
grid = document.querySelector('.pane.index>.grid')
for (let app of apps) {
let description = document.createElement('div'),
title = document.createElement('a'),
link = document.createElement('i'),
content = document.createElement('div'),
element = document.createElement('div'),
icon = document.createElement('i')
description.append(title, link, content)
element.append(app.name)
element.append(icon)
description.classList.add('description', app.name)
title.classList.add('title')
link.classList.add('link', 'icon-link-ext')
content.classList.add('content')
icon.classList.add('icon-link-ext')
title.setAttribute('href', app.link)
title.setAttribute('title', app.name)
title.setAttribute('target', '_blank')
element.setAttribute('data-target', app.name)
element.setAttribute('data-link', app.link)
title.textContent = app.title
content.textContent = app.content
head.append(description)
grid.append(element)
}
+22 -74
View File
@@ -15,7 +15,7 @@
<body>
<div id="floating">
<div id="nav">
<nav>
<img src="/media/m_stripes.svg" alt="logo" id="miniLogo">
<span id="logoText"><span>M</span>a<span>t</span>eusz <span>P</span><span>s</span>trucha</span>
@@ -27,25 +27,36 @@
<div style="clear: both"></div>
</div>
</div>
</nav>
</div>
<div class="wrapper">
<div class="stripes primary">
<object type="image/svg+xml" data="/media/stripes_primary.svg"></object>
</div>
<div class="stripes secondary">
<object type="image/svg+xml" data="/media/stripes_secondary.svg"></object>
</div>
<div class="panes">
<div class="pane" id="about">
<div class="header">
<div class="text big typein" data-content="Hi, I'm Mathew"></div>
<div class="pane about" data-id="about">
<div class="header main">
<div class="text big typein" data-content="Hi, I'm Mathew">&#8203;</div>
<div class="text smol">I aspire to be a developer/sysadmin</div>
<div class="text smolest">I usually work with JavaScript or Python. My sysadmin experience is currently
limited to a
linux lab enviroment.
My repos are mainly smaller tools I made for myself, but I did few bigger projects, which you can see below
</div>
<div class="arrow"></div>
</div>
<div class="header verbose">
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Consequatur impedit illo sequi amet quo pariatur ullam alias, corrupti fuga nam voluptas ducimus placeat a, assumenda eius blanditiis, repellat tempora hic!</p>
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Consequatur impedit illo sequi amet quo pariatur ullam alias, corrupti fuga nam voluptas ducimus placeat a, assumenda eius blanditiis, repellat tempora hic!</p>
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Consequatur impedit illo sequi amet quo pariatur ullam alias, corrupti fuga nam voluptas ducimus placeat a, assumenda eius blanditiis, repellat tempora hic!</p>
</div>
<div class="socials">
@@ -58,11 +69,11 @@
</div>
</div>
<div class="pane" id="projects">
<div class="pane projects" data-id="projects">
work in progress
</div>
<div class="pane" id="index">
<div class="pane index" data-id="index">
<div class="head">
<div class="description active">
<div class="title">Choose an app</div>
@@ -72,76 +83,13 @@
<div class="grid">
</div>
<script>
var apps = [
{
name: 'plex',
title: 'plex.mtps.pl',
content: "Plex Media Server. Serwer filmów, seriali, zdjęć i muzyki",
link: 'https://plex.mtps.pl/'
},
{
name: 'radio',
title: 'radio-rolnik.mtps.pl',
content: "Strona radia szkolnego Rolnika. Aktualna top lista utworów wybrana przez uczniów.",
link: 'https://radio-rolnik.mtps.pl/'
},
{
name: 'r',
title: 'r.mtps.pl',
content: "Serwer do skracania linków",
link: 'https://r.mtps.pl/'
},
{
name: 'send',
title: 'send.mtps.pl',
content: "Self hostowany serwer Firefox Send. Szyfrowany upload plików, z hasłem i datą wygaśnięcia",
link: 'https://send.mtps.pl/'
},
{
name: 'mc',
title: 'mc2.mtps.pl',
content: "Serwer Minecraft. Koronawirus, edycja nr 6.",
link: 'https://mc.mtps.pl/mc2/dynmap'
},
]
const head = document.querySelector('#index>.head'),
grid = document.querySelector('#index>.grid')
for(let app of apps){
let description = document.createElement('div'),
title = document.createElement('div'),
link = document.createElement('a'),
content = document.createElement('div'),
element = document.createElement('div'),
icon = document.createElement('i')
description.append(title, link, content)
element.append(app.name)
element.append(icon)
description.classList.add('description', app.name)
title.classList.add('title')
link.classList.add('link', 'icon-link-ext')
content.classList.add('content')
icon.classList.add('icon-link-ext')
link.setAttribute('href', app.link)
link.setAttribute('target', '_blank')
element.setAttribute('data-target', app.name)
element.setAttribute('data-link', app.link)
title.textContent = app.title
content.textContent = app.content
head.append(description)
grid.append(element)
}
</script>
<!-- generates application list -->
<script src="/apps.js"></script>
</div>
</div>
</div>
</body>
+56 -31
View File
@@ -1,89 +1,114 @@
const Panes = {
active: null,
scrollTimeout: null,
switch(target) {
if (target == this.active) return
this.active = target
document.querySelector('.button.active').classList.remove('active')
document.querySelector(`.button[data-target=${target}]`).classList.add('active')
},
scrollTo(target) {
clearTimeout(this.scrollTimeout)
document.querySelector(`#${target}`).scrollIntoView({
let targetPane = document.querySelector(`[data-id=${target}]`)
if (!targetPane) return
targetPane.scrollIntoView({
behavior: 'smooth'
})
Panes.switch(target)
}
}
window.onload = function () {
// nav buttons handler
document.querySelector('#nav').onclick = function (e) {
e.preventDefault()
document.querySelector('nav').onclick = function (e) {
let target = e.target.getAttribute('data-target')
if (target) {
Panes.scrollTo(target)
}
if (target) Panes.scrollTo(target)
}
// verbose about handler
document.querySelector('.about .arrow').onclick = function (e) {
let about = document.querySelector('.about')
about.classList.contains('verbose') ?
about.classList.remove('verbose') :
about.classList.add('verbose')
}
// index buttons handler
document.querySelector('#index>.grid').onclick = function (e) {
console.log(this, e.target)
document.querySelector('.pane.index>.grid').onclick = function (e) {
// if pane is already open, redirect to link
if (e.target.classList.contains('active')) {
window.open(e.target.getAttribute('data-link'))
return
}
if (this != e.target) {
let target = e.target.getAttribute('data-target'),
targetEl = document.querySelector(`.head>.description.${target}`),
activeGrid = document.querySelector('.grid>div.active')
let targetButton = e.target,
targetId = targetButton.getAttribute('data-target'), // target app id
targetDescription = document.querySelector(`.head>.description.${targetId}`), // target app description
currentButton = document.querySelector('.grid>div.active') // currently active app button
if (!targetEl) return
// description doesn't exist
if (!targetDescription) return
document.querySelector('.head>.description.active').classList.remove('active')
if (activeGrid) activeGrid.classList.remove('active')
targetEl.classList.add('active')
e.target.classList.add('active')
// deactivate previous
document.querySelector('.head>.description.active').classList.remove('active') // deactivate current description
if (currentButton) currentButton.classList.remove('active') // deactivate current app button
// activate new
targetDescription.classList.add('active')
targetButton.classList.add('active')
}
}
// scroll handler
document.querySelector('.wrapper').addEventListener('scroll', function (e) {
let x = this.scrollTop / window.innerHeight,
y = Math.floor(x + .5)
y = Math.floor(x + .5),
z = x % 1,
v = 1 - z
clearTimeout(Panes.scrollTimeout)
Panes.scrollTimeout = setTimeout(function () {
Panes.scrollTo(document.querySelector('.panes').children[y].id)
Panes.switch(document.querySelector('.panes').children[y].getAttribute('data-id'))
if (z < .2 || v < .2)
Panes.scrollTo(document.querySelector('.panes').children[y].getAttribute('data-id'))
}, 200)
});
// window.onhashchange = e => {
// e.preventDefault()
// console.log(e, location.hash)
// }
// hash check
if (location.hash) {
let target = location.hash.slice(1)
if (!document.querySelector(`#${target}`)) return
Panes.switch(target)
document.querySelector(`#${target}`).scrollIntoView()
window.scrollTo(0, 0) // prevent scroll jump
let target = location.hash.slice(1) // get target pane
Panes.scrollTo(target)
}
// initial typewriter animation
document.querySelectorAll('.typein').forEach(typein => {
var target = typein.getAttribute('data-content')
function print(index) {
typein.textContent += target[index]
if (target[index + 1]) {
function print(index = 0) {
typein.textContent += target[index] // add next char
if (target[index + 1]) { // if exists, shedule next char
setTimeout(function () {
print(index + 1)
}, 75)
}
}
print(0)
print() // start animation
})
}
+1 -1
View File
@@ -1,7 +1,7 @@
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
viewBox="0 0 1080 7680" style="enable-background:new 0 0 1080 7680;" xml:space="preserve">
<style type="text/css">
.st0{ fill: hsl(0 0% 16.5% / .5); }
.st0{ fill: hsl(60deg 1% 16%); }
</style>
<g>
<path class="st0" d="M180.9,162.7c56.4,56.4,105.1,66.8,148.1,75.9c41.4,8.8,77.2,16.4,123.2,62.4c46,46,53.6,81.7,62.4,123.2

Before

Width:  |  Height:  |  Size: 39 KiB

After

Width:  |  Height:  |  Size: 39 KiB

+1 -1
View File
@@ -1,7 +1,7 @@
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
viewBox="0 0 1080 7680" style="enable-background:new 0 0 1080 7680;" xml:space="preserve">
<style type="text/css">
.st1{ fill: hsl(120 1% 25% / .2); }
.st1{ fill: hsl(38 40% 25% / .2); }
</style>
<g>
<path class="st1"

Before

Width:  |  Height:  |  Size: 43 KiB

After

Width:  |  Height:  |  Size: 43 KiB

+108 -47
View File
@@ -3,23 +3,31 @@
--color-main: #f7b440;
}
@keyframes fadein {
from {
transform: scale(50);
}
to {
transform: scale(1);
}
}
body {
margin: 0px;
font-family: Roboto;
background-size: cover;
color: #fefefe;
background: #2c2c2b;
background: hsl(60deg 1% 18%);
overflow: hidden;
}
@keyframes blink-caret {
from, to { border-color: transparent }
50% { border-color: white; }
}
@keyframes typing {
from { width: 0 }
to { width: 27rem }
from, to {
border-color: transparent
}
50% {
border-color: white;
}
}
::-webkit-scrollbar {
@@ -80,6 +88,7 @@ body {
margin: auto;
box-sizing: border-box;
border-top: 1px solid #fefefe33;
scroll-margin: -1px;
}
.pane:first-child {
@@ -96,7 +105,7 @@ body {
width: 100%;
}
#nav {
nav {
margin: 1rem 2rem;
margin-top: 3rem;
user-select: none;
@@ -151,17 +160,80 @@ body {
/* about */
#about {
.pane.about {
text-align: center;
padding-left: 0;
padding-right: 0;
width: 100%;
display: flex;
align-items: center;
--offset: 0%;
}
.pane.about.verbose {
--offset: -100%;
}
.header {
margin-top: 21vh;
font-family: 'Courier New', Courier, monospace;
font-family: "Roboto Mono";
width: 100%;
position: absolute;
transition: margin ease-in-out .5s;
margin-bottom: 10%;
}
.header.main {
margin-left: var(--offset);
}
.arrow {
position: absolute;
right: 2em;
top: 0;
height: 100%;
width: 2em;
display: flex;
align-items: center;
justify-content: center;
cursor: pointer;
transition: right ease-in-out .5s;
}
.arrow:hover:after {
border-width: 4px;
}
.arrow:after {
content: '';
border-width: 3px;
border-color: var(--color-main);
border-radius: 2px;
border-style: none solid solid none;
width: 1em;
height: 1em;
transform: rotate(-45deg);
display: inline-block;
transition: transform ease-in-out .5s;
}
.about.verbose .arrow {
right: -4.2em;
z-index: 5;
}
.about.verbose .arrow:after {
transform: rotate(135deg);
}
.header.verbose {
width: 100%;
position: absolute;
margin-left: calc(100% + var(--offset));
box-sizing: border-box;
padding: 0 5em;
max-height: 65%;
overflow: auto;
}
.header>.big {
@@ -172,9 +244,7 @@ body {
display: inline-block;
padding-right: 5px;
border-right: 3px solid white;
animation:
blink-caret .75s step-end infinite;
animation: blink-caret .75s step-end infinite;
}
.header>.smol {
@@ -202,13 +272,13 @@ body {
font-size: 2rem;
}
.socials > a {
.socials>a {
color: inherit;
position: relative;
width: 100%;
}
.socials > a:before{
.socials>a:before {
content: "";
position: absolute;
z-index: -1;
@@ -224,18 +294,18 @@ body {
transition: width .2s, height .1s;
}
.socials > a:hover:before{
.socials>a:hover:before {
height: 100%;
width: 100%;
}
/* Index */
#index > .head {
.pane.index>.head {
font-family: 'Roboto Mono';
margin-bottom: 2rem;
height: 40%;
overflow: hidden;
/* overflow: hidden; */
position: relative;
}
@@ -251,19 +321,24 @@ body {
visibility: visible;
}
.description > .title {
.description>.title {
color: inherit;
text-decoration: none;
font-size: 2rem;
margin-bottom: 1rem;
display: inline-block;
}
.description > a.link {
color: inherit;
.description>.link {
color: transparent;
text-decoration: none;
margin-left: .5rem;
position: absolute;
left: -2.5em;
top: 1em;
}
.description > a.link:hover {
.description>.title:hover + .link {
color: var(--color-main);
}
@@ -276,7 +351,7 @@ body {
user-select: none;
}
.grid > div {
.grid>div {
width: calc(50% - 1rem);
font-weight: bold;
text-transform: uppercase;
@@ -290,86 +365,72 @@ body {
overflow-x: hidden;
}
.grid > div:nth-child(odd){
.grid>div:nth-child(odd) {
margin-right: .5rem;
}
.grid > div:nth-child(even){
.grid>div:nth-child(even) {
margin-left: .5rem;
}
.grid > div > i{
.grid>div>i {
float: right;
margin-right: -3rem;
transition: margin .2s;
pointer-events: none;
}
.grid > div:hover {
.grid>div:hover {
color: var(--color-main);
border-width: 0px 0px 1px 5px;
}
.grid > div.active {
.grid>div.active {
color: white;
border-width: 0px 0px 1px 1px;
background: var(--color-main);
}
.grid > div.active:hover {
.grid>div.active:hover {
border-width: 0px 0px 1px 5px;
}
.grid > div.active:hover > i {
.grid>div.active:hover>i {
margin-right: 0;
}
@media only screen and (max-width: 700px) {
/* navigation */
#butts {
display: flex;
width: 100%;
}
#butts>.button {
width: 100%;
}
.pane {
padding-top: 10rem;
padding-right: 0;
padding-left: 0;
}
/* about */
.header {
margin-top: 19vh;
}
.header>.big {
font-size: 9vw;
}
.header>.smol {
font-size: 5vw;
margin-top: 0.5rem;
}
.header>.smolest {
font-size: .8rem;
max-width: 75vw;
margin-top: 1.3rem;
}
/* index */
.description > .title {
.description>.title {
font-size: 1.5rem;
}
.description > .content {
.description>.content {
font-size: .9rem;
}
}