<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Dad Joke Visualizer</title>
<style>
body {
font-family: 'Comic Sans MS', cursive, sans-serif;
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
margin: 0;
padding: 20px;
min-height: 100vh;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
}
.container {
background: white;
border-radius: 20px;
padding: 40px;
box-shadow: 0 20px 40px rgba(0,0,0,0.1);
max-width: 600px;
text-align: center;
animation: slideIn 0.8s ease-out;
}
@keyframes slideIn {
from { opacity: 0; transform: translateY(30px); }
to { opacity: 1; transform: translateY(0); }
}
h1 {
color: #333;
margin-bottom: 30px;
font-size: 2.5em;
text-shadow: 2px 2px 4px rgba(0,0,0,0.1);
}
.subtitle {
color: #666;
font-size: 1.2em;
margin-bottom: 40px;
}
.input-group {
margin-bottom: 30px;
}
label {
display: block;
margin-bottom: 10px;
color: #555;
font-size: 1.1em;
}
input[type="text"] {
width: 100%;
padding: 15px;
border: 2px solid #ddd;
border-radius: 10px;
font-size: 1.1em;
box-sizing: border-box;
}
input[type="text"]:focus {
outline: none;
border-color: #667eea;
}
select.rating-selector {
width: 100%;
padding: 15px;
border: 2px solid #ddd;
border-radius: 10px;
font-size: 1.1em;
background: white;
cursor: pointer;
box-sizing: border-box;
}
select.rating-selector:focus {
outline: none;
border-color: #667eea;
}
select.rating-selector option {
padding: 10px;
font-size: 1em;
}
.generate-button {
background: linear-gradient(45deg, #667eea, #764ba2);
color: white;
padding: 15px 40px;
border: none;
border-radius: 25px;
font-size: 1.3em;
cursor: pointer;
transition: transform 0.2s ease, box-shadow 0.2s ease;
margin-bottom: 20px;
}
.generate-button:hover {
transform: translateY(-2px);
box-shadow: 0 10px 20px rgba(0,0,0,0.2);
}
.generate-button:disabled {
opacity: 0.6;
cursor: not-allowed;
transform: none;
}
.loading {
display: none;
color: #667eea;
font-size: 1.1em;
margin-top: 20px;
}
.spinner {
border: 3px solid #f3f3f3;
border-top: 3px solid #667eea;
border-radius: 50%;
width: 30px;
height: 30px;
animation: spin 1s linear infinite;
margin: 0 auto 10px;
}
@keyframes spin {
0% { transform: rotate(0deg); }
100% { transform: rotate(360deg); }
}
.error {
color: #e74c3c;
background: #fdf2f2;
padding: 15px;
border-radius: 10px;
margin-top: 20px;
display: none;
}
.success {
color: #27ae60;
background: #f0f9f0;
padding: 15px;
border-radius: 10px;
margin-top: 20px;
display: none;
}
.footer {
margin-top: 40px;
color: #888;
font-size: 0.9em;
}
</style>
</head>
<body>
<div class="container">
<h1>๐ญ Dad Joke Visualizer</h1>
<p class="subtitle">Generate hilarious Dad Jokes with AI-powered visualizations!</p>
<div class="input-group">
<label for="topic">Optional Topic (e.g., "cats", "programming", "food"):</label>
<input type="text" id="topic" placeholder="Leave empty for a random Dad Joke">
</div>
<div class="input-group">
<label for="rating">Content Rating:</label>
<select id="rating" class="rating-selector">
<option value="PG">๐ PG - Clean & Family Friendly</option>
<option value="PG-13" selected>๐ PG-13 - Mild Adult Humor</option>
<option value="R">๐ R - Mature Audiences Only</option>
</select>
</div>
<button class="generate-button" onclick="generateJoke()">
๐ช Generate Dad Joke & Visualization
</button>
<div class="loading" id="loading">
<div class="spinner"></div>
<div>Creating your Dad Joke masterpiece...</div>
</div>
<div class="error" id="error"></div>
<div class="success" id="success"></div>
<div class="footer">
<p>Powered by AI โข Made with โค๏ธ for Dad Joke enthusiasts</p>
</div>
</div>
<script>
async function generateJoke() {
const topic = document.getElementById('topic').value.trim();
const rating = document.getElementById('rating').value;
const button = document.querySelector('.generate-button');
const loading = document.getElementById('loading');
const error = document.getElementById('error');
const success = document.getElementById('success');
// Reset UI
error.style.display = 'none';
success.style.display = 'none';
button.disabled = true;
loading.style.display = 'block';
try {
// This would normally call the MCP server
// For demo purposes, we'll simulate the process
await new Promise(resolve => setTimeout(resolve, 2000));
// Simulate success with rating info
success.innerHTML = `
<strong>๐ Success!</strong><br>
Your ${rating} Dad Joke has been generated and visualized!<br>
${topic ? `Topic: ${topic}` : 'Random topic selected'} โข Rating: ${rating}<br>
<em>Note: This is a demo. In the actual implementation, this would call the MCP server.</em>
`;
success.style.display = 'block';
} catch (err) {
error.innerHTML = `<strong>โ Error:</strong> ${err.message}`;
error.style.display = 'block';
} finally {
button.disabled = false;
loading.style.display = 'none';
}
}
// Allow Enter key to trigger generation
document.getElementById('topic').addEventListener('keypress', function(e) {
if (e.key === 'Enter') {
generateJoke();
}
});
</script>
</body>
</html>