From 683aaf37fd02c6dfa864abe2be5a9d670cc9d442 Mon Sep 17 00:00:00 2001 From: BTCforPlebs Date: Thu, 25 Sep 2025 11:30:27 -0400 Subject: [PATCH] nice update --- .DS_Store | Bin 10244 -> 8196 bytes .gitignore | 1 + public/assets/js/scripts.js | 115 +++++++++++++++++----------------- public/index.html | 12 ++-- public/learn-nostr/index.html | 18 ++++-- 5 files changed, 81 insertions(+), 65 deletions(-) diff --git a/.DS_Store b/.DS_Store index 2e122abb806bf3a178b5d8cf26e0dae9699cdae4..7d6b81d28b90129ca08ceb8bd85d13e9683963e4 100644 GIT binary patch delta 106 zcmZn(XmOBWU|?W$DortDU;r^WfEYvza8E20o2aMA$gweCH$NlCWF7&B&0!K7*(Ww| v2{Ho}0D%NIkZ=X5-B|dYc{0CBAO|DF1cu4+JX0sX5uCDlwrmd5#0GW%@@N%| delta 1360 zcmeH`OH30{6o&5)Dl-`fw@|S>nzj-}rI9zWk|4HVG=fxUMeuDqls~6yu-lWuy&HU_x$JFbMDP|a%S3Q!Y)Dx zf)i35Azo&3?6-EBznCalJm^Ega`;^#3e0@kcC?HHNrZ&RFwsepgo#RIA`*io^lexQ zNioYy&Jcx2%+iS=P8xAh)kRkHjVaSal`E5JtUcuSHZ{~|{oYKVzSi$;Y;MeEd2VNA zO-s+r4BHuWw{!FpchS1JGiIc^xv83ERsmaOB z4D(WPIeg~T;(7in`9^+_pX8V6aF&Le(2Ni|(S=hOzz`%1V+1NDkj4});~H+_7G^Pr zMcl)EJj5d`;RRk|8E^3(AMnu}cSf7G)Yg^H&i&xsf+xzz$Wvy#$Tdy#EcD!(tF)}# zw_EVg?F^JH_f|2vgF&)owcq2RIjlFftgZ71G?$U**K?cvOkzU>4hsU^#(H4KTHQ>N z4G|2nG8Rydt0csHUK}yMm$;&S2BsBl3{E>b7@RPA(2EEzU=T5g43!EEaU_sL23btw zI&Lsf^H{)b+`(N2>jA^HgeQ24XIQ~1UYq^98n!lf>E5KK>e>h!0IZy#ukswZ%w(Te rU`vNJ;>(HOxn^O-X=jc-`1`Cdo0wW_H{%rx=3}Slf201jQG5OZn-?!7 diff --git a/.gitignore b/.gitignore index 1bb6247..39501e1 100644 --- a/.gitignore +++ b/.gitignore @@ -60,3 +60,4 @@ BTCforPlebs Website Videos/Learn-Bitcoin/4.0_Price.html BTCforPlebs Website Videos/Learn-Bitcoin/btcforplebs_opening_video (1080p).html BTCforPlebs Website Videos/Learn-Bitcoin/btcforplebs_opening_video (1080p).mp4 BTCforPlebs Website Videos/Learn-Bitcoin/btcforplebs_opening_video (1080p).txt +.DS_Store diff --git a/public/assets/js/scripts.js b/public/assets/js/scripts.js index 7b82de9..e9a7a58 100644 --- a/public/assets/js/scripts.js +++ b/public/assets/js/scripts.js @@ -1,31 +1,31 @@ // Folder Toggle Function -function toggleFolder(folderId, buttonId) { +document.addEventListener('DOMContentLoaded', () => { + function toggleFolder(folderId, buttonId) { const folder = document.getElementById(folderId); const button = document.getElementById(buttonId); // Close other folders and deactivate buttons document.querySelectorAll('.links').forEach(link => { - if (link.id !== folderId) { - link.style.display = 'none'; - } + if (link.id !== folderId) { + link.style.display = 'none'; + } }); document.querySelectorAll('.button').forEach(btn => { - if (btn.id !== buttonId) { - btn.classList.remove('active'); - } + if (btn.id !== buttonId) { + btn.classList.remove('active'); + } }); // Toggle the selected folder if (folder.style.display === 'block') { - folder.style.display = 'none'; - button.classList.remove('active'); + folder.style.display = 'none'; + button.classList.remove('active'); } else { - folder.style.display = 'block'; - button.classList.add('active'); + folder.style.display = 'block'; + button.classList.add('active'); } } -// Section Navigation Function function navigateToSection(select) { const sectionId = select.value; if (sectionId) { @@ -33,70 +33,73 @@ function navigateToSection(select) { } } -// Function to prefetch a URL -function prefetch(url) { + // Function to prefetch a URL + function prefetch(url) { const link = document.createElement('link'); link.rel = 'prefetch'; link.href = url; document.head.appendChild(link); } -// Add event listeners to your links -const links = document.querySelectorAll('a.prefetch'); + // Add event listeners to your links + const links = document.querySelectorAll('a.prefetch'); links.forEach(link => { link.addEventListener('mouseenter', () => { - const url = link.href; // Get the link URL - prefetch(url); // Call prefetch function + const url = link.href; // Get the link URL + prefetch(url); // Call prefetch function }); }); -// Footer Loader and Event Listeners -fetch('/parts/footer.html') + // Footer Loader and Event Listeners + fetch('/parts/footer.html') .then(response => response.text()) .then(data => { document.getElementById('footer').innerHTML = data; - // Attach event listeners after footer is loaded - const onChainButton = document.getElementById('onChainButton'); - const lightningButton = document.getElementById('lightningButton'); - const qrCodes = document.getElementById('qrCodes'); - const onChainQRCode = document.getElementById('onChainQRCode'); - const lightningQRCode = document.getElementById('lightningQRCode'); + // Attach event listeners after footer is loaded + const onChainButton = document.getElementById('onChainButton'); + const lightningButton = document.getElementById('lightningButton'); + const qrCodes = document.getElementById('qrCodes'); + const onChainQRCode = document.getElementById('onChainQRCode'); + const lightningQRCode = document.getElementById('lightningQRCode'); - // Initially hide the QR codes section - qrCodes.style.display = 'none'; + // Initially hide the QR codes section + qrCodes.style.display = 'none'; - onChainButton.addEventListener('click', function () { - // Toggle visibility of On-Chain QR Code - const isOnChainVisible = onChainQRCode.style.display === 'block'; - qrCodes.style.display = 'block'; // Show QR codes section - onChainQRCode.style.display = isOnChainVisible ? 'none' : 'block'; // Toggle On-Chain - lightningQRCode.style.display = 'none'; // Hide Lightning QR code - }); + onChainButton.addEventListener('click', function () { + // Toggle visibility of On-Chain QR Code + const isOnChainVisible = onChainQRCode.style.display === 'block'; + qrCodes.style.display = 'block'; // Show QR codes section + onChainQRCode.style.display = isOnChainVisible ? 'none' : 'block'; // Toggle On-Chain + lightningQRCode.style.display = 'none'; // Hide Lightning QR code + }); - lightningButton.addEventListener('click', function () { - // Toggle visibility of Lightning QR Code - const isLightningVisible = lightningQRCode.style.display === 'block'; - qrCodes.style.display = 'block'; // Show QR codes section - lightningQRCode.style.display = isLightningVisible ? 'none' : 'block'; // Toggle Lightning - onChainQRCode.style.display = 'none'; // Hide On-Chain QR code - }); + lightningButton.addEventListener('click', function () { + // Toggle visibility of Lightning QR Code + const isLightningVisible = lightningQRCode.style.display === 'block'; + qrCodes.style.display = 'block'; // Show QR codes section + lightningQRCode.style.display = isLightningVisible ? 'none' : 'block'; // Toggle Lightning + onChainQRCode.style.display = 'none'; // Hide On-Chain QR code + }); }) .catch(error => console.error('Error loading footer:', error)); - // Fetch the latest commit information from GitHub - fetch('https://api.github.com/repos/btcforplebs/BTCforPlebs.com/commits/main') - .then(response => response.json()) - .then(data => { - const lastUpdate = new Date(data.commit.author.date); // Commit date - const formattedDate = lastUpdate.toLocaleDateString(); - const formattedTime = lastUpdate.toLocaleTimeString([], { hour: '2-digit', minute: '2-digit' }); + fetch('https://api.github.com/repos/btcforplebs/BTCforPlebs.com/commits/main') + .then(response => response.json()) + .then(data => { + const lastUpdate = new Date(data.commit.author.date); // Commit date + const formattedDate = lastUpdate.toLocaleDateString(); + const formattedTime = lastUpdate.toLocaleTimeString([], { hour: '2-digit', minute: '2-digit' }); + + // Update the text content of the last-updated-text element + document.getElementById('last-updated-text').textContent = `Website last updated: ${formattedDate} ${formattedTime}`; + }) + .catch(error => { + console.error('Error fetching last update:', error); + document.getElementById('last-updated-text').textContent = 'Last update: Error fetching data.'; + }); + + +}); - // Update the text content of the last-updated-text element - document.getElementById('last-updated-text').textContent = `Website last updated: ${formattedDate} ${formattedTime}`; - }) - .catch(error => { - console.error('Error fetching last update:', error); - document.getElementById('last-updated-text').textContent = 'Last update: Error fetching data.'; - }); \ No newline at end of file diff --git a/public/index.html b/public/index.html index ed8286a..fc62531 100644 --- a/public/index.html +++ b/public/index.html @@ -41,14 +41,18 @@ + + + + - \ No newline at end of file + +