查找当前主题下的style.css。CSS文件根据主题自行选择可能名称不符。找到以下代码:
#comments .comment-author .avatar{display:block;float:left;width:40px;height:40px;margin:1.4rem 1rem 0 0;border-radius:50%}
修改为:
#comments .comment-author .avatar{display:block;float:left;width:40px;height:40px;margin:1.4rem 1rem 0 0;border-radius:50%;transition: all 0.5s}
<h1>comments .comment-author .avatar:hover{transform:rotate(360deg)}</h1>
即可大功告成@(太开心)
具体演示效果,可参照本博客评论头像,如果你跟我一样使用Hran的主题,可以直接查找替换。
transition: all 0.5s
是表示旋转在0.5秒内完成,可自行修改速度
transform: rotate(360deg)
表示图片旋转360度,可自行修改
到处逛博客圈,又发现好多好东西,赶紧收藏起来,感谢Destined博主的奉献!
Typecho免插件实现博主认证
打开 comments.php
,找到下面这条代码:
在后面加上如下代码:[/p>#### Typecho留言加上@
- 打开模板文件夹里的functions.php文件,添加以下代码:
/<em>评论增加@功能</em>/
function getPermalinkFromCoid($coid) {
$db = Typecho_Db::get();
$options = Typecho_Widget::widget('Widget_Options');
$contents = Typecho_Widget::widget('Widget_Abstract_Contents');
$row = $db->fetchRow($db->select('cid, type, author, text')->from('table.comments')
->where('coid = ? AND status = ?', $coid, 'approved'));
if (empty($row)) return 'Comment not found!';
$cid = $row['cid'];
$select = $db->select('coid, parent')->from('table.comments')
->where('cid = ? AND status = ?', $cid, 'approved')->order('coid');
if ($options->commentsShowCommentOnly)
$select->where('type = ?', 'comment');
$comments = $db->fetchAll($select);
if ($options->commentsOrder == 'DESC')
$comments = array_reverse($comments);
foreach ($comments as $key => $val)
$array[$val['coid']] = $val['parent'];
$i = $coid;
while ($i != 0) {
$break = $i;
$i = $array[$i];
}
$count = 0;
foreach ($array as $key => $val) {
if ($val == 0) $count++;
if ($key == $break) break;
}
$parentContent = $contents->push($db->fetchRow($contents->select()->where('table.contents.cid = ?', $cid)));
$permalink = rtrim($parentContent['permalink'], '/');
$page = ($options->commentsPageBreak)
? '/comment-page-' . ceil($count / $options->commentsPageSize)
: ( substr($permalink, -5, 5) == '.html' ? '' : '/' );
return array(
"author" => $row['author'],
"text" => $row['text'],
"href" => "{$permalink}{$page}#{$row['type']}-{$coid}"
);
}
- 然后打开你的
comment.php
文件,找到以下代码:
在其前面加入如下代码:](mailto:/p>