commissions/index.html

247 lines
9.0 KiB
HTML
Raw Normal View History

2021-10-12 05:32:13 +00:00
<!DOCTYPE html>
<html>
<head>
<link href="https://fonts.googleapis.com/css?family=Ubuntu&display=swap" rel="stylesheet" />
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<style>
body {
font-family: "Ubuntu", sans-serif;
}
a.G, a.R, a.X {
display: inline-block;
border: 2px solid transparent;
overflow: hidden;
}
img {
max-height: 200px;
max-width: 100%;
}
a.X {
border: 2px solid red;
}
a.X img {
filter: blur(1rem);
}
a.R {
border: 2px solid orange;
}
a.R img {
filter: blur(0.5rem);
}
a.X img:hover, a.R img:hover {
filter: blur(0);
}
main {
max-width: 1024px;
border: 1px solid #ccc;
margin: 0 auto;
padding: 0.5rem;
overflow: none;
text-align: center;
}
footer {
max-width: 1024px;
margin: 0 auto;
padding: 1rem 0;
font-size: 10pt;
text-align: right;
}
.modal {
display: none;
position: fixed;
top: 0;
left: 0;
bottom: 0;
width: 100%;
background-color: rgba(0, 0, 0, 0.8);
}
.modal .inner {
width: calc(100% - 2rem);
max-height: calc(100vh - 2rem);
max-width: 1024px;
position: relative;
overflow: scroll;
margin: 1rem auto;
padding: 0;
background-color: #fff;
}
.modal .meta {
padding: 1rem;
margin: 0 auto;
}
.show {
display: block !important;
}
.modal .img {
text-align: center;
width: 100%;
}
.modal .img img {
max-width: 100%;
max-height: 100vh;
}
dt {
font-weight: bold;
}
table {
margin: 0 auto;
min-width: 50%;
}
td {
padding: 5px;
}
tbody tr:nth-child(even) td {
background-color: #eee;
}
thead th {
border-bottom: 2px solid #888;
}
</style>
</head>
<body>
<main>
<h1>Commissions</h1>
<p><strong>
<a href="by-artist">By artist</a> |
<a href="by-character">By character</a> |
<a href="by-rating">By rating</a> (
<a href="by-rating/G">G</a> -
<a href="by-rating/R">R</a> -
<a href="by-rating/X">X</a>) |
<a href="by-song">By song</a> |
<a href="all.html">All images</a>
</strong></p>
2022-10-08 01:15:41 +00:00
<a href="os--pin--maddy-os--X.png" class="X">
<img src="thumbs/os--pin--maddy-os--X.png" title="pin" alt="pin" />
</a>
<a href="jd--cairns--dear-codrin--G.png" class="G">
<img src="thumbs/jd--cairns--dear-codrin--G.png" title="cairns" alt="cairns" />
</a>
2022-08-25 21:18:27 +00:00
<a href="bambolbi--lace--ephah--R.png" class="R">
<img src="thumbs/bambolbi--lace--ephah--R.png" title="lace" alt="lace" />
</a>
2022-06-25 01:12:45 +00:00
<a href="wanderlust--whoops--maddy-atokad--X.jpg" class="X">
<img src="thumbs/wanderlust--whoops--maddy-atokad--X.jpg" title="whoops" alt="whoops" />
</a>
2022-08-31 20:16:59 +00:00
<a href="irisjay--ps-covers--various--G.png" class="G">
<img src="thumbs/irisjay--ps-covers--various--G.png" title="ps-covers" alt="ps-covers" />
</a>
2022-05-04 19:47:50 +00:00
<a href="jd--writeskunk--slowhours--G.png" class="G">
<img src="thumbs/jd--writeskunk--slowhours--G.png" title="writeskunk" alt="writeskunk" />
</a>
2022-04-26 01:35:17 +00:00
<a href="bambolbi--doublefenn--ephah-kiku--X.jpg" class="X">
<img src="thumbs/bambolbi--doublefenn--ephah-kiku--X.jpg" title="doublefenn" alt="doublefenn" />
</a>
<a href="bambolbi--doublefenn--ephah-kiku--R.jpg" class="R">
<img src="thumbs/bambolbi--doublefenn--ephah-kiku--R.jpg" title="doublefenn" alt="doublefenn" />
</a>
2022-03-12 04:15:29 +00:00
<a href="lunegrimm--illumination-s--slowhours--G.png" class="G">
<img src="thumbs/lunegrimm--illumination-s--slowhours--G.png" title="illumination-s" alt="illumination-s" />
2022-03-12 04:12:06 +00:00
</a>
2022-02-23 01:14:17 +00:00
<a href="kitsooki--sticker-6--slowhours--G.png" class="G">
<img src="thumbs/kitsooki--sticker-6--slowhours--G.png" title="sticker-6" alt="sticker-6" />
2021-10-12 05:32:13 +00:00
</a>
</main>
<footer>
2022-10-08 01:15:41 +00:00
Site built using <a href="https://commorg.projects.makyo.io" target="_blank">commission organizer</a> on 2022-10-07.
2021-10-12 05:32:13 +00:00
</footer>
<div class="modal">
<div class="inner">
<div class="meta"></div>
<div class="img"></div>
</div>
</div>
<script type="text/javascript">
const root = window.location.pathname.replace(/\/by-.+$/, '/');
const modal = document.querySelector('.modal');
const img = document.querySelector('.img');
const meta = document.querySelector('.meta');
const scroll = {
top: window.scrollY,
left: window.scrollX,
behavior: 'auto'
};
let mustLoadHash = window.location.hash !== '';
function loadHash() {
if (!mustLoadHash) {
mustLoadHash = true;
return;
}
hash = window.location.hash.replace('#', '');
if (hash !== '') {
scroll.top = window.scrollY;
scroll.left = window.scrollX;
document.querySelectorAll('.G, .R, .X').forEach(thumb => {
if (thumb.attributes.href.textContent === hash) {
thumb.click();
}
});
} else {
hideModal();
window.scrollTo(scroll);
}
}
function hideModal() {
modal.classList.remove('show');
// There's an edge case here, where if you load the page with
// no hash, click an image, then click back, it adds an empty
// hash to the URL (e.g: example.com/#). The problem with this
// is that it adds to the history, so if you click back from
// there, it goes to the location without the hash, then adds
// the hash again, meaning you can't back out of the page
// after clicking an image.
//
// The web is a mess and computers were a mistake.
if (window.location.hash !== '') {
window.location.hash = '';
}
}
document.body.addEventListener('keydown', evt => {
if (evt.key === 'Escape') {
hideModal();
}
});
modal.addEventListener('click', evt => {
hideModal();
});
window.onhashchange = loadHash;
document.querySelectorAll('.G, .R, .X').forEach(thumb => {
thumb.addEventListener('click', evt => {
const imgName = thumb.attributes.href.textContent;
const parts = imgName.split('.')[0].split('--');
const title = parts[1].replace(/-/g, ' ');
const characters = parts[2].split('-').map(c => `<a href="${root}by-character/${c}">${c}</a>`).join(', ');
evt.preventDefault();
modal.classList.add('show');
mustLoadHash = true;
window.location.hash = imgName;
img.innerHTML = `<a href="${imgName}" target="_blank"><img src="${imgName}" title="${title}" alt="${title}" /></a>`;
meta.innerHTML = `<h2>${title}</h2>
<table>
<thead>
<tr>
<th>Artist</th>
<th>Characters</th>
<th>Rating</th>
</tr>
</thead>
<tbody>
<tr>
<td><a href="${root}by-artist/${parts[0]}">${parts[0]}</a></td>
<td>${characters}</td>
<td><a href="${root}by-rating/${parts[3]}">${parts[3]}</a></td>
</tr>
</tbody>
</table>`;
});
});
loadHash();
</script>
</body>
</html>