isn't it crazy that i got to the end of making this button and then someone said "oh you know the browser back button saves anchor history already right?"

This commit is contained in:
Juicysteak117
2025-10-26 17:25:28 -07:00
parent 67204fbb95
commit 396a50830f
6 changed files with 632 additions and 537 deletions

View File

@@ -3,8 +3,8 @@
<head>
<meta content="text/html; charset=utf-8" http-equiv="content-type"/>
<title>A PRACTICAL GUIDE TO FEMINIZING HRT</title>
<!--Generated on Sat Oct 25 16:16:51 2025 by LaTeXML (version 0.8.8) http://dlmf.nist.gov/LaTeXML/.-->
<!--Document created on October 25, 2025.-->
<!--Generated on Sun Oct 26 17:12:37 2025 by LaTeXML (version 0.8.8) http://dlmf.nist.gov/LaTeXML/.-->
<!--Document created on October 26, 2025.-->
<link href="LaTeXML.css" rel="stylesheet" type="text/css"/>
<link href="ltx-article.css" rel="stylesheet" type="text/css"/>
<meta content="width=device-width, initial-scale=1, shrink-to-fit=no" name="viewport"/>
@@ -17,7 +17,7 @@
<link href="pghrtcss.css" rel="stylesheet" type="text/css"/>
<script defer="true" src="pghrtjs.js" type="text/javascript"></script>
</head>
<body><div id="snackbar">Link Copied!</div><div class="togglebuttons"><button id="theme-toggle"></button><button id="font-toggle">Aa</button></div><div class="header"><button id="menu" onclick="document.getElementById('sidebar').classList.toggle('show')"></button></div><nav class="ltx_TOC ltx_list_toc ltx_toc_toc" id="sidebar"><h6 class="ltx_title ltx_title_contents">Contents</h6>
<body><div id="snackbar">Link Copied!</div><div id="return" title="Return to previous position"></div><div class="togglebuttons"><button id="theme-toggle"></button><button id="font-toggle">Aa</button></div><div class="header"><button id="menu" onclick="document.getElementById('sidebar').classList.toggle('show')"></button></div><nav class="ltx_TOC ltx_list_toc ltx_toc_toc" id="sidebar"><h6 class="ltx_title ltx_title_contents">Contents</h6>
<ol class="ltx_toclist">
<li class="ltx_tocentry ltx_tocentry_section"><a class="ltx_ref" href="#S0" title="In A PRACTICAL GUIDE TO FEMINIZING HRT"><span class="ltx_text ltx_ref_title"><span class="ltx_tag ltx_tag_ref">0 </span>FOREWORD</span></a></li>
<li class="ltx_tocentry ltx_tocentry_section"><a class="ltx_ref" href="#Sx1" title="In A PRACTICAL GUIDE TO FEMINIZING HRT"><span class="ltx_text ltx_ref_title">DEDICATION</span></a></li>
@@ -322,7 +322,7 @@
<span class="ltx_personname"><a class="ltx_ref ltx_href" href="https://katea.gay/" title="">Katie Tightpussy</a>
</span></span>
</div>
<div class="ltx_dates">(October 25, 2025)</div>
<div class="ltx_dates">(October 26, 2025)</div>
<div class="ltx_abstract">
<h6 class="ltx_title ltx_title_abstract">DISCLAIMER</h6>
<p class="ltx_p">I am not a doctor. I do not work in medicine. I am not a medical professional in any capacity. I am a layperson offering lay opinions based on the extent of my own education and experiences. All information and assertions below should be treated accordingly as mere opinion rather than statement of fact or medical advice. This guide prioritizes community moral truth where scientific research falters. Basically, dont get mad at me.</p>
@@ -2736,7 +2736,7 @@
<p class="ltx_p"><a class="ltx_ref ltx_href" href="https://github.com/Juicysteak117/pghrt/" title="">Source code available here on GitHub.</a></p>
</div>
<div class="ltx_para ltx_noindent" id="Sx6.p2">
<p class="ltx_p">Full Compilation Datetime: <span class="undefined">Sat Oct 25 16:16:51 2025</span></p>
<p class="ltx_p">Full Compilation Datetime: <span class="undefined">Sun Oct 26 17:12:37 2025</span></p>
</div>
<div class="ltx_para ltx_noindent" id="Sx6.p3">
<p class="ltx_p">(There arent LaTeXML bindings for <span class="ltx_text ltx_font_typewriter">datetime2</span>, <span class="ltx_text ltx_font_typewriter">hanging</span>, or <span class="ltx_text ltx_font_typewriter">hyphenat</span>, so the formatting is slightly ugly. If youd really like to help me out, please write those bindings!!!)</p>
@@ -2826,7 +2826,7 @@
</article>
</div>
<footer class="ltx_page_footer">
<div class="ltx_page_logo">Generated on Sat Oct 25 16:16:51 2025 by <a class="ltx_LaTeXML_logo" href="http://dlmf.nist.gov/LaTeXML/"><span style="letter-spacing:-0.2em; margin-right:0.1em;">L<span class="ltx_font_smallcaps" style="position:relative; bottom:2.2pt;">a</span>T<span class="ltx_font_smallcaps" style="font-size:120%;position:relative; bottom:-0.2ex;">e</span></span><span style="font-size:90%; position:relative; bottom:-0.2ex;">XML</span><img alt="Mascot Sammy" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAsAAAAOCAYAAAD5YeaVAAAAAXNSR0IArs4c6QAAAAZiS0dEAP8A/wD/oL2nkwAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAd0SU1FB9wKExQZLWTEaOUAAAAddEVYdENvbW1lbnQAQ3JlYXRlZCB3aXRoIFRoZSBHSU1Q72QlbgAAAdpJREFUKM9tkL+L2nAARz9fPZNCKFapUn8kyI0e4iRHSR1Kb8ng0lJw6FYHFwv2LwhOpcWxTjeUunYqOmqd6hEoRDhtDWdA8ApRYsSUCDHNt5ul13vz4w0vWCgUnnEc975arX6ORqN3VqtVZbfbTQC4uEHANM3jSqXymFI6yWazP2KxWAXAL9zCUa1Wy2tXVxheKA9YNoR8Pt+aTqe4FVVVvz05O6MBhqUIBGk8Hn8HAOVy+T+XLJfLS4ZhTiRJgqIoVBRFIoric47jPnmeB1mW/9rr9ZpSSn3Lsmir1fJZlqWlUonKsvwWwD8ymc/nXwVBeLjf7xEKhdBut9Hr9WgmkyGEkJwsy5eHG5vN5g0AKIoCAEgkEkin0wQAfN9/cXPdheu6P33fBwB4ngcAcByHJpPJl+fn54mD3Gg0NrquXxeLRQAAwzAYj8cwTZPwPH9/sVg8PXweDAauqqr2cDjEer1GJBLBZDJBs9mE4zjwfZ85lAGg2+06hmGgXq+j3+/DsixYlgVN03a9Xu8jgCNCyIegIAgx13Vfd7vdu+FweG8YRkjXdWy329+dTgeSJD3ieZ7RNO0VAXAPwDEAO5VKndi2fWrb9jWl9Esul6PZbDY9Go1OZ7PZ9z/lyuD3OozU2wAAAABJRU5ErkJggg=="/></a>
<div class="ltx_page_logo">Generated on Sun Oct 26 17:12:37 2025 by <a class="ltx_LaTeXML_logo" href="http://dlmf.nist.gov/LaTeXML/"><span style="letter-spacing:-0.2em; margin-right:0.1em;">L<span class="ltx_font_smallcaps" style="position:relative; bottom:2.2pt;">a</span>T<span class="ltx_font_smallcaps" style="font-size:120%;position:relative; bottom:-0.2ex;">e</span></span><span style="font-size:90%; position:relative; bottom:-0.2ex;">XML</span><img alt="Mascot Sammy" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAsAAAAOCAYAAAD5YeaVAAAAAXNSR0IArs4c6QAAAAZiS0dEAP8A/wD/oL2nkwAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAd0SU1FB9wKExQZLWTEaOUAAAAddEVYdENvbW1lbnQAQ3JlYXRlZCB3aXRoIFRoZSBHSU1Q72QlbgAAAdpJREFUKM9tkL+L2nAARz9fPZNCKFapUn8kyI0e4iRHSR1Kb8ng0lJw6FYHFwv2LwhOpcWxTjeUunYqOmqd6hEoRDhtDWdA8ApRYsSUCDHNt5ul13vz4w0vWCgUnnEc975arX6ORqN3VqtVZbfbTQC4uEHANM3jSqXymFI6yWazP2KxWAXAL9zCUa1Wy2tXVxheKA9YNoR8Pt+aTqe4FVVVvz05O6MBhqUIBGk8Hn8HAOVy+T+XLJfLS4ZhTiRJgqIoVBRFIoric47jPnmeB1mW/9rr9ZpSSn3Lsmir1fJZlqWlUonKsvwWwD8ymc/nXwVBeLjf7xEKhdBut9Hr9WgmkyGEkJwsy5eHG5vN5g0AKIoCAEgkEkin0wQAfN9/cXPdheu6P33fBwB4ngcAcByHJpPJl+fn54mD3Gg0NrquXxeLRQAAwzAYj8cwTZPwPH9/sVg8PXweDAauqqr2cDjEer1GJBLBZDJBs9mE4zjwfZ85lAGg2+06hmGgXq+j3+/DsixYlgVN03a9Xu8jgCNCyIegIAgx13Vfd7vdu+FweG8YRkjXdWy329+dTgeSJD3ieZ7RNO0VAXAPwDEAO5VKndi2fWrb9jWl9Esul6PZbDY9Go1OZ7PZ9z/lyuD3OozU2wAAAABJRU5ErkJggg=="/></a>
</div></footer>
</div>
</body>

