<style>
#subscribeFloat{
position:fixed;
left:-235px;
top:50%;
transform:translateY(-50%);
z-index:9999;
transition:0.4s;
}
#subscribeFloat:hover{
left:0;
}
#subscribeFloat a{
display:flex;
align-items:center;
gap:10px;
background:linear-gradient(90deg,#ff9800,#ff5722);
color:#fff;
font-weight:bold;
text-decoration:none;
padding:14px 18px;
border-radius:0 12px 12px 0;
box-shadow:0 4px 15px rgba(0,0,0,0.25);
font-size:16px;
letter-spacing:0.3px;
white-space:nowrap;
}
#subscribeFloat .icon{
font-size:22px;
}
/* Mobile */
@media(max-width:768px){
#subscribeFloat{
left:-195px;
top:70%;
}
#subscribeFloat a{
font-size:13px;
padding:10px 14px;
}
}
</style>
<!-- Floating Subscribe Button -->
<div id='subscribeFloat'>
<a href="javascript:void(0);" onclick="goSubscribe()">
<span class='icon'>📩</span>
<span>Subscribe Newsletter</span>
<span class='icon'>➤</span>
</a>
</div>
<script>
function goSubscribe(){
let currentUrl =
window.location.pathname +
window.location.search;
window.location.href =
'subscribe.php?url=' +
encodeURIComponent(currentUrl);
}
</script>
No comments:
Post a Comment