1file quiz, pay app

<!DOCTYPE html>

<html lang=”en”>

<head>

<meta charset=”UTF-8″ />

<meta name=”viewport” content=”width=device-width, initial-scale=1.0″/>

<meta name=”theme-color” content=”#0a0a0a”/>

<title>Be Your Own Boss</title>

<style>

body { font-family: sans-serif; background: #f2f2f2; padding: 2em; }

.container { max-width: 500px; margin: auto; background: #fff; padding: 2em; border-radius: 10px; box-shadow: 0 0 10px #ccc; }

h2 { text-align: center; }

label { display: block; margin-top: 1em; }

input, select, button {

width: 100%; padding: 0.75em; margin-top: 0.5em;

border: 1px solid #ccc; border-radius: 5px;

}

button { background: #4CAF50; color: white; font-size: 1em; border: none; cursor: pointer; }

button:hover { background: #45a049; }

</style>

<!– Inlined manifest as base64 data URI –>

<link rel=”manifest” href=”data:application/manifest+json;base64,eyJuYW1lIjoiQmUgWW91ciBPd24gQm9zcyIsInNob3J0X25hbWUiOiJCb3NzQXBwIiwic3RhcnRfdXJsIjoiLiIsImRpc3BsYXkiOiJzdGFuZGFsb25lIiwiYmFja2dyb3VuZF9jb2xvciI6IiNmZmZmZmYiLCJ0aGVtZV9jb2xvciI6IiMwYTBhMGEiLCJpY29ucyI6W3sic3JjIjoiaWNvbi5wbmciLCJ0eXBlIjoiaW1hZ2UvcG5nIiwic2l6ZXMiOiIxOTJ4MTkyIn1dfQ==”>

</head>

<body>

<div class=”container”>

<h2>Start Your Freedom Journey</h2>

<form id=”quizForm”>

<label>Your Name:

<input type=”text” name=”name” required />

</label>

<label>Email Address:

<input type=”email” name=”email” required />

</label>

<label>Gender:

<select name=”gender” required>

<option value=””>Select</option>

<option>Male</option>

<option>Female</option>

<option>Other</option>

</select>

</label>

<label>Your Goal:

<input type=”text” name=”goal” placeholder=”e.g., Be My Own Boss” required />

</label>

<label>Your Target:

<input type=”text” name=”target” placeholder=”e.g., I want it all!” required />

</label>

<button type=”submit”>Continue</button>

</form>

</div>

<script>

document.getElementById(‘quizForm’).addEventListener(‘submit’, async function (e) {

e.preventDefault();

const form = e.target;

const data = {

name: form.name.value,

email: form.email.value,

gender: form.gender.value,

goal: form.goal.value,

target: form.target.value,

};

// Send email using FormSubmit.co

fetch(“https://formsubmit.co/ajax/crh2123@icloud.com“, {

method: “POST”,

headers: { ‘Content-Type’: ‘application/json’ },

body: JSON.stringify({

Name: data.name,

Email: data.email,

Gender: data.gender,

Goal: data.goal,

Target: data.target,

_subject: “New Lead from PWA Quiz App”

})

}).then(response => {

window.location.href = “https://buy.stripe.com/28ocNTasB6NQ54kcMM“;

}).catch(error => {

alert(“Something went wrong. Please try again.”);

console.error(error);

});

});

// Inline service worker registration

if (‘serviceWorker’ in navigator) {

const swCode = `

self.addEventListener(‘install’, e => {

e.waitUntil(

caches.open(‘boss-app-v1’).then(cache => {

return cache.addAll([‘./’]);

})

);

});

self.addEventListener(‘fetch’, e => {

e.respondWith(

caches.match(e.request).then(response => {

return response || fetch(e.request);

})

);

});

`;

const blob = new Blob([swCode], { type: ‘text/javascript’ });

const swURL = URL.createObjectURL(blob);

navigator.serviceWorker.register(swURL).then(() => {

console.log(“Service Worker Registered”);

});

}

</script>

</body>

</html>

Leave a comment