当前位置:首页 > 技术博客 > HTML > 【原创】浏览器访问动画单页提示页面

【原创】浏览器访问动画单页提示页面

3个月前 (03-22)HTML295

微信,QQ用户访问转浏览器访问的动画提示页面,www.liuzhixi.cn作者原创!



<!DOCTYPE html>    
<html lang="zh-CN">    
<head>    
<meta charset="UTF-8">    
<meta name="viewport" content="width=device-width, initial-scale=1.0">    
<title>请使用浏览器打开</title>    
<style>    
/* 基础样式 */    
body {    
font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;    
background: url("https://static.zhihu.com/heifetz/assets/sign_bg.47eec442.png") no-repeat center center fixed;    
background-size: cover;    
display: flex;    
justify-content: center;    
align-items: center;    
height: 100vh;    
margin: 0;    
color: #fff;    
position: relative;    
overflow: hidden;    
}    
/* 遮罩层 */    
body::before {    
content: "";    
position: absolute;    
top: 0;    
left: 0;    
width: 100%;    
height: 100%;    
background: rgba(0, 0, 0, 0.5);    
z-index: 0;    
}    
.container {    
text-align: center;    
background: rgba(255, 255, 255, 0.1);    
padding: 40px;    
border-radius: 20px;    
backdrop-filter: blur(10px);    
box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);    
max-width: 400px;    
width: 100%;    
animation: fadeIn 1s ease-in-out;    
position: relative;    
z-index: 1;    
border: 1px solid rgba(255, 255, 255, 0.3);    
}    
h1 {    
font-size: 2rem;    
margin-bottom: 20px;    
font-weight: 600;    
color: #fff;    
text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);    
}    
p {    
font-size: 1rem;    
line-height: 1.6;    
margin-bottom: 30px;    
color: rgba(255, 255, 255, 0.8);    
}    
.browser-icon {    
width: 100px;    
height: 100px;    
margin-bottom: 20px;    
animation: bounce 2s infinite;    
filter: drop-shadow(2px 4px 6px rgba(0, 0, 0, 0.5));    
}    
/* 按钮样式 */    
.button {    
display: inline-block;    
padding: 12px 24px;    
font-size: 1rem;    
color: #fff;    
background: linear-gradient(135deg, #6a11cb, #2575fc);    
border-radius: 30px;    
text-decoration: none;    
transition: all 0.3s ease;    
box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);    
position: relative;    
overflow: hidden;    
}    
.button:hover {    
transform: translateY(-2px);    
box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);    
}    
.button:active {    
transform: translateY(0);    
box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);    
}    
/* 动画 */    
@keyframes fadeIn {    
from {    
opacity: 0;    
transform: translateY(20px);    
}    
to {    
opacity: 1;    
transform: translateY(0);    
}    
}    
@keyframes bounce {    
0%, 100% {    
transform: translateY(0);    
}    
50% {    
transform: translateY(-10px);    
}    
}    
</style>    
</head>    
<body>    
<div class="container">    
<img src="https://img.icons8.com/fluency/96/000000/internet.png" alt="Browser Icon" class="browser-icon">    
<h1>请使用浏览器打开</h1>    
<p>为了获得更好的体验,请复制链接并在浏览器中打开。</p>    
<a href="#" class="button">复制链接</a>    
</div>    
<script>    
// 检测是否在微信或手机QQ中打开    
function isWeixin() {    
return /MicroMessenger/i.test(navigator.userAgent);    
}    
function isQQ() {    
return /QQ/i.test(navigator.userAgent);    
}    
if (isWeixin() || isQQ()) {    
// 如果在微信或手机QQ中打开,显示提示信息    
document.querySelector(".container").innerHTML = `    
<img src="https://img.icons8.com/fluency/96/000000/internet.png" alt="Browser Icon" class="browser-icon">    
<h1>请使用浏览器打开</h1>    
<p>为了获得更好的体验,请点击右上角菜单,选择“在浏览器中打开”。</p>    
<a href="#" class="button">复制链接</a>    
`;    
}    
// 复制链接功能    
const button = document.querySelector(".button");    
button.addEventListener("click", (e) => {    
e.preventDefault();    
const url = window.location.href;    
navigator.clipboard.writeText(url).then(() => {    
alert("链接已复制到剪贴板!");    
}).catch(() => {    
alert("复制失败,请手动复制链接。");    
});    
});    
</script>    
</body>    
</html>


版权声明:本文由 LzxBlog 发布,如需转载请注明出处。

本文链接:https://www.liuzhixi.cn/html/311.html

返回列表

上一篇:响应式课程培训中心HTML模板

没有最新的文章了...

相关文章

html5的inputType

html5的inputType

属性值说明email限制用户输入的内容必须是Email类型url限制用户输入的内容必须是url类型date限制用户输入的内容必须是日期类型time限制用户输入的...

产品分类图片列表tab切换特效

产品分类图片列表tab切换特效

jQuery制作简洁的产品分类图片列表tab布局,带标题和分类菜单的图文列表选项卡切换特效。...

黑色的分类下拉菜单选择ui特效

黑色的分类下拉菜单选择ui特效

html5基于svg制作制作黑色简洁的带图标分类的下拉菜单,点击选中下拉菜单效果。可用于各大网站分类菜单选择特效。css代码html { &...

React垂直手风琴收缩展示特效

React垂直手风琴收缩展示特效

基于React dom制作简洁黑色的垂直手风琴菜单收缩内容展示,支持滑动和多个菜单收缩展开效果,通过js获取标题和内容,直接修改文本即可使用。下载链接: htt...

网页坦克大战

网页坦克大战

经典90版html5坦克大战游戏+源码。操作说明:玩家1:wasd上左下右,space射击;玩家2:方向键,enter射击。n下一关,p上一关。下载链接: ht...

简洁的手工商品电子商务HTML模板

简洁的手工商品电子商务HTML模板

一款简洁大气的手工商品,手工制品,手工艺术品销售商城HTML响应式模板。它总共包含2个主页、6个博客页面、6个商店页面、11个产品页面、6个内页等。...

发表评论

访客

看不清,换一张

◎欢迎参与讨论,请在这里发表您的看法和观点。