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

mbdsecure v1

+148 -3
+10
.vscode/launch.json
··· 1 + { 2 + "configurations": [ 3 + { 4 + "type": "chrome", 5 + "name": "http://127.0.0.1:3000/mbdsecure/v1/checkpoint.html", 6 + "request": "launch", 7 + "url": "http://127.0.0.1:3000/mbdsecure/v1/checkpoint.html" 8 + } 9 + ] 10 + }
-3
leaving.html
··· 12 12 <!-- Tailwind CSS CDN --> 13 13 <script src="https://cdn.tailwindcss.com"></script> 14 14 15 - <!-- Preload fonts (optional, but good for performance) --> 16 - <link rel="preload" href="/_next/static/media/97a52bce187043ec-s.p.woff2" as="font" type="font/woff2" crossorigin="anonymous" data-next-font="size-adjust"/> 17 - <link rel="preload" href="/_next/static/media/e4af272ccee01ff0-s.p.woff2" as="font" type="font/woff2" crossorigin="anonymous" data-next-font="size-adjust"/> 18 15 </head> 19 16 <body class="bg-white text-gray-800"> 20 17 <div id="__next">
+138
mbdsecure/v1/checkpoint.html
··· 1 + <!DOCTYPE html> 2 + <html lang="en"> 3 + <head> 4 + <meta charset="utf-8"/> 5 + <meta name="viewport" content="width=device-width, initial-scale=1.0"/> 6 + <title>Wait one second!</title> 7 + 8 + <!-- SEO: No-index this page as it's transitional content --> 9 + <meta name="robots" content="noindex, nofollow"> 10 + 11 + <!-- Tailwind CSS CDN --> 12 + <script src="https://cdn.tailwindcss.com"></script> 13 + <style> 14 + /* Ensure full screen height and a nice font family */ 15 + html, body, #__next { 16 + height: 100%; 17 + } 18 + body { 19 + font-family: 'Inter', sans-serif; 20 + } 21 + </style> 22 + </head> 23 + <body class="bg-gray-100 dark:bg-gray-900 text-gray-800 dark:text-gray-200"> 24 + <div id="__next" class="flex flex-col min-h-screen"> 25 + <div class="flex-grow flex flex-col justify-center items-center p-4"> 26 + <!-- Header: Consistent with the main page design --> 27 + <header class="flex flex-col items-center py-12 md:py-16"> 28 + <div class="mb-8"> 29 + <a href="#" class="flex flex-col items-center"> 30 + <!-- Replaced image with a simple SVG for self-containment --> 31 + <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" class="w-16 h-16 mb-2 text-blue-600"> 32 + <path fill="currentColor" d="M256 0c53 0 102.7 13.9 146.3 38.6c-17.7 20.3-43.7 34.4-72.3 39.4c17.5 13.6 28.5 35.8 28.5 60.5c0 44.9-36.4 81.3-81.3 81.3s-81.3-36.4-81.3-81.3c0-24.7 11-46.9 28.5-60.5c-28.6-5-54.6-19.1-72.3-39.4C153.3 13.9 203 0 256 0zm0 304c-88.4 0-160 71.6-160 160c0 17.7 14.3 32 32 32h256c17.7 0 32-14.3 32-32c0-88.4-71.6-160-160-160zm0-192a80 80 0 1 1 0 160a80 80 0 1 1 0-160zM480 320c-17.7 0-32 14.3-32 32c0 88.4-71.6 160-160 160c-88.4 0-160-71.6-160-160c0-17.7-14.3-32-32-32s-32 14.3-32 32c0 123.7 100.3 224 224 224s224-100.3 224-224c0-17.7-14.3-32-32-32z"/> 33 + </svg> 34 + <h1 class="text-3xl font-bold">Wait one second!</h1> 35 + </a> 36 + </div> 37 + </header> 38 + 39 + <!-- Content --> 40 + <main class="w-9/10 max-w-md mx-auto text-center"> 41 + <div id="redirect-container"> 42 + <h3 class="mb-4 text-2xl font-medium">You are now leaving danielmorrisey.com</h3> 43 + <!-- Updated text to include source and redirect URLs --> 44 + <p id="verification-text" class="mb-2 text-gray-600 dark:text-gray-400"> 45 + {s} needs to verify the security of the connection before continuing to {r} 46 + </p> 47 + <!-- Turnstile widget container --> 48 + <div id="turnstile-widget" class="flex justify-center my-6"></div> 49 + 50 + <p class="text-sm text-gray-600 dark:text-gray-400 mb-6"> 51 + Destination: <a id="destination-link" href="#" class="text-blue-600 dark:text-blue-400 break-all hover:underline"></a> 52 + </p> 53 + <!-- "Go Now" button is removed as Turnstile handles the redirect --> 54 + <!-- This container can be used for a verification message --> 55 + <div id="verification-message" class="hidden text-green-600 dark:text-green-400 font-bold"> 56 + Verification successful! Redirecting... 57 + </div> 58 + </div> 59 + <div id="error-container" class="hidden"> 60 + <h3 class="mb-4 text-2xl font-medium text-red-600 dark:text-red-400">Invalid Link</h3> 61 + <p>A valid destination link was not provided. Please check the URL and try again.</p> 62 + </div> 63 + </main> 64 + </div> 65 + 66 + <footer class="w-9/10 max-w-md mx-auto text-center py-4 text-gray-500 dark:text-gray-400 text-sm"> 67 + &copy; 2024-<span id="currentYear"></span> <a href="#" class="text-blue-600 dark:text-blue-400 transition-colors hover:text-blue-800 dark:hover:text-blue-500">Made by Danny UK</a> <i>by Daniel Morrisey</i> 68 + </footer> 69 + </div> 70 + <script> 71 + // Main logic for the secure redirect page. 72 + document.addEventListener('DOMContentLoaded', () => { 73 + const urlParams = new URLSearchParams(window.location.search); 74 + const redirectUrl = urlParams.get('r'); 75 + const sourceUrl = urlParams.get('s'); 76 + 77 + const redirectContainer = document.getElementById('redirect-container'); 78 + const errorContainer = document.getElementById('error-container'); 79 + const destinationLink = document.getElementById('destination-link'); 80 + const verificationMessage = document.getElementById('verification-message'); 81 + const verificationText = document.getElementById('verification-text'); 82 + 83 + const currentYearSpan = document.getElementById('currentYear'); 84 + currentYearSpan.textContent = new Date().getFullYear(); 85 + 86 + // Function to handle the successful Turnstile challenge. 87 + window.onTurnstileSuccess = (token) => { 88 + console.log('Turnstile challenge completed successfully! Token:', token); 89 + 90 + // Show the success message and hide the widget. 91 + const turnstileWidget = document.getElementById('turnstile-widget'); 92 + turnstileWidget.classList.add('hidden'); 93 + verificationMessage.classList.remove('hidden'); 94 + 95 + // Redirect to the destination URL after a short delay to show the message. 96 + setTimeout(() => { 97 + window.location.href = redirectUrl; 98 + }, 1000); // Redirect after 1 second. 99 + }; 100 + 101 + // This is the onload callback for the Turnstile script. 102 + // It renders the widget after the script has loaded. 103 + window.onloadTurnstileCallback = () => { 104 + // IMPORTANT: Replace '1x00000000000000000000AA' with your actual Cloudflare Turnstile site key. 105 + // This demo key is for testing purposes only. 106 + turnstile.render('#turnstile-widget', { 107 + sitekey: '0x4AAAAAABnz2nYFLlHtxvo3', 108 + callback: 'onTurnstileSuccess', 109 + theme: 'auto' 110 + }); 111 + }; 112 + 113 + // Load the Cloudflare Turnstile script dynamically. 114 + const script = document.createElement('script'); 115 + script.src = 'https://challenges.cloudflare.com/turnstile/v0/api.js?onload=onloadTurnstileCallback'; 116 + script.async = true; 117 + script.defer = true; 118 + document.head.appendChild(script); 119 + 120 + if (redirectUrl) { 121 + // Set the destination link text and href. 122 + destinationLink.href = redirectUrl; 123 + destinationLink.textContent = redirectUrl; 124 + 125 + // Update the verification text with source and redirect URLs. 126 + verificationText.innerHTML = `<span class="font-bold">${sourceUrl || 'The current page'}</span> needs to verify the security of the connection before continuing to <span class="font-bold">${redirectUrl}</span>`; 127 + 128 + redirectContainer.classList.remove('hidden'); 129 + errorContainer.classList.add('hidden'); 130 + } else { 131 + // Show the error message if the redirect URL is missing. 132 + redirectContainer.classList.add('hidden'); 133 + errorContainer.classList.remove('hidden'); 134 + } 135 + }); 136 + </script> 137 + </body> 138 + </html>