超甜辣妹壁纸图片资源库网站源码开源免费下载

2026年3月22日12:05 宋佳乐 315 次浏览
超甜辣妹壁纸图片资源库网站源码开源免费下载


网站源码下载


点击查看演示站


开源代码如下:


<!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://cdn.tailwindcss.com"></script>
    <link href="https://cdn.jsdelivr.net/npm/font-awesome@4.7.0/css/font-awesome.min.css" rel="stylesheet">
    <script>
        // Tailwind自定义配置
        tailwind.config = {
            theme: {
                extend: {
                    colors: {
                        primary: '#ff69b4', // 甜辣粉
                        secondary: '#2d3748', // 深灰
                        light: '#f8f9fa', // 浅灰
                    },
                    fontFamily: {
                        sans: ['Inter', 'system-ui', 'sans-serif'],
                    },
                }
            }
        }
    </script>
    <style type="text/tailwindcss">
        @layer utilities {
            .wallpaper-card {
                @apply relative rounded-lg overflow-hidden shadow-lg hover:shadow-2xl transition-all duration-300 cursor-pointer;
            }
            .wallpaper-card:hover .overlay {
                @apply opacity-100;
            }
            .overlay {
                @apply absolute inset-0 bg-black/50 flex items-center justify-center opacity-0 transition-opacity duration-300;
            }
            .modal {
                @apply fixed inset-0 bg-black/80 flex items-center justify-center z-50 hidden;
            }
            .modal-content {
                @apply max-w-4xl max-h-[90vh] relative;
            }
            /* 新增:壁纸图片容器样式 */
            .wallpaper-img-container {
                @apply w-full min-h-[200px] max-h-[600px] flex items-center justify-center bg-gray-200;
            }
        }
    </style>
