修bug

•
8259 26

前言

很久之前添加了上下文点击切换功能,但是一直没发现新增的切换区域没有做夜间模式适配,修复并记录一下。还有文章粘贴代码显示没做限制,有多少代码就显示多少会导致整屏都是代码,很不好,限制一下。

添加上下文切换

找到usr/themes/pigeon/post.php文件,在104行添加以下代码

                    <div class="prvenext m-b-lg">
                        <ul class="nextprev">
                        <li class="next"><a>« <?php $this->theNext(); ?></a></li>
                        <li class="pervious"><?php $this->thePrev(); ?><a> »</a></li></ul>
                    </div>

样式代码可在<script>标签上一行添加,代码如下

            <style>
               
                .prvenext {
                    background-color:#fff;
                    padding: 1.5rem 0;
                }
                .prvenext ul {
                    padding: 0;
                    margin: 0;
                    list-style: none;
                    display: flex;
                    align-items: center;
                    justify-content: space-between;
                    width: 100%;
                    padding: 0 1.25rem;
                }
                .prvenext ul li {
                    position: relative;
                    list-style-type:none;
                    text-overflow:ellipsis;
                    overflow:hidden;
                    white-space:nowrap;
                }
                .prvenext a {
                    color: #9999FF;
                    text-decoration: none;
                    transition: color .1s;
                }
                @media (max-width:767.98px){
                    .prvenext ul{
                        flex-direction: column;
                        align-items: normal;
                    }
                    .pervious li{
                        display: ;
                    }
                    .prvenext .next{
                        text-align: left;
                        line-height: 25px;
                    }
                 .prvenext .pervious{
                        text-align: right;
                    }
                }
               
            </style>

夜间模式适配

在usr/themes/pigeon/assets/css/style.css文件中搜索.public,.dark .album_list,然后在搜索到的代码后添加,.dark .prvenext,整体如下所示.public,.dark .album_list,.dark .prvenext{...}

代码区域显示限制

请教了风记星辰,依然是style.css文件,搜索.song pre code在大括号中添加如下代码

max-width:235px;min-height: 60px;margin: 0 -16px 0 0;-webkit-mask: linear-gradient(180deg, #00000000, #000) no-repeat 0 0 / 100% 10px, linear-gradient(180deg, #000, #000) no-repeat center / 100% calc(100% - 20px), linear-gradient(180deg, #000, #00000000) no-repeat 100% 100% / 100% 10px;

贴心的风记星辰,把代码显示区域底部的滑动渐变都做好了,还有滚动条靠右侧显示,区别图就不放了,图床服务器估计快挂了,不好买新服务器更不好续费,太贵了!

最后更新 2022-09-21