restincode/memorial.html
mauvehed 744b7426f2 chore: set prettier for pre-commit
chore: run pre-commit scans against all files and keep changes
chore: add CNAME, Gemfile and yaml/yml files to pre-commit exclude
2023-07-31 18:27:09 -05:00

225 lines
7.4 KiB
HTML

<!doctype html>
<html lang="en">
<head>
<title>Rest In Code - In Memory of</title>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta
name="author"
content="Connie \'Sunfire\' Hill and Rest In Code contributors"
/>
<link rel="stylesheet" href="style.css" />
<link
href="https://fonts.googleapis.com/css?family=Share+Tech+Mono&display=swap"
rel="stylesheet"
/>
<link rel="shortcut icon" type="image/x-icon" href="/images/favicon.png" />
<script
src="https://code.jquery.com/jquery-3.7.0.min.js"
integrity="sha256-2Pmvv0kuTBOenSvLm6bvfBSSHrUJ+3A7x6P5Ebd07/g="
crossorigin="anonymous"
></script>
<script>
$(function () {
// find out who it is based on link that sent us here
var person;
var params = new URLSearchParams(window.location.search);
if (params.get("name") != null) {
var name = params.get("name");
person = "/people/" + name + ".json";
} else {
person = "/people/person.json";
}
// pull the json data for that person
$.getJSON(person, function (data) {
var fullname = data.firstname + " " + data.lastname;
if (data.handle != "") {
fullname += " (" + data.handle + ")";
}
// insert basic data where appropriate
$("title").append(fullname);
$("#subtitle").append(fullname);
$("#memorial-name").append(fullname);
$(".birth").append(data.birth);
$(".death").append(data.death);
$(".issue").append(data.issue);
// is there an affiliations value?
if (data.affiliations == null || data.affiliations == "") {
$(".affiliations").append("None");
} else {
$(".affiliations").append(data.affiliations);
}
// is there an obituary value?
if (data.obituary == null || data.obituary == "") {
$(".obituary").append("");
} else {
$(".obituary").append(
'<a href="' + data.obituary + '"><b>Obituary</b></a>',
);
}
// is there an issue value?
if (data.issue == null || data.issue == "") {
data.issue =
"https://github.com/restincode/restincode/blob/master/CONTRIBUTING.md";
} else {
data.issue =
"https://github.com/restincode/restincode/issues/" + data.issue;
}
// is there a main image value?
if (data.mainimage == "") {
$(".memorial-main-image")
.attr("src", "/images/face-silhouette-clipart.png")
.attr("alt", "placeholder photo");
} else {
$(".memorial-main-image")
.attr("src", data.mainimage)
.attr("alt", "Main photo of " + fullname);
}
// is there a maintext value?
if (data.maintext == "") {
$("#memorial-text").append(
"<p>No information has been submitted for this person. Help us by submitting <a href='" +
data.issue +
"'>here.</a>",
);
} else {
$("#memorial-text").append(data.maintext);
}
``;
// check for and then build social media links list
if (data.socialmedialinks == "") {
$("#social-media").append(
"No social media links have been submitted for this person. Help us by submitting <a href='" +
data.issue +
"'>here.</a>",
);
} else {
for (s = 0; s < data.socialmedialinks.length; s++) {
var sitename = data.socialmedialinks[s]["sitename"];
var siteurl = data.socialmedialinks[s]["siteurl"];
var social =
'<a href="' + siteurl + '">' + sitename + "</a></br />";
$("#social-media").append(social);
}
}
// check for and then build contributions links list
if (data.contributions == "") {
$("#contributions-list").append(
"<li>No contributions have been submitted for this person. Help us by submitting <a href='" +
data.issue +
"'>here.</a>",
);
} else {
for (x = 0; x < data.contributions.length; x++) {
var title = data.contributions[x]["title"];
var url = data.contributions[x]["url"];
var text = data.contributions[x]["description"];
var cont;
// contributions don't have to have links
if (url == "") {
cont = "<li><b>" + title + "</b> - " + text + "</li>";
} else {
cont =
"<li><a href='" +
url +
"'>" +
title +
"</a> - " +
text +
"</li>";
}
$("#contributions-list").append(cont);
}
}
// check for and then build photo gallery
if (data.gallery == "") {
$("#nogallery").append(
"No images have been submitted for this person yet. Help us by submitting <a href='" +
data.issue +
"'>here.</a>",
);
} else {
for (i = 0; i < data.gallery.length; i++) {
var imgurl = data.gallery[i]["url"];
var imgtitle = data.gallery[i]["title"];
var caption = data.gallery[i]["caption"];
var image =
"<figure class='memorial-gallery'><img src='" +
imgurl +
"' alt='" +
imgtitle +
"'><figcaption>" +
caption +
"</figcaption>";
$("#gallery").append(image);
}
}
});
});
</script>
</head>
<body>
<header>
<h1 id="main-title">
RestInCode - <span id="subtitle">In Memory of </span>
</h1>
</header>
<div id="memorial-page">
<div>
<h2 id="memorial-name"></h2>
<aside>
<!-- Info at a glance -->
<p class="birth"><b>Born:</b></p>
<p class="death"><b>Died:</b></p>
<p class="affiliations"><b>Affiliations:</b><br /></p>
<p class="obituary"></p>
<!-- Links -->
<div id="social-media">
<h4>Social Media</h4>
</div>
</aside>
<p id="memorial-text">
<img src="#" alt="memorial image" class="memorial-main-image" />
<!-- summary, obituary, or main description -->
</p>
<hr />
<h3>Contributions</h3>
<ul id="contributions-list"></ul>
<hr />
<h3>Gallery</h3>
<div id="nogallery">
<div id="gallery"></div>
</div>
</div>
<footer>
<a href="index.html" class="btn-main-back">&lt;&lt; Back</a>
Content and Images, unless otherwise specified, &copy; Rest In Code ||
Website design by
<a
href="https://sunfire.hitsaru.com"
target="_blank"
rel="noopener noreferrer"
>Sunfire</a
>
2019
</footer>
</div>
</body>
</html>