欢迎来到好人卡资源网,专注网络技术资源收集,我们不仅是网络资源的搬运工,也生产原创资源。寻找资源请留言或关注公众号:烈日下的男人

typecho美化代码(二)

网站源码 sky995 1年前 (2023-04-07) 516次浏览 0个评论

本文及资源最后更新时间 2023-04-07 by sky995

复制版权提醒◆放置到 footer

  • <script>
  • document.body.addEventListener(‘copy’, function (e) {
  • if (window.getSelection().toString() && window.getSelection().toString().length > 42) {
  • setClipboardText(e);
  • alert(‘商业转载请联系作者获得授权,非商业转载请注明出处,谢谢合作。’);
  • }
  • });
  • function setClipboardText(event) {
  • var clipboardData = event.clipboardData || window.clipboardData;
  • if (clipboardData) {
  • event.preventDefault();
  • var htmlData =
  • + ‘著作权归作者所有。<br>’
  • + ‘商业转载请联系作者获得授权,非商业转载请注明出处。<br>’
  • + ‘作者:<?php $this->author() ?><br>’
  • + ‘链接:’ + window.location.href + ‘<br>’
  • + ‘来源:<?php $this->options->siteUrl(); ?><br><br>’
  • + window.getSelection().toString();
  • var textData =
  • + ‘著作权归作者所有。\n’
  • + ‘商业转载请联系作者获得授权,非商业转载请注明出处。\n’
  • + ‘作者:<?php $this->author() ?>\n’
  • + ‘链接:’ + window.location.href + ‘\n’
  • + ‘来源:<?php $this->options->siteUrl(); ?>\n\n’
  • + window.getSelection().toString();
  • clipboardData.setData(‘text/html’, htmlData);
  • clipboardData.setData(‘text/plain’,textData);
  • }
  • }
  • </script>

站点提醒◆放置到 footer

  • <script>
  • notie({
  • type: ‘info’,
  • text: ‘<?php $this->archiveTitle(array(
  • ‘post’ =>_t(‘欢迎阅读<strong>《 %s 》</strong>’),
  • ‘page’ =>_t(‘<strong> %s </strong>’),
  • ‘category’=>_t(‘分类<strong> %s </strong>下的文章’),
  • ‘search’=>_t(‘包含关键字<strong> %s </strong>的文章’),
  • ‘tag’ =>_t(‘标签<strong> %s </strong>下的文章’),
  • ‘author’=>_t(‘<strong> %s </strong>的主页’)
  • ), , ); ?>‘,
  • autoHide: true
  • })
  • </script>

返回顶部◆放置到 footer

  • <SCRIPT language=JavaScript>
  • var currentpos,timer;
  • function initialize()
  • {
  • timer=setInterval(“scrollwindow()”,10);
  • }
  • function sc(){
  • clearInterval(timer);
  • }
  • function scrollwindow()
  • {
  • currentpos=document.body.scrollTop;
  • window.scroll(0,++currentpos);
  • if (currentpos != document.body.scrollTop)
  • sc();
  • }
  • document.onmousedown=sc
  • document.ondblclick=initialize
  • </script>

网站夜间模式

网站底部蒲公英◆放置到 footer

  • <div class=“dandelion”>
  • <span class=“smalldan”></span>
  • <span class=“bigdan”></span>
  • </div>
  • <style type=“text/css”>
  • @media screen and (max-width:600px){
  • .dandelion{display: none !important;}
  • }
  • .dandelion .smalldan {
  • width: 36px;
  • height: 60px;
  • left: 88px;
  • background-position: 090px;
  • border: 0px solid red;
  • }
  • .dandelion span {
  • -webkit-animation: ball-x 3s linear 2s infinite;
  • -moz-animation: ball-x 3s linear 2s infinite;
  • animation: ball-x 3s linear 2s infinite;
  • -webkit-transform-origin: bottom center;
  • -moz-transform-origin: bottom center;
  • transform-origin: bottom center;
  • }
  • .dandelion span {
  • display: block;
  • position: fixed;
  • z-index:9999999999;
  • bottom: 0px;
  • background-repeat: no-repeat;
  • _background: none;
  • }
  • .dandelion .bigdan {
  • width: 64px;
  • height: 115px;
  • left: 41px;
  • background-position: –86px36px;
  • border: 0px solid red;
  • }
  • @keyframes ball-x {
  • 0% { transform:rotate(0deg);}
  • 25% { transform:rotate(5deg); }
  • 50% { transform:rotate(0deg);}
  • 75% { transform:rotate(-5deg);}
  • 100% { transform:rotate(0deg);}
  • }
  • @-webkitkeyframes ball-x {
  • 0% { -webkit-transform:rotate(0deg);}
  • 25% { -webkit-transform:rotate(5deg); }
  • 50% { -webkit-transform:rotate(0deg);}
  • 75% { -webkit-transform:rotate(-5deg);}
  • 100% { -webkit-transform:rotate(0deg);}
  • }
  • @-mozkeyframes ball-x {
  • 0% { -moz-transform:rotate(0deg);}
  • 25% { -moz-transform:rotate(5deg); }
  • 50% { -moz-transform:rotate(0deg);}
  • 75% { -moz-transform:rotate(-5deg);}
  • 100% { -moz-transform:rotate(0deg);}
  • }
  • </style>

好人卡资源网 , 版权所有丨如未注明 , 均为原创丨本网站采用BY-NC-SA协议进行授权
转载请注明原文链接:typecho美化代码(二)
喜欢 (0)
发表我的评论
取消评论

表情 贴图 加粗 删除线 居中 斜体 签到

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址