nice update

This commit is contained in:
2025-09-25 11:30:27 -04:00
parent a28e973040
commit 683aaf37fd
5 changed files with 81 additions and 65 deletions

BIN
.DS_Store vendored

Binary file not shown.

1
.gitignore vendored
View File

@@ -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).html
BTCforPlebs Website Videos/Learn-Bitcoin/btcforplebs_opening_video (1080p).mp4 BTCforPlebs Website Videos/Learn-Bitcoin/btcforplebs_opening_video (1080p).mp4
BTCforPlebs Website Videos/Learn-Bitcoin/btcforplebs_opening_video (1080p).txt BTCforPlebs Website Videos/Learn-Bitcoin/btcforplebs_opening_video (1080p).txt
.DS_Store

View File

@@ -1,31 +1,31 @@
// Folder Toggle Function // Folder Toggle Function
function toggleFolder(folderId, buttonId) { document.addEventListener('DOMContentLoaded', () => {
function toggleFolder(folderId, buttonId) {
const folder = document.getElementById(folderId); const folder = document.getElementById(folderId);
const button = document.getElementById(buttonId); const button = document.getElementById(buttonId);
// Close other folders and deactivate buttons // Close other folders and deactivate buttons
document.querySelectorAll('.links').forEach(link => { document.querySelectorAll('.links').forEach(link => {
if (link.id !== folderId) { if (link.id !== folderId) {
link.style.display = 'none'; link.style.display = 'none';
} }
}); });
document.querySelectorAll('.button').forEach(btn => { document.querySelectorAll('.button').forEach(btn => {
if (btn.id !== buttonId) { if (btn.id !== buttonId) {
btn.classList.remove('active'); btn.classList.remove('active');
} }
}); });
// Toggle the selected folder // Toggle the selected folder
if (folder.style.display === 'block') { if (folder.style.display === 'block') {
folder.style.display = 'none'; folder.style.display = 'none';
button.classList.remove('active'); button.classList.remove('active');
} else { } else {
folder.style.display = 'block'; folder.style.display = 'block';
button.classList.add('active'); button.classList.add('active');
} }
} }
// Section Navigation Function
function navigateToSection(select) { function navigateToSection(select) {
const sectionId = select.value; const sectionId = select.value;
if (sectionId) { if (sectionId) {
@@ -33,70 +33,73 @@ function navigateToSection(select) {
} }
} }
// Function to prefetch a URL // Function to prefetch a URL
function prefetch(url) { function prefetch(url) {
const link = document.createElement('link'); const link = document.createElement('link');
link.rel = 'prefetch'; link.rel = 'prefetch';
link.href = url; link.href = url;
document.head.appendChild(link); document.head.appendChild(link);
} }
// Add event listeners to your links // Add event listeners to your links
const links = document.querySelectorAll('a.prefetch'); const links = document.querySelectorAll('a.prefetch');
links.forEach(link => { links.forEach(link => {
link.addEventListener('mouseenter', () => { link.addEventListener('mouseenter', () => {
const url = link.href; // Get the link URL const url = link.href; // Get the link URL
prefetch(url); // Call prefetch function prefetch(url); // Call prefetch function
}); });
}); });
// Footer Loader and Event Listeners // Footer Loader and Event Listeners
fetch('/parts/footer.html') fetch('/parts/footer.html')
.then(response => response.text()) .then(response => response.text())
.then(data => { .then(data => {
document.getElementById('footer').innerHTML = data; document.getElementById('footer').innerHTML = data;
// Attach event listeners after footer is loaded // Attach event listeners after footer is loaded
const onChainButton = document.getElementById('onChainButton'); const onChainButton = document.getElementById('onChainButton');
const lightningButton = document.getElementById('lightningButton'); const lightningButton = document.getElementById('lightningButton');
const qrCodes = document.getElementById('qrCodes'); const qrCodes = document.getElementById('qrCodes');
const onChainQRCode = document.getElementById('onChainQRCode'); const onChainQRCode = document.getElementById('onChainQRCode');
const lightningQRCode = document.getElementById('lightningQRCode'); const lightningQRCode = document.getElementById('lightningQRCode');
// Initially hide the QR codes section // Initially hide the QR codes section
qrCodes.style.display = 'none'; qrCodes.style.display = 'none';
onChainButton.addEventListener('click', function () { onChainButton.addEventListener('click', function () {
// Toggle visibility of On-Chain QR Code // Toggle visibility of On-Chain QR Code
const isOnChainVisible = onChainQRCode.style.display === 'block'; const isOnChainVisible = onChainQRCode.style.display === 'block';
qrCodes.style.display = 'block'; // Show QR codes section qrCodes.style.display = 'block'; // Show QR codes section
onChainQRCode.style.display = isOnChainVisible ? 'none' : 'block'; // Toggle On-Chain onChainQRCode.style.display = isOnChainVisible ? 'none' : 'block'; // Toggle On-Chain
lightningQRCode.style.display = 'none'; // Hide Lightning QR code lightningQRCode.style.display = 'none'; // Hide Lightning QR code
}); });
lightningButton.addEventListener('click', function () { lightningButton.addEventListener('click', function () {
// Toggle visibility of Lightning QR Code // Toggle visibility of Lightning QR Code
const isLightningVisible = lightningQRCode.style.display === 'block'; const isLightningVisible = lightningQRCode.style.display === 'block';
qrCodes.style.display = 'block'; // Show QR codes section qrCodes.style.display = 'block'; // Show QR codes section
lightningQRCode.style.display = isLightningVisible ? 'none' : 'block'; // Toggle Lightning lightningQRCode.style.display = isLightningVisible ? 'none' : 'block'; // Toggle Lightning
onChainQRCode.style.display = 'none'; // Hide On-Chain QR code onChainQRCode.style.display = 'none'; // Hide On-Chain QR code
}); });
}) })
.catch(error => console.error('Error loading footer:', error)); .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')
fetch('https://api.github.com/repos/btcforplebs/BTCforPlebs.com/commits/main') .then(response => response.json())
.then(response => response.json()) .then(data => {
.then(data => { const lastUpdate = new Date(data.commit.author.date); // Commit date
const lastUpdate = new Date(data.commit.author.date); // Commit date const formattedDate = lastUpdate.toLocaleDateString();
const formattedDate = lastUpdate.toLocaleDateString(); const formattedTime = lastUpdate.toLocaleTimeString([], { hour: '2-digit', minute: '2-digit' });
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.';
});

View File

@@ -41,14 +41,18 @@
<button class="button" id="bitcoin-folder-btn" onclick="toggleFolder('folder2', 'bitcoin-folder-btn')">Use Bitcoin <span style="color: #F7931A;"></span></button> <button class="button" id="bitcoin-folder-btn" onclick="toggleFolder('folder2', 'bitcoin-folder-btn')">Use Bitcoin <span style="color: #F7931A;"></span></button>
<div class="links" id="folder2"> <div class="links" id="folder2">
<a href="https://lightning.btcforplebs.com" target="_blank" class="prefetch">Lightning</a> <a href="https://lightning.btcforplebs.com" target="_blank" class="prefetch">Lightning</a>
<a href="https://mempool.space" target="_blank" class="prefetch">Mempool</a> <a href="https://mempool.btcforplebs.com" target="_blank" class="prefetch">Mempool</a>
<a href="https://kibo.money" target="_blank" class="prefetch">Charts</a> <a href="https://bitview.space/" target="_blank" class="prefetch">Charts</a>
</div> </div>
<button class="button" id="nostr-folder-btn" onclick="toggleFolder('folder1', 'nostr-folder-btn')">Use Nostr <span style="color: #F7931A;"></span></button> <button class="button" id="nostr-folder-btn" onclick="toggleFolder('folder1', 'nostr-folder-btn')">Use Nostr <span style="color: #F7931A;"></span></button>
<div class="links" id="folder1"> <div class="links" id="folder1">
<a href="https://nostr.btcforplebs.com" target="_blank" class="prefetch">Nostr Client</a> All apps hosted by BTCforPlebs<br></br>
<a href="https://nostrapps.com" target="_blank">More Nostr Apps</a> <a href="https://nostrudel.btcforplebs.com" target="_blank" class="prefetch">Nostrudel</a>
<a href="https://nosotros.btcforplebs.com" target="_blank" class="prefetch">Nosotros</a>
<a href="https://bloom.btcforplebs.com" target="_blank" class="prefetch">Bloom</a>
<a href="https://btcforplebs.com/relay" target="_blank" class="prefetch">Relay</a>
<a href="https://nostrapps.com" target="_blank">More</a>
</div> </div>
<button class="button" id="cashu-folder-btn" onclick="toggleFolder('folder3', 'cashu-folder-btn')">Use Cashu <span style="color: #F7931A;"></span></button> <button class="button" id="cashu-folder-btn" onclick="toggleFolder('folder3', 'cashu-folder-btn')">Use Cashu <span style="color: #F7931A;"></span></button>
<div class="links" id="folder3"> <div class="links" id="folder3">

View File

@@ -4,10 +4,12 @@
<meta charset="UTF-8"> <meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Learn Nostr</title> <title>Learn Nostr</title>
<script src='https://www.unpkg.com/nostr-login@latest/dist/unpkg.js'></script>
</head> <!-- 1⃣ NostrLogin library -->
<script src="https://www.unpkg.com/nostr-login@latest/dist/unpkg.js"></script>
<link rel="stylesheet" href="/assets/css/main.css"> <link rel="stylesheet" href="/assets/css/main.css">
</head>
<body> <body>
<!-- Bitcoin Price Banner --> <!-- Bitcoin Price Banner -->
@@ -26,14 +28,20 @@
<div class="video-container"> <div class="video-container">
<video controls playsinline width="100%" height="auto" poster="https://img.youtube.com/vi/8aZkg3OQc5c/maxresdefault.jpg"> <video controls playsinline width="100%" height="auto" poster="https://img.youtube.com/vi/8aZkg3OQc5c/maxresdefault.jpg">
<source src="https://player.vimeo.com/progressive_redirect/playback/920597331/rendition/1080p/file.mp4?loc=external&log_user=0&signature=679fc1e260d7c0a66c6cb9f5168b4d117e6cc79c2e895ca6c34723066c912687" type="video/mp4"> <source src="https://v.nostr.build/voby1u385n0ZwAbp.mp4" type="video/mp4">
Your browser does not support the video tag. Your browser does not support the video tag.
</video> </video>
</div> </div>
<a href="/index.html" class="button">Home</a> <a href="/index.html" class="button">Home</a>
</div> </div>
<div id="footer"></div> <div id="footer"></div>
<!-- 2⃣ Nostr Tools library -->
<script type="module" src="/assets/js/nostr-tools.js"></script>
</body> </body>
</html> </html>