* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
background: linear-gradient(135deg, #38a3a5 0%, #22577a 100%);
min-height: 100vh;
display: flex;
justify-content: center;
align-items: center;
padding: 20px;
}
.container {
background: white;
border-radius: 20px;
box-shadow: 0 20px 60px rgba(56, 163, 165, 0.4);
max-width: 600px;
width: 100%;
padding: 50px 40px;
text-align: center;
}
.header {
margin-bottom: 40px;
}
.header h1 {
font-size: 2.5rem;
background: linear-gradient(135deg, #38a3a5 0%, #22577a 100%);
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
background-clip: text;
margin-bottom: 15px;
font-weight: 700;
}
.header p {
color: #666;
font-size: 1.05rem;
line-height: 1.6;
}
.name-display {
background: linear-gradient(135deg, #38a3a5 0%, #22577a 100%);
color: white;
padding: 40px 30px;
border-radius: 15px;
margin-bottom: 30px;
min-height: 150px;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
box-shadow: 0 10px 30px rgba(56, 163, 165, 0.3);
position: relative;
overflow: hidden;
}
.name-display::before {
content: '';
position: absolute;
top: -50%;
left: -50%;
width: 200%;
height: 200%;
background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
animation: shimmer 3s infinite;
}
@keyframes shimmer {
0% {
transform: translate(-50%, -50%) rotate(0deg);
}
100% {
transform: translate(-50%, -50%) rotate(360deg);
}
}
.generated-name {
font-size: 2.5rem;
font-weight: 700;
letter-spacing: 1px;
margin-bottom: 10px;
animation: fadeIn 0.5s ease;
position: relative;
z-index: 1;
}
.name-subtitle {
font-size: 0.95rem;
opacity: 0.9;
font-style: italic;
position: relative;
z-index: 1;
}
@keyframes fadeIn {
from {
opacity: 0;
transform: translateY(-10px);
}
to {
opacity: 1;
transform: translateY(0);
}
}
.placeholder {
font-size: 1.2rem;
opacity: 0.8;
font-style: italic;
}
.generate-btn {
width: 100%;
padding: 18px;
font-size: 1.2rem;
font-weight: 700;
color: white;
background: linear-gradient(135deg, #38a3a5 0%, #22577a 100%);
border: none;
border-radius: 12px;
cursor: pointer;
transition: all 0.3s ease;
text-transform: uppercase;
letter-spacing: 2px;
box-shadow: 0 6px 20px rgba(56, 163, 165, 0.3);
margin-bottom: 20px;
}
.generate-btn:hover {
transform: translateY(-3px);
box-shadow: 0 10px 30px rgba(56, 163, 165, 0.5);
}
.generate-btn:active {
transform: translateY(-1px);
}
.actions {
display: flex;
gap: 15px;
}
.action-btn {
flex: 1;
padding: 12px;
font-size: 0.95rem;
font-weight: 600;
color: #38a3a5;
background: white;
border: 2px solid #38a3a5;
border-radius: 10px;
cursor: pointer;
transition: all 0.3s ease;
}
.action-btn:hover {
background: #38a3a5;
color: white;
transform: translateY(-2px);
}
.action-btn:disabled {
opacity: 0.5;
cursor: not-allowed;
transform: none;
}
.info-box {
margin-top: 30px;
padding: 20px;
background: linear-gradient(135deg, rgba(56, 163, 165, 0.1) 0%, rgba(34, 87, 122, 0.1) 100%);
border-radius: 12px;
border-left: 4px solid #38a3a5;
}
.info-box h3 {
color: #38a3a5;
margin-bottom: 10px;
font-size: 1rem;
font-weight: 600;
}
.info-box p {
color: #666;
font-size: 0.9rem;
line-height: 1.6;
}
@media (max-width: 600px) {
.container {
padding: 30px 25px;
}
.header h1 {
font-size: 2rem;
}
.generated-name {
font-size: 1.8rem;
}
.generate-btn {
font-size: 1rem;
padding: 15px;
}
.actions {
flex-direction: column;
}
}
const firstNames = [
'Benedict', 'Bendydick', 'Benefit', 'Burlington', 'Benadryl', 'Bentobox',
'Bourgeoisie', 'Buttercup', 'Bandicoot', 'Buckingham', 'Battlefield',
'Brandybuck', 'Barnabas', 'Butterscotch', 'Bendystraw', 'Beneficial',
'Beethoven', 'Blenderdick', 'Thundersnatch', 'Bumblesniff', 'Bendthatdick',
'Bunsenburner', 'Bandersnatch', 'Brittlebitch', 'Burgerking', 'Bendystick'
];
const lastNames = [
'Cumberbatch', 'Cucumberpatch', 'Cuttlefish', 'Cunningsnatch', 'Crumplesnatch',
'Curdlesnoot', 'Custardbath', 'Candygram', 'Cumberdict', 'Cabbagepatch',
'Chowderpants', 'Cuddlebug', 'Cricketbat', 'Crumpleditch', 'Chucklebucket',
'Thunderbatch', 'Cumbersome', 'Cummerbund', 'Counterbatch', 'Snugglesnatch',
'Curdlemilk', 'Clumpybunch', 'Crumblesnatch', 'Pumpkinpatch', 'Hufflepuff'
];
const generateBtn = document.getElementById('generateBtn');
const copyBtn = document.getElementById('copyBtn');
const shareBtn = document.getElementById('shareBtn');
const nameDisplay = document.getElementById('nameDisplay');
let currentName = '';
function generateName() {
const firstName = firstNames[Math.floor(Math.random() * firstNames.length)];
const lastName = lastNames[Math.floor(Math.random() * lastNames.length)];
currentName = `${firstName} ${lastName}`;
nameDisplay.innerHTML = `
<div class="generated-name">${currentName}</div>
<div class="name-subtitle">A perfectly British gentleman</div>
`;
copyBtn.disabled = false;
shareBtn.disabled = false;
}
generateBtn.addEventListener('click', generateName);
copyBtn.addEventListener('click', () => {
navigator.clipboard.writeText(currentName).then(() => {
const originalText = copyBtn.innerHTML;
copyBtn.innerHTML = '✅ Copied!';
setTimeout(() => {
copyBtn.innerHTML = originalText;
}, 2000);
});
});
shareBtn.addEventListener('click', () => {
if (navigator.share) {
navigator.share({
title: 'Benedict Cumberbatch Name Generator',
text: `Check out this name: ${currentName}`,
}).catch(() => {});
} else {
const url = window.location.href;
navigator.clipboard.writeText(`${currentName} - Generated at ${url}`);
const originalText = shareBtn.innerHTML;
shareBtn.innerHTML = '✅ Link Copied!';
setTimeout(() => {
shareBtn.innerHTML = originalText;
}, 2000);
}
});
// Generate initial name
window.addEventListener('load', generateName);
No comments yet. Be the first!