Skip to content

Commit

Permalink
Some fixes and code clean up :3 (#1)
Browse files Browse the repository at this point in the history
* Make buttons links

Unsure why the details-approach was taken initially when it would've been more intuitive to just make the button itself a link.

* Refactor the gallery :3

* Refactor the index :3

Slight language tweak too.

* Add blurb about icons to the leading paragraph

* Add Ampflower to attributions.html

Almost left without a word,
  • Loading branch information
Ampflower authored Dec 18, 2024
1 parent 38b8efb commit 9690100
Show file tree
Hide file tree
Showing 6 changed files with 108 additions and 95 deletions.
78 changes: 36 additions & 42 deletions attributions.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,63 +14,57 @@ <h1>Attributions</h1>
<h2>KTrain5369</h2>
<p>One of the main mantainers of the Notessential website, and creator of this gallery.</p>
<div class="social-buttons">
<button onclick="toggleSocials('ktrain-bsky')">Bluesky</button>
<button onclick="toggleSocials('ktrain-github')">GitHub</button>
<button onclick="toggleSocials('ktrain-website')">Website</button>
</div>
<div class="social-info" id="ktrain-bsky">
<p>Bluesky: <a href="https://bsky.app/profile/ktrain5369.bsky.social" target="_blank">https://bsky.app/profile/ktrain5369.bsky.social</a></p>
</div>
<div class="social-info" id="ktrain-github">
<p>GitHub: <a href="https://github.com/KTrain5169" target="_blank">https://github.com/KTrain5169</a></p>
</div>
<div class="social-info" id="ktrain-website">
<p>Website: <a href="https://ktrain5169.github.io/" target="_blank">https://ktrain5169.github.io/</a></p>
<a href="https://bsky.app/profile/ktrain5369.bsky.social" target="_blank">
<button>Bluesky</button>
</a>
<a href="https://github.com/KTrain5169" target="_blank">
<button>GitHub</button>
</a>
<a href="https://ktrain5169.github.io/" target="_blank">
<button>Website</button>
</a>
</div>
</div>


<div class="contributor">
<h2>blryface</h2>
<p>The creator of Notessential and one of the Vital owners.</p>
<div class="social-buttons">
<button onclick="toggleSocials('blryface-github')">GitHub</button>
<button onclick="toggleSocials('blryface-website')">Website</button>
<button onclick="toggleSocials('pridecraft-website')">Pridecraft</button>
</div>
<div class="social-info" id="blryface-github">
<p>GitHub: <a href="https://github.com/maskersss" target="_blank">https://github.com/maskersss</a></p>
</div>
<div class="social-info" id="blryface-website">
<p>Website: <a href="https://blurry.gay/" target="_blank">https://blurry.gay/</a></p>
</div>
<div class="social-info" id="pridecraft-website">
<p>Pridecraft: <a href="https://pridecraft.gay/" target="_blank">https://pridecraft.gay/</a></p> <!-- see this, ThinkSeal? -->
<a href="https://github.com/blryface" target="_blank">
<button>GitHub</button>
</a>
<a href="https://blurry.gay/" target="_blank">
<button>Website</button>
</a>
<a href="https://pridecraft.gay/" target="_blank">
<button>Pridecraft</button>
</a>
</div>
</div>

<div class="contributor">
<h2>maskers</h2>
<div class="social-buttons">
<button onclick="toggleSocials('maskers-github')">GitHub</button>
</div>
<div class="social-info" id="maskers-github">
<p>GitHub: <a href="https://github.com/maskersss" target="_blank">https://github.com/maskersss</a></p>
<a href="https://github.com/maskersss" target="_blank">
<button>GitHub</button>
</a>
</div>
</div>

<!-- Add more attributions similarly -->

<script>
// Function to toggle visibility of the social info boxes
function toggleSocials(id) {
var element = document.getElementById(id);
if (element.style.display === "none" || element.style.display === "") {
element.style.display = "block";
} else {
element.style.display = "none";
}
}
</script>
<div class="contributor">
<h2>Ampflower</h2>
<p><i>comes out of nowhere, fixes the site, almost leaves without a word</i></p>
<div class="social-buttons">
<a href="https://ampflower.gay" target="_blank">
<button>Website</button>
</a>
<a href="https://bsky.app/profile/ampflower.gay" target="_blank">
<button>Bluesky</button>
</a>
<a href="https://github.com/Ampflower" target="_blank">
<button>GitHub</button>
</a>
</div>
</div>
</body>
</html>
59 changes: 22 additions & 37 deletions crashes.html
Original file line number Diff line number Diff line change
@@ -1,80 +1,65 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Crashes | Notessential Gallery</title> <!-- Titles shouldn't be so huge -->
<link rel="stylesheet" type="text/css" href="./css/gallery.css">
</head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Crashes | Notessential Gallery</title> <!-- Titles shouldn't be so huge -->
<script src="./js/gallery.js" defer></script>
<link rel="stylesheet" type="text/css" href="./css/gallery.css">
</head>
<body>
<b>Gallery: Crashes and other issues where essential was confirmed to be the problems' source</b>
<div class="gallery">
<figure>
<img src="./images/crashes/image1.png" alt="Crash/issue image 1" onclick="openModal(this.src)">
<img src="./images/crashes/image1.png" alt="Crash/issue image 1">
<figcaption>Provided by KTrain5369</figcaption>
</figure>
<figure>
<img src="./images/crashes/image2.png" alt="Crash/issue image 2" onclick="openModal(this.src)">
<img src="./images/crashes/image2.png" alt="Crash/issue image 2">
<figcaption>Provided by KTrain5369</figcaption>
</figure>
<figure>
<img src="./images/crashes/image3.png" alt="Crash/issue image 3" onclick="openModal(this.src)">
<img src="./images/crashes/image3.png" alt="Crash/issue image 3">
<figcaption>Provided by KTrain5369</figcaption>
</figure>
<figure>
<img src="./images/crashes/image4.png" alt="Crash/issue image 4" onclick="openModal(this.src,)">
<img src="./images/crashes/image4.png" alt="Crash/issue image 4">
<figcaption>Provided by KTrain5369</figcaption>
</figure>
<figure>
<img src="./images/crashes/image5.png" alt="Crash/issue image 5" onclick="openModal(this.src)">
<img src="./images/crashes/image5.png" alt="Crash/issue image 5">
<figcaption>Provided by KTrain5369</figcaption>
</figure>
<figure>
<img src="./images/crashes/image6.png" alt="Crash/issue image 6" onclick="openModal(this.src)">
<img src="./images/crashes/image6.png" alt="Crash/issue image 6">
<figcaption>Provided by KTrain5369</figcaption>
</figure>
<figure>
<img src="./images/crashes/image7.png" alt="Crash/issue image 7" onclick="openModal(this.src)">
<img src="./images/crashes/image7.png" alt="Crash/issue image 7">
<figcaption>Provided by KTrain5369</figcaption>
</figure>
<figure>
<img src="./images/crashes/image8.png" alt="Crash/issue image 8" onclick="openModal(this.src)">
<img src="./images/crashes/image8.png" alt="Crash/issue image 8">
<figcaption>Provided by KTrain5369</figcaption>
</figure>
<figure>
<img src="./images/crashes/image9.png" alt="Crash/issue image 9" onclick="openModal(this.src)">
<img src="./images/crashes/image9.png" alt="Crash/issue image 9">
<figcaption>Provided by KTrain5369</figcaption>
</figure>
<figure>
<img src="./images/crashes/image10.png" alt="Crash/issue image 10" onclick="openModal(this.src)">
<img src="./images/crashes/image10.png" alt="Crash/issue image 10">
<figcaption>Provided by maskers</figcaption>
</figure>
<figure>
<img src="./images/crashes/image11.png" alt="Crash/issue image 11" onclick="openModal(this.src)">
<img src="./images/crashes/image11.png" alt="Crash/issue image 11">
<figcaption>Provided by ???</figcaption>
</figure>
</div>

<div id="imgModal" class="modal" onclick="closeModal()">
<span class="modal-close">&times;</span>
<img id="modalImage">
</div>

<script>
// Function to open the modal and pass the image and caption
function openModal(imgSrc, captionText) {
const modal = document.getElementById("imgModal");
const modalImg = document.getElementById("modalImage");
const modalCaption = document.getElementById("modalCaption");
modal.style.display = "flex";
modalImg.src = imgSrc;
modalCaption.innerText = captionText;
}

// Function to close the modal
function closeModal() {
document.getElementById("imgModal").style.display = "none";
}
</script>
<div id="imgModal" class="modal">
<span class="modal-close">&times;</span>
<img src="about:blank" id="modalImage"/>
<span id="modalCaption"></span>
</div>
</body>
</html>
6 changes: 5 additions & 1 deletion css/gallery.css
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ b {
padding: 5px;
box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
transition: transform 0.2s ease-in-out;
cursor: pointer;
}

.gallery img:hover {
Expand All @@ -49,7 +50,10 @@ b {

/* Modal background */
.modal {
display: none; /* Hidden by default */
visibility: hidden; /* Hidden by default */
display: flex;
flex-flow: column;
gap: 12px;
position: fixed;
z-index: 100; /* On top of other content */
left: 0;
Expand Down
11 changes: 7 additions & 4 deletions css/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,12 @@ a:hover {
ul {
list-style: none;
padding: 0;
margin: 20px 0;
}

/* Style the list items */
ul li {
background-color: #282828;
border-radius: 5px;
padding: 10px;
margin: 10px 0;
transition: background-color 0.3s ease;
}

Expand All @@ -54,7 +51,9 @@ ul li:hover {
}

ul li a { /* u ii a i u iii a i */
color: white; /* Match the text color of the li */
color: inherit; /* Inherits the colour from li */
display: block; /* Ensures that padding actually works */
padding: 10px;
}

ul li a:hover {
Expand All @@ -75,3 +74,7 @@ html, body {
br {
margin-bottom: 10px;
}

h1,h2,h3 {
margin-bottom: 0.25em;
}
21 changes: 10 additions & 11 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,15 @@
<link rel="stylesheet" type="text/css" href="./css/index.css"> <!-- Link to the CSS file --> <!-- <-- does that really need to be commented here -->
</head>
<body>
<b> The Notessential Gallery </b>
<br>
This is where some images used in Notessential, or to prove the site is trustworthy are stored.
<br>
Current galleries:
<br>
<ul>
<li><a href="./crashes.html">Images showing Essential causes a fair bit of issues</a></li>
</ul>
<br>
<a href="./attributions.html">Thank you to these people for helping populate the gallery.</a>
<h1>The Notessential Gallery</h1>
<p>This is where some images used in Notessential, both for icons and to prove the site is trustworthy, are
stored.</p>
<h2>Current galleries:</h2>
<ul>
<li><a href="./crashes.html">Images showing Essential causes a fair bit of issues</a></li>
</ul>
<p>
<a href="./attributions.html">Thank you to these people for helping populate the gallery.</a>
</p>
</body>
</html>
28 changes: 28 additions & 0 deletions js/gallery.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
'use strict';

const imgModal = document.getElementById("imgModal");

// Function to open the modal and pass the image and caption
function openModal(imgSrc, captionText) {
const modalImg = document.getElementById("modalImage");
const modalCaption = document.getElementById("modalCaption");
imgModal.style.visibility = "visible";
modalImg.src = imgSrc;
modalCaption.innerText = captionText;
}

// Function to close the modal
function closeModal() {
imgModal.style.visibility = null;
}

function galleryClick(event) {
const caption = event.target.parentNode.getElementsByTagName("figcaption")[0];
openModal(event.target.src, caption.innerText);
}

for(const img of document.querySelectorAll(".gallery img")) {
img.addEventListener("click", galleryClick);
}

imgModal.addEventListener("click", closeModal);

0 comments on commit 9690100

Please sign in to comment.