Business Card Maker
body {
margin: 0;
padding: 0;
display: flex;
align-items: center;
justify-content: center;
height: 100vh;
background-color: #f0f0f0;
}
.business-card {
background-color: #3498db;
color: #ffffff;
padding: 20px;
border-radius: 10px;
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
cursor: pointer;
transition: background-color 0.3s;
}
.header {
text-align: center;
}
.logo {
width: 100px;
height: 100px;
background-image: url('logo.png'); /* Replace with your logo image URL */
background-size: cover;
background-position: center;
}
.name {
font-size: 1.5em;
font-weight: bold;
}
.position {
margin-top: 5px;
}
.contact {
margin-top: 20px;
}
.email, .phone {
font-size: 1.2em;
}
document.addEventListener('DOM Content Loaded', function () {
const business Card = document.getElementById('business Card');
businessCard.addEventListener('click', function () {
// Change background color on click
const random Color = get Random Color();
businessCard.style.backgroundColor = random Color;
// Use Snap.svg to manipulate the business card logo
const logo = Snap('#logo');
logo.animate({ transform: 'r360' }, 1000);
});
function Get Random Color() {
const letters = '0123456789ABCDEF';
let color = '#';
for (let i = 0; i < 6; i++) {
color += letters[Math.floor(Math.random() * 16)];
}
return color;
}
});
No comments:
Post a Comment