Removed alembic poem and github references

This commit is contained in:
Mattia Mascarello 2024-08-20 22:03:06 +02:00
parent d00fa2e8b4
commit 25501f07a7
2 changed files with 7 additions and 95 deletions

View File

@ -209,84 +209,38 @@
<caption>Web Resources</caption>
<tbody>
<tr>
<td>Github</td>
<td><a href="https://github.com/MatMasIt" aria-label="GitHub Profile of MatMasIt">MatMasIt</a></td>
</tr>
<tr>
<td>"Stazione Meteorologica Permanente del Liceo Scientifico Statale Leonardo Cocito"</td>
<td><a href="https://liceococito.edu.it/meteo" aria-label="Home of the Cocito Weather Station">Home</a></td>
</tr>
<tr>
<td>Open Source Cocito Weather Station</td>
<td><a href="http://github.com/StazioneMeteoCocito/"
aria-label="GitHub Repositories for Cocito Weather Station">Repos</a></td>
<td>Gitea</td>
<td><a href="https://gitea.mattiaturin.duckdns.org" aria-label="Gitea profile">My gitea stash</a></td>
</tr>
</tbody>
</table>
<br>
<table>
<caption>Top Listed Projects</caption>
<caption>Selected Listed Projects</caption>
<tbody>
<tr>
<td>BiblioTau <em>(Work in Progress)</em></td>
<td>Library Management System</td>
</tr>
<tr>
<td><a href="https://github.com/MatMasIt/Alembic" aria-label="Alembic - My Poetry in English">Alembic</a>
<td><a href="https://gitea.mattiaturin.duckdns.org/mattia/Alembic" aria-label="Alembic - My Poetry in English">Alembic</a>
</td>
<td>My Poetry in English</td>
</tr>
<tr>
<td><a href="https://github.com/MatMasIt/epg-it"
aria-label="epg-it - Italian TV Electronic Program Guide">epg-it</a></td>
<td>Italian tv electronic program guide archival repo</td>
</tr>
<tr>
<td><a href="https://github.com/MatMasIt/notesArchive"
aria-label="notesArchive - My School Notes Organized">notesArchive</a></td>
<td>My school notes organized</td>
</tr>
<tr>
<td><a href="https://github.com/MatMasIt/fantaProf"
aria-label="fantaProf - The Classic Italian Professor Blaming Game">fantaProf</a></td>
<td>The classic italian professor blaming game</td>
</tr>
<tr>
<td><a href="https://github.com/MatMasIt/dante-lang"
aria-label="dante-lang - The Dante Programming Language">dante-lang</a></td>
<td>The Dante Programming Language</td>
</tr>
<tr>
<td><a href="https://github.com/MatMasIt/costLatex"
<td><a href="https://gitea.mattiaturin.duckdns.org/mattia/costLatex"
aria-label="costLatex - Italian Constitution in LaTeX">costLatex</a></td>
<td>Italian Constitution in <span class="latex">L<span>a</span>T<span>e</span>X</span></td>
</tr>
<tr>
<td><a href="https://github.com/MatMasIt/costGit"
<td><a href="https://gitea.mattiaturin.duckdns.org/mattia/costGit"
aria-label="costGit - Amendments to the Italian Constitution as Git Commits">costGit</a></td>
<td>Amendments to the italian constitution as git commits</td>
</tr>
<tr>
<td><a href="https://github.com/MatMasIt/SocialCreditScoreGame"
aria-label="SocialCreditScoreGame - A Video Game to Praise Chinese Social Credit System">SocialCreditScoreGame</a>
</td>
<td>A videogame to eloquently praise the most perfect chinese social credit system</td>
</tr>
<tr>
<td><a href="https://github.com/MatMasIt/mordApp"
<td><a href="https://gitea.mattiaturin.duckdns.org/mattia/mordApp"
aria-label="mordApp - Mordecai Food Ordering System">mordApp</a></td>
<td>Mordecai Food Ordering System</td>
</tr>
</tbody>
</table>
<article id="poemOfTheDay">
<h3>My <i>poem of the day</i>, n. <span id="poemn"></span>, from <a target="_blank"
href="https://github.com/MatMasIt/Alembic" aria-label="Alembic - Collection of Poems"><i>Alembic</i></a>
</h3>
<h2 id="poemTitle" aria-live="polite">(loading)</h2>
<p id="poemText" aria-live="polite">...</p>
</article>
<br>
<div class="centered-container">
<img src="images/Gadsden_flag.svg" alt="Liberty above all"><br>
@ -343,7 +297,6 @@
document.getElementById("noScript").style.display = "none";
</script>
</div>
<script src="poemOfTheDay.js"></script>
<script src="script.js"></script>
</body>

View File

@ -1,41 +0,0 @@
function getDayOfTheYear() {
var now = new Date();
var start = new Date(now.getFullYear(), 0, 0);
var diff = now - start;
var oneDay = 1000 * 60 * 60 * 24;
return Math.floor(diff / oneDay);
}
function replaceAll(string, search, replace) {
return string.split(search).join(replace);
}
function getPoemOfTheDayIndex(npoems) {
return getDayOfTheYear() % npoems;
}
function cleanText(text) {
let te = "";
let i = 0;
let t = text.split("\\begin{Verse}").forEach(element => { // there may be multiple pages of verses
if (i == 0) { i++; return; } // skip title
te += element.split("\\end")[0];
});
te = replaceAll(te, "\\\\", "<br />");
te = replaceAll(te, "\\", "<br />");
return te;
}
function setPoemOfTheDay() {
fetch('https://raw.githubusercontent.com/MatMasIt/Alembic/main/Alembic.tex')
.then((response) => response.text())
.then((data) => {
let parts = data.split("\\chapter{");
let n = getPoemOfTheDayIndex(parts.length - 1); // ignore header, data[0]
let part = parts[n + 1];
let title = part.split("}")[0];
let text = cleanText(part);
document.getElementById("poemn").innerText = n + 1;
document.getElementById("poemTitle").innerText = title;
document.getElementById("poemText").innerHTML = text;
});
}