diff --git a/template/5iux/config.php b/template/5iux/config.php new file mode 100644 index 0000000..61dce41 --- /dev/null +++ b/template/5iux/config.php @@ -0,0 +1,53 @@ + 'textarea', + 'name' => 'home_title', + 'title' => '首页提示', + 'description' => '显示在首页的提示内容,支持HTML代码', + "value" => $GLOBALS['conf']['home-title'], + ], + [ + 'type' => 'select', + 'name' => 'lytoday', + 'title' => '今日热榜', + 'description' => 'LyToday-JS插件显示位置,每日免费请求上限200次 查看文档', + "value" => 0, + 'enum' => [ + 0 => "关闭", + 1 => "开启", + ], + + ], + [ + 'type' => 'textarea', + 'name' => 'lytodaycode', + 'title' => '今日热榜代码', + 'description' => 'LyToday-JS插件自定义代码,若不了解请勿修改 查看文档', + 'value' => '
', + ], + [ + 'type' => 'text', + 'name' => 'gonganbei', + 'title' => '公安网备案号', + 'description' => '公安网备案号,留空不显示', + 'value' => '', + 'placeholder' => "京公安网备xxxxxxxxxx号" + + ], + +]; diff --git a/template/5iux/css/style.css b/template/5iux/css/style.css index ca333fb..f97a0d4 100644 --- a/template/5iux/css/style.css +++ b/template/5iux/css/style.css @@ -8,7 +8,7 @@ github:https://github.com/5iux/sou */ *{padding:0;margin:0;outline:none;-webkit-tap-highlight-color:transparent} -html,body{width:100%;height:100%;position:relative;overflow:hidden;background:#fff} +html,body{width:100%;height:100%;position:relative;overflow-x:hidden;background:#fff} html{font-family:'Noto Sans SC Sliced',PingFangSC-Light,Microsoft YaHei UI,Microsoft YaHei,helvetica,sans-serif;font-weight:500;color:#000} form,input,button{padding:0;margin:0;border:none;outline:none;background:none} input::-webkit-input-placeholder{color:#ccc;letter-spacing:2px;font-size:16px} @@ -16,8 +16,8 @@ ul,li{display:block;list-style:none} a{text-decoration:none;color:#000} #content{width:100%;height:100%} li img{width:14px;height:14px;margin:0 5px 0 8px;vertical-align:-0.15em;fill:currentColor;overflow:hidden} -.con{width:100%;transition:1s all;margin:auto;min-width:320px;height:380px;position:absolute;left:0;top:-100px;right:0;bottom:0} -.con .shlogo{position:relative;width:auto;height:auto;margin:20px auto} +.con{width:100%;transition:1s all;margin:auto;min-width:320px;} +.con .shlogo{position:relative;width:auto;height:auto;margin:10vh auto 5vh} h2.title{text-align:center;color:#fff;font-size:26px;font-weight:600;text-shadow:1px 1px 8px #504b4b} .con .shlogo a{width:100%;display:block;width:100%;height:100%} .con .sou{max-width:680px;position:relative;width:calc(100% - 60px);min-width:320px;margin:0 auto} @@ -29,17 +29,18 @@ h2.title{text-align:center;color:#fff;font-size:26px;font-weight:600;text-shadow .con .sou .lylme .lg img{display:block;width:25px;height:25px;position:absolute;left:25px;top:12px;overflow:hidden;cursor:pointer} .con .sou .lylme .wd:focus{color:#000;background:#fff;box-shadow:0 0px 15px 0 rgba(32,33,36,0.2);border-color:#fff} .con .sou .lylme button{width:40px;height:40px;display:block;position:absolute;z-index:10;right:6px;top:6px;cursor:pointer;font-size:22px;line-height:40px;border-radius:50%;color:#ddd} -.con .sou #word{backdrop-filter: blur(10px);width:calc(100% - 70px);padding: 15px;border-radius:10px;left:20px;position:absolute;z-index:500;top:65px;background:#ffffffb0;;line-height:30px;font-size:16px;overflow:hidden;display:none} -.con .sou #word li{cursor:pointer;color:#555;margin: 5px;} -#word li:hover{background-color:#ddd} -.foot{text-shadow: 0px 0px 5px black;position:fixed;bottom:20px;text-align:center;width:100%;color:#fff;line-height:20px;font-size:12px;height:auto} +.con .sou #word{backdrop-filter: blur(10px);width:calc(100% - 70px);padding: 15px;border-radius:10px;left:20px;position:absolute;z-index:500;top:65px;background:#ffffffb0;;line-height:30px;font-size:16px;overflow:hidden;display:none; box-shadow: 0 0.5rem 0.625rem #d4d4d4f2} +.con .sou #word li{cursor:pointer;color:#555;margin: 5px;padding: 2px 5px;} +li.selected{background:#ffffffd1;} +#word li:hover {background-color: #ffffffd1;} +.foot{text-shadow: 0px 0px 5px black;position:relative;bottom:20px;text-align:center;width:100%;color:#fff;line-height:20px;font-size:12px;height:auto} .foot a{color:#fff} .home{width:50px;height:50px;position:absolute;right:70px;top:10px;z-index:200;cursor:pointer} .home a{font-size:20px;color:#999;line-height:50px;display:block;text-align:center} #menu{width:50px;height:50px;background: #f4f6f900;border-radius: 50%;transform:scale(0.8);position:absolute;right:10px;top:5px;z-index:2000000;cursor:pointer;transition:0.5s} #menu i{position:absolute;left:0;right:0;margin:24px auto;width:30px;height:2px;background:#fff} -#menu i:before{content:'';width:20px;height:2px;top:-8px;background:#fff;position:absolute;right:0} -#menu i:after{content:'';width:20px;height:2px;bottom:-8px;background:#fff;position:absolute;left:0} +#menu i:before{content:'';width:30px;height:3px;top:-8px;background:#fff;position:absolute;right:0} +#menu i:after{content:'';width:30px;height:3px;bottom:-8px;background:#fff;position:absolute;left:0} #menu.on{right:380px;background:#f4f6f900;border-radius:25px} #menu.on i{width:20px;background:#fff} #menu.on i:before{top:-5px;transform:rotate(45deg);width:14px;right:-1px;left:auto;background:#fff} @@ -53,11 +54,11 @@ h2.title{text-align:center;color:#fff;font-size:26px;font-weight:600;text-shadow .list ul li.title{width:100%;height:40px;line-height:40px;margin:20px 0 0;text-align:center;text-indent:10px;color:#fff;font-size:18px;font-weight:bold} svg.icon{width:14px;height:14px;margin:0 5px 0 8px;vertical-align:-0.15em;fill:currentColor;overflow:hidden} .list ul li.title svg.icon{width:20px;height:20px} -@media (max-width:640px){.con{top:0px} +@media (max-width:640px){.con{top:80px} .con .shlogo{width:auto;height:auto} .con .sou .lylme .wd:focus{background:#f1f1f1;box-shadow:none;border-color:#ccc} .con .sou .lylme button{border-radius:25px} -.con .sou #word{max-height:150px} +.con .sou #word{max-height:50vh} #menu.on{right:270px} .list{width:227px} .list ul{width:220px} @@ -71,12 +72,38 @@ svg.icon{width:14px;height:14px;margin:0 5px 0 8px;vertical-align:-0.15em;fill:c }@media (prefers-color-scheme:dark){body{background-color:#162035} .mywth{color:#bbb} .con .sou .lylme .wd:focus{background:#293550;border:1px solid #162035} -.con .sou .lylme .wd{border:1px solid #293550;color:#bbb} +.con .sou .lylme .wd{border:1px solid #293550;color:#ffffff} .con .sou #word{border:15px solid #293550;background:#293550} .con .sou #word .click_work{color:#89b} }::-webkit-scrollbar{width:6px;height:6px} -::-webkit-scrollbar-track{background:#222d46;border-radius:0px} -::-webkit-scrollbar-thumb{background:#293550;border-radius:0px} -::-webkit-scrollbar-thumb:hover{background:#293550} -::-webkit-scrollbar-corner{background:#222d46} -.hide {display:none} \ No newline at end of file +::-webkit-scrollbar-thumb{background:none;border-radius:0px} +::-webkit-scrollbar-thumb:hover{background:none} +::-webkit-scrollbar-corner{background:none} +.hide {display:none} +#content { + min-height: 100vh; + display: flex; + flex-direction: column; + justify-content: space-between; +} +a.icp { + margin: 0 5px; +} +p.yan { + text-shadow: 0px 0px 5px black; + text-align: center; + width: 100%; + color: #fff; + font-size: 12px; + margin: 40px auto; +} +.con .sou .lylme .wd::-webkit-input-placeholder { + color: #fff; +} +.con .sou .lylme .wd:focus::-webkit-input-placeholder { + color: #555; +} +.htmlcode { + width: 90%; + margin: 50px auto 30px; +} \ No newline at end of file diff --git a/template/5iux/css/wea.css b/template/5iux/css/wea.css deleted file mode 100644 index fec442f..0000000 --- a/template/5iux/css/wea.css +++ /dev/null @@ -1,40 +0,0 @@ -@charset "utf-8"; -/* -作者:D.Young -主页:https://yyv.me/ -github:https://github.com/5iux/sou -日期:2019-07-11 -版权所有,请勿删除 -*/ -.mywth{position:absolute;left:20px;top:15px;height:20px;line-height:20px;cursor:pointer;z-index:100000;color:#fff !important;font-size:14px;text-shadow:0px 1px 0px #000} -.mywth .wea{display:inline-block;height:18px;vertical-align:middle;padding-bottom:3px} -@keyframes bgmove{0%{background-position:left} -50%{background-position:right} -100%{background-position:left} -}.mywth .wea_hover{width:400px;padding:25px 10px;position:absolute;z-index:100000;font-size:12px;line-height:20px;left:0;top:30px;box-shadow:5px 5px 5px 0 rgba(33,150,243,0.3);border-radius:15px;background-size:cover;background-repeat:no-repeat;background-position:left;color:#fff;visibility:hidden;opacity:0;transition:0.3s all;animation:bgmove 16s linear infinite} -.mywth:hover .wea_hover{visibility:visible;opacity:1} -.wea_in{position:relative;float:left;width:calc(100% - 20px);margin-left:10px} -.wea_top span{display:block;float:left;line-height:20px} -.wea_top span.city{width:100%;line-height:26px} -.wea_top span.city b{display:inline-block;float:left;background:#fd0;font-size:14px;padding:0 10px;border-radius:13px;color:#06b;margin-right:5px} -.wea_top span.img{width:50px;height:120px} -.wea_top span.tem{width:120px;height:120px;text-align:center} -.wea_top span.tem b{display:block;width:100%;height:40px;font-weight:lighter;font-size:32px;line-height:40px;margin-top:30px} -.wea_top span.air{height:40px;width:120px;margin-top:30px} -.wea_top span.air_tips{text-indent:15px} -.wea_con{margin:20px 10px;position:relative;float:left} -.wea_con ul{width:100%;margin-left:1px} -.wea_con ul li{float:left;width:calc(25% - 12px);font-size:12px;overflow:hidden;border:1px solid #eee;padding:0 5px;font-size:12px;line-height:25px;font-weight:bold;text-align:center;position:relative;margin:0 -1px -1px 0} -.wea_con ul li b{color:#fd0;font-size:14px} -.wea_con ul li:hover{background:rgba(255,255,255,0.3);color:#000} -.wea_con ul li i{display:none;font-size:12px;font-weight:normal;font-style:normal;line-height:16px;margin:5px 0} -.wea_foot ul{position:relative;float:left;width:100%} -.wea_foot ul li{float:left;width:33.3%;overflow:hidden;text-align:center;font-weight:bold} -.wea_foot ul li img{display:inline-block;vertical-align:center;height:30px;margin:5px} -.wea_foot ul li b{color:#0f0;font-weight:normal} -.wea_foot ul li i{font-weight:normal;font-style:normal} -@media (max-width:640px){.mywth{color:#777;left:10px;top:20px} -.mywth .wea_hover{display:none} -.mywth.hidden{display:none} -}@media (max-height:420px){.mywth{display:none} -} \ No newline at end of file diff --git a/template/5iux/index.php b/template/5iux/index.php index da5af22..bef82aa 100644 --- a/template/5iux/index.php +++ b/template/5iux/index.php @@ -8,8 +8,6 @@ - - @@ -20,126 +18,138 @@ - - + '; } else { echo ''; } ?> - -
- + +
+ '', //分组结束标签 - $html = array( - 'g1' => '', //分组结束标签 + 'l1' => '
  • ', //链接开始标签 + 'l2' => '{link_icon}{link_name}', //链接内容 + 'l3' => '
  • ', //链接结束标签 + ); + lists($html); + ?> +
    +
    +
    - 'l1' => '
  • ', //链接开始标签 - 'l2' => '{link_icon}{link_name}', //链接内容 - 'l3' => '
  • ', //链接结束标签 - ); - lists($html); - - echo '
    '; - if ($conf['tq']) { - echo ' -
    -
    -
    -
    -
      -
      -
      -
        -
        -
        - - - '; - } - ?> -
        -
        -
        - -
        -
        + -
        - ' . yan() . '

        '; - } - $i = 0; - $tagslists = $site->getTags(); - while ($taglists = $DB->fetch($tagslists)) { - echo '' . $taglists["tag_name"] . ''; - if ($i < $DB->num_rows($tagslists) - 1) { - $i++; - echo ' | '; - } - } - ?> - - ' . $conf["wztj"] . '

        '; - } - ?> - - ' . $conf['icp'] . '

        '; - } - ?> - - -
        +
        +
        - - - - - +

        + ' . $conf['icp'] . ''; + } + if (!empty(theme_config('gonganbei', ""))) { + preg_match_all('/\d+/', theme_config('gonganbei'), $gab); + echo '公安网备' . theme_config('gonganbei') . ' '; + } + ?> +

        + +

        + + + +
        +
        +
        +
        + + + + + + + - \ No newline at end of file diff --git a/template/5iux/js/sou.js b/template/5iux/js/sou.js index 1800233..7084cbe 100644 --- a/template/5iux/js/sou.js +++ b/template/5iux/js/sou.js @@ -64,45 +64,93 @@ $(document).ready(function() { $(".mywth").removeClass('hidden'); $('#word').hide(); }); - $(".mywth").click(function(event) { - var wt = $("body").width(); - if (wt < 750 || wt == 750) { - //window.location.href = "https://tianqi.qq.com/"; - window.location.href = "/weather/"; - } - }); + }); +const searchInput = document.getElementById('search-text'); +const wordList = document.getElementById('word').getElementsByTagName('li'); +let selectedWordIndex = -1; +let ignoreKeyEvents = false; // 新增标志用于判断是否忽略键盘事件 + +// 监听键盘事件 +searchInput.addEventListener('keydown', function(event) { + switch(event.key) { + case 'ArrowUp': + event.preventDefault(); + selectPreviousWord(); + fillInputWithSelectedWord(); + break; + case 'ArrowDown': + event.preventDefault(); + selectNextWord(); + fillInputWithSelectedWord(); + break; + default: + ignoreKeyEvents = false; // 其他键盘事件恢复正常 + break; + } +}); + +// 选中上一个选项 +function selectPreviousWord() { + if (selectedWordIndex > 0) { + wordList[selectedWordIndex].classList.remove('selected'); + selectedWordIndex--; + wordList[selectedWordIndex].classList.add('selected'); + } +} + +// 选中下一个选项 +function selectNextWord() { + if (selectedWordIndex < wordList.length - 1) { + if (selectedWordIndex >= 0) { + wordList[selectedWordIndex].classList.remove('selected'); + } + selectedWordIndex++; + wordList[selectedWordIndex].classList.add('selected'); + } +} + +// 将选中的选项填入输入框 +function fillInputWithSelectedWord() { + if (selectedWordIndex !== -1) { + searchInput.value = wordList[selectedWordIndex].innerText; + ignoreKeyEvents = true; // 标记忽略键盘事件 + } +} + //关键词sug $(function() { //当键盘键被松开时发送Ajax获取数据 - $('.wd').keyup(function() { - var keywords = $(this).val(); - if (keywords == '') { $('#word').hide(); return }; - $.ajax({ - url: 'https://suggestion.baidu.com/su?wd=' + keywords, - dataType: 'jsonp', - jsonp: 'cb', //回调函数的参数名(键值)key - // jsonpCallback: 'fun', //回调函数名(值) value - beforeSend: function() { - // $('#word').append('
      • 正在加载。。。
      • '); - }, - success: function(data) { - $('#word').empty().show(); - if (data.s == '') { - //$('#word').append('
        Not find "' + keywords + '"
        '); + $('#search-text').on('keyup', function() { + if (!ignoreKeyEvents) { // 只有在标志为false时才执行 + var keywords = $(this).val(); + if (keywords == '') { $('#word').hide(); return }; + $.ajax({ + url: 'https://suggestion.baidu.com/su?wd=' + keywords, + dataType: 'jsonp', + jsonp: 'cb', + beforeSend: function() { + // $('#word').append('
      • 正在加载。。。
      • '); + }, + success: function(data) { + $('#word').empty().show(); + if (data.s == '') { + $('#word').empty(); + $('#word').hide(); + } + $.each(data.s, function() { + $('#word').append('
      • ' + this + '
      • '); + }) + // 重新设置选中词汇的索引 + selectedWordIndex = -1; + }, + error: function() { + $('#word').empty().show(); $('#word').hide(); } - $.each(data.s, function() { - $('#word').append('
      • ' + this + '
      • '); - }) - }, - error: function() { - $('#word').empty().show(); - //$('#word').append('
        Fail "' + keywords + '"
        '); - $('#word').hide(); - } - }) + }) + } }) //点击搜索数据复制给搜索框 $(document).on('click', '#word li', function() { diff --git a/template/5iux/js/wea.js b/template/5iux/js/wea.js deleted file mode 100644 index ef3402b..0000000 --- a/template/5iux/js/wea.js +++ /dev/null @@ -1,55 +0,0 @@ -/*天气插件开始 -天气插件api请在wea目录中index.php修改 -申请地址:和风天气-https://dev.heweather.com/ -*/ -//菜单点击 -$("#menu").click(function(event) { - $(".mywth").toggleClass('hidden'); -}); -$("#content").click(function(event) { - $(".mywth").removeClass('hidden'); -}); - -$.ajax({ - url: './template/5iux/wea/', - dataType: 'json', - error: function() { - console.log('天气插件网络错误!'); - }, - success: function(res) { - //判断夜晚 - var now = new Date(), - hour = now.getHours(); - if (hour < 18) { myday = "d"; } else { myday = "n"; } - //天气 - $('.mywth').append(res.HeWeather6[0].basic.location + ' ' + res.HeWeather6[0].now.cond_txt + ' ' + res.HeWeather6[0].now.tmp + '℃ ' + res.HeWeather6[0].now.wind_dir); - - $('.wea_hover').css('background-image', 'url(https://cdn.heweather.com/img/plugin/190516/bg/view/' + res.HeWeather6[0].now.cond_code + myday + '.png)'); - //今日天气 - $('.wea_top').append('' + res.HeWeather6[0].basic.location + ' ' + res.HeWeather6[0].update.loc + ' 更新 ' + res.HeWeather6[0].now.tmp + '℃' + res.HeWeather6[0].now.cond_txt + '紫外线指数:' + res.HeWeather6[0].lifestyle[5].brf + '
        相对湿度:' + res.HeWeather6[0].now.hum + '%
        ' + res.HeWeather6[0].now.wind_dir + ':' + res.HeWeather6[0].now.wind_sc + '级
        ' + res.HeWeather6[0].lifestyle[3].txt + ''); - //今日指数 - var wea_con; - for (var x = 0; x < 8; x++) { - wea_con = '
      • 指数
        ' + res.HeWeather6[0].lifestyle[x].brf + '
      • '; - $(".wea_con ul").append(wea_con); - } - $('.wea_comf span').text('舒适度'); - $('.wea_drsg span').text('穿衣'); - $('.wea_flu span').text('感冒'); - $('.wea_sport span').text('运动'); - $('.wea_trav span').text('旅游'); - $('.wea_uv span').text('紫外线'); - $('.wea_cw span').text('洗车'); - $('.wea_air span').text('空气'); - - - //未来3天天气 - var wea_foot; - for (var i = 0; i < 3; i++) { - wea_foot = '
      • ' + res.HeWeather6[0].daily_forecast[i].date + '

        ' + res.HeWeather6[0].daily_forecast[i].cond_txt_d + '
        ' + res.HeWeather6[0].daily_forecast[i].tmp_min + '°/' + res.HeWeather6[0].daily_forecast[i].tmp_max + '°' + '
      • '; - $(".wea_foot ul").append(wea_foot); - } - } -}); - -/*天气插件结束*/ \ No newline at end of file diff --git a/template/5iux/wea/index.php b/template/5iux/wea/index.php deleted file mode 100644 index 27fbd6c..0000000 --- a/template/5iux/wea/index.php +++ /dev/null @@ -1,18 +0,0 @@ - \ No newline at end of file diff --git a/template/baisu/config.php b/template/baisu/config.php new file mode 100644 index 0000000..c9c4567 --- /dev/null +++ b/template/baisu/config.php @@ -0,0 +1,96 @@ + 'select', + 'name' => 'lytoday', + 'title' => '今日热榜', + 'description' => 'LyToday-JS插件显示位置,每日免费请求上限200次查看文档', + "value" => 0, + 'enum' => [ + 0 => "关闭", + 1 => "搜索栏下方", + 2 => "底部" + ], + + ], + [ + 'type' => 'select', + 'name' => 'group_font_weight', + 'title' => '分组名称字体粗组', + 'description' => '链接名称字体粗组', + "value" => "normal", + 'enum' => [ + 'lighter' => "细体", + 'normal' => "正常", + 'bold' => "粗体" + ], + ], + [ + 'type' => 'select', + 'name' => 'url_font_weight', + 'title' => '链接名称字体粗组', + 'description' => '链接名称字体粗组', + "value" => "normal", + 'enum' => [ + 'lighter' => "细体", + 'normal' => "正常", + 'bold' => "粗体" + ], + + ], + [ + 'type' => 'textarea', + 'name' => 'lytodaycode', + 'title' => '今日热榜代码', + 'description' => 'LyToday-JS插件自定义代码,若不了解请勿修改 查看文档', + 'value' => '
        ', + ], + [ + 'type' => 'radio', + 'name' => 'logo_show', + 'title' => '显示LOGO', + 'value' => 1, + 'enum' => [ + 1 => "显示", + 2 => "隐藏", + ], + ], + [ + 'type' => 'text', + 'name' => 'gonganbei', + 'title' => '公安备案号', + 'description' => '公安备案号,留空不显示', + 'value' => '', + 'placeholder' => "京公安网备xxxxxxxxxx号" + + ], + +]; diff --git a/template/baisu/css/style.css b/template/baisu/css/style.css index 62cc325..e27b5a2 100644 --- a/template/baisu/css/style.css +++ b/template/baisu/css/style.css @@ -44,12 +44,19 @@ p.content } #word li { - margin: 10px; - padding: 5px; + padding: 8px; width: 100%; cursor: pointer } +li.selected { + background: #f1f1f1 +} + +#word li:hover { + background-color: #f1f1f1; +} + p.content { text-align: center; color: #999; @@ -62,15 +69,17 @@ p.content { .urllist svg, .site-name svg { width: 24px; - height: 20px; + height: 24px; margin: auto 15px auto 0px } .list svg.icon, .list img { - width: 22px; - height: 22px; - margin-right: 10px + width: 28px; + height: 28px; + margin-right: 10px; + padding: 2px; + border: 10px; } * { @@ -91,7 +100,7 @@ textarea:focus { input {} body { - background-color: #f5f6fa + background-color: #f9f9f9 } img { @@ -133,8 +142,8 @@ a { .index-nav { width: 240px; height: 100vh; - background-color: #FFFFFF; - padding: 20px 5px 100px 0px; + background-color: #fff; + padding: 20px 5px 20px 0px; box-shadow: 1px 0px 5px 0 #eeeeee; position: fixed; top: 0; @@ -151,7 +160,7 @@ a { .index-nav .logo a { display: block; font-weight: bold; - font-size: 24px; + font-size: 20px; height: 30px; margin: 25px } @@ -169,8 +178,8 @@ a { } .index-nav .type-list { - height: calc(100% - 60px); - padding: 0 25px 100px; + height: 100%; + padding: 0 25px 80px; overflow: auto } @@ -185,7 +194,7 @@ a { } .index-nav .type-list::-webkit-scrollbar-thumb { - background-color: #64a15e; + background-color: #dddee3; border-radius: 50px } @@ -212,12 +221,13 @@ a { display: flex; justify-content: flex-start; align-items: center; - font-size: 14px; - font-weight: bold; + font-size: 15px; + font-weight: 500; padding: 0 10px; border-radius: 5px; color: #3a3a3a; - transition: 0.3s all + transition: 0.3s all; + background: #fbfbfb; } .index-nav .type-list .list a i { @@ -468,7 +478,8 @@ a { } .search-main .search-btnlist .search-lists { - width: 390px; + width: calc(100vw - 30px); + max-width: 500px; display: flex; justify-content: space-between; align-items: center; @@ -480,7 +491,7 @@ a { padding: 12px; border-radius: 6px; z-index: 100; - box-shadow: 0px 0px 6px #000000 + box-shadow: 0px 0px 6px #b4b4b4; } .search-main .search-btnlist .search-lists.hide { @@ -492,7 +503,7 @@ a { line-height: 40px; padding: 0 10px; display: flex; - justify-content: flex-start; + justify-content: center; align-items: center; font-size: 15px; border-radius: 6px; @@ -503,8 +514,8 @@ a { .search-main .search-btnlist .search-lists .list img, .search-main .search-btnlist .search-lists .list svg { display: block; - width: 20px; - height: 20px; + width: 24px; + height: 24px; margin-right: 8px; border-radius: 6px } @@ -517,7 +528,7 @@ a { .search-main-w .date-main { text-shadow: 1px 1px 8px #504b4b; - width: 49%; + width: 100%; height: 180px; background-color: #477975; background-repeat: no-repeat; @@ -591,14 +602,16 @@ div#he-plugin-standard { } .site-main .site-name { + background: #fff; + border-radius: 6px; + color: #333333; + padding: 10px; display: flex; - justify-content: flex-start; + justify-content: center; align-items: center; - align-self: center; - font-size: 18px; + font-size: 15px; line-height: 30px; - font-weight: bold; - margin-bottom: 15px + margin-bottom: 15px; } .site-main .site-name i { @@ -638,7 +651,7 @@ div#he-plugin-standard { .site-main .site-list .list { width: 24%; background-color: #ffffff; - border-radius: 4px; + border-radius: 6px; transition: 0.3s all; margin-bottom: 15px; position: relative; @@ -668,16 +681,16 @@ div#he-plugin-standard { .site-main .site-list .list a { display: flex; - flex-wrap: wrap; - justify-content: flex-start; + flex-wrap: nowrap; width: 100%; - padding: 0 5% + padding: 1.5% 5%; + justify-content: space-evenly; + flex-direction: row; } .site-main .site-list .list p.name { - color: #666666; - font-weight: bold; - width: 60%; + color: #555555; + width: 100%; overflow: hidden; text-overflow: ellipsis; position: relative; @@ -749,7 +762,7 @@ footer { } footer a { - color: #666 + color: #2eb3ff } footer.show { @@ -767,7 +780,10 @@ footer a:hover { z-index: 99; width: 45px } - +a.icp { + margin: 5px; + font-size: 14px; +} .tool-list .list { width: 45px; height: 45px; @@ -965,7 +981,9 @@ footer a:hover { .m-header { display: none } - +.index-nav .type-list .list a i { + font-size: 14px; +} @media only screen and (max-width:1200px) { #word { top: 340px @@ -1033,9 +1051,6 @@ footer a:hover { margin: auto } - .site-main .site-list .list a { - padding: 0 10% 0 5% - } footer { padding-left: 0 @@ -1070,8 +1085,8 @@ footer a:hover { height: 40px; font-size: 28px; text-align: center; - border: 1px solid #000; - color: #000; + /* border: 1px solid #919191; */ + color: #919191; border-radius: 6px } @@ -1089,7 +1104,6 @@ footer a:hover { .m-navlist { display: flex; - justify-content: space-between; flex-wrap: wrap; align-items: center } diff --git a/template/baisu/index.php b/template/baisu/index.php index 977647f..d284bbc 100644 --- a/template/baisu/index.php +++ b/template/baisu/index.php @@ -1,4 +1,5 @@ + @@ -6,25 +7,37 @@ - - - <?php echo $conf['title'] ?> - - + +
        - - - - - - .search-main-w {display: none;} @media only screen and (max-width: 1200px){.search-main {padding-top:70px !important;}}'; - } ?> + - - + diff --git a/template/baisu/js/common.js b/template/baisu/js/common.js index 69f9e98..b1bf242 100644 --- a/template/baisu/js/common.js +++ b/template/baisu/js/common.js @@ -1,6 +1,6 @@ var bodyH = $('.index-main').height(); var winH = $(window).height() - 100; -if(bodyH > winH) { +if (bodyH > winH) { $('footer').addClass('show'); }; @@ -12,23 +12,23 @@ if(bodyH > winH) { // }) //搜索引擎切换 function searchChange() { - $(".search-change").click(function() { + $(".search-change").click(function () { $('.search-lists').toggleClass('hide'); -// console.log('1') + // console.log('1') }); - $(".search-lists .list").click(function() { + $(".search-lists .list").click(function () { var souurl = $(this).data('url'); var text = $(this).html(); $('.search-btn').html(text); $('.search-btn').attr('data-url', souurl); $('.search-lists').addClass('hide'); - console.log(souurl); + console.log(souurl); }); - $(".search-btn").click(function() { + $(".search-btn").click(function () { var url = $(this).attr('data-url'); var kw = $('#search').val(); - if(kw !== "") { + if (kw !== "") { window.open(url + kw); } else { layer.msg('未输入搜索框关键词!', { @@ -40,14 +40,14 @@ function searchChange() { searchChange(); //回车键、本地搜索 function keyClick() { - $('body').keyup(function(e) { - if(e.keyCode === 13) { + $('body').keyup(function (e) { + if (e.keyCode === 13) { var isFocus = $("#search").is(":focus"); - if(true == isFocus) { + if (true == isFocus) { // console.log(isFocus); var url = $('.search-btn').attr('data-url'); var kw = $('#search').val(); - if(kw !== "") { + if (kw !== "") { window.open(url + kw); } else { // layer.msg('未输入搜索框关键词!', { @@ -57,55 +57,55 @@ function keyClick() { } } }); - $("#search").focus(function(data, status) { + $("#search").focus(function (data, status) { $('.search-lists').addClass('hide'); }); - $("#search").blur(function(data, status) { - if($("#search").val() == '') { + $("#search").blur(function (data, status) { + if ($("#search").val() == '') { $(".site-name").removeClass("hidden"); }; }); - var h = holmes({ - input: '#search', - find: '.urllist', - placeholder: '
        未搜索到匹配结果!
        ', - mark: false, - hiddenAttr: true, - class: { - visible: 'visible', - hidden: 'hidden' - }, - onFound(el) { - $(".site-name").addClass("hidden"); - }, - onInput(el) { - $(".site-name").addClass("hidden"); - }, - onVisible(el) { - $(".site-name").removeClass("hidden"); - }, - onEmpty(el) { - $(".site-name").removeClass("hidden"); - }, - }); + // var h = holmes({ + // input: '#search', + // find: '.urllist', + // placeholder: '
        未搜索到匹配结果!
        ', + // mark: false, + // hiddenAttr: true, + // class: { + // visible: 'visible', + // hidden: 'hidden' + // }, + // onFound(el) { + // $(".site-name").addClass("hidden"); + // }, + // onInput(el) { + // $(".site-name").addClass("hidden"); + // }, + // onVisible(el) { + // $(".site-name").removeClass("hidden"); + // }, + // onEmpty(el) { + // $(".site-name").removeClass("hidden"); + // }, + // }); } -//keyClick(); +keyClick(); //锚点、返回顶部 -$("a.catlist").click(function() { +$("a.catlist").click(function () { $("html, body").animate({ scrollTop: $($(this).attr("href")).offset().top - 5 + "px" }, 500); return false; }); -$('.scroll_top').click(function() { +$('.scroll_top').click(function () { $('html,body').animate({ scrollTop: '0px' }, 500); }); -$(window).scroll(function() { - if($(window).scrollTop() >= 100) { +$(window).scroll(function () { + if ($(window).scrollTop() >= 100) { $(".scroll_top").fadeIn(1000); } else { $(".scroll_top").stop(true, true).fadeOut(1000); @@ -141,7 +141,7 @@ var date = myDate.getDate(); var nowDate = year + ' 年 ' + getNow(month) + " 月 " + getNow(date) + " 日"; $('#nowYmd').text(nowDate); -$('.date-main').click(function() { +$('.date-main').click(function () { window.open('https://wannianli.tianqi.com/'); }); //获取农历 @@ -155,45 +155,99 @@ var nowWeek = lunarD.getWeekInChinese(); $('#nowWeek').text('星期' + nowWeek); //手机端 -$(".navbar").click(function() { +$(".navbar").click(function () { $(".m-navlist-w").slideToggle(); $(this).toggleClass("hover"); }); -$(".m-navlist a.list").click(function() { +$(".m-navlist a.list").click(function () { $(".m-navlist-w").slideUp(); }); - $(function() { +const searchInput = document.getElementById('search'); +const wordList = document.getElementById('word').getElementsByTagName('li'); +let selectedWordIndex = -1; +let ignoreKeyEvents = false; // 新增标志用于判断是否忽略键盘事件 + +// 监听键盘事件 +searchInput.addEventListener('keydown', function(event) { + switch(event.key) { + case 'ArrowUp': + event.preventDefault(); + selectPreviousWord(); + fillInputWithSelectedWord(); + break; + case 'ArrowDown': + event.preventDefault(); + selectNextWord(); + fillInputWithSelectedWord(); + break; + default: + ignoreKeyEvents = false; // 其他键盘事件恢复正常 + break; + } +}); + +// 选中上一个选项 +function selectPreviousWord() { + if (selectedWordIndex > 0) { + wordList[selectedWordIndex].classList.remove('selected'); + selectedWordIndex--; + wordList[selectedWordIndex].classList.add('selected'); + } +} + +// 选中下一个选项 +function selectNextWord() { + if (selectedWordIndex < wordList.length - 1) { + if (selectedWordIndex >= 0) { + wordList[selectedWordIndex].classList.remove('selected'); + } + selectedWordIndex++; + wordList[selectedWordIndex].classList.add('selected'); + } +} + +// 将选中的选项填入输入框 +function fillInputWithSelectedWord() { + if (selectedWordIndex !== -1) { + searchInput.value = wordList[selectedWordIndex].innerText; + ignoreKeyEvents = true; // 标记忽略键盘事件 + } +} + +//关键词sug +$(function() { //当键盘键被松开时发送Ajax获取数据 - $('#search').keyup(function() { - var keywords = $(this).val(); - if (keywords == '') { $('#word').hide(); return }; - $.ajax({ - url: 'https://suggestion.baidu.com/su?wd=' + keywords, - dataType: 'jsonp', - jsonp: 'cb', //回调函数的参数名(键值)key - // jsonpCallback: 'fun', //回调函数名(值) value - beforeSend: function() { - // $('#word').append('
      • 正在加载。。。
      • '); - }, - success: function(data) { - $('#word').empty().show(); - if (data.s == '') { - // $('#word').append('
        暂无 ' + keywords + ' 相关索引
        '); - $('#word').empty(); + $('#search').on('keyup', function() { + if (!ignoreKeyEvents) { // 只有在标志为false时才执行 + var keywords = $(this).val(); + if (keywords == '') { $('#word').hide(); return }; + $.ajax({ + url: 'https://suggestion.baidu.com/su?wd=' + keywords, + dataType: 'jsonp', + jsonp: 'cb', + beforeSend: function() { + // $('#word').append('
      • 正在加载。。。
      • '); + }, + success: function(data) { + $('#word').empty().show(); + if (data.s == '') { + $('#word').empty(); + $('#word').hide(); + } + $.each(data.s, function() { + $('#word').append('
      • ' + this + '
      • '); + }) + // 重新设置选中词汇的索引 + selectedWordIndex = -1; + }, + error: function() { + $('#word').empty().show(); $('#word').hide(); } - $.each(data.s, function() { - $('#word').append('
      • ' + this + '
      • '); - }) - }, - error: function() { - $('#word').empty().show(); - //$('#word').append('
        Fail "' + keywords + '"
        '); - $('#word').hide(); - } - }) + }) + } }) //点击搜索数据复制给搜索框 $(document).on('click', '#word li', function() { @@ -201,24 +255,22 @@ $(".m-navlist a.list").click(function() { $('#search').val(word); $('#word').empty(); $('#word').hide(); - //$("form").submit(); - $('.search-btn').trigger('click');//触发搜索事件 + $('.submit').trigger('click');//触发搜索事件 }) $(document).on('click', '.container,.banner-video,nav', function() { $('#word').empty(); $('#word').hide(); }) +}) -}) +$(function () { - $(function () { - - //点击空白处隐藏弹出层。 - $(document).click(function(event){ - var _con = $('#word'); // 设置目标区域 - if(!_con.is(event.target) && _con.has(event.target).length === 0){ // Mark 1 + //点击空白处隐藏弹出层。 + $(document).click(function (event) { + var _con = $('#word'); // 设置目标区域 + if (!_con.is(event.target) && _con.has(event.target).length === 0) { // Mark 1 //$('#word').slideUp('slow'); //滑动消失 $('#word').hide(300); //淡出消失 - } + } }); - }) +}) diff --git a/template/baisu/list.php b/template/baisu/list.php index 3df9766..3cd35f4 100644 --- a/template/baisu/list.php +++ b/template/baisu/list.php @@ -1,12 +1,14 @@ '
        {group_icon}{group_name}
        ', //分组开始标签 'g2' => '
        ', //分组内容 'g3' => '
        ', //分组结束标签 'l1' => '', //链接结束标签 ); lists($html); diff --git a/template/dashlite/config.php b/template/dashlite/config.php new file mode 100644 index 0000000..9eeed81 --- /dev/null +++ b/template/dashlite/config.php @@ -0,0 +1,13 @@ + 'text', + 'name' => 'search', + 'title' => '自定义搜索引擎', + 'description' => '%s表示搜索词,例:百度搜索 https://www.baidu.com/s?word=%shttps://www.baidu.com/s?wd=%s&ie=UTF-8
        若搜索词在末尾可省略%s', + 'value' => 'https://cn.bing.com/search?q=%s', + 'placeholder' => "https://cn.bing.com/search?q=" + + ] +]; diff --git a/template/dashlite/index.php b/template/dashlite/index.php index c63ecdb..a4d4a37 100644 --- a/template/dashlite/index.php +++ b/template/dashlite/index.php @@ -8,7 +8,7 @@ - + @@ -47,21 +47,21 @@ getTags(); - while ($taglists = $DB->fetch($tagslists)) { + while ($taglists = $DB->fetch($tagslists)) { - echo ' + echo '
      • + if ($taglists["tag_target"] == 1) { + echo ' target="_blank"'; + } + echo '> ' . $taglists["tag_name"] . '
      • '; - } - ?> + } + ?>
      • @@ -70,15 +70,15 @@
      • getGroups(); // 获取分类 - if (checkmobile()) { - echo('
        '); - while ($group = $DB->fetch($groups)) { //循环所有分组 - echo '
      • ' . $group["group_name"] . '
      • + $groups = $site->getGroups(); // 获取分类 + if (checkmobile()) { + echo ('
        '); + while ($group = $DB->fetch($groups)) { //循环所有分组 + echo '
      • ' . $group["group_name"] . '
      • ' . "\n"; - } - } - ?> + } + } + ?>
        @@ -110,10 +110,10 @@
        -
        +
        -
        +
        @@ -144,7 +144,7 @@
        '; } - ?> + ?>
        @@ -167,12 +167,12 @@ ' . $conf["wztj"] . '

        '; } - ?> + ?>
        @@ -181,14 +181,37 @@
        - - - + + + - + + ', + ], + [ + 'type' => 'radio', + 'name' => 'background_position', + 'title' => '背景图片位置', + 'value' => '0', + 'enum' => [ + 0 => "跟随滚动", + 1 => "固定位置", + ], + ], + [ + 'type' => 'text', + 'name' => 'gonganbei', + 'title' => '公安备案号', + 'description' => '公安备案号,留空不显示', + 'value' => '', + 'placeholder' => "京公安网备xxxxxxxxxx号" + + ], + +]; diff --git a/template/default/css/style.css b/template/default/css/style.css index 7b3663c..ab55901 100644 --- a/template/default/css/style.css +++ b/template/default/css/style.css @@ -1,5 +1,5 @@ a:hover{text-decoration:none;font-weight:bold} -a.icp{font-size:12px;color:#bbb;text-align:center} +a.icp{font-size:12px;color:#888;text-align:center;margin: 0 5px;} .navbar .navbar-expand-lg .navbar-light .fixed-top{position:absolute;z-index:10000} .bottom-cover{background-image:linear-gradient(rgba(255,255,255,0) 0%,rgb(244 248 251 / 0.6) 50%,rgb(244 248 251) 100%)} .navbar-light .navbar-toggler{color:#fff} @@ -90,4 +90,38 @@ div#navbarsExample05{background:rgba(0,0,0,0.8);padding:10px 30px;border-radius: ::-webkit-scrollbar-track{background:#eee;border-radius:0px} ::-webkit-scrollbar-thumb{background:#ddd;border-radius:0px} ::-webkit-scrollbar-thumb:hover{background:#ccc} -::-webkit-scrollbar-corner{background:#ddd} \ No newline at end of file +::-webkit-scrollbar-corner{background:#ddd} +::-webkit-scrollbar-corner{background:#ddd} +li.selected{background:#f1f1f1} +#word li:hover {background-color: #f1f1f1;} +@font-face{font-family:"Micro";src:url('MicroExtendFLF.ttf')} +#show_time{font-family:"Micro";text-align:center;font-weight:bold;font-size:30px;color:#fff;text-shadow:1px 1px 2px #000} +#show_date{text-align:center;font-size:16px;color:#fff;font-weight:bold;margin:10px} + +.box{margin:40px 0;position:fixed;z-index:1000} +.change-type{min-width:40px;min-height:160px;position:absolute;z-index:99;left:0;top:0;display:flex} +.change-type .type-left{width:0;background:#fff;height:100%;box-shadow:0 2px 12px 0 rgb(0 0 0 / 50%);border-bottom-right-radius:5px;border-top-right-radius:5px;margin-left:-40px;overflow:hidden;transition:width 0.4s;-moz-transition:width 0.4s;-webkit-transition:width 0.4s;-o-transition:width 0.4s} +.change-type .showListType{width:150px;transition:width 0.4s;-moz-transition:width 0.4s;-webkit-transition:width 0.4s;-o-transition:width 0.4s} +.change-type .type-left ul{margin-bottom:0px} +.change-type .type-left ul li{line-height:40px;height:40px;text-align:left;width:100%;position:relative;cursor:pointer;list-style:none} +.change-type .type-left ul li a{display:block;height:100%;position:absolute;left:0;top:0;z-index:9;padding-left:15px;overflow:hidden;width:calc(100% - 17px);color:#333;font-size:14px;border-left:2px solid #26778d} +.change-type .type-left ul li span{display:block;position:absolute;width:0;height:100%;left:0;top:0;z-index:8;overflow:hidden;transition:width 0.5s;-moz-transition:width 0.5s;-webkit-transition:width 0.5s;-o-transition:width 0.5s} +.change-type .type-left ul li:hover span{transition:width 0.5s;-moz-transition:width 0.5s;-webkit-transition:width 0.5s;-o-transition:width 0.5s} +.type-left ul li:nth-child(1):hover span,.type-left ul li:nth-child(1).active span,.type-left ul li:nth-child(8):hover span,.type-left ul li:nth-child(8).active span{background:#2C73D2;width:100%;box-shadow:0px 2px 5px 0 rgba(0,0,0,0.5)} +.type-left ul li:nth-child(1):hover a,.type-left ul li:nth-child(1).active a,.type-left ul li:nth-child(8):hover a,.type-left ul li:nth-child(8).active a{border-left:2px solid #2C73D2;color:#fff} +.type-left ul li:nth-child(2):hover span,.type-left ul li:nth-child(2).active span,.type-left ul li:nth-child(9):hover span,.type-left ul li:nth-child(9).active span{background:#D65DB1;width:100%;box-shadow:0px 2px 5px 0 rgba(0,0,0,0.5)} +.type-left ul li:nth-child(2):hover a,.type-left ul li:nth-child(2).active a,.type-left ul li:nth-child(9):hover a,.type-left ul li:nth-child(9).active a{border-left:2px solid #D65DB1;color:#fff} +.type-left ul li:nth-child(3):hover span,.type-left ul li:nth-child(3).active span,.type-left ul li:nth-child(10):hover span,.type-left ul li:nth-child(10).active span{background:#00C9A7;width:100%;box-shadow:0px 2px 5px 0 rgba(0,0,0,0.5)} +.type-left ul li:nth-child(3):hover a,.type-left ul li:nth-child(3).active a,.type-left ul li:nth-child(10):hover a,.type-left ul li:nth-child(10).active a{border-left:2px solid #00C9A7;color:#fff} +.type-left ul li:nth-child(4):hover span,.type-left ul li:nth-child(4).active span,.type-left ul li:nth-child(11):hover span,.type-left ul li:nth-child(11).active span{background:#009EFA;width:100%;box-shadow:0px 2px 5px 0 rgba(0,0,0,0.5)} +.type-left ul li:nth-child(4):hover a,.type-left ul li:nth-child(4).active a,.type-left ul li:nth-child(11):hover a,.type-left ul li:nth-child(11).active a{border-left:2px solid #009EFA;color:#fff} +.type-left ul li:nth-child(5):hover span,.type-left ul li:nth-child(5).active span,.type-left ul li:nth-child(12):hover span,.type-left ul li:nth-child(12).active span{background:#FF8066;width:100%;box-shadow:0px 2px 5px 0 rgba(0,0,0,0.5)} +.type-left ul li:nth-child(5):hover a,.type-left ul li:nth-child(5).active a,.type-left ul li:nth-child(12):hover a,.type-left ul li:nth-child(12).active a{border-left:2px solid #FF8066;color:#fff} +.type-left ul li:nth-child(6):hover span,.type-left ul li:nth-child(6).active span,.type-left ul li:nth-child(13):hover span,.type-left ul li:nth-child(13).active span{background:#64b5f6;width:100%;box-shadow:0px 2px 5px 0 rgba(0,0,0,0.5)} +.type-left ul li:nth-child(6):hover a,.type-left ul li:nth-child(6).active a,.type-left ul li:nth-child(13):hover a,.type-left ul li:nth-child(13).active a{border-left:2px solid #64b5f6;color:#fff} +.type-left ul li:nth-child(7):hover span,.type-left ul li:nth-child(7).active span,.type-left ul li:nth-child(14):hover span,.type-left ul li:nth-child(14).active span{background:#388e3c;width:100%;box-shadow:0px 2px 5px 0 rgba(0,0,0,0.5)} +.type-left ul li:nth-child(7):hover a,.type-left ul li:nth-child(7).active a,.type-left ul li:nth-child(14):hover a,.type-left ul li:nth-child(14).active a{border-left:2px solid #388e3c;color:#fff} +ul.navbar-nav.mr-auto{margin-left:60px} +.type-right{position:fixed;top:38px} +.type-right svg{width:28px;height:28px} +@media screen and (max-width:992px){.type-right{position:fixed;top:10px;right:10px}} diff --git a/template/default/footer.php b/template/default/footer.php index cbdf8d0..e93e9bd 100644 --- a/template/default/footer.php +++ b/template/default/footer.php @@ -1,22 +1,32 @@ - - + - - + + + \ No newline at end of file diff --git a/template/default/index.php b/template/default/index.php index dbad899..2080fe6 100644 --- a/template/default/index.php +++ b/template/default/index.php @@ -1,117 +1,123 @@ - - - - - <?php echo $conf['title']?> - - - - - - - - - - - - - - - - - - -