Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
BigCoke233 authored Jul 25, 2019
1 parent 35a5154 commit 1718bd7
Show file tree
Hide file tree
Showing 12 changed files with 295 additions and 25 deletions.
41 changes: 41 additions & 0 deletions about.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
<?php if (!defined('__TYPECHO_ROOT_DIR__')) exit;
/**
* 关于页面
*
* @package custom
*/
$this->need('includes/head.php');
$this->need('includes/header.php');
?>
<main class="main-container container">
<div class="post-body">
<br><br><br>
<div class="about">
<div class="about-avatar">
<?php echo $this->author->gravatar(300); ?>
<?php if($this->fields->name==!''): ?>
<h2 class="about-name"><?php echo $this->fields->name(); ?></h2>
<?php endif; ?>
</div>
<div class="about-social">
<?php if($this->fields->github==!''): ?>
<a href="https://github.com/<?php echo $this->fields->github(); ?>" target="_blank" title="GayHub"><i class="iconfont icon-github"></i></a>
<?php endif; ?>
<?php if($this->fields->qq==!''): ?>
<a href="tencent://Message/?Uin=<?php echo $this->fields->qq(); ?>&amp;websiteName=q-zone.qq.com&amp;Menu=yes" target="_blank" title="QQ"><i class="iconfont icon-qq1"></i></a>
<?php endif; ?>
<?php if($this->fields->bilibili==!''): ?>
<a href="https://space.bilibili.com/<?php echo $this->fields->bilibili(); ?>" target="_blank" title="Bilibili"><i class="iconfont icon-bilibili-"></i></a>
<?php endif; ?>
<?php if($this->fields->email==!''): ?>
<a href="mail:<?php echo $this->fields->email(); ?>"><i class="iconfont icon-mail_fill" target="_blank" title="email"></i></a>
<?php endif; ?>
</div>
</div>
<div class="post-content page-content">
<?php $this->content(); ?>
</div>
</div>
<?php $this->need('includes/comments.php'); ?>
</main>
<?php $this->need('includes/footer.php'); ?>
34 changes: 29 additions & 5 deletions assets/css/dark.miracles.css
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,12 @@
.body-dark .comment-reply a {
background: transparent
}
/* No Shadow */
.body-dark .options {
box-shadow: 0 0 0 #fff;
-moz-box-shadow: 0 0 0 #fff;
-webkit-box-shadow: 0 0 0 #fff;
}
/* Need Shadow */
.body-dark .dark-button,
.body-dark .post-body,
Expand All @@ -44,7 +50,8 @@
.body-dark .OwO-body,
.body-dark .OwO-open .OwO-logo,
.body-dark .OwO .OwO-body .OwO-items .OwO-item:hover,
.body-dark .options {
.body-dark .options,
.body-dark .comment-pagenav a {
box-shadow: 0 0 36px #323232!important;
-moz-box-shadow: 0 0 36px #323232!important;
-webkit-box-shadow: 0 0 36px #323232!important
Expand All @@ -65,7 +72,11 @@
.body-dark .comment-author,
.body-dark .bubble.saying-body,
.body-dark .tags-item a,
.body-dark .options-button-active {
.body-dark .options-button-active,
.body-dark .drawer-footer,
.body-dark .drawer-search,
.body-dark .drawer-content a:hover,
.body-dark .comment-pagenav a {
background: #646464!important;
}
/* Need #5a5a5a bg */
Expand All @@ -88,7 +99,11 @@
.body-dark .dialog,
.body-dark .options,
.body-dark .options-theme-label,
.body-dark .options-family-button {
.body-dark .options-family-button,
.body-dark .drawer,
.body-dark .drawer-icon,
.body-dark .drawer-search-form input,
.body-dark .drawer-search-form button {
background: #5a5a5a!important
}
/* OwO */
Expand Down Expand Up @@ -126,7 +141,13 @@
.body-dark .mobile-menu-footer,
.body-dark .options-family-button,
.body-dark .options-theme-item:hover .options-theme-label,
.body-dark .options-contentsize-button {
.body-dark .options-contentsize-button,
.body-dark .drawer,
.body-dark .drawer a,
.body-dark .drawer-open .drawer-button,
.body-dark .drawer-icon,
.body-dark .drawer-search-form button,
.body-dark .drawer-search-form input {
color: #fafafa!important
}
/* Need #5a5a5a color */
Expand All @@ -146,7 +167,10 @@
.body-dark .mobile-menu-title,
.body-dark .mobile-menu-footer,
.body-dark .saying-textarea,
.body-dark .options hr{
.body-dark .options hr,
.body-dark .drawer,
.body-dark .drawer-search-form button,
.body-dark .drawer-search-form input {
border-color: #6e6e6e!important;
}
.body-dark .tip {
Expand Down
83 changes: 76 additions & 7 deletions assets/css/miracles.min.css
Original file line number Diff line number Diff line change
Expand Up @@ -83,15 +83,19 @@ hr {
}
.html-filter-sepia {
filter: sepia(30%);
-webkit-filter: sepia(30%);;
-moz-filter: sepia(30%);;
-ms-filter: sepia(30%);;
-o-filter: sepia(30%);;
-webkit-filter: sepia(30%);
-moz-filter: sepia(30%);
-ms-filter: sepia(30%);
-o-filter: sepia(30%);
filter:progid:DXImageTransform.Microsoft.BasicImage(sepia=0.30);
}

/* 组件 */
/* > 按钮 */
button {
outline: none;
cursor: pointer
}
.button {
border: 3px solid #ccc;
border-radius: 30px;
Expand All @@ -114,6 +118,36 @@ hr {
background: rgb(235,235,235);
color: #fff;
}
/* > Alert */
.alert {
background: rgb(80,80,80);
color: #fff;
border-bottom-left-radius: 4px;
border-bottom-right-radius: 4px;
padding: 10px 18px;
position: fixed;
top: 0;
left: 0;
right: 0;
width: 100%;
margin: 0 auto;
box-shadow: 0 0 4px #000;
-moz-box-shadow: 0 0 4px #000;
-webkit-box-shadow: 0 0 4px #000;
z-index: 40;
transition: all 0.3s;
}
.alert.ready {
top: -200px;
}
.alert-close {
border: none;
background: rgb(0,0,0,0);
transform: scale(0.8);
color: #fff;
float: right;
margin-top: -36px;
}

/* Large Mask */
.mask {
Expand All @@ -124,7 +158,7 @@ hr {
right: 0;
background: rgb(70,70,70,0);
z-index: -100;
transition: all 0.4s;
transition: background 0.4s;
}
.mask-open {
background: rgb(70,70,70,0.7);
Expand Down Expand Up @@ -272,7 +306,7 @@ hr {
color: rgb(80,80,80);
text-shadow: 0 0 0 #fff;
}
.drawer-open #live2dcanvas {
#live2dcanvas {
z-index: 0!important;
}

Expand Down Expand Up @@ -343,7 +377,10 @@ hr {
.index-banner {
margin-top: -21px;
width: 100%;
text-align: center
text-align: center;
background-size: cover;
background-repeat: no-repeat;
background-position: 50% 50%;
}
.dark-cover,
.banner-mask {
Expand Down Expand Up @@ -632,6 +669,34 @@ hr {
font-size: 160%;
}

/* 关于页面 */
.about-avatar img {
margin: 0 auto;
display: block;
padding: 2px;
border: 3px solid #ddd;
border-radius: 100%;
height: 200px;
width: 200px;
}
.about-name {
text-align: center;
font-size: 35px;
margin: 20px 0;
margin-bottom: 0;
}
.about-social {
text-align: center;
margin-top: 15px;
}
.about-social a {
transform: scale(1.2);
border-radius: 100%;
padding: 5px 10px;
}
.about-social a:hover {
background: rgb(246,246,246);
}

/* 标签云 */
.tags-list {
Expand Down Expand Up @@ -1316,6 +1381,10 @@ iframe[src*="//player.bilibili.com/player.html"] {
}
/* > Pad and up */
@media (min-width:768px) {
.alert {
min-width: 300px;
max-width: 700px
}
.drawer-avatar img {
height: 220px;
width: 220px;
Expand Down
109 changes: 109 additions & 0 deletions assets/js/comment.ajax.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
/**
* Ajax Comment
* 半成品,还有报错,所以没有引用
*/
var replyTo = '';
var bindButton = function() {
//绑定“评论回复”和“取消回复”的事件
$(".comment-reply a").click(
function () {
replyTo = $(this).parent().parent().parent().parent().parent().parent().attr("id");
}
);
$(".cancel-comment-reply a").click(function () { replyTo = ''; });
}
function commentCounts() {
//显示在评论区的评论数加一
var counts = parseInt($(".comment-title").text());
$(".comment-title").html($(".comment-title").html().replace(/\d+/, counts + 1));
};
function beforeSendComment() {
//发送前的一些处理
$(".comment-submit button").text("提交中");
}
function afterSendComment(ok) {
//发送后的处理
//清空replyTo变量,以及结束过渡动画、重新绑定回复按钮等等
//ok作为一个评论或失败的标志

if (ok) {
$(".comment-textarea").val('');
replyTo = '';
}
bindButton();
}
//主体部分
beforeSendComment();
$("#comment-form").submit(function() {
//监听评论表单submit事件
var commentData = $(this).serializeArray(); //获取表单POST的数据
beforeSendComment();
$.ajax({
type: $(this).attr('method'),
url: $(this).attr('action'),
data: commentData,
error: function(e) {
//失败的处理
//这里比较随意,比如可以直接刷新页面
console.log('Ajax Comment Error');
window.location.realod();
},
success: function(data) {
if (!$('.comments', data).length) {
var msg = $('title').eq(0).text().trim().toLowerCase() === 'error' ? $('.container', data).eq(0).text() : '评论提交失败!';
alertSend(msg);
afterSendComment(false);
return false;
}
}
})
return false;
});
var newComment;
/** 获取新评论的id */
newCommentId = $(".comment-list", data).html().match(/id=\"?comment-\d+/g).join().match(/\d+/g).sort(function (a, b) { return a - b }).pop();
if(replyTo === '') {
if(!$('.comment-list').length) {
//检查是否已有评论
newComment = $("#li-comment-" + newCommentId, data);
//没有的话需要先嵌入评论列表的结构
//具体结构需要参照评论的模板而定,参照下图
$('.comment-title').after('<div class="comment-container"><ol class="comment-list"></ol></div>');
//插入评论
$('.comment-list').first().prepend((newComment).addClass('animated fadeInUp'));
}
else if($('.prev').length) {
//这里是当前评论不在第一页的情况
//所以这里可以进行比如跳转到第一页的操作,当然也可以进行别的操作
$('.comment-pagenav ul li a').eq(1).click();
}
else {
//当前页面直接在最前面插入评论
newComment = $("#li-comment-" + newCommentId, data);
$('.comment-list').first().prepend((newComment).addClass('animated fadeInUp'));
}
//页面滑动到评论列表头部
$('html,body').animate({scrollTop:$('.comment-title').offset().top - 100},1000);
}
else {
//取数据
newComment = $("#li-comment-" + newCommentId, data);
//处理子级评论
if ($('#' + replyTo).find('.comment-children').length) {
//当前父评论已经有嵌套的结构
//直接插入新的评论
$('#' + replyTo + ' .comment-children .comment-list').first().prepend((newComment).addClass('animated fadeInUp'));
TypechoComment.cancelReply();
}
else {
//当前父评论没有嵌套的结构
//先构建嵌套的结构再进插入子评论
//插入的结构视模板具体情况而定
$('#' + replyTo).append('<div class="comment-children"><ol class="comment-list"></ol></div>');
$('#' + replyTo + ' .comment-children .comment-list').first().prepend((newComment).addClass('animated fadeInUp'));
TypechoComment.cancelReply();
}
}
commentCounts();
afterSendComment(true);
alertSend("评论提交成功!");
Loading

0 comments on commit 1718bd7

Please sign in to comment.