2024防红代码分享

<?php
if (!defined('EMLOG_ROOT')) {
    $scriptpath = str_replace('\\', '/', $_SERVER['SCRIPT_NAME']);
    $sitepath = substr($scriptpath, 0, strrpos($scriptpath, '/'));
    $siteurl = ($_SERVER['SERVER_PORT'] == '443' ? 'https://' : 'https://') . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
}
?>
<!DOCTYPE html>
<html lang="zh-CN">

<head>
    <meta charset="UTF-8">
    <title>资源宝www.httple.net</title>
    <style>
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }

        body {
            //鸿蒙字体,如果没有安装这个字体那么就不会生效
            font-family: 'HarmonyOS Sans SC', sans-serif;
        background-repeat: repeat;
        background-size: cover;
        }

        .overlay {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            display: flex;
            justify-content: center;
            align-items: center;
            //自动获取bing每日背景图
             background-image: url('https://bing.img.run/1920x1080.php');
            z-index: 9999;
            background-repeat: no-repeat;
    background-size: cover;
    background-position: center center;
            
        }

        .message {
            background-color: #fff;
            padding: 20px;
            border-radius: 10px;
            text-align: center;
            box-shadow: 0 0 10px rgba(0, 0, 0, 0.2);
            max-width: 80%;
        }

        .icon {
            width: 196px;
            height: 87px;
            background: url(LOGO链接) no-repeat center center;
            background-size: cover;
            margin-bottom: 20px;
            margin-left: auto;
            margin-right: auto;
        }

        .wenben {
            margin-bottom: 20px;
        }

        .wenben p {
            font-size: 16px;
            line-height: 1.5;
        }

        .url {
            margin-bottom: 20px;
            text-align: center;
        }

        .url input {
            width: 100%;
            padding: 10px;
            border: none;
            border-radius: 5px;
            background-color: #f5f5f5;
            text-align: center;
            color: #787070;
            font-size: 16px;
            font-weight: bold;
        }

        .copy,
        .tutorial {
            display: inline-block;
            padding: 10px 20px;
            border: none;
            border-radius: 5px;
            transition: background-color 0.3s ease;
            font-size: 16px;
            line-height: 1.5;
            text-transform: uppercase;
            cursor: pointer;
            margin-right: 10px;
            color: #fff;
        }

        .copy:hover,
        .tutorial:hover {
            opacity: 0.8;
        }

        .copy {
            background-color: #007bff;
        }

        .tutorial {
            background-color: #28a745;
        }

        .toast {
            position: fixed;
            top: 20px;
            left: 50%;
            transform: translateX(-50%);
            background-color: rgba(0, 0, 0, 0.7);
            color: #fff;
            padding: 10px 20px;
            border-radius: 5px;
            opacity: 0;
            transition: opacity 0.3s ease;
            font-size: 16px;
            line-height: 1.5;
        }

        .toast.show {
            opacity: 1;
        }
    </style>
</head>

<body>
    <div class="overlay">
        <div class="message">
            <div class="icon"></div>
            <div class="wenben">
              <p>
  由于微信或QQ浏览器的限制
</p>
<p>
  你可以选择<strong>复制链接</strong>或右上角点击“<strong>...</strong>”选择<strong>浏览器中打开</strong>
</p>
            </div>
            <div class="url">
                <input type="text" value="<?php echo htmlspecialchars($siteurl, ENT_QUOTES); ?>" size="<?php echo strlen($siteurl); ?>" readonly>
            </div>
            <button class="copy" onclick="copyUrl()">复制链接</button>
            <!--<button class="tutorial" onclick="showTutorial()">操作教程</button>-->
            <div class="toast" id="toast">链接已复制到剪贴板</div>
        </div>
    </div>
    <div id="tutorial" style="display: none;">
        <div class="overlay">
            <div class="message">
                <div class="wenben" style="text-align: left;">
                    <p>如何在微信或QQ中使用系统浏览器打开当前页面:</p>
                    <p>1. 点击右上角的三个点,打开菜单。</p>
                    <p>2. 选择“在浏览器中打开”。</p>
                    <p>3. 系统会自动打开默认的浏览器,并打开当前页面。</p>
                </div>
                <button class="tutorial" onclick="hideTutorial()">关闭</button>
            </div>
        </div>
    </div>
    <script>
        function copyUrl() {
            var urlInput = document.querySelector('.url input');
            urlInput.select();
            document.execCommand('copy');
            var toast = document.getElementById('toast');
            toast.classList.add('show');
            setTimeout(function () {
                toast.classList.remove('show');
            }, 2000);
        }

        function showTutorial() {
            document.getElementById('tutorial').style.display = 'block';
        }

        function hideTutorial() {
            document.getElementById('tutorial').style.display = 'none';
        }
    </script>
</body>

</html>
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

云博客-资源宝

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值