文章收藏

2021-2-4
emlog模板制作帮助手册

emlog模板制作帮助手册

emlog基本模板文件必须文件:main.css: CSS(样式表)文件log_list.php: 日志列表页模板echo_log.php: 日志页模板page.php: 页面(page)模板footer.php: Footer模板header.php: Header模板t.php: 碎语模板module.php: 包含widgets、评论、引用、编辑等可选文件:side.php : 侧边栏模板 基本条件判断Tag$curpage:当前页面表示,常用判断tag如下:$curpage== CURPAGE_HOME:首页$curpage == CURPAGE_TW:碎语页$curpage == CURPAGE_LOG:日志、page页ROLE:当前访问者身份ROLE == 'admin':管理员ROLE == 'writer':联合撰写人ROLE == 'vistor':未登录用户模板PHP标签说明通用:<?php if(!defined('EMLOG_ROOT')) {exit('error!');} ?>存在每个php文件头部,防止非法访问<?php include getViews('XXXX');; ?>: 调用当前模板目录下XXXX.php文件<?php echo EMLOG_VERSION;?>:显示当前emlog版本<?php echo TEMPLATE_URL; ?>: 显示模板文件路径<?php echo BLOG_URL; ?>: 显示博客Url<?php echo $blogtitle; ?>: 显示博客标题(会根据当前页面变化)<?php echo $blogname; ?>: 显示博客名称<?php echo $bloginfo; ?>:显示博客描述<?php echo $icp; ?>:显示备案号<?php endforeach; ?>: 循环结束,需和<?php foreach(xxxx): ?>配对<?php endif;?>:结束if标签,需和<?php if(xxxx): ?>配对 header.php<?php/*Template Name:模板名称Description:模板描述Author:模板作者Author Url:作者主页Sidebar Amount:侧边栏数目,最大4*/?>模板注释,存在于header.php头部,可为空 <?php doAction('navbar', '左标签', '右标签'); ?>:插件挂载点,用于导航栏,左右标签为html标签,用以控制样式,可为空<?php if($istwitter == 'y'):?>:如果后台设置前台可见碎语链接<?phpforeach ($navibar as $key => $val):if ($val['hide'] == 'y'){continue;}if (empty($val['url'])){$val['url'] = BLOG_URL.'?post='.$key;}?>:开始导航循环 footer.php<?php doAction('index_footer'); ?>:插件挂载点(用于统计代码等) echo_log.php<?php topflg($top); ?>:置顶标志,函数存在于module.php<?php echo $log_title; ?>:显示日志、page标题<?php echo $log_content; ?>:显示日志内容<?php blog_sort($sortid, $logid); ?>:显示分类,该函数存在于module.php<?php editflg($logid,$author); ?>:显示编辑链接,函数存在于module.php<?php blog_author($author); ?>:显示日志作者,函数存在于module.php<?php echo gmdate('Y-n-j G:i l', $date); ?>:日志发表时间,格式是2010-12-11 19:05 30,格式可修改<?php blog_att($logid); ?>:显示日志附件(图片附件不显示),函数存在于module.php<?php blog_tag($logid); ?>:显示日志标签,函数存在于module.php<?php doAction('log_related'); ?>:插件挂载点(用于相关日志等)<?php neighbor_log(); ?>:显示相邻日志,函数存在于module.php<?php blog_trackback(); ?>:显示引用通告地址及引用,函数存在于module.php<?php blog_comments(); ?>:显示日志评论,函数存在于module.php<?php if ($allow_remark == 'y'){blog_comments_post();}?>:根据是否允许评论显示评论表单,函数存在于module.php page.php<?php echo $log_title; ?>:显示日志、page标题<?php echo $log_content; ?>:显示日志内容<?php blog_att($logid); ?>:显示附件(图片附件不显示),函数存在于module.php<?php if ($allow_remark == 'y'){blog_comments();blog_comments_post();} ?>:根据是否允许评论显示评论和评论表单,函数存在于module.php log_list.php<?php doAction('index_loglist_top'); ?>:插件挂载点,存在于列表顶部(用于公告等)<?php foreach($logs as $value): ?>: 开始循环输出日志列表---------------------------------以下仅存在于<?php foreach($logs as $value): ?>和<?php endforeach; ?>之间<?php topflg($value['top']); ?>:置顶标志,函数存在于module.php<?php echo $value['log_title']; ?>:显示日志标题<?php echo $value['log_description']; ?>:显示日志摘要<?php blog_sort($value['sortid'], $value['logid']); ?>:显示分类,该函数存在于module.php<?php editflg($value['logid'],$value['author']); ?>:显示编辑链接,函数存在于module.php<?php blog_author($value['author']); ?>:显示日志作者,函数存在于module.php<?php echo gmdate('Y-n-j G:i l', $value['date']); ?>:日志发表时间,格式是2010-12-11 19:05 30,格式可自行修改<?php blog_att($value['logid']); ?>:显示日志附件(图片附件不显示),函数存在于module.php<?php blog_tag($value['logid']); ?>:显示日志标签,函数存在于module.php<?php echo $value['comnum']; ?>:评论数<?php echo $value['tbcount']; ?>:引用数<?php echo $value['views']; ?>:浏览数----------------------------------以上仅存在于<?php foreach($logs as $value): ?>和<?php endforeach; ?>之间<?php echo $page_url;?>:显示分页 side.php<?php $widgets = !empty($options_cache['widgetsX']) ? unserialize($options_cache['widgetsX']) : array(); ?>:该页面要加载的widgets,X为数字,不超过header.php里设置的侧边栏数目<?php doAction('diff_side'); ?>:插件挂载点<?phpforeach ($widgets as $val){$widget_title = @unserialize($options_cache['widget_title']);$custom_widget = @unserialize($options_cache['custom_widget']);if(strpos($val, 'custom_wg_') === 0){$callback = 'widget_custom_text';if(function_exists($callback)){call_user_func($callback, htmlspecialchars($custom_widget[$val]['title']), $custom_widget[$val]['content'], $val);}}else{$callback = 'widget_'.$val;if(function_exists($callback)){preg_match("/^.*\s\((.*)\)/", $widget_title[$val], $matchs);$wgTitle = isset($matchs[1]) ? $matchs[1] : $widget_title[$val];call_user_func($callback, htmlspecialchars($wgTitle));}}}?>:这一长串用于显示widgets module.php(建议参考默认模板里的注释)function widget_xxxx($title):显示widgets函数,如widget_blogger($title)显示博主信息 t.php<?phpforeach($tws as $val):$author = $user_cache[$val['author']]['name'];$avatar = empty($user_cache[$val['author']]['avatar']) ?BLOG_URL . 'admin/views/' . ADMIN_TPL . '/images/avatar.jpg' :BLOG_URL . $user_cache[$val['author']]['avatar'];$tid = (int)$val['id'];?>:开始循环输出碎语<?php echo $author; ?>:显示碎语发布者<?php echo $val['t'];?>:显示碎语内容<?php echo $pageurl;?>:显示碎语分页<?php echo $twnum; ?>:显示碎语数目...
2021-2-1
HS轻论坛APP展示页代码免费分享

