<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>微信扫描关注特效</title>
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
<style>
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
font-family: 'Microsoft YaHei', sans-serif;
background-color: #f5f5f5;
color: #333;
line-height: 1.6;
}
.container {
max-width: 800px;
margin: 50px auto;
padding: 20px;
text-align: center;
}
h1 {
color: #07C160;
margin-bottom: 30px;
font-size: 28px;
}
.content {
background-color: white;
border-radius: 10px;
padding: 30px;
box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
position: relative;
overflow: hidden;
}
.wechat-tip {
display: none;
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
background-color: rgba(0, 0, 0, 0.7);
z-index: 9999;
justify-content: center;
align-items: center;
}
.wechat-box {
background-color: white;
padding: 20px;
border-radius: 10px;
text-align: center;
animation: fadeIn 0.5s;
position: relative;
}
.wechat-box img {
width: 200px;
height: 200px;
margin: 15px 0;
border: 1px solid #eee;
}
.close-btn {
position: absolute;
top: 10px;
right: 10px;
font-size: 20px;
cursor: pointer;
color: #999;
}
.qrcode-btn {
display: inline-block;
margin-top: 20px;
padding: 12px 30px;
background-color: #07C160;
color: white;
border-radius: 5px;
text-decoration: none;
font-size: 16px;
cursor: pointer;
transition: all 0.3s;
border: none;
outline: none;
}
.qrcode-btn:hover {
background-color: #06AD56;
transform: translateY(-2px);
box-shadow: 0 5px 10px rgba(7, 193, 96, 0.3);
}
.guide {
margin-top: 30px;
text-align: left;
padding: 15px;
background-color: #f9f9f9;
border-radius: 5px;
border-left: 4px solid #07C160;
}
.guide ol {
padding-left: 20px;
}
.guide li {
margin-bottom: 10px;
}
.footer {
margin-top: 30px;
color: #999;
font-size: 14px;
}
@keyframes fadeIn {
from { opacity: 0; transform: scale(0.8); }
to { opacity: 1; transform: scale(1); }
}
.pulse {
animation: pulse 1.5s infinite;
}
@keyframes pulse {
0% { transform: scale(1); }
50% { transform: scale(1.05); }
100% { transform: scale(1); }
}
</style>
</head>
<body>
<div class="container">
<h1>欢迎关注我们的微信公众号</h1>
<div class="content">
<p>获取更多精彩内容,请扫描下方二维码关注我们的微信公众号</p>
<button class="qrcode-btn pulse">点击显示二维码</button>
<div class="guide">
<h3>关注指南:</h3>
<ol>
<li>点击上方按钮显示二维码</li>
<li>打开微信扫一扫功能</li>
<li>对准屏幕上的二维码扫描</li>
<li>点击关注公众号</li>
</ol>
</div>
</div>
<div class="footer">
</div>
</div>
<div class="wechat-tip">
<div class="wechat-box">
<span class="close-btn">×</span>
<h2>微信扫码关注</h2>
<p>长按识别二维码关注公众号</p>
<img src="https://via.placeholder.com/200x200/07C160/FFFFFF?text=WeChat+QR" alt="微信公众号二维码">
<p>关注后获取更多精彩内容</p>
</div>
</div>
<script>
$(document).ready(function() {
// 显示二维码弹窗
$('.qrcode-btn').click(function() {
$('.wechat-tip').fadeIn(300);
});
// 关闭二维码弹窗
$('.close-btn').click(function() {
$('.wechat-tip').fadeOut(300);
});
// 点击弹窗外部关闭
$(document).mouseup(function(e) {
var container = $(".wechat-box");
if (!container.is(e.target) && container.has(e.target).length === 0) {
$('.wechat-tip').fadeOut(300);
}
});
// 按钮悬停效果
$('.qrcode-btn').hover(
function() {
$(this).addClass('pulse');
},
function() {
$(this).removeClass('pulse');
}
);
// 模拟二维码加载
setTimeout(function() {
$('.wechat-box img').attr('src', 'https://via.placeholder.com/200x200/07C160/FFFFFF?text=WeChat+QR');
}, 500);
});
</script>
</body>
</html>
3551

被折叠的 条评论
为什么被折叠?



