Added initial content on top of standard pages

This commit is contained in:
GeekOfWires 2025-07-15 13:19:34 -04:00
parent 612e564b31
commit 36d001c589
6 changed files with 100 additions and 29 deletions

View file

@ -3,13 +3,15 @@
<head>
<meta charset="UTF-8">
<title>Celebrating Christmas!</title>
<link type="text/css" rel="stylesheet" href="static/site.css" />
<link type="text/css" rel="stylesheet" href="static/css/site.css" />
<script src=" https://cdn.jsdelivr.net/npm/htmx.org/dist/htmx.min.js "></script>
<script src="https://cdn.jsdelivr.net/npm/@starfederation/datastar/dist/datastar.min.js" type="module"></script>
<script src="https://cdn.jsdelivr.net/npm/axios/dist/axios.min.js"></script>
<script src="https://unpkg.com/alpinejs" defer></script>
<script src="static/js/site.js" defer></script>
</head>
<body>
<div class="main">
<div class="body-content" id="body-content" hx-trigger="load delay:1s" hx-get="/pages/home.html" hx-swap="innerHTML">
<div class="body-content" id="body-content" hx-trigger="load" hx-get="/pages/home.html" hx-swap="innerHTML">
<p class="loading">Loading...</p>
</div>
</div>

View file

@ -1,24 +0,0 @@
{
"christmasQuotes": [
{
"quote": "You can mess with a lot of things, but you can't mess with kids on Christmas",
"attribution": "Kevin McCallister, \"Home Alone 2: Lost in New York\""
},
{
"quote": "I never thought it was such a bad little tree. Its not bad at all really. Maybe it just needs a little love.",
"attribution": "Charlie Brown, \"A Charlie Brown Christmas\""
},
{
"quote": "Christmas was on its way. Lovely, glorious, beautiful Christmas, upon, which the entire kid year revolved.",
"attribution": "Ralphie, \"A Christmas Story\""
},
{
"quote": "Just remember, the true spirit of Christmas lies in your heart.",
"attribution": "Santa, \"The Polar Express\""
},
{
"quote": "Seeing is believing, but sometimes the most real things in the world are the things we cant see.",
"attribution": "Conductor, \"The Polar Express\""
}
]
}

View file

@ -1,3 +1,10 @@
<p class="site-title">
Merry Christmas!
</p>
</p>
<div x-data="{ quoteSel: {}, quoteIndex: -1 }" x-init="quoteSel = (await quotesForPage.getRandomQuoteAsync())">
<blockquote x-text="quoteSel.quote">
</blockquote>
<p class="cited-source"><span x-text="quoteSel.attribution"></span>, <cite x-text="quoteSel.source"></cite></p>
<input type="hidden" x-model="quoteIndex" />
</div>

View file

@ -9,7 +9,7 @@ html {
margin: 0;
padding: 0;
background: #FF0000;
background: linear-gradient(180deg,rgba(255, 0, 0, 0.75) 0%, rgba(99, 2, 2, 1) 15%, rgba(2, 99, 2, 1) 85%, rgba(0, 255, 0, 0.75) 100%);
background: linear-gradient(180deg,rgba(75, 0, 0, 0.75) 0%, rgba(75, 2, 2, 1) 15%, rgba(2, 75, 2, 1) 85%, rgba(0, 75, 0, 0.75) 100%);
scroll-behavior: smooth;
}
@ -61,6 +61,36 @@ body {
text-shadow: 0 0 15px rgba(99, 2, 2, 1);
}
.cited-source {
margin: 32px 60px;
}
@media (max-width: 1000px) {
.main {
margin: auto;
width: 80vw;
height: 70vh;
background: rgba(255,255,255,.25);
padding: 6px;
border-radius: 5px;
box-shadow: 0 0 25px rgba(0,0,0,0.5);
overflow-y: auto;
}
}
@media (max-width: 700px) {
.main {
margin: auto;
width: 95vw;
height: 80vh;
background: rgba(255,255,255,.25);
padding: 6px;
border-radius: 5px;
box-shadow: 0 0 25px rgba(0,0,0,0.5);
overflow-y: auto;
}
}
/* ===== Scrollbar CSS ===== */
/* Firefox */
* {

12
static/js/site.js Normal file
View file

@ -0,0 +1,12 @@
const quotesForPage = {
getQuoteData: async function() {
return (await axios.get('/static/json/quotes.json')).data;
},
getRandomQuoteAsync: async function() {
let quotes = (await quotesForPage.getQuoteData()).christmasQuotes;
let indexChoice = Math.floor(Math.random() * quotes.length);
return quotes[indexChoice];
}
}

44
static/json/quotes.json Normal file
View file

@ -0,0 +1,44 @@
{
"christmasQuotes": [
{
"quote": "God bless us, everyone!",
"attribution": "Tiny Tim",
"source": "A Christmas Carol"
},
{
"quote": "You can mess with a lot of things, but you can't mess with kids on Christmas",
"attribution": "Kevin McCallister",
"source": "Home Alone 2: Lost in New York"
},
{
"quote": "I never thought it was such a bad little tree. Its not bad at all really. Maybe it just needs a little love.",
"attribution": "Charlie Brown",
"source": "A Charlie Brown Christmas"
},
{
"quote": "Christmas was on its way. Lovely, glorious, beautiful Christmas, upon, which the entire kid year revolved.",
"attribution": "Ralphie",
"source": "A Christmas Story"
},
{
"quote": "Just remember, the true spirit of Christmas lies in your heart.",
"attribution": "Santa",
"source": "The Polar Express"
},
{
"quote": "Seeing is believing, but sometimes the most real things in the world are the things we cant see.",
"attribution": "Conductor",
"source": "The Polar Express"
},
{
"quote": "You're skipping Christmas! Isn't that against the law?",
"attribution": "Spike Frohmeyer",
"source": "Christmas with the Kranks"
},
{
"quote": "Every time a bell rings, an angel gets his wings.",
"attribution": "Zuzu Bailey",
"source": "It's a Wonderful Life"
}
]
}