tangled
alpha
login
or
join now
danielmorrisey.com
/
website
1
fork
atom
madebydanny.uk written in html, css, and a lot of JavaScript I don't understand
madeydanny.uk
html
css
javascript
1
fork
atom
overview
issues
pulls
pipelines
mbdsecure v1
Daniel Morrisey
7 months ago
307e7d0f
864a90e6
+148
-3
3 changed files
expand all
collapse all
unified
split
.vscode
launch.json
leaving.html
mbdsecure
v1
checkpoint.html
+10
.vscode/launch.json
···
1
1
+
{
2
2
+
"configurations": [
3
3
+
{
4
4
+
"type": "chrome",
5
5
+
"name": "http://127.0.0.1:3000/mbdsecure/v1/checkpoint.html",
6
6
+
"request": "launch",
7
7
+
"url": "http://127.0.0.1:3000/mbdsecure/v1/checkpoint.html"
8
8
+
}
9
9
+
]
10
10
+
}
-3
leaving.html
···
12
12
<!-- Tailwind CSS CDN -->
13
13
<script src="https://cdn.tailwindcss.com"></script>
14
14
15
15
-
<!-- Preload fonts (optional, but good for performance) -->
16
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
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
1
+
<!DOCTYPE html>
2
2
+
<html lang="en">
3
3
+
<head>
4
4
+
<meta charset="utf-8"/>
5
5
+
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
6
6
+
<title>Wait one second!</title>
7
7
+
8
8
+
<!-- SEO: No-index this page as it's transitional content -->
9
9
+
<meta name="robots" content="noindex, nofollow">
10
10
+
11
11
+
<!-- Tailwind CSS CDN -->
12
12
+
<script src="https://cdn.tailwindcss.com"></script>
13
13
+
<style>
14
14
+
/* Ensure full screen height and a nice font family */
15
15
+
html, body, #__next {
16
16
+
height: 100%;
17
17
+
}
18
18
+
body {
19
19
+
font-family: 'Inter', sans-serif;
20
20
+
}
21
21
+
</style>
22
22
+
</head>
23
23
+
<body class="bg-gray-100 dark:bg-gray-900 text-gray-800 dark:text-gray-200">
24
24
+
<div id="__next" class="flex flex-col min-h-screen">
25
25
+
<div class="flex-grow flex flex-col justify-center items-center p-4">
26
26
+
<!-- Header: Consistent with the main page design -->
27
27
+
<header class="flex flex-col items-center py-12 md:py-16">
28
28
+
<div class="mb-8">
29
29
+
<a href="#" class="flex flex-col items-center">
30
30
+
<!-- Replaced image with a simple SVG for self-containment -->
31
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
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
33
+
</svg>
34
34
+
<h1 class="text-3xl font-bold">Wait one second!</h1>
35
35
+
</a>
36
36
+
</div>
37
37
+
</header>
38
38
+
39
39
+
<!-- Content -->
40
40
+
<main class="w-9/10 max-w-md mx-auto text-center">
41
41
+
<div id="redirect-container">
42
42
+
<h3 class="mb-4 text-2xl font-medium">You are now leaving danielmorrisey.com</h3>
43
43
+
<!-- Updated text to include source and redirect URLs -->
44
44
+
<p id="verification-text" class="mb-2 text-gray-600 dark:text-gray-400">
45
45
+
{s} needs to verify the security of the connection before continuing to {r}
46
46
+
</p>
47
47
+
<!-- Turnstile widget container -->
48
48
+
<div id="turnstile-widget" class="flex justify-center my-6"></div>
49
49
+
50
50
+
<p class="text-sm text-gray-600 dark:text-gray-400 mb-6">
51
51
+
Destination: <a id="destination-link" href="#" class="text-blue-600 dark:text-blue-400 break-all hover:underline"></a>
52
52
+
</p>
53
53
+
<!-- "Go Now" button is removed as Turnstile handles the redirect -->
54
54
+
<!-- This container can be used for a verification message -->
55
55
+
<div id="verification-message" class="hidden text-green-600 dark:text-green-400 font-bold">
56
56
+
Verification successful! Redirecting...
57
57
+
</div>
58
58
+
</div>
59
59
+
<div id="error-container" class="hidden">
60
60
+
<h3 class="mb-4 text-2xl font-medium text-red-600 dark:text-red-400">Invalid Link</h3>
61
61
+
<p>A valid destination link was not provided. Please check the URL and try again.</p>
62
62
+
</div>
63
63
+
</main>
64
64
+
</div>
65
65
+
66
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
67
+
© 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
68
+
</footer>
69
69
+
</div>
70
70
+
<script>
71
71
+
// Main logic for the secure redirect page.
72
72
+
document.addEventListener('DOMContentLoaded', () => {
73
73
+
const urlParams = new URLSearchParams(window.location.search);
74
74
+
const redirectUrl = urlParams.get('r');
75
75
+
const sourceUrl = urlParams.get('s');
76
76
+
77
77
+
const redirectContainer = document.getElementById('redirect-container');
78
78
+
const errorContainer = document.getElementById('error-container');
79
79
+
const destinationLink = document.getElementById('destination-link');
80
80
+
const verificationMessage = document.getElementById('verification-message');
81
81
+
const verificationText = document.getElementById('verification-text');
82
82
+
83
83
+
const currentYearSpan = document.getElementById('currentYear');
84
84
+
currentYearSpan.textContent = new Date().getFullYear();
85
85
+
86
86
+
// Function to handle the successful Turnstile challenge.
87
87
+
window.onTurnstileSuccess = (token) => {
88
88
+
console.log('Turnstile challenge completed successfully! Token:', token);
89
89
+
90
90
+
// Show the success message and hide the widget.
91
91
+
const turnstileWidget = document.getElementById('turnstile-widget');
92
92
+
turnstileWidget.classList.add('hidden');
93
93
+
verificationMessage.classList.remove('hidden');
94
94
+
95
95
+
// Redirect to the destination URL after a short delay to show the message.
96
96
+
setTimeout(() => {
97
97
+
window.location.href = redirectUrl;
98
98
+
}, 1000); // Redirect after 1 second.
99
99
+
};
100
100
+
101
101
+
// This is the onload callback for the Turnstile script.
102
102
+
// It renders the widget after the script has loaded.
103
103
+
window.onloadTurnstileCallback = () => {
104
104
+
// IMPORTANT: Replace '1x00000000000000000000AA' with your actual Cloudflare Turnstile site key.
105
105
+
// This demo key is for testing purposes only.
106
106
+
turnstile.render('#turnstile-widget', {
107
107
+
sitekey: '0x4AAAAAABnz2nYFLlHtxvo3',
108
108
+
callback: 'onTurnstileSuccess',
109
109
+
theme: 'auto'
110
110
+
});
111
111
+
};
112
112
+
113
113
+
// Load the Cloudflare Turnstile script dynamically.
114
114
+
const script = document.createElement('script');
115
115
+
script.src = 'https://challenges.cloudflare.com/turnstile/v0/api.js?onload=onloadTurnstileCallback';
116
116
+
script.async = true;
117
117
+
script.defer = true;
118
118
+
document.head.appendChild(script);
119
119
+
120
120
+
if (redirectUrl) {
121
121
+
// Set the destination link text and href.
122
122
+
destinationLink.href = redirectUrl;
123
123
+
destinationLink.textContent = redirectUrl;
124
124
+
125
125
+
// Update the verification text with source and redirect URLs.
126
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
127
+
128
128
+
redirectContainer.classList.remove('hidden');
129
129
+
errorContainer.classList.add('hidden');
130
130
+
} else {
131
131
+
// Show the error message if the redirect URL is missing.
132
132
+
redirectContainer.classList.add('hidden');
133
133
+
errorContainer.classList.remove('hidden');
134
134
+
}
135
135
+
});
136
136
+
</script>
137
137
+
</body>
138
138
+
</html>