From 3255a6830c41979d2f3a308d6f6882c5c3f87522 Mon Sep 17 00:00:00 2001 From: Syndamia Date: Sun, 20 Feb 2022 10:25:39 +0200 Subject: Replaced most of the index page html with markdown --- src/styles.css | 4 ---- 1 file changed, 4 deletions(-) (limited to 'src/styles.css') diff --git a/src/styles.css b/src/styles.css index c322f77..5ecf230 100644 --- a/src/styles.css +++ b/src/styles.css @@ -162,10 +162,6 @@ h2 + p img, h3 + p img, h4 + p img, h5 + p img, h6 + p img { } @media screen and (min-width: 610px) { - #index-page { - margin-bottom: 10px; - } - #index-contents { display: flex; align-items: center; -- cgit v1.3.1-26-gb76a From bc5188fc21a825f4849139cd9888b0476fd34a99 Mon Sep 17 00:00:00 2001 From: Syndamia Date: Sun, 20 Feb 2022 13:09:15 +0200 Subject: Implemented click to zoom on images --- src/_footer.html | 2 ++ src/scripts/image-show.js | 24 ++++++++++++++++++++++++ src/styles.css | 23 +++++++++++++++++++---- 3 files changed, 45 insertions(+), 4 deletions(-) create mode 100644 src/scripts/image-show.js (limited to 'src/styles.css') diff --git a/src/_footer.html b/src/_footer.html index 32da16f..b498d55 100644 --- a/src/_footer.html +++ b/src/_footer.html @@ -18,6 +18,8 @@ ssg by Roman Zolotarev lowdown by Kristaps Dzonsons + + diff --git a/src/scripts/image-show.js b/src/scripts/image-show.js new file mode 100644 index 0000000..1683107 --- /dev/null +++ b/src/scripts/image-show.js @@ -0,0 +1,24 @@ +let scrollPosition = 0; + +function clickToView() { + if (scrollPosition === 0) { + scrollPosition = window.scrollY; + window.scrollTo(0, 0); + } + + this.classList.toggle('clicked-image'); + document.body.classList.toggle('body-on-clicked-image'); + + if (this.className.length === 0) { + window.scrollTo(0, scrollPosition); + scrollPosition = 0; + } +} + +const images = document.getElementsByTagName('img'); + +for (const image of images) { + if (image.alt !== '🔗') { + image.onclick = clickToView; + } +} diff --git a/src/styles.css b/src/styles.css index 5ecf230..abe7006 100644 --- a/src/styles.css +++ b/src/styles.css @@ -58,10 +58,6 @@ img { image-rendering: crisp-edges; } -img:hover { - image-rendering: pixelated; -} - img, hr { border: 1px solid black; } @@ -360,6 +356,25 @@ code span { color: #afaf00; } +/* Script specific styling */ + +.clicked-image { + position: absolute; + width: 100vw; + height: 100vh; + max-width: none !important; + max-height: none !important; + border: none; + object-fit: contain; + left: 0; + top: 0; + padding: 1em; +} + +.body-on-clicked-image { + overflow: hidden; +} + /* OpenSans font */ @font-face { -- cgit v1.3.1-26-gb76a From 6aad9721fdd39bf138c1655a0d0488ee1f8d6cb6 Mon Sep 17 00:00:00 2001 From: Syndamia Date: Sun, 20 Feb 2022 13:25:30 +0200 Subject: Updated mundus article texture rendering to pixelated --- src/blog/mundus-first-shot-at-gamedev/timeline.md | 4 ++-- src/styles.css | 4 ++++ 2 files changed, 6 insertions(+), 2 deletions(-) (limited to 'src/styles.css') diff --git a/src/blog/mundus-first-shot-at-gamedev/timeline.md b/src/blog/mundus-first-shot-at-gamedev/timeline.md index 3ade67c..41c4b5b 100644 --- a/src/blog/mundus-first-shot-at-gamedev/timeline.md +++ b/src/blog/mundus-first-shot-at-gamedev/timeline.md @@ -30,7 +30,7 @@ Finally, it was time to plan the actual game. So far I have only done preparation but on this day, I started actual programming. The UI and most of the mechanics were completely sketched. -Around a week later I also drew the first proper textures for the game world: a [tile of grass](https://gitlab.com/Syndamia/IT-kariera/-/blob/a100f71372496ba89e26fedc520edcefd2442848/Year%202/Software%20development/Mundus/Mundus/Icons/Land/Ground/grass.png) ![](./img/grass-tile.png) and a [tile of grass with a boulder on top](https://gitlab.com/Syndamia/IT-kariera/-/blob/a100f71372496ba89e26fedc520edcefd2442848/Year%202/Software%20development/Mundus/Mundus/Icons/Land/Ground/boulder.png) ![](./img/boulder-tile.png). These replaced the [grass](https://gitlab.com/Syndamia/IT-kariera/-/blob/7b2c8cbc1d6adb874ca6a41f2871ea1950866d70/Year%202/Software%20development/Project/Mundus/Mundus/Views/Icons/Land/Ground/grass.jpg) ![](./img/placeholder-grass-tile.jpg) and [rock](https://gitlab.com/Syndamia/IT-kariera/-/blob/7b2c8cbc1d6adb874ca6a41f2871ea1950866d70/Year%202/Software%20development/Project/Mundus/Mundus/Views/Icons/Land/Ground/rock.jpg) ![](./img/placeholder-rock-tile.jpg) placeholder textures I made on the 29th. +Around a week later I also drew the first proper textures for the game world: a [tile of grass](https://gitlab.com/Syndamia/IT-kariera/-/blob/a100f71372496ba89e26fedc520edcefd2442848/Year%202/Software%20development/Mundus/Mundus/Icons/Land/Ground/grass.png) and a [tile of grass with a boulder on top](https://gitlab.com/Syndamia/IT-kariera/-/blob/a100f71372496ba89e26fedc520edcefd2442848/Year%202/Software%20development/Mundus/Mundus/Icons/Land/Ground/boulder.png) . These replaced the [grass](https://gitlab.com/Syndamia/IT-kariera/-/blob/7b2c8cbc1d6adb874ca6a41f2871ea1950866d70/Year%202/Software%20development/Project/Mundus/Mundus/Views/Icons/Land/Ground/grass.jpg) and [rock](https://gitlab.com/Syndamia/IT-kariera/-/blob/7b2c8cbc1d6adb874ca6a41f2871ea1950866d70/Year%202/Software%20development/Project/Mundus/Mundus/Views/Icons/Land/Ground/rock.jpg) placeholder textures I made on the 29th. Concerning the temporary textures, I just drew them in half an hour in GIMP, so I could test out some of the code. @@ -40,7 +40,7 @@ The proper textures, I believe, turned out fairly well, given that I've never be Slowly and steadily I had been making fine progress, but a lot of issues started to surface. As it turns out, I hadn't thought everything completely through, so I mostly went back to the drawing board. -But at the very least, I had some important systems in place, like breaking and placing stuff, proper movement through the map and using items. Also, I had drawn my favorite texture from the whole projects: [the tree](https://gitlab.com/Syndamia/Mundus/-/blob/c47a34847e52ef76361394dba2c4f524a56d1b92/Mundus/Icons/Land/Items/tree.png) ![](./img/tree-tile.png). +But at the very least, I had some important systems in place, like breaking and placing stuff, proper movement through the map and using items. Also, I had drawn my favorite texture from the whole projects: [the tree](https://gitlab.com/Syndamia/Mundus/-/blob/c47a34847e52ef76361394dba2c4f524a56d1b92/Mundus/Icons/Land/Items/tree.png) . > ***06.04.2020*** Day 58 diff --git a/src/styles.css b/src/styles.css index abe7006..e99096c 100644 --- a/src/styles.css +++ b/src/styles.css @@ -58,6 +58,10 @@ img { image-rendering: crisp-edges; } +.pixelated-render { + image-rendering: pixelated; +} + img, hr { border: 1px solid black; } -- cgit v1.3.1-26-gb76a From d4b9e3ed8d6b3a8d5e57c1eee09d1c5cde8c5981 Mon Sep 17 00:00:00 2001 From: Syndamia Date: Sun, 20 Feb 2022 13:47:48 +0200 Subject: Added info about click to zoom on regarding-js page --- src/regarding-js.md | 1 + src/styles.css | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) (limited to 'src/styles.css') diff --git a/src/regarding-js.md b/src/regarding-js.md index 3f250dc..e21de62 100644 --- a/src/regarding-js.md +++ b/src/regarding-js.md @@ -12,3 +12,4 @@ To keep everything transparent, all pages on [Web Apps]() will require JavaScrip |Description|GitLab source|Website source| |---|---|---| +|Click to zoom on images|[Link](https://gitlab.com/Syndamia/syndamiadotcom/-/tree/master/src/scripts/image-show.js)|[Link](/scripts/image-show.js) diff --git a/src/styles.css b/src/styles.css index e99096c..7024177 100644 --- a/src/styles.css +++ b/src/styles.css @@ -241,7 +241,7 @@ article > table td:first-child { width: 60%; } -article > table td:nth-child(2) { +article > table td:nth-child(n+2) { line-height: 1.1em; padding: 0.3em; padding-top: 0.2em; -- cgit v1.3.1-26-gb76a