HS轻论坛APP展示页代码免费分享

<!-- <?php global $HP; $_G['SET']['WEBTITLE'] = 'APP在线下载'; $_G['TEMPLATE']['HEAD'] = $_G['TEMPLATE']['FOOT'] = 'null'; $_G['TEMPLATE']['BODY'] = $HP; ?> --> <style> html, body { background-color: #00b7ee; width: 100%; height: 100%; background-image: url(https://www.hadsky.com/app/hadskydownload/template/img/clouds.png); background-position: bottom center; background-repeat: repeat-x; } ._main { padding-top: 47px; } ._bg_image { width: 240px; height: 493px; float: right; background-image: url(https://www.hadsky.com/app/hadskydownload/template/img/iphone.png); background-position: center center; background-repeat: no-repeat; background-size: 240px auto; padding-top: 59px; } ._bg_image .swiper-container { margin-left: 15px; width: 210px; height: 373px; } ._bg_image .swiper-container img { width: 100%; height: 100%; } ._appinfo { color: #fff; padding-top: 30px; max-width: 360px; word-break: break-all; } ._appinfo ._title { background-image: url(https://www.hadsky.com/app/hadskydownload/template/img/logo.png); background-position: left; background-repeat: no-repeat; background-size: 64px 64px; height: 64px; font-weight: bold; line-height: 64px; padding-left: 74px; font-size: 24px; letter-spacing: 2px; } ._appinfo ._content { padding: 10px 0; font-size: 14px; letter-spacing: 1px; } @media only screen and (max-width: 999px) { body { background-image: none; } ._bg_image { float: none; margin: 0 auto; } ._appinfo { padding: 30px; } } </style> <link href="https://lib.baomitu.com/Swiper/4.5.0/css/swiper.min.css" rel="stylesheet"> <div class="pk-row _main" style="display:none;"> <div class="pk-w-sm-12 pk-w-md-6"> <div class="_bg_image"> <div class="swiper-container"> <div class="swiper-wrapper"> <a class="swiper-slide" href="javascript:"> <img src="https://www.hadsky.com/app/hadskydownload/template/img/app/1.png" alt="Image"> </a> <a class="swiper-slide" href="javascript:"> <img src="https://www.hadsky.com/app/hadskydownload/template/img/app/2.png" alt="Image"> </a> <a class="swiper-slide" href="javascript:"> <img src="https://www.hadsky.com/app/hadskydownload/template/img/app/3.png" alt="Image"> </a> <a class="swiper-slide" href="javascript:"> <img src="https://www.hadsky.com/app/hadskydownload/template/img/app/4.png" alt="Image"> </a> <a class="swiper-slide" href="javascript:"> <img src="https://www.hadsky.com/app/hadskydownload/template/img/app/5.png" alt="Image"> </a> </div> </div> </div> </div> <div class="pk-w-sm-12 pk-w-md-6"> <div class="_appinfo"> <div class="_title">HS轻社区</div> <div class="_content"> <p>HadSky官方APP,界面简洁,操作方便,程序轻快,您也可以为您的网站申请一款属于自己的APP [ <a target="_blank" class="pk-hover-underline" href="https://www.hadsky.com/app-zhanzhang-index.html?s=applyapp">立即申请&raquo;</a> ] </p> <p><br></p> <p style="font-size: 12px;">系统版本:1.0.0</p> <p style="font-size: 12px;">软件大小:21.73MB</p> <p style="font-size: 12px;">更新时间:2019-08-28</p> </div> <div class="pk-row" style="padding-top:20px;text-align:center"> <div class="pk-w-md-6 pk-w-sm-12" style="margin-bottom:27px"> <div style="letter-spacing:1px;font-size:16px;font-weight:bold">Android版</div> <div id="_android_canvas" style="padding:10px 0"></div> <div> <a target="_blank" class="pk-btn pk-btn-danger _dbtn" href="http://qiniu.hadsky.com/app/hsqsq.apk" data-type="android">立即下载</a> </div> </div> <div class="pk-w-md-6 pk-w-sm-12 pk-hide" style="margin-bottom:27px"> <div style="letter-spacing:1px;font-size:16px;font-weight:bold">IOS版</div> <div id="_ios_canvas" style="padding:10px 0"></div> <div> <a target="_blank" class="pk-btn pk-btn-danger _dbtn" href="javascript:" data-type="ios">立即下载</a> </div> </div> </div> </div> </div> </div> <div class="pk-hadsky _foot" style="font-size:12px;color:#333;text-align:center;padding:10px 0;width:100%;position:fixed;left:0;bottom:0;"> <span>Powered by HadSky</span> </div> <script src="https://lib.baomitu.com/Swiper/4.5.0/js/swiper.min.js"></script> <script src="https://lib.baomitu.com/qrcode-generator/1.4.3/qrcode.min.js"></script> <script> $(function() { $(window).on('resize', function() { if($(window).width() > 1000) { $('._main').css({ paddingTop: ($(window).height() - 493) / 2 - 67 }); $('._foot').css({ position: 'fixed' }); } else { $('._main').css({ paddingTop: 47 }); $('._foot').css({ position: 'relative' }); } }).resize(); var s = $('._dbtn'); for(var i = 0; i < s.length; i++) { var qr = qrcode(7, "H"); qr.addData($(s[i]).attr('href')); qr.make(); $('#_' + $(s[i]).data('type') + '_canvas').html(qr.createImgTag()); } $("._main").fadeIn(1500); new Swiper('.swiper-container', { loop: true, autoplay: { delay: 3000, disableOnInteraction: false } }); }); </script> 上面的部分链接和信息需要你自己自行更改一下,使用方法:后台 - 插件 - 自定义HTML页面应用 - 设置 - 新建页面 - 复制上面的代码粘贴进去保存即可...
2021-2-1
github 的黑夜模式小猫咪动画源码

github 的黑夜模式小猫咪动画源码

html: <!-- 暗黑模式 --> <div class="profile-color-modes js-promo-color-modes-banner-profile"> <svg aria-hidden="true" height="45" viewBox="0 0 106 60" fill="none" stroke-width="3" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"> <g class="profile-color-modes-illu-group profile-color-modes-illu-red"> <path d="M37.5 58.5V57.5C37.5 49.768 43.768 43.5 51.5 43.5V43.5C59.232 43.5 65.5 49.768 65.5 57.5V58.5"></path> </g> <g class="profile-color-modes-illu-group profile-color-modes-illu-orange"> <path d="M104.07 58.5C103.401 55.092 97.7635 54.3869 95.5375 57.489C97.4039 54.6411 99.7685 48.8845 94.6889 46.6592C89.4817 44.378 86.1428 50.1604 85.3786 54.1158C85.9519 50.4768 83.7226 43.294 78.219 44.6737C72.7154 46.0534 72.7793 51.3754 74.4992 55.489C74.169 54.7601 72.4917 53.3567 70.5 52.8196"></path> </g> <g class="profile-color-modes-illu-group profile-color-modes-illu-purple"> <path d="M5.51109 58.5V52.5C5.51109 41.4543 14.4654 32.5 25.5111 32.5C31.4845 32.5 36.8464 35.1188 40.5111 39.2709C40.7212 39.5089 40.9258 39.7521 41.1245 40"></path> <path d="M27.511 49.5C29.6777 49.5 28.911 49.5 32.511 49.5"></path> <path d="M27.511 56.5C29.6776 56.5 26.911 56.5 30.511 56.5"></path> </g> <g class="profile-color-modes-illu-group profile-color-modes-illu-green"> <circle cx="5.5" cy="12.5" r="4"></circle> <circle cx="18.5" cy="5.5" r="4"></circle> <path d="M18.5 9.5L18.5 27.5"></path> <path d="M18.5 23.5C6 23.5 5.5 23.6064 5.5 16.5"></path> </g> <g class="profile-color-modes-illu-group profile-color-modes-illu-blue"> <g class="profile-color-modes-illu-frame"> <path d="M40.6983 31.5C40.5387 29.6246 40.6456 28.0199 41.1762 27.2317C42.9939 24.5312 49.7417 26.6027 52.5428 30.2409C54.2551 29.8552 56.0796 29.6619 57.9731 29.6619C59.8169 29.6619 61.5953 29.8452 63.2682 30.211C66.0833 26.5913 72.799 24.5386 74.6117 27.2317C75.6839 28.8246 75.0259 33.7525 73.9345 37.5094C74.2013 37.9848 74.4422 38.4817 74.6555 39"></path> </g> <g class="profile-color-modes-illu-frame"> <path d="M41.508 31.5C41.6336 31.2259 41.7672 30.9582 41.9085 30.6968C40.7845 26.9182 40.086 21.8512 41.1762 20.2317C42.9939 17.5312 49.7417 19.6027 52.5428 23.2409C54.2551 22.8552 56.0796 22.6619 57.9731 22.6619C59.8169 22.6619 61.5953 22.8452 63.2682 23.211C66.0833 19.5913 72.799 17.5386 74.6117 20.2317C75.6839 21.8246 75.0259 26.7525 73.9345 30.5094C75.1352 32.6488 75.811 35.2229 75.811 38.2283C75.811 38.49 75.8058 38.7472 75.7957 39"></path> <path d="M49.4996 33V35.6757"></path> <path d="M67.3375 33V35.6757"></path> </g> <g class="profile-color-modes-illu-frame"> <path d="M41.508 31.5C41.6336 31.2259 41.7672 30.9582 41.9085 30.6968C40.7845 26.9182 40.086 21.8512 41.1762 20.2317C42.9939 17.5312 49.7417 19.6027 52.5428 23.2409C54.2551 22.8552 56.0796 22.6619 57.9731 22.6619C59.8169 22.6619 61.5953 22.8452 63.2682 23.211C66.0833 19.5913 72.799 17.5386 74.6117 20.2317C75.6839 21.8246 75.0259 26.7525 73.9345 30.5094C75.1352 32.6488 75.811 35.2229 75.811 38.2283C75.811 38.49 75.8058 38.7472 75.7957 39"></path> </g> <g class="profile-color-modes-illu-frame"> <path d="M41.508 31.5C41.6336 31.2259 41.7672 30.9582 41.9085 30.6968C40.7845 26.9182 40.086 21.8512 41.1762 20.2317C42.9939 17.5312 49.7417 19.6027 52.5428 23.2409C54.2551 22.8552 56.0796 22.6619 57.9731 22.6619C59.8169 22.6619 61.5953 22.8452 63.2682 23.211C66.0833 19.5913 72.799 17.5386 74.6117 20.2317C75.6839 21.8246 75.0259 26.7525 73.9345 30.5094C75.1352 32.6488 75.811 35.2229 75.811 38.2283C75.811 38.49 75.8058 38.7472 75.7957 39"></path> <path d="M49.4996 33V35.6757"></path> <path d="M67.3375 33V35.6757"></path> </g> <g class="profile-color-modes-illu-frame"> <path d="M41.508 31.5C41.6336 31.2259 41.7672 30.9582 41.9085 30.6968C40.7845 26.9182 40.086 21.8512 41.1762 20.2317C42.9939 17.5312 49.7417 19.6027 52.5428 23.2409C54.2551 22.8552 56.0796 22.6619 57.9731 22.6619C59.8169 22.6619 61.5953 22.8452 63.2682 23.211C66.0833 19.5913 72.799 17.5386 74.6117 20.2317C75.6839 21.8246 75.0259 26.7525 73.9345 30.5094C75.1352 32.6488 75.811 35.2229 75.811 38.2283C75.811 38.49 75.8058 38.7472 75.7957 39"></path> </g> <g class="profile-color-modes-illu-frame"> <path d="M41.508 31.5C41.6336 31.2259 41.7672 30.9582 41.9085 30.6968C40.7845 26.9182 40.086 21.8512 41.1762 20.2317C42.9939 17.5312 49.7417 19.6027 52.5428 23.2409C54.2551 22.8552 56.0796 22.6619 57.9731 22.6619C59.8169 22.6619 61.5953 22.8452 63.2682 23.211C66.0833 19.5913 72.799 17.5386 74.6117 20.2317C75.6839 21.8246 75.0259 26.7525 73.9345 30.5094C75.1352 32.6488 75.811 35.2229 75.811 38.2283C75.811 38.49 75.8058 38.7472 75.7957 39"></path> <path d="M49.4996 33V35.6757"></path> <path d="M67.3375 33V35.6757"></path> </g> <g class="profile-color-modes-illu-frame"> <path d="M73.4999 40.2236C74.9709 38.2049 75.8108 35.5791 75.8108 32.2283C75.8108 29.2229 75.1351 26.6488 73.9344 24.5094C75.0258 20.7525 75.6838 15.8246 74.6116 14.2317C72.7989 11.5386 66.0832 13.5913 63.2681 17.211C61.5952 16.8452 59.8167 16.6619 57.973 16.6619C56.0795 16.6619 54.2549 16.8552 52.5427 17.2409C49.7416 13.6027 42.9938 11.5312 41.176 14.2317C40.0859 15.8512 40.7843 20.9182 41.9084 24.6968C41.003 26.3716 40.4146 28.3065 40.2129 30.5"></path> <path d="M82.9458 30.5471L76.8413 31.657"></path> <path d="M76.2867 34.4319L81.8362 37.7616"></path> <path d="M49.4995 27.8242V30.4999"></path> <path d="M67.3374 27.8242V30.4998"></path> </g> <g class="profile-color-modes-illu-frame"> <path d="M45.3697 34.2658C41.8877 32.1376 39.7113 28.6222 39.7113 23.2283C39.7113 20.3101 40.3483 17.7986 41.4845 15.6968C40.3605 11.9182 39.662 6.85125 40.7522 5.23168C42.5699 2.53117 49.3177 4.6027 52.1188 8.24095C53.831 7.85521 55.6556 7.66186 57.5491 7.66186C59.3929 7.66186 61.1713 7.84519 62.8442 8.21095C65.6593 4.59134 72.375 2.5386 74.1877 5.23168C75.2599 6.82461 74.6019 11.7525 73.5105 15.5094C74.7112 17.6488 75.3869 20.2229 75.3869 23.2283C75.3869 28.6222 73.2105 32.1376 69.7285 34.2658C70.8603 35.5363 72.6057 38.3556 73.3076 40"></path> <path d="M49.0747 19.8242V22.4999"></path> <path d="M54.0991 28C54.6651 29.0893 55.7863 30.0812 57.9929 30.0812C59.0642 30.0812 59.8797 29.8461 60.5 29.4788"></path> <path d="M66.9126 19.8242V22.4999"></path> <path d="M33.2533 20.0237L39.0723 22.1767"></path> <path d="M39.1369 25.0058L33.0935 27.3212"></path> <path d="M81.8442 19.022L76.0252 21.1751"></path> <path d="M75.961 24.0041L82.0045 26.3196"></path> </g> <g class="profile-color-modes-illu-frame"> <path d="M73.4999 40.2236C74.9709 38.2049 75.8108 35.5791 75.8108 32.2283C75.8108 29.2229 75.1351 26.6488 73.9344 24.5094C75.0258 20.7525 75.6838 15.8246 74.6116 14.2317C72.7989 11.5386 66.0832 13.5913 63.2681 17.211C61.5952 16.8452 59.8167 16.6619 57.973 16.6619C56.0795 16.6619 54.2549 16.8552 52.5427 17.2409C49.7416 13.6027 42.9938 11.5312 41.176 14.2317C40.0859 15.8512 40.7843 20.9182 41.9084 24.6968C41.003 26.3716 40.4146 28.3065 40.2129 30.5"></path> <path d="M82.9458 30.5471L76.8413 31.657"></path> <path d="M76.2867 34.4319L81.8362 37.7616"></path> <path d="M49.4995 27.8242V30.4999"></path> <path d="M67.3374 27.8242V30.4998"></path> </g> <g class="profile-color-modes-illu-frame"> <path d="M40.6983 31.5C40.5387 29.6246 40.6456 28.0199 41.1762 27.2317C42.9939 24.5312 49.7417 26.6027 52.5428 30.2409C54.2551 29.8552 56.0796 29.6619 57.9731 29.6619C59.8169 29.6619 61.5953 29.8452 63.2682 30.211C66.0833 26.5913 72.799 24.5386 74.6117 27.2317C75.6839 28.8246 75.0259 33.7525 73.9345 37.5094C74.2013 37.9848 74.4422 38.4817 74.6555 39"></path> </g> </g> </svg> <span class="profile-color-modes-toggle js-promo-color-modes-toggle" role="checkbox" aria-checked="false" aria-label="Toggle dark mode" tabindex="0"> <div class="profile-color-modes-toggle-track"></div> <div class="profile-color-modes-toggle-thumb js-promo-color-modes-thumb"> <svg style="fill: #ffdf5d; margin: 7px 0 0 7px;" aria-hidden="true" width="14" height="13" viewBox="0 0 14 13" xmlns="http://www.w3.org/2000/svg"> <path fill-rule="evenodd" clip-rule="evenodd" d="M4.52208 7.71754C7.5782 7.71754 10.0557 5.24006 10.0557 2.18394C10.0557 1.93498 10.0392 1.68986 10.0074 1.44961C9.95801 1.07727 10.3495 0.771159 10.6474 0.99992C12.1153 2.12716 13.0615 3.89999 13.0615 5.89383C13.0615 9.29958 10.3006 12.0605 6.89485 12.0605C3.95334 12.0605 1.49286 10.001 0.876728 7.24527C0.794841 6.87902 1.23668 6.65289 1.55321 6.85451C2.41106 7.40095 3.4296 7.71754 4.52208 7.71754Z"></path> </svg> </div> </span> </div>css: /* 暗夜模式 */ // style :root,[data-color-mode=light] { --color-text-primary: #24292e; --color-bg-canvas: #fff; --color-scale-gray-3: #d1d5da; --color-scale-purple-8: #3a1d6e; --color-scale-white: #fff; --color-scale-purple-9: #29134e; --color-scale-gray-8: #2f363d; --color-scale-purple-6: #5a32a3; --color-scale-yellow-4: #ffdf5d; --color-scale-yellow-0: #fffdef; --color-auto-gray-3: #d1d5da; --color-scale-red-5: #d73a49; --color-scale-orange-3: #ffab70; --color-scale-purple-5: #6f42c1; --color-scale-green-3: #85e89d; --color-scale-blue-4: #2188ff; --color-scale-gray-6: #586069; } [data-color-mode=dark] { --color-text-primary: #c9d1d9; --color-bg-canvas: #0d1117; --color-scale-gray-3: #8b949e; --color-scale-purple-8: #3c1e70; --color-scale-white: #f0f6fc; --color-scale-purple-9: #271052; --color-scale-gray-8: #161b22; --color-scale-purple-6: #6e40c9; --color-scale-yellow-4: #bb8009; --color-scale-yellow-0: #f8e3a1; --color-auto-gray-3: #30363d; --color-scale-red-5: #da3633; --color-scale-orange-3: #f0883e; --color-scale-purple-5: #8957e5; --color-scale-green-3: #3fb950; --color-scale-blue-4: #388bfd; --color-scale-gray-6: #30363d; } /* 暗夜模式 */ [data-color-mode] { color: var(--color-text-primary); background-color: var(--color-bg-canvas) } :root,[data-color-mode=light] { color-scheme: light } [data-color-mode=dark] { color-scheme: dark } // style end :root,[data-color-mode=light] { --color-profile-color-modes-toggle-track-border:var(--color-scale-gray-3)} [data-color-mode=dark] { --color-profile-color-modes-toggle-track-border:var(--color-scale-purple-8)} :root,[data-color-mode=light] { --color-profile-color-modes-toggle-track-bg:var(--color-scale-white)} [data-color-mode=dark] { --color-profile-color-modes-toggle-track-bg:var(--color-scale-purple-9)} :root,[data-color-mode=light] { --color-profile-color-modes-toggle-thumb-bg:var(--color-scale-gray-8)} [data-color-mode=dark] { --color-profile-color-modes-toggle-thumb-bg:var(--color-scale-purple-6)} :root,[data-color-mode=light] { --color-profile-color-modes-toggle-moon:var(--color-scale-yellow-4)} [data-color-mode=dark] { --color-profile-color-modes-toggle-moon:var(--color-scale-yellow-0)} //color .profile-color-modes { display: block; position: relative; padding-right: 32px } .profile-color-modes-toggle { position: absolute; top: 12px; right: 0 } .profile-color-modes-toggle-track { width: 42px; height: 24px; border-radius: 24px; border: 3px solid var(--color-profile-color-modes-toggle-track-border); background-color: var(--color-profile-color-modes-toggle-track-bg) } .profile-color-modes-toggle-thumb { position: absolute; top: -2px; left: -2px; width: 28px; height: 28px; border-radius: 50%; background-color: var(--color-profile-color-modes-toggle-thumb-bg); transition: transform .3s cubic-bezier(.4,.03,0,1); cursor: pointer } [data-color-mode=dark] .profile-color-modes-toggle-thumb { transform: translateX(18px) } .profile-color-modes-popover { opacity: .01; transition: opacity .5s cubic-bezier(.4,.03,0,1) } .profile-color-modes-popover.shown { opacity: 1 } .profile-color-modes-illu-group { stroke: var(--color-auto-gray-3) } .profile-color-modes-illu-frame { opacity: 0 } :root .profile-color-modes-illu-frame:nth-child(8),[data-color-mode=light] .profile-color-modes-illu-frame:nth-child(8) { animation: profile-light-color-modes-illu-anim-frame-show 0s forwards,profile-light-color-modes-illu-anim-frame-hide 0s .3s forwards } :root .profile-color-modes-illu-frame:nth-child(9),[data-color-mode=light] .profile-color-modes-illu-frame:nth-child(9) { animation: profile-light-color-modes-illu-anim-frame-show 0s .3s forwards,profile-light-color-modes-illu-anim-frame-hide 0s .36s forwards } :root .profile-color-modes-illu-frame:nth-child(10),[data-color-mode=light] .profile-color-modes-illu-frame:nth-child(10) { animation: profile-light-color-modes-illu-anim-frame-show 0s .36s forwards } @keyframes profile-light-color-modes-illu-anim-frame-show { 0% { opacity: 0; animation-timing-function: ease-out } to { opacity: 1 } } @keyframes profile-light-color-modes-illu-anim-frame-hide { 0% { opacity: 1; animation-timing-function: ease-in } to { opacity: 0 } } [data-color-mode=dark] .profile-color-modes-illu-red { stroke: var(--color-scale-red-5) } [data-color-mode=dark] .profile-color-modes-illu-orange { stroke: var(--color-scale-orange-3) } [data-color-mode=dark] .profile-color-modes-illu-purple { stroke: var(--color-scale-purple-5) } [data-color-mode=dark] .profile-color-modes-illu-green { stroke: var(--color-scale-green-3) } [data-color-mode=dark] .profile-color-modes-illu-blue { stroke: var(--color-scale-blue-4) } [data-color-mode=dark] .profile-color-modes-illu-group { animation: profile-color-modes-illu-anim .2s cubic-bezier(.72,.08,1,.68) backwards } @keyframes profile-color-modes-illu-anim { 0% { stroke: var(--color-scale-gray-6) } } [data-color-mode=dark] .profile-color-modes-illu-frame { animation: profile-color-modes-illu-anim-frame-show 0s forwards,profile-color-modes-illu-anim-frame-hide 0s forwards } [data-color-mode=dark] .profile-color-modes-illu-frame:first-child { opacity: 1; animation: profile-color-modes-illu-anim-frame-hide 0s forwards } [data-color-mode=dark] .profile-color-modes-illu-frame:nth-child(8) { animation: profile-color-modes-illu-anim-frame-show 0s forwards } @keyframes profile-color-modes-illu-anim-frame-show { 0% { opacity: 0; animation-timing-function: ease-out } to { opacity: 1 } } @keyframes profile-color-modes-illu-anim-frame-hide { 0% { opacity: 1; animation-timing-function: ease-in } to { opacity: 0 } } [data-color-mode=dark] .profile-color-modes-illu-red { animation-delay: .4s; animation-duration: .1s } [data-color-mode=dark] .profile-color-modes-illu-orange { animation-delay: .5s; animation-duration: .1s } [data-color-mode=dark] .profile-color-modes-illu-purple { animation-delay: .6s; animation-duration: .1s } [data-color-mode=dark] .profile-color-modes-illu-blue { animation-delay: .7s; animation-duration: .1s } [data-color-mode=dark] .profile-color-modes-illu-green { animation-delay: .8s; animation-duration: .2s; animation-timing-function: cubic-bezier(.47,2.92,.84,-1.5) } [data-color-mode=dark] .profile-color-modes-illu-frame:first-child { animation-delay: 1.8s } [data-color-mode=dark] .profile-color-modes-illu-frame:nth-child(2) { animation-delay: 1.8s,2.58s } [data-color-mode=dark] .profile-color-modes-illu-frame:nth-child(3) { animation-delay: 2.58s,2.66s } [data-color-mode=dark] .profile-color-modes-illu-frame:nth-child(4) { animation-delay: 2.66s,2.78s } [data-color-mode=dark] .profile-color-modes-illu-frame:nth-child(5) { animation-delay: 2.78s,2.84s } [data-color-mode=dark] .profile-color-modes-illu-frame:nth-child(6) { animation-delay: 2.84s,3.44s } [data-color-mode=dark] .profile-color-modes-illu-frame:nth-child(7) { animation-delay: 3.44s,3.56s } [data-color-mode=dark] .profile-color-modes-illu-frame:nth-child(8) { animation-delay: 3.56s } [data-color-mode=dark] .profile-color-modes-illu-frame:nth-child(9),[data-color-mode=dark] .profile-color-modes-illu-frame:nth-child(10) { animation: none } /* 暗夜end */切换控制是通过修改您的 html 根节点来控制的,因此需要修改您的 html 根节点代码: <html lang="en"> //改为: <html lang="en" data-color-mode="light">js: // 切换按钮 function set_mode_toggle(e) { let t = !0, mode = "dark"; "true" === e.getAttribute("aria-checked") && (t = !1 , mode = "light") e.setAttribute("aria-checked", String(t)) change_mode(mode); } // 改变模式 并设置 cookie function change_mode(e) { const t = document.querySelector("html[data-color-mode]"); if (e === "dark") document.cookie = "night=1;path=/"; else document.cookie = "night=0;path=/" t && t.setAttribute("data-color-mode", e) } // 获取当前模式 function get_user_scheme_mode() { const e = document.querySelector("html[data-color-mode]"); if (!e) return; const t = e.getAttribute("data-color-mode"); return "auto" === t ? function() { if (get_sys_scheme_mode("dark")) return "dark"; if (get_sys_scheme_mode("light")) return "light"; }() : t } // 获取系统模式 先判断 cookie 在获取系统的 function get_sys_scheme_mode(e) { let night = document.cookie.replace(/(?:(?:^|.*;\s*)night\s*\=\s*([^;]*).*$)|^.*$/, "$1") if (night){ if(night === '0'){ return false }else if(night === '1'){ return true } }else return window.matchMedia && window.matchMedia(`(prefers-color-scheme: ${e})`).matches } !async function() { const e = document.querySelector(".js-promo-color-modes-toggle"); if (e && "auto" === function() { const e = document.querySelector("html[data-color-mode]"); if (!e) return; return e.getAttribute("data-color-mode") }()) { "dark" === get_user_scheme_mode() && e.setAttribute("aria-checked", "true") } }() !async function() { document.querySelector(".js-color-mode-settings") && window.history.replaceState({}, document.title, document.URL.split("?")[0]) }() // 添加点击事件 let toggle_btn = document.getElementsByClassName("js-promo-color-modes-toggle") toggle_btn[0]? toggle_btn[0].addEventListener('click',function (e) { set_mode_toggle(e.currentTarget) },false):false...
2021-1-28
愿漫漫长路,总有人陪伴左右

愿漫漫长路,总有人陪伴左右

昨晚下班很晚,可地铁依旧很挤。等了几班车,才挤上了车尾。好不容易找到一个还算宽松的位置站着,正想松口气时,看到一个满脸泪水的姑娘。她没有表情,没有声音,但眼泪一直在流。很想送她一张纸巾,但强按住了快要伸出去的手。这种境况下,她应该不太希望被关注,也不太想被打扰吧。好想此时能有一个她特别亲密的朋友在身边,帮她擦干眼泪,给她一个紧紧地拥抱。可生命中有太多孤独,需要一个人面对。有太多眼泪,需要独自品味。曾经你也经历过这样的时刻吧。悲从心生,怎么也压不住心底的委屈。顾不得身处的环境,也无心顾及周围人的看法。只能用仅剩的理智,控制着自己不要哭出声。多希望在这些时刻,能有一人陪伴在你身边。知你心事,懂你委屈,帮你擦干脸上的泪水。轻声告诉你“想哭就哭,你还有我。”生命是一段旅程,可是很多时候,旅途中的风景没有我们想象中那么美好。总会在某些猝不及防的时刻,用这样或那样的事情,打的人措手不及。而我们只能照单全收,独自消化,停一段时间后,才能收拾好心情后,重新出发。在这段旅程中,你一边努力,一边迷茫。陪在你身边的人,总是只陪了一段,就去了不同的方向。让我感谢命运我的生命总有人匆匆离去太多今天想要去逃避被推进被驱离你是否也一直在寻找?寻找一个人解开你的迷茫,指引你人生的方向,陪你走到旅程尽头,看遍沿途的风景。寻找一个人在大雨中为你撑伞,在黑暗中默默抱紧你,陪你彻夜聊天,陪你开心陪你流泪。虽然常听人说,人生而孤独。但还是希望你能找到这么一个人。往后余生,不论遇到什么,都不用一个人孤身面对。漫漫人生路,能有他来作陪。...
微信二维码
Sitemap