|
分享下我自己折腾的自定义模块代码供大家下载,可能某些主题不支持,具体大家自行测试
侧边栏发帖按钮代码:
- <div style="margin: 20px 0;">
- <style>
- @import url('https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0/css/all.min.css');
- </style>
- <a href="forum.php?mod=misc&action=nav"
- onclick="showWindow('nav', this.href, 'get', 0); return false;"
- style="display: block; width: 100%; background-color: #009a61; color: white; padding: 12px 0; border-radius: 8px; text-align: center; text-decoration: none; font-size: 16px; font-weight: 500; transition: background-color 0.2s ease;"
- onmouseover="this.style.backgroundColor='#007a4d'"
- onmouseout="this.style.backgroundColor='#009a61'">
- <i class="fas fa-edit" style="margin-right: 6px;"></i> 我要发帖
- </a>
- </div>
复制代码
首页公告框重新美化
- <style>
- #notices {
- max-width: 800px;
- margin: 0 auto;
- padding: 0;
- }
- .alert-notice {
- background: #f8fdf8;
- border: 1px solid #e5f3e5;
- border-radius: 6px;
- padding: 16px;
- margin: 12px 0;
- border-left: 3px solid #22c55e;
- }
- .alert-notice h2 {
- color: #14532d;
- font-weight: 600;
- font-size: 18px;
- margin: 0 0 12px 0;
- }
- .alert-notice p {
- color: #166534;
- font-size: 14px;
- line-height: 1.5;
- margin: 8px 0;
- }
- .alert-notice a {
- color: #14532d;
- text-decoration: none;
- font-weight: 500;
- }
- .alert-notice a:hover {
- color: #0f3b21;
- text-decoration: underline;
- }
- @media (max-width: 768px) {
- .alert-notice {
- padding: 14px;
- margin: 10px;
- }
- }
- </style>
- </head>
- <div id="notices" class="">
- <div class="alert-notice alert-warning" role="alert">
- <h2>欢迎加入 Blog do 论坛!</h2>
- <p>Blog do 论坛是博客建站爱好者的交流平台,我们致力于为大家提供一个开放的交流环境。</p>
-
- <p>Blog do论坛官网:<a class="report xs-12" href="https://nav.blog.do/" target="_blank">https://www.blog.do/</a></p>
-
- <p>Blog do网址导航:<a class="report xs-12" href="https://nav.blog.do/" target="_blank">https://nav.blog.do/</a></p>
-
- <p>站长邮箱:admin@blog.do</p>
- </div>
- </div>
复制代码
添加侧边栏友情链接展示框
- <title>友情链接 - 美化版</title>
- <style>
- /* 友情链接容器 */
- .x.cl {
- background: #ffffff;
- border-radius: 12px;
- box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
- overflow: hidden;
- margin-bottom: 20px;
- border: 1px solid rgba(0, 0, 0, 0.05);
- }
- /* 标题样式 */
- .friendship-title {
- background: #f8f9fa;
- color: #333;
- padding: 12px 16px;
- margin: 0;
- font-size: 14px;
- font-weight: 500;
- display: flex;
- align-items: center;
- position: relative;
- border-bottom: 1px solid #e9ecef;
- }
- .friendship-title::before {
- content: "🔗";
- margin-right: 6px;
- font-size: 14px;
- }
- /* 链接列表 */
- .cl.mbm {
- list-style: none;
- margin: 0;
- padding: 10px;
- display: flex;
- flex-wrap: wrap;
- gap: 6px;
- }
- .cl.mbm li {
- position: relative;
- transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
- flex: 0 0 calc(50% - 3px);
- }
- .cl.mbm li a {
- display: block;
- padding: 8px 12px;
- color: #333;
- text-decoration: none;
- font-size: 12px;
- font-weight: 400;
- position: relative;
- transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
- background: #f8f9fa;
- border-radius: 6px;
- text-align: center;
- line-height: 1.3;
- white-space: nowrap;
- overflow: hidden;
- text-overflow: ellipsis;
- }
- .cl.mbm li a::before {
- content: "";
- position: absolute;
- left: 0;
- top: 0;
- bottom: 0;
- width: 100%;
- background: rgba(0, 153, 101, 0.1);
- opacity: 0;
- border-radius: 6px;
- transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1);
- z-index: -1;
- }
- /* 悬停效果 */
- .cl.mbm li:hover {
- transform: translateY(-2px);
- }
- .cl.mbm li:hover a {
- color: #009965;
- }
- .cl.mbm li:hover a::before {
- opacity: 1;
- }
- /* 响应式设计 */
- @media (max-width: 768px) {
- .sidebar-demo {
- max-width: 100%;
- margin: 0;
- }
-
- .friendship-title {
- padding: 10px 12px;
- font-size: 13px;
- }
-
- .cl.mbm {
- padding: 8px;
- }
-
- .cl.mbm li a {
- padding: 6px 8px;
- font-size: 11px;
- }
- }
- /* 加载动画 */
- .x.cl {
- animation: slideInUp 0.6s cubic-bezier(0.4, 0, 0.2, 1);
- }
- @keyframes slideInUp {
- from {
- opacity: 0;
- transform: translateY(20px);
- }
- to {
- opacity: 1;
- transform: translateY(0);
- }
- }
- /* 深色模式支持 */
- @media (prefers-color-scheme: dark) {
- body {
- background: #1a1a1a;
- }
-
- .x.cl {
- background: #2d2d2d;
- border-color: rgba(255, 255, 255, 0.1);
- box-shadow: 0 2px 12px rgba(0, 0, 0, 0.3);
- }
-
- .cl.mbm li a {
- color: #e0e0e0;
- }
-
- .cl.mbm li:hover a {
- background: linear-gradient(90deg, rgba(0, 153, 101, 0.15), rgba(0, 153, 101, 0.08));
- color: #009965;
- }
-
- .cl.mbm li:not(:last-child)::after {
- background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
- }
- }
- </style>
- </head>
- <body>
- <div class="sidebar-demo">
- <!-- 友情链接模块 - 使用Discuz动态代码 -->
- <div class="x cl">
- <h3 class="friendship-title">友情链接</h3>
- <ul class="cl mbm">
- [loop]
- <li><a href="{url}" {target}>{title}</a></li>
- [/loop]
- </ul>
- </div>
- </div>
复制代码
|
|