diff --git a/org/header.html b/org/header.html index 268626e..c1a5f95 100644 --- a/org/header.html +++ b/org/header.html @@ -2,9 +2,9 @@ home - - - + + Random quote! Don't shoot the messenger ;) + wanderer diff --git a/org/index.org b/org/index.org index c0156c7..e377503 100644 --- a/org/index.org +++ b/org/index.org @@ -19,4 +19,8 @@ - *email*: [[mailto:me@fragal.eu][me (at) fragal.eu]] - *XMPP*: me (at) chat.fragal.eu + +#+BEGIN_EXPORT html +#+END_EXPORT + #+INCLUDE: "./footer.html" export html diff --git a/site/css/stylesheet.css b/site/css/stylesheet.css index 1563cc9..9a9ffcd 100644 --- a/site/css/stylesheet.css +++ b/site/css/stylesheet.css @@ -129,6 +129,43 @@ color: purple; } +/* Random quote JS class */ +.output a { + font-size: 16px; + font-style: italic; + text-align: center; + color: grey; +} + +/* Tooltip container */ +.tooltip { + position: relative; + display: inline-block; + border-bottom: 1px dotted black; /* Add dots under the hoverable text */ + cursor: pointer; +} + +/* Tooltip text */ +.tooltiptext { + font-size: 16px; + visibility: hidden; /* Hidden by default */ + width: 130px; + background-color: black; + color: #f6f1ec; + text-align: center; + padding: 5px 0; + border-radius: 6px; + position: absolute; + z-index: 1; /* Ensure tooltip is displayed above content */ + top: -5px; + left: 105%; +} + +/* Show the tooltip text on hover */ +.tooltip:hover .tooltiptext { + visibility: visible; +} + /* TOP BAR */ header { padding:1rem; @@ -144,13 +181,6 @@ color: #f6f1ec; } -.output a { - font-style: italic; - text-align: center; - justify-content: space-between; - color: grey; -} - header nav { display: flex; align-items: center; diff --git a/site/js/randomQuote.js b/site/js/randomQuote.js index e1693e1..739fd24 100644 --- a/site/js/randomQuote.js +++ b/site/js/randomQuote.js @@ -3,24 +3,25 @@ {"quote":"La vita necesita más café y menos estrés", "author": "Café Maguana" }, {"quote":"Sta rottura de cojoni dei fascisti", "author": "Ivano Ceccarelli" }, {"quote":"It never gets easier, you just go faster", "author": "Velominati" }, - {"quote":"Respect the earth; don’t litter", "author": "Common Sense™"}, - {"quote":"Impara, Fai, Insegna", "author":"Ciclofficina Ciclostile" }, + {"quote":"Respect the earth; don’t litter", "author": "common sense™"}, + {"quote":"Lo vedi, lo fai, lo insegni", "author":"Ciclofficina Ruotalibera" }, {"quote":"Never lift your bike over your head", "author": "Velominati"}, {"quote":"Padre Pio amico degli sbirri", "author": "Heavy Merda" }, {"quote":"Come un serpente indotto a camminare", "author": "Attrito"}, - {"quote":"Fight for your right to party", "author": ""} + {"quote":"Fight for your right to party", "author": ""}, + {"quote":"No hagas planes en Cuba", "author": "el Gato"} ]; -function random(arrayLength) +function random(l) { - return Math.floor(Math.random() * arrayLength); // Math.random() returns a random number between 0 (inclusive), and 1 (exclusive). + return Math.floor(Math.random() * l); } function generateRandomQuote() { - var randomNumber = random(arr.length); // 0 to 14 - document.getElementById("quote").innerHTML = arr[randomNumber].quote; - document.getElementById("author").innerHTML = "" + "[" + arr[randomNumber].author + "]" + var n = random(arr.length); + var author = arr[n].author ? (" - " + arr[n].author) : ""; + document.getElementById("quote").innerHTML = arr[n].quote + author; } generateRandomQuote();