<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Krispis Industries Logo</title>
<style>
body {
background-color: #2c3e50;
text-align: center;
font-family: 'Arial, sans-serif';
}
#logoCanvas {
margin-top: 50px;
border: 2px solid #34495e;
}
#downloadBtn {
margin-top: 20px;
padding: 15px 30px;
font-size: 18px;
color: #ecf0f1;
background-color: #e74c3c;
border: none;
border-radius: 5px;
cursor: pointer;
}
#downloadBtn:hover {
background-color: #c0392b;
}
</style>
</head>
<body>
<canvas id="logoCanvas" width="800" height="300"></canvas>
<br>
<button id="downloadBtn">Download Logo as PNG</button>
<script>
const canvas = document.getElementById('logoCanvas');
const ctx = canvas.getContext('2d');
// Background Gradient
const bgGradient = ctx.createLinearGradient(0, 0, canvas.width, canvas.height);
bgGradient.addColorStop(0, '#8e44ad');
bgGradient.addColorStop(1, '#2980b9');
ctx.fillStyle = bgGradient;
ctx.fillRect(0, 0, canvas.width, canvas.height);
// Decorative Circles
for (let i = 0; i < 100; i++) {
ctx.beginPath();
const radius = Math.random() * 50;
const x = Math.random() * canvas.width;
const y = Math.random() * canvas.height;
ctx.arc(x, y, radius, 0, Math.PI * 2, false);
ctx.fillStyle = `rgba(255, 255, 255, ${Math.random() * 0.1})`;
ctx.fill();
}
// Text Shadow
ctx.shadowColor = 'rgba(0, 0, 0, 0.7)';
ctx.shadowOffsetX = 4;
ctx.shadowOffsetY = 4;
ctx.shadowBlur = 10;
// Text Styling
ctx.font = 'bold 80px Verdana';
ctx.textAlign = 'center';
ctx.fillStyle = '#ecf0f1';
ctx.fillText('Krispis Industries', canvas.width / 2, canvas.height / 2);
// Reset Shadow for Inner Glow
ctx.shadowColor = 'transparent';
ctx.lineWidth = 2;
ctx.strokeStyle = '#ecf0f1';
ctx.strokeText('Krispis Industries', canvas.width / 2, canvas.height / 2);
// Download Button Functionality
const downloadBtn = document.getElementById('downloadBtn');
downloadBtn.addEventListener('click', function () {
const link = document.createElement('a');
link.download = 'krispis_industries_logo.png';
link.href = canvas.toDataURL();
link.click();
});
</script>
</body>
</html>
Instructions:
- Save the above code in a file with an
.html extension (e.g., logo.html).
- Open the file in a web browser to view the rendered logo.
- Click the "Download Logo as PNG" button to save the logo as a PNG image.
Explanation:
- Canvas Element: Used to draw the logo dynamically with HTML5 Canvas API.
- Gradient Background: A linear gradient creates a colorful background that transitions from purple to blue.
- Decorative Elements: Semi-transparent white circles add a dynamic and stylish effect to the background.
- Text Styling: The company name "Krispis Industries" is styled with a bold font, center alignment, and shadows for depth.
- Download Functionality: JavaScript captures the canvas content and triggers a download when the button is clicked.
Feel free to customize the styles, colors, and decorative elements to match your brand's aesthetic.