57 lines
2.0 KiB
PHP
57 lines
2.0 KiB
PHP
<?php
|
|
/**
|
|
* Plugin Name: Telegram 联系按钮
|
|
* Description: 在页面右下角添加悬浮的 Telegram 联系按钮。
|
|
*/
|
|
|
|
function shihao_tg_button() {
|
|
?>
|
|
<div class="shihao-tg-wrapper">
|
|
<a href="https://t.me/shihaowz" target="_blank" class="shihao-tg-btn">
|
|
<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
|
|
<path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm4.64 6.8c-.15 1.58-.8 5.42-1.13 7.19-.14.75-.42 1-.68 1.03-.58.05-1.02-.38-1.58-.75-.88-.58-1.38-.94-2.23-1.5-.99-.65-.35-1.01.22-1.59.15-.15 2.71-2.48 2.76-2.69.01-.03.01-.14-.07-.2-.08-.06-.19-.04-.27-.02-.11.02-1.93 1.23-5.46 3.62-.51.35-.98.52-1.4.51-.46-.01-1.35-.26-2.01-.48-.81-.27-1.45-.42-1.39-.88.03-.24.31-.48.84-.74 3.27-1.42 5.44-2.35 6.51-2.81 3.1-.1.32-.42.34-.44.02-.02.04-.05.04-.08z" fill="white"/>
|
|
</svg>
|
|
<span class="tg-label">联系客服</span>
|
|
</a>
|
|
</div>
|
|
<style>
|
|
.shihao-tg-wrapper {
|
|
position: fixed;
|
|
bottom: 30px;
|
|
right: 30px;
|
|
z-index: 10000;
|
|
text-align: center;
|
|
}
|
|
.shihao-tg-btn {
|
|
display: flex;
|
|
flex-direction: column;
|
|
align-items: center;
|
|
text-decoration: none;
|
|
transition: transform 0.3s ease;
|
|
}
|
|
.shihao-tg-btn:hover {
|
|
transform: scale(1.1);
|
|
}
|
|
.shihao-tg-btn svg {
|
|
width: 60px;
|
|
height: 60px;
|
|
background: #0088cc;
|
|
border-radius: 50%;
|
|
padding: 12px;
|
|
box-shadow: 0 10px 25px rgba(0, 136, 204, 0.4);
|
|
margin-bottom: 5px;
|
|
}
|
|
.tg-label {
|
|
background: #fff;
|
|
color: #0088cc;
|
|
font-size: 12px;
|
|
font-weight: bold;
|
|
padding: 4px 10px;
|
|
border-radius: 20px;
|
|
box-shadow: 0 4px 10px rgba(0,0,0,0.1);
|
|
white-space: nowrap;
|
|
}
|
|
</style>
|
|
<?php
|
|
}
|
|
add_action('wp_footer', 'shihao_tg_button');
|