/* Download App Button Widget Styles */
#blogger-download-widget {
position: relative;
z-index: 1000;
font-family: -apple-system, BlinkMacSystemFont, ‘Segoe UI’, Roboto, sans-serif;
margin: 20px 0;
text-align: center;
}
.blogger-download-button {
display: inline-flex;
align-items: center;
gap: 12px;
padding: 16px 24px;
background: linear-gradient(135deg, #17a2b8, #138496);
border: none;
border-radius: 30px;
color: white;
font-size: 16px;
font-weight: 600;
cursor: pointer;
transition: all 0.3s ease;
text-decoration: none;
outline: none;
box-shadow: 0 6px 20px rgba(23, 162, 184, 0.4);
position: relative;
overflow: hidden;
}
.blogger-download-button::before {
content: ”;
position: absolute;
top: 0;
left: -100%;
width: 100%;
height: 100%;
background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
transition: left 0.6s ease;
}
.blogger-download-button:hover::before {
left: 100%;
}
.blogger-download-button:hover {
transform: translateY(-3px);
box-shadow: 0 8px 25px rgba(23, 162, 184, 0.5);
background: linear-gradient(135deg, #138496, #117a8b);
}
.blogger-download-button:focus {
outline: 3px solid #17a2b8;
outline-offset: 3px;
}
.blogger-download-button:active {
transform: translateY(-1px);
box-shadow: 0 4px 15px rgba(23, 162, 184, 0.4);
}
.download-icon {
font-size: 20px;
flex-shrink: 0;
}
.download-text {
font-size: 16px;
font-weight: 600;
}
/* Pulse animation for the button */
@keyframes pulse {
0% {
box-shadow: 0 0 0 0 rgba(23, 162, 184, 0.7);
}
70% {
box-shadow: 0 0 0 15px rgba(23, 162, 184, 0);
}
100% {
box-shadow: 0 0 0 0 rgba(23, 162, 184, 0);
}
}
.blogger-download-button {
animation: pulse 2s infinite;
}
/* Responsive Design */
@media (max-width: 768px) {
.blogger-download-button {
padding: 14px 20px;
font-size: 15px;
}
.download-icon {
font-size: 18px;
}
.download-text {
font-size: 15px;
}
}
@media (max-width: 480px) {
.blogger-download-button {
padding: 12px 18px;
font-size: 14px;
width: 100%;
max-width: 300px;
}
.download-icon {
font-size: 16px;
}
.download-text {
font-size: 14px;
}
}
/* Accessibility & Reduced Motion */
@media (prefers-reduced-motion: reduce) {
.blogger-download-button {
animation: none;
}
.blogger-download-button::before {
transition: none;
}
.blogger-download-button {
transition: none;
}
}
/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
.blogger-download-button:focus {
outline-color: #17a2b8;
}
}
(function() {
‘use strict’;
// Avoid conflicts with existing code
if (window.BloggerDownloadWidget) return;
class BloggerDownloadWidget {
constructor() {
this.downloadBtn = document.querySelector(‘.blogger-download-button’);
this.init();
}
init() {
this.setupEventListeners();
}
setupEventListeners() {
if (this.downloadBtn) {
// Add keyboard navigation
this.downloadBtn.addEventListener(‘keydown’, (e) => {
if (e.key === ‘Enter’ || e.key === ‘ ‘) {
e.preventDefault();
this.downloadBtn.click();
}
});
// Add download confirmation
this.downloadBtn.addEventListener(‘click’, (e) => {
// Optional: Add download confirmation dialog
if (this.showDownloadConfirmation()) {
// Proceed with download
this.trackDownload();
} else {
e.preventDefault();
}
});
}
}
showDownloadConfirmation() {
// Optional: Show confirmation dialog before download
// Return true to proceed, false to cancel
return true; // Remove this if you want to add confirmation
}
trackDownload() {
// Optional: Track download event for analytics
if (typeof gtag !== ‘undefined’) {
gtag(‘event’, ‘download’, {
‘event_category’: ‘App’,
‘event_label’: ‘App Download’
});
}
// Optional: Show download started message
this.showDownloadMessage();
}
showDownloadMessage() {
// Create a temporary message
const message = document.createElement(‘div’);
message.style.cssText = `
position: fixed;
top: 20px;
right: 20px;
background: #28a745;
color: white;
padding: 12px 20px;
border-radius: 5px;
font-size: 14px;
z-index: 100000;
box-shadow: 0 4px 12px rgba(0,0,0,0.3);
animation: slideIn 0.3s ease;
`;
message.textContent = ‘Download started! Check your downloads folder.’;
// Add slide-in animation
const style = document.createElement(‘style’);
style.textContent = `
@keyframes slideIn {
from { transform: translateX(100%); opacity: 0; }
to { transform: translateX(0); opacity: 1; }
}
`;
document.head.appendChild(style);
document.body.appendChild(message);
// Remove message after 3 seconds
setTimeout(() => {
message.style.animation = ‘slideIn 0.3s ease reverse’;
setTimeout(() => {
if (message.parentNode) {
message.parentNode.removeChild(message);
}
}, 300);
}, 3000);
}
}
// Initialize when DOM is ready
function initWidget() {
if (document.getElementById(‘blogger-download-widget’)) {
window.BloggerDownloadWidget = new BloggerDownloadWidget();
}
}
if (document.readyState === ‘loading’) {
document.addEventListener(‘DOMContentLoaded’, initWidget);
} else {
initWidget();
}
})();