首页
留言板
统计
Search
1
阿里云国际OSS使用CloudFlare免流量
2,263 阅读
2
PP.UA免费域名注册
2,173 阅读
3
Adobe Photoshop CS2经典版 中文原版
2,158 阅读
4
7-Zip中文美化版
2,027 阅读
5
获取免费的 Microsoft 365 E5 开发人员订阅
1,941 阅读
软件分享
网络资源
网络代码
生活情感
免费主机
Search
标签搜索
代码
工具软件
Android
教程
Emlog
办公软件
图形图像
免费空间
Web
情感
PHP
视频
系统工具
上传下载
Windows
建站
PDF
网盘
学习
Typecho
ZJ
累计撰写
802
篇文章
累计收到
105
条评论
首页
栏目
软件分享
网络资源
网络代码
生活情感
免费主机
页面
留言板
统计
搜索到
71
篇与
的结果
2022-09-21
为你的网站添加点击散开特效
将以下代码复制到你网站最底部即可实现<canvas id="fireworks" style="position: fixed; left: 0px; top: 0px; pointer-events: none; z-index: 2147483647; width: 1920px; height: 151px;" width="3840" height="302"></canvas> <script type="text/javascript" src="https://cdn.jsdelivr.net/npm/animejs@3.0.1/lib/anime.min.js"></script> <script type="text/javascript"> function updateCoords(e) { pointerX = (e.clientX || e.touches[0].clientX) - canvasEl.getBoundingClientRect().left, pointerY = e.clientY || e.touches[0].clientY - canvasEl.getBoundingClientRect().top } function setParticuleDirection(e) { var t = anime.random(0, 360) * Math.PI / 180, a = anime.random(50, 180), n = [-1, 1][anime.random(0, 1)] * a; return { x: e.x + n * Math.cos(t), y: e.y + n * Math.sin(t) } } function createParticule(e, t) { var a = {}; return a.x = e, a.y = t, a.color = colors[anime.random(0, colors.length - 1)], a.radius = anime.random(16, 32), a.endPos = setParticuleDirection(a), a.draw = function() { ctx.beginPath(), ctx.arc(a.x, a.y, a.radius, 0, 2 * Math.PI, !0), ctx.fillStyle = a.color, ctx.fill() }, a } function createCircle(e, t) { var a = {}; return a.x = e, a.y = t, a.color = "#F00", a.radius = .1, a.alpha = .5, a.lineWidth = 6, a.draw = function() { ctx.globalAlpha = a.alpha, ctx.beginPath(), ctx.arc(a.x, a.y, a.radius, 0, 2 * Math.PI, !0), ctx.lineWidth = a.lineWidth, ctx.strokeStyle = a.color, ctx.stroke(), ctx.globalAlpha = 1 }, a } function renderParticule(e) { for (var t = 0; t < e.animatables.length; t++) e.animatables[t].target.draw() } function animateParticules(e, t) { for (var a = createCircle(e, t), n = [], i = 0; i < numberOfParticules; i++) n.push(createParticule(e, t)); anime.timeline().add({ targets: n, x: function(e) { return e.endPos.x }, y: function(e) { return e.endPos.y }, radius: .1, duration: anime.random(1200, 1800), easing: "easeOutExpo", update: renderParticule }).add({ targets: a, radius: anime.random(80, 160), lineWidth: 0, alpha: { value: 0, easing: "linear", duration: anime.random(600, 800) }, duration: anime.random(1200, 1800), easing: "easeOutExpo", update: renderParticule, offset: 0 }) } function debounce(fn, delay) { var timer return function() { var context = this var args = arguments clearTimeout(timer) timer = setTimeout(function() { fn.apply(context, args) }, delay) } } var canvasEl = document.querySelector("#fireworks"); if (canvasEl) { var ctx = canvasEl.getContext("2d"), numberOfParticules = 30, pointerX = 0, pointerY = 0, tap = "mousedown", colors = ["#FF1461", "#18FF92", "#5A87FF", "#FBF38C"], setCanvasSize = debounce(function() { canvasEl.width = 2 * window.innerWidth, canvasEl.height = 2 * window.innerHeight, canvasEl.style.width = window.innerWidth + "px", canvasEl.style.height = window.innerHeight + "px", canvasEl.getContext("2d").scale(2, 2) }, 500), render = anime({ duration: 1 / 0, update: function() { ctx.clearRect(0, 0, canvasEl.width, canvasEl.height) } }); document.addEventListener(tap, function(e) { "sidebar" !== e.target.id && "toggle-sidebar" !== e.target.id && "A" !== e.target.nodeName && "IMG" !== e.target.nodeName && (render.play(), updateCoords(e), animateParticules(pointerX, pointerY)) }, !1), setCanvasSize(), window.addEventListener("resize", setCanvasSize, !1) } </script>
2022年09月21日
15 阅读
0 评论
0 点赞
2022-09-14
emlog转typecho,完美转换(包括阅读浏览次数)
使用方法需要依赖 PHP-MySQLi-Database-Class需要php包含mysqli扩展在emlog2typecho.php开头处设置好require路径以及数据库相关配置运行emlog2typecho.phprequire_once 'MysqliDb.php'; $db_host = '127.0.0.1'; $db_port = 3306; $db_user = 'xxx'; $db_passwd = 'xxx'; $emlogDb = 'xxx'; $emlogPrefix = 'emlog_'; $typechoDb = 'xxx'; $typechoPrefix = 'typecho_';测试版本emlog5.3.1 > typecho1.2.0Github项目地址https://github.com/oyyq99999/emlog2typecho原版不支持阅读次数转换,修改后的emlog2typecho.php支持{cloud title="" type="lz" url="https://qpan.lanzouw.com/b08byd1mf" password="ddzy"/}
2022年09月14日
47 阅读
0 评论
1 点赞
2021-09-11
Emlog按天数调用热门文章和随机文章列表
在module.php里面添加如下:<?php //30天按点击率排行文章 function getdatelogs($log_num) { $db = Database::getInstance(); $time = time(); $sql = "SELECT gid,title,comnum FROM ".DB_PREFIX."blog WHERE type='blog' AND date > $time - 30*24*60*60 ORDER BY `views` DESC LIMIT 0,$log_num"; $list = $db->query($sql); while($row = $db->fetch_array($list)){ ?> <li class="layout_li"><strong><img src="<?php echo TEMPLATE_URL; ?>/img/hot_1.gif" alt="本月热门"> <?php echo $row['comnum']; ?></strong><a href="<?php echo Url::log($row['gid']); ?>" title="<?php echo $row['title']; ?>"><span><?php echo ++$i;?></span><?php echo $row['title']; ?></a></li> <?php } ?> <?php } ?> <?php //随机文章 function getRandLog($log_num) { $db = Database::getInstance(); $sql = "SELECT gid,title,comnum FROM ".DB_PREFIX."blog WHERE type='blog' and hide='n' ORDER BY rand() LIMIT 0,$log_num"; $list = $db->query($sql); while($row = $db->fetch_array($list)){ ?> <li class="layout_li"><strong><?php echo gettime($row['gid']);?></strong><a href="<?php echo Url::log($row['gid']); ?>" title="<?php echo $row['title']; ?>"><span>荐</span><?php echo $row['title']; ?></a></li> <?php } ?> <?php } ?>调用代码:一般都放在首页文件log_list.php里 <article class="hot_posts "> <div class="suiji"> <h3>随机文章</h3> <ul class="layout_ul"> <li class="layout_li"><?php getRandLog(6);?></li> </ul> </div> <div class="hots"> <h3>本月热门</h3> <ul class="layout_ul"> <li class="layout_li"><?php getdatelogs(6);?></li> </ul> </div> </article> ccs代码: .hot_posts { background-color:#fff; padding:20px; position:relative; font-size:0; box-shadow:0 0px 20px rgba(160, 160, 160, 0.1); border-radius:10px; margin-bottom: 10px; } .hot_posts .suiji { display:inline-block; vertical-align:top; width:50%; padding-right:10px; } .hot_posts .hots { display:inline-block; vertical-align:top; width:50%; padding-left:10px; } .hot_posts h3 { border-bottom:2px #f2f2f2 solid; padding-bottom:6px; margin-bottom:8px; font-size:16px; margin-top:0; position:relative; } .hot_posts h3:after { content:""; color:#ffffff; position:absolute; height:2px; width:30px; background:#45b6f7; left:0; bottom:-2px; -webkit-transition:all .25s ease-in; -moz-transition:all .25s ease-in; transition:all .25s ease-in; } .hot_posts .suiji:hover h3:after, .hot_posts .hots:hover h3:after { width:100px; } .hot_posts ul { padding:0 } .hot_posts ul li { display:block; padding:8px 0; -webkit-transition:ease-in-out 0.25s; transition:ease-in-out 0.25s; font-size:12px; } .hot_posts ul li:hover { font-size:15px; -webkit-transition:ease-in-out 0.25s; transition:ease-in-out 0.25s; } .hot_posts ul li a { display:block; -ms-text-overflow:ellipsis; text-overflow:ellipsis; white-space:nowrap; overflow:hidden; line-height:22px; } .hot_posts ul li strong { float:right; font-weight:normal; line-height:22px; padding-left:15px; } .hot_posts ul li a>img { width:30px; height:22px; margin-right:4px; border-radius:5px; vertical-align:bottom; } .hot_posts span { width:22px; height:22px; background-color:#f2f2f2; display:inline-block; text-align:center; margin-right:4px; border-radius:25px; line-height:22px; color:#666; } .hot_posts ul li:nth-child(1) span { background-color:#ff5a3c; color:#fff; } .hot_posts ul li:nth-child(2) span { background-color:#13b755; color:#fff; } .hot_posts ul li:nth-child(3) span { background-color:#00a9e3; color:#fff; } @media screen and (max-width: 768px) { .hot_posts .suiji { width:100%; margin-bottom:20px; } .hot_posts .hots { width:100%; padding-left:0; } }以下图片放到当前模板文件夹/img/hot_1.gif
2021年09月11日
131 阅读
0 评论
0 点赞
2021-09-11
emlog优化缓存速度
未修改前(include\lib\cache.php)文件路径/** * 用户信息缓存 */private function mc_user() {$user_cache = array();$query = $this->db->query("SELECT * FROM " . DB_PREFIX . "user");while ($row = $this->db->fetch_array($query)) { $photo = array(); $avatar = ''; if(!empty($row['photo'])){ $photosrc = str_replace("../", '', $row['photo']); $imgsize = chImageSize($row['photo'], Option::ICON_MAX_W, Option::ICON_MAX_H); $photo['src'] = htmlspecialchars($photosrc); $photo['width'] = $imgsize['w']; $photo['height'] = $imgsize['h']; $avatar = strstr($photosrc, 'thum') ? str_replace('thum', 'thum52', $photosrc) : preg_replace("/^(.*)\/(.*)$/", "\$1/thum52-\$2", $photosrc); $avatar = file_exists('../' . $avatar) ? $avatar : $photosrc; } $row['nickname'] = empty($row['nickname']) ? $row['username'] : $row['nickname']; $user_cache[$row['uid']] = array( 'photo' => $photo, 'avatar' => $avatar, 'name_orig' => $row['nickname'], 'name' => htmlspecialchars($row['nickname']), 'mail' => htmlspecialchars($row['email']), 'des' => htmlClean($row['description']), 'ischeck' => htmlspecialchars($row['ischeck']), 'role' => $row['role'], );}$cacheData = serialize($user_cache);$this->cacheWrite($cacheData, 'user');}替换下面代码:/** * 用户信息缓存 */private function mc_user() { $user_cache = array(); $query = $this->db->query("SELECT uid,username,nickname,role,ischeck,photo,email,description FROM " . DB_PREFIX . "user"); while ($row = $this->db->fetch_array($query)) { // $photo = array(); /* $avatar = ''; if(!empty($row['photo'])){ $photosrc = str_replace("../", '', $row['photo']); $imgsize = chImageSize($row['photo'], Option::ICON_MAX_W, Option::ICON_MAX_H); $photo['src'] = htmlspecialchars($photosrc); $photo['width'] = $imgsize['w']; $photo['height'] = $imgsize['h']; $avatar = strstr($photosrc, 'thum') ? str_replace('thum', 'thum52', $photosrc) : preg_replace("/^(.*)\/(.*)$/", "\$1/thum52-\$2", $photosrc); $avatar = file_exists('../' . $avatar) ? $avatar : $photosrc; }*/ $row['nickname'] = empty($row['nickname']) ? $row['username'] : $row['nickname']; $user_cache[$row['uid']] = array( 'photo' => $row['photo'], 'avatar' => $row['photo'], 'name_orig' => $row['nickname'], 'name' => htmlspecialchars($row['nickname']), 'mail' => htmlspecialchars($row['email']), 'des' => htmlClean($row['description']), 'ischeck' => htmlspecialchars($row['ischeck']), 'role' => $row['role'], ); } $cacheData = serialize($user_cache); $this->cacheWrite($cacheData, 'user');} emlog核心优化:(admin\save_log.php)文件路径 // 源代码$CACHE->updateCache(); // 修改为:$CACHE->updateCache(array('sta', 'tags', 'newlog', 'logsort', 'logtags'));
2021年09月11日
78 阅读
0 评论
0 点赞
2021-09-11
自动PC端显示 手机端隐藏CSS代码判断实现
实现场景描述:有些内容部署在PC端但是有不适合在手机端显示(比如盒子过大,遮挡内容)或者手机端显示毫无意义等。我们可以使用下面的代码来实现:电脑端显示,手机端隐藏。实现方法:@media screen and (max-width: 1221px) { .wapnone{display:none; } } 调用多个<class> @media screen and (max-width: 1221px) { .tool_cai,.tool_code,.tool_zan{display:none;} } 调用ID @media screen and (max-width: 1221px) { #lzxPlayer{display:none;} }在需要隐藏的区域加一个DIV,代码如下:<div class="wapnone">你要css判断隐藏的内容</div> <div class="tool_cai">你要css判断隐藏的内容</div> <div class="tool_code">你要css判断隐藏的内容</div> <div class="tool_zan">你要css判断隐藏的内容</div> <div id="lzxPlayer">你要css判断隐藏的内容</div>(1221px表示如果屏幕尺寸达到了1221像素以下将会隐藏否则显示。具体数值可以自行调试)
2021年09月11日
132 阅读
0 评论
0 点赞
2021-09-11
emlog添加验证码点击刷新
Emlog有用到验证码的源代码有如下文件:Emlog碎语:/t/index.phpEmlog评论:/include/controller/log_controller.phpEmlog管理后台登录:include\lib\loginauth.php将以上文件的验证码位置的img标签添加以下语句即可实现点击刷新验证码功能(调用验证码<?php echo $verifyCode; ?>):增加以下代码: style=\"cursor:pointer;\" alt=\"未显示?请点击刷新\" title=\"看不清楚?请点击刷新\" onclick=\"this.src=this.src+'?'\"原代码: <img src=\"".BLOG_URL."include/lib/checkcode.php\" align=\"absmiddle\" /><input name=\"imgcode\" type=\"text\" class=\"input\" size=\"5\" tabindex=\"5\" />修改后代码: <img src=\"".BLOG_URL."include/lib/checkcode.php\" align=\"absmiddle\" style=\"cursor:pointer;\" alt=\"未显示?请点击刷新\" title=\"看不清楚?请点击刷新\" onclick=\"this.src=this.src+'?'\" /><input name=\"imgcode\" type=\"text\" class=\"input\" size=\"5\" tabindex=\"5\" />
2021年09月11日
115 阅读
0 评论
0 点赞
2021-06-27
美化file上传表单选择文件按钮代码
模板制作时写file上传文件表单,默认样式不是很好看,为了美观好看就要自定义代码来美化file上传表单选择文件按钮,为了方便有需要的站长,今天分享美化file上传表单选择文件按钮代码,代码中包含css样式、html代码、javascript代码,只需要复制代码稍作修改放到模板中就可使用。<style> *{margin:0;border:0;padding:0;} .file{margin:100px auto 0;width:300px;border:1px solid #00aff0;height:40px;border-radius:6px;position:relative} .blueButton{position:absolute;display:block;width:100px;height:40px;right:0;background-color:#00b3ee;color:#fff;text-decoration:none;text-align:center;font:normal normal normal 16px/40px 'Microsoft YaHei';cursor:pointer;border-radius:4px} .blueButton:hover{text-decoration:none} .myFileUpload{position:absolute;display:block;width:100px;height:40px;right:0;opacity:0} .show{position:absolute;top:5px;left:5px;width:calc(100% - 100px);height:30px;font:normal normal normal 14px/30px 'Microsoft YaHei'} </style> <div class="file"> <div class="show">请选择需要上传的文件...</div> <a href='javascript:void(0);' class="blueButton">选择文件</a> <input type="file" class="myFileUpload" /> </div> <script src="//cdn.staticfile.org/jquery/1.7.2/jquery.min.js" type="text/javascript"></script> <script type="text/javascript"> $(document).ready(function() { $(".myFileUpload").change(function(){ var arrs=$(this).val().split('\\'); console.log(arrs); var filename=arrs[arrs.length-1]; $(".show").html(filename); }); }); </script>
2021年06月27日
128 阅读
0 评论
0 点赞
2021-03-17
自动复制内容到剪切板的隐藏js代码
一串实用的js代码,自动复制内容到剪切板的隐藏js代码,在页面部署自动复制内容代码后,不论电脑还是手机只要用户点击就会自动复制内容到剪切板,很实用的js代码,只需要把代码复制到页面模板中,稍作修改即可使用。<script src="https://cdnjs.cat.net/ajax/libs/jquery/3.3.1/jquery.min.js"></script> <script src="https://cdnjs.cat.net/ajax/libs/clipboard.js/1.7.1/clipboard.min.js"></script> <script> $("body").onclick = copycode(); $("body").attr("id" ,"copy"); $("body").attr("data-clipboard-text" ,"需要复制的内容"); function copycode(){var clipboard = new Clipboard('#copy');clipboard.on('success', function (e){console.log("copy ok");});clipboard.on('error', function (e){console.log("copy error");});} </script>
2021年03月17日
146 阅读
0 评论
0 点赞
1
2
...
9