File diff suppressed because it is too large Load Diff

View File

@@ -175,50 +175,82 @@ ol[class="ltx_toclist ltx_toclist_section"]{
content: "" !important;
}
/* return to ref button ⮌ */
#return.show:after {
content: "⮌";
display: block;
}
/* return to ref button ⮌ */
#return:after {
content: "🡱";
display: block;
top: 40px;
position: relative;
}
#return {
position: fixed;
bottom: 5vh;
left: calc(55% + 400px);
width: 80px;
height: 80px;
font-size: 70px;
color: var(--font-bold);
line-height: 0;
padding: 0;
border-radius: 0;
border: 2px solid var(--toc-accent);
background: var(--toc-bg);
cursor: pointer;
text-align: center;
font-family: 'crm';
}
/* i'm just copying this shit from w3schools ngl */
#snackbar {
visibility: hidden;
min-width: 250px;
margin-left: -125px;
background-color: var(--snackbar-bg);
color: var(--snackbar-color);
text-align: center;
border-radius: 2px;
padding: 16px;
position: fixed;
z-index: 1;
left: 50%;
bottom: 30px;
font-size: 17px;
visibility: hidden;
min-width: 250px;
margin-left: -125px;
background-color: var(--snackbar-bg);
color: var(--snackbar-color);
text-align: center;
border-radius: 2px;
padding: 16px;
position: fixed;
z-index: 1;
left: 50%;
bottom: 30px;
font-size: 17px;
}
#snackbar.show {
visibility: visible;
-webkit-animation: fadein 0.5s, fadeout 0.5s 2.5s;
animation: fadein 0.5s, fadeout 0.5s 2.5s;
visibility: visible;
-webkit-animation: fadein 0.5s, fadeout 0.5s 2.5s;
animation: fadein 0.5s, fadeout 0.5s 2.5s;
}
/* styling the toggle buttons, which yes i know this is cursed */
#theme-toggle, #font-toggle {
position: fixed;
top: 0;
right: 0;
width: 80px;
height: 80px;
font-size: 80px;
color: var(--font-bold);
line-height: 0;
padding-bottom: 9px;
border-radius: 0;
border: 2px solid var(--toc-accent);
background: var(--toc-bg);
cursor: pointer;
position: fixed;
top: 0;
right: 0;
width: 80px;
height: 80px;
font-size: 80px;
color: var(--font-bold);
line-height: 0;
padding-bottom: 9px;
border-radius: 0;
border: 2px solid var(--toc-accent);
background: var(--toc-bg);
cursor: pointer;
}
#theme-toggle:hover, #font-toggle:hover {
background: var(--toc-hover);
background: var(--toc-hover);
}
/* BELIEVE ME, i know this is cursed. YOU try having a generated html output that you're adding amendments to with sloppy code injection! AND also clearly defined content layout requirements based on the project requirements. i don't need to over engineer this, okay!? */
@@ -263,13 +295,16 @@ ol[class="ltx_toclist ltx_toclist_section"]{
#font-toggle {top: calc(2 * var(--mobile-button)); }
.ltx_tocentry.ltx_tocentry_section > .ltx_ref:after { margin-right: 20px; }
:target::before { margin-top: -5vh; height: 5vh; }
#return {left: calc(95% - 50px) !important; height: 50px; width: 50px; font-size: 50px; }
#return:after { top: 25px; }
}
@media screen AND (max-width:500px) {
.ltx_eqn_table {font-size: 15px; }
}
/* hack for the return button to not cut off the screen until mobile crossover */
@media screen AND (max-width:1200px) {
#return {left: calc(55% + 350px); }
}

