<style>
.upvote-button {
display: inline-block;
background-color: #fa5518ff;
color: #ffffff;
font-weight: bold;
padding: 12px 24px;
font-size: 16px;
border: none;
border-radius: 6px;
text-decoration: none;
cursor: pointer;
transition: background-color 0.3s ease;
}
.upvote-button:hover {
background-color: #e14911;
}
</style>
<button id="upvote-button" class="upvote-button">
👍 Upvote This Post
</button>
<script>
const currentUrl = window.location.href;
const pathParts = window.location.pathname.split('/').filter(Boolean);
const slug = pathParts[pathParts.length - 1] || 'this-post';
// Convert slug to Title Case
const blogTitle = slug.replace(/-/g, ' ').replace(/\b\w/g, char => char.toUpperCase());
// Update button text
const upvoteBtn = document.getElementById('upvote-button');
upvoteBtn.textContent = `👍 Vote for ${blogTitle}`;
// Build form URL with UTM params
const formBaseUrl = "https://files.bizlyapp.com/widget/form/bCzNPP8KQXEF4AhB1oye";
const fullUrl = `${formBaseUrl}?initial_url=${encodeURIComponent(currentUrl)}&blog_voted_for=${encodeURIComponent(blogTitle)}`;
// Open form on click
upvoteBtn.addEventListener('click', () => {
window.open(fullUrl, '_blank');
});
</script>