diff --git a/manuscript/views.py b/manuscript/views.py index 65cc62c..bc68f25 100644 --- a/manuscript/views.py +++ b/manuscript/views.py @@ -1,3 +1,5 @@ +from html import unescape + from django.http import HttpRequest from django.shortcuts import render from django.urls import reverse @@ -16,6 +18,8 @@ def about(request: HttpRequest): def stanzas(request: HttpRequest): stanzas = Stanza.objects.all().order_by("stanza_line_code_starts") + for stanza in stanzas: + stanza.stanza_text = unescape(stanza.stanza_text) return render(request, "stanzas.html", {"stanzas": stanzas}) diff --git a/static/css/custom.css b/static/css/custom.css new file mode 100644 index 0000000..b85da73 --- /dev/null +++ b/static/css/custom.css @@ -0,0 +1,25 @@ +.prose span div { + display: inline; +} + +[data-notation] { + background-color: #ffffcc; + cursor: help; + border: 1px solid black; + padding: 0 0.2em; +} +.shadow-left { + box-shadow: -8px 0 10px -6px rgba(0, 0, 0, 0.2); +} +/* +[data-notation]:hover::before { + content: attr(data-notation); + position: absolute; + background: #ffffcc; + padding: 5px; + border: 1px solid #000; + border-radius: 5px; + margin-top: 30px; + font-size: 0.8em; + z-index: 10; +} */ diff --git a/static/js/stanza.js b/static/js/stanza.js new file mode 100644 index 0000000..6025a72 --- /dev/null +++ b/static/js/stanza.js @@ -0,0 +1,25 @@ +// Get the sidebar, close button, and notation text elements +var sidebar = document.getElementById("sidebar"); +var closeButton = document.getElementById("close-button"); +var notationText = document.getElementById("notation-text"); + +// Listen for click events on the document +document.addEventListener("click", function (event) { + // If the clicked element has a data-notation attribute + if (event.target.hasAttribute("data-notation")) { + // Get the data-notation text + var text = event.target.getAttribute("data-notation"); + + // Update the notation text + notationText.textContent = text; + + // Show the sidebar + sidebar.style.transform = "translateX(0)"; + } +}); + +// Add a click event listener to the close button +closeButton.addEventListener("click", function () { + // Hide the sidebar + sidebar.style.transform = "translateX(100%)"; +}); diff --git a/templates/base.html b/templates/base.html index d0fa922..911b43d 100644 --- a/templates/base.html +++ b/templates/base.html @@ -5,80 +5,318 @@
-The La Sfera Project encompasses a number of different scholarly efforts exploring the Florentine merchant Gregorio Dati's treatise La sfera (The Globe), written sometime around 1430. It began with the #lasferachallenge
, the social-media brainchild of Laura Morreale and Ben Albritton, in 2020, but has since expanded in multiple scholarly directions.