View File

@@ -5,12 +5,13 @@ function initTocOnClick() {
var i;
for (i = 0; i < coll.length; i++) {
coll[i].addEventListener("click", function () {
coll[i].addEventListener("click", function (event) {
this.classList.toggle("active");
var content = this.nextElementSibling;
if (content) {
if (content.style.maxHeight) {
content.style.maxHeight = null;
event.preventDefault(); // don't jump when closing
} else {
content.style.maxHeight = content.scrollHeight + "px";
}
@@ -33,6 +34,8 @@ function copyURI(evt) {
// clipboard write failed
});
// toast that i ripped from w3schools. does not nicely handle being spam clicked. w/e
// OKAY understanding more later. why is this replace and not remove? so ugly wow...
// you're telling me that chatgpt and copilot were trained on obtuse garbage like this!?
var x = document.getElementById("snackbar");
x.className = "show";
setTimeout(function(){ x.className = x.className.replace("show", ""); }, 2000);
@@ -105,9 +108,57 @@ function initFontToggle() {
});
}
// saving the scroll position for clicking references or toc
function saveScroll() {
var coll = document.querySelectorAll(".ltx_ref");
var i;
for (i = 0; i < coll.length; i++) {
coll[i].addEventListener("click", function () {
document.getElementById("return").classList.add("show"); // only fires once
pos = window.scrollY;
scrollArray = JSON.parse(sessionStorage.getItem('scrollPos'));
scrollArray.unshift(pos);
sessionStorage.setItem('scrollPos', JSON.stringify(scrollArray));
});
}
}
// it returns. positions stored in array then will jump back
function returnScroll() {
document.getElementById("return").addEventListener("click", function () {
scrollArray = JSON.parse(sessionStorage.getItem('scrollPos'));
// check if saved, otherwise goto top and remove back arrow
if (scrollArray.length > 1) {
pos = scrollArray.shift();
sessionStorage.setItem('scrollPos', JSON.stringify(scrollArray));
window.scroll(0, Number(pos));
}
else if (scrollArray.length == 1) {
this.classList.remove("show");
pos = scrollArray.shift();
sessionStorage.setItem('scrollPos', JSON.stringify(scrollArray));
window.scroll(0, Number(pos));
// scroll top
}
else {
this.classList.remove("show");
window.scroll(0, 0);
// scroll top
}
});
}
// run da functions
initTocOnClick();
detectColorScheme();
detectFont();
initThemeToggle();
initFontToggle();
initFontToggle();
saveScroll();
returnScroll();
// init scoll pos array storage (should this be done elsehow?)
sessionStorage.setItem('scrollPos', JSON.stringify([]));

View File

@@ -20,8 +20,8 @@
}
% TO-DO
% add in an a5 pdf version
% add a return to ref button
% decide how to showcase translations + translation notes
% add auto loc func for available loc when setting up loc
\usepackage{graphicx}
\graphicspath{ {./img/} }

11
soup.py
View File

@@ -48,8 +48,15 @@ toast = soup.new_tag (
string="Link Copied!"
)
# Prepend header and toc into body
soup.body.insert(0, toast, toggles, header, toc)
# add return to ref button
ref = soup.new_tag (
"div",
id="return",
title="Return to previous position"
)
# prepend bottom with all the silly stuff i add
soup.body.insert(0, toast, ref, toggles, header, toc)
# Add header info tags
# i don't know if there's a better way to do all of these in a batch but like eh w/e