madebydanny.uk written in html, css, and a lot of JavaScript I don't understand madeydanny.uk
html css javascript

i did a thing agian

+5 -83
.DS_Store

This is a binary file and will not be displayed.

+2 -3
index.html
··· 138 138 <h2><i class="fa-solid fa-heart"></i> Made Possible Thanks To</h2> 139 139 Made possible thanks to <a href="https://madebydanny.uk/followonbsky.html?did=mbdio.uk">@mbdio.uk</a>, <a href="https://madebydanny.uk/followonbsky.html?did=tangled.org">@tangled.org</a>, <a href="https://madebydanny.uk/followonbsky.html?did=wisp.place">@wisp.place</a>, <a href="https://madebydanny.uk/followonbsky.html?did=/nekomimi.pet">@nekomimi.pet</a>, <a href="https://madebydanny.uk/followonbsky.html?did=juli.ee">@juli.ee</a>, <a href="https://lovable.dev">lovable.dev</a>, <a href="https://pdsls.dev">@pdsls.dev</a>, <a href="https://cloudflare.com">cloudflare.com</a>, <a href="https://madebydanny.uk/followonbsky.html?did=/vscode.dev">@vscode.dev</a>, <a href="https://github.com">@github.com</a>, <a href="https://madebydanny.uk/followonbsky.html?did=jack.xyz">jack.xyz</a>, <a href="https://upcloud.com">upcloud.com</a>, <a href="https://tailscale.com">tailscale.com</a>, <a href="https://raspberrypi.com">raspberrypi.com</a>, Ubuntu, Apple, Reddit, <a href="www.youtube.com/@LinusTechTips">Linus Tech Tips</a>, <a href="https://w3schools.com">W3Schools</a> and you 140 140 </div> 141 - <div id="footer" class="white-card"></div> 142 - <div class="content-section"> 143 - <iframe src="https://status.madebydanny.uk/badge?theme=dark" width="250" height="30" frameborder="0" scrolling="no" style="color-scheme: normal"></iframe> 141 + <div id="footer" class="white-card"> 142 + &copy;2024-25 Daniel Morrisey, Powered by the <a href="https://atproto.com">AT Protocol</a>, <a href="https://upcloud.com">UpCloud</a> & <a href="https://cloudflare.com">Cloudflare</a> 144 143 </div> 145 144 <button onclick="topFunction()" id="myBtn" title="Go to top"><i class="fa-solid fa-arrow-up"></i></button> 146 145 <script src="https://feed.madebydannyuk.workers.dev/embed.js" async></script>
+3 -80
js/index.js
··· 19 19 document.documentElement.scrollTop = 0; 20 20 } 21 21 22 - 23 - 24 22 // ============================================ 25 23 // GITHUB API - LAST UPDATED 26 24 // ============================================ ··· 133 131 function linkifyText(text) { 134 132 if (!text) return ''; 135 133 136 - // URL regex pattern 137 134 const urlPattern = /(\b(https?|ftp|file):\/\/[-A-Z0-9+&@#\/%?=~_|!:,.;]*[-A-Z0-9+&@#\/%=~_|])/ig; 138 135 139 136 return text.replace(urlPattern, (url) => { ··· 142 139 } 143 140 144 141 function createProfileLink(handle, displayName) { 145 - const did = handle; // You can convert handle to DID if needed 142 + const did = handle; 146 143 return `<a href="/followonbsky.html?did=${did}" target="_blank" style="text-decoration: none; color: inherit;">${displayName}</a>`; 147 144 } 148 145 ··· 350 347 } 351 348 352 349 // ============================================ 353 - // CUSTOM PDS API - FOOTER 354 - // ============================================ 355 - 356 - async function fetchFooter() { 357 - const footerElement = document.querySelector('#footer'); 358 - const apiUrl = 'https://mbdio.uk/xrpc/com.atproto.repo.getRecord?repo=did:plc:l37td5yhxl2irrzrgvei4qay&collection=uk.madebydanny.footer&rkey=3m534asvjl52b'; 359 - 360 - try { 361 - const response = await fetch(apiUrl); 362 - if (!response.ok) throw new Error('Failed to fetch footer content'); 363 - 364 - const data = await response.json(); 365 - if (data.value && data.value.content) { 366 - footerElement.innerHTML = data.value.content; 367 - } else { 368 - footerElement.textContent = 'No footer content available'; 369 - } 370 - } catch (error) { 371 - console.error('Error fetching footer content:', error); 372 - footerElement.textContent = 'Error loading footer content'; 373 - } 374 - } 375 - 376 - // ============================================ 377 350 // CUSTOM PDS API - PROJECTS 378 351 // ============================================ 379 352 ··· 388 361 const data = await response.json(); 389 362 if (data.value && data.value.projects) { 390 363 const projectsHtml = data.value.projects.map(project => ` 391 - 392 364 <div class="project-item"> 393 365 <h3><a href="${project.link}" target="_blank">${project.name}</a></h3> 394 366 <p>${project.description}</p> ··· 439 411 const profileUrl = 'https://mbdio.uk/xrpc/com.atproto.repo.getRecord?repo=did:plc:l37td5yhxl2irrzrgvei4qay&collection=sh.tangled.actor.profile&rkey=self'; 440 412 441 413 try { 442 - // Fetch the actor profile to get pinned repositories 443 414 const profileResponse = await fetch(profileUrl); 444 415 if (!profileResponse.ok) throw new Error('Failed to fetch tangled profile'); 445 416 446 417 const profileData = await profileResponse.json(); 447 418 const pinnedRepos = profileData.value.pinnedRepositories || []; 448 419 449 - // Filter out empty strings 450 420 const validPinnedRepos = pinnedRepos.filter(uri => uri && uri.trim() !== ''); 451 421 452 422 if (validPinnedRepos.length === 0) { ··· 454 424 return; 455 425 } 456 426 457 - // Fetch each pinned repository's data 458 427 const repoPromises = validPinnedRepos.map(async atUri => { 459 428 try { 460 - // Parse the AT URI to get the collection and rkey 461 - // Format: at://did:plc:l37td5yhxl2irrzrgvei4qay/sh.tangled.repo/3m2weura7jo22 462 429 const uriParts = atUri.replace('at://', '').split('/'); 463 430 const did = uriParts[0]; 464 431 const collection = uriParts[1]; ··· 477 444 478 445 let lastCommitDate = null; 479 446 480 - // Try to fetch last commit info from GitHub if it's a GitHub repo 481 447 if (link.includes('github.com')) { 482 448 try { 483 449 const repoPath = link.replace('https://github.com/', ''); ··· 494 460 } 495 461 } 496 462 497 - return { 498 - knot, 499 - name, 500 - description, 501 - link, 502 - lastCommitDate 503 - }; 463 + return { knot, name, description, link, lastCommitDate }; 504 464 } catch (error) { 505 465 console.error(`Error fetching repo ${atUri}:`, error); 506 466 return null; ··· 508 468 }); 509 469 510 470 const repos = await Promise.all(repoPromises); 511 - 512 - // Filter out any null results from failed fetches 513 471 const validRepos = repos.filter(repo => repo !== null); 514 472 515 473 if (validRepos.length === 0) { ··· 517 475 return; 518 476 } 519 477 520 - // Sort by last commit date (most recent first), repos without dates go to the end 521 478 validRepos.sort((a, b) => { 522 479 if (!a.lastCommitDate && !b.lastCommitDate) return 0; 523 480 if (!a.lastCommitDate) return 1; ··· 550 507 } 551 508 552 509 // ============================================ 553 - // CUSTOM PDS API - THANKS SECTION 554 - // ============================================ 555 - 556 - async function fetchThanks() { 557 - const thanksElement = document.getElementById('thanks-content'); 558 - if (!thanksElement) return; 559 - 560 - const apiUrl = 'https://mbdio.uk/xrpc/com.atproto.repo.getRecord?repo=did:plc:l37td5yhxl2irrzrgvei4qay&collection=uk.madebydanny.thanks&rkey=3m5orengzks2d'; 561 - 562 - try { 563 - const response = await fetch(apiUrl); 564 - if (!response.ok) throw new Error('Failed to fetch thanks content'); 565 - 566 - const data = await response.json(); 567 - if (data.value && data.value.content) { 568 - thanksElement.innerHTML = data.value.content; 569 - } else { 570 - thanksElement.innerHTML = '<p>No thanks content available</p>'; 571 - } 572 - } catch (error) { 573 - console.error('Error fetching thanks content:', error); 574 - thanksElement.innerHTML = '<p>Error loading thanks content</p>'; 575 - } 576 - } 577 - 578 - // ============================================ 579 510 // CLEAR COOKIES AND REFRESH 580 511 // ============================================ 581 512 582 513 function clearCookiesAndRefresh() { 583 - // Clear all cookies 584 514 document.cookie.split(";").forEach(function(c) { 585 515 document.cookie = c.replace(/^ +/, "").replace(/=.*/, "=;expires=" + new Date().toUTCString() + ";path=/"); 586 516 }); 587 517 588 - // Clear localStorage 589 518 localStorage.clear(); 590 - 591 - // Clear sessionStorage 592 519 sessionStorage.clear(); 593 - 594 - // Refresh the page 595 520 location.reload(true); 596 521 } 597 522 ··· 604 529 fetchLatestPost(); 605 530 fetchAbout(); 606 531 fetchTexts(); 607 - fetchFooter(); 608 532 fetchProjects(); 609 533 fetchCurrentStatus(); 610 - fetchTangledRepo(); 611 - fetchThanks(); 534 + fetchTangledRepo();