</head>
<body class="bg-gray-100 min-h-screen">
    <!-- 头部导航 -->
    <header class="bg-white shadow-md sticky top-0 z-40">
        <div class="container mx-auto px-4 py-3 flex items-center justify-between">
            <!-- Logo -->
            <div class="flex items-center">
                <img src="http://www.songjiale.com/img/logo.png" alt="logo" class="h-10 w-auto">
                <h1 class="ml-3 text-xl font-bold text-primary">超甜辣妹壁纸</h1>
            </div>
            
            <!-- 导航菜单 -->
            <nav>
                <ul class="flex space-x-6">
                    <li><a href="#" class="text-secondary hover:text-primary font-medium">首页</a></li>
                    <li><a href="#" class="text-secondary hover:text-primary font-medium">热门壁纸</a></li>
                    <li><a href="#" class="text-secondary hover:text-primary font-medium">关于我们</a></li>
                </ul>
            </nav>
        </div>
    </header>

    <!-- 主内容区 -->
    <main class="container mx-auto px-4 py-8">
        <!-- 页面介绍 -->
        <section class="mb-8 text-center">
            <h2 class="text-[clamp(1.8rem,4vw,2.5rem)] font-bold text-secondary mb-4">超甜辣妹壁纸合集</h2>
            <p class="text-gray-600 max-w-2xl mx-auto mb-6">
                这里汇集了全网最火的甜辣妹风格壁纸,每一张都精心挑选,适合手机、平板、电脑等各种设备使用。
                喜欢的壁纸请<b>右键点击图片 → 选择"图片另存为"</b>即可下载保存哦~
            </p>
            <div class="inline-block bg-primary/10 text-primary px-4 py-2 rounded-full text-sm">
                <i class="fa fa-heart mr-2"></i> 已更新 <?= rand(1000, 9999) ?>+ 张精美壁纸
            </div>
        </section>

        <!-- 壁纸展示区 -->
        <section class="mb-12">
            <!-- 调整网格列数:根据图片比例优化,减少大屏下列数避免过窄 -->
            <div class="grid grid-cols-1 sm:grid-cols-2 md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-6">
                <?php
                // 获取当前页码,默认第1页
                $page = isset($_GET['page']) ? max(1, intval($_GET['page'])) : 1;
                $perPage = 20; // 每页数量调整:适配新布局,减少每页数量避免加载过慢
                $totalPages = 10; // 模拟总页数,可根据实际需求调整
                
                // 生成当前页的壁纸图片
                for ($i = 1; $i <= $perPage; $i++) {
                    // 拼接API地址(添加随机参数避免缓存)
                    $imgUrl = "https://api.lolimi.cn/API/xjj/lt?rand=" . rand(100000, 999999);
                ?>
                <div class="wallpaper-card" onclick="openModal('<?= $imgUrl ?>')">
                    <!-- 核心修改:替换固定高度为自适应容器 -->
                    <div class="wallpaper-img-container">
                        <img src="<?= $imgUrl ?>" 
                             alt="辣妹壁纸<?= ($page-1)*$perPage + $i ?>" 
                             class="max-w-full max-h-full object-contain">
                    </div>
                    <div class="overlay">
                        <div class="text-white text-center">
                            <i class="fa fa-search-plus text-2xl mb-2"></i>
                            <p class="text-sm">点击查看大图</p>
                        </div>
                    </div>
                </div>
                <?php } ?>
            </div>
        </section>

        <!-- 分页控件 -->
        <section class="flex justify-center">
            <nav class="flex items-center space-x-2">
                <?php if ($page > 1): ?>
                <a href="?page=<?= $page-1 ?>" class="px-4 py-2 bg-white border border-gray-300 rounded hover:bg-primary hover:text-white transition-colors">
                    <i class="fa fa-chevron-left"></i> 上一页
                </a>
                <?php endif; ?>

                <span class="px-4 py-2 bg-primary text-white rounded">
                    第 <?= $page ?> 页 / 共 <?= $totalPages ?> 页
                </span>

                <?php if ($page < $totalPages): ?>
                <a href="?page=<?= $page+1 ?>" class="px-4 py-2 bg-white border border-gray-300 rounded hover:bg-primary hover:text-white transition-colors">
                    下一页 <i class="fa fa-chevron-right"></i>
                </a>
                <?php endif; ?>
            </nav>
        </section>
    </main>

    <!-- 图片放大模态框 -->
    <div id="imageModal" class="modal">
        <div class="modal-content">
            <span onclick="closeModal()" class="absolute top-4 right-4 text-white text-3xl cursor-pointer hover:text-primary">&times;</span>
            <img id="modalImage" src="" alt="大图预览" class="max-w-full max-h-[90vh]">
        </div>
    </div>

    <!-- 底部信息 -->
    <footer class="bg-secondary text-white py-6">
        <div class="container mx-auto px-4 text-center">
            <p>&copy; <?= date('Y') ?> 宋佳乐博客技术支持</p>
            <p class="text-sm text-gray-400 mt-2">
                <i class="fa fa-info-circle mr-1"></i> 所有壁纸仅供个人欣赏使用,请勿用于商业用途
            </p>
        </div>
    </footer>

    <!-- JavaScript -->
    <script>
        // 打开图片放大模态框
        function openModal(imgUrl) {
            const modal = document.getElementById('imageModal');
            const modalImage = document.getElementById('modalImage');
            modalImage.src = imgUrl;
            modal.style.display = 'flex';
            
            // 点击模态框背景关闭
            modal.onclick = function(e) {
                if (e.target === modal) {
                    closeModal();
                }
            }
            
            // 按ESC键关闭
            document.addEventListener('keydown', function(e) {
                if (e.key === 'Escape') {
                    closeModal();
                }
            });
        }

        // 关闭图片放大模态框
        function closeModal() {
            const modal = document.getElementById('imageModal');
            modal.style.display = 'none';
        }

        // 页面加载完成后的提示
        window.onload = function() {
            console.log('超甜辣妹壁纸网站加载完成~');
        }
    </script>
</body>
</html>

315 ° 来自:iPhone 本地/内网
您可能还喜欢这些:
版权声明 1 本网站名称:宋佳乐博客
2 本站永久网址:www.songjiale.com
3 本网站的文章部分内容可能来源于网络,仅供大家学习与参考,如有侵权,请联系站长 QQ2801910651进行删除处理。
4 本站一切资源不代表本站立场,并不代表本站赞同其观点和对其真实性负责。
5 本站一律禁止以任何方式发布或转载任何违法的相关信息,访客发现请向站长举报
6 本站资源大都存储在云盘,如发现链接失效,请联系我们我们会第一时间更新。
7 如无特别声明本文即为原创文章仅代表个人观点,版权归《宋佳乐博客》所有,欢迎转载,转载请保留原文链接。
8 如果您想第一时间收到本博最新文章可微信搜索公众号《佳乐博客》关注公众号第一时间获取最新消息。
广告位联系QQ2801910651 广告位联系QQ2801910651丨或者在线留言留下您的联系方式我们客服主动与您联系!
🌐 智链云科 全球MRO产业互联网双平台 mro.songjiale.com

亲,沙发正空着,还不快来抢?

评论审核已开启 记住我的个人信息 回复后邮件通知我
联系频道
任何意见或建议可以通过以下方式与我联系:
邮箱:sjl@songjiale.com QQ:1036821383
电话:16653183905
         
相关链接
© 2026 宋佳乐 [ 2026博客 ] Cpyright © 2015-2026, 宋佳乐. All Rights Reserved
投稿 - 相声 - 微博 - 下载 - 客服 - 发布 - 抖音 - 自媒体 - 郭晓婷 - 嘿 - 冀ICP备09062420号
Back to Top