diff options
| -rw-r--r-- | assets/css/miracles.min.css | 69 | ||||
| -rw-r--r-- | assets/js/main.js | 4 | ||||
| -rw-r--r-- | saying.php | 67 |
3 files changed, 140 insertions, 0 deletions
diff --git a/assets/css/miracles.min.css b/assets/css/miracles.min.css index 9ed26fd..d1164e7 100644 --- a/assets/css/miracles.min.css +++ b/assets/css/miracles.min.css @@ -958,6 +958,75 @@ hr { margin-top: 0;
}
+.saying-form {
+ margin-bottom: 20px;
+}
+.saying-OwO {
+ float: left;
+ margin-left: 0
+}
+.saying-submit {
+ float: right;
+ background: var(--theme-color);
+ border-radius: 5px;
+ color: white;
+ padding: 10px 20px;
+ border: none;
+ font-size: 15px;
+ cursor: pointer;
+}
+.saying-content p {
+ padding: 10px 20px;
+}
+.saying-content a {
+ color: white;
+}
+.saying-author,
+.saying-meta,
+.saying-author a {
+ position: absolute;
+ color: rgb(250,250,250)!important;
+ font-size: 12px;
+}
+.saying-meta {
+ bottom: 3px;
+ right: 10px;
+}
+.saying-author {
+ top: 3px;
+ left: 20px;
+}
+.saying-meta i {
+ font-size: 12px;
+}
+
+/* 气泡 */
+.bubble {
+ position: relative;
+ background: var(--theme-color);
+ border-radius: 2px;
+ padding: 0;
+ color: white;
+ display: inline-block;
+ min-width: 300px;
+ transition: all 0.3s;
+}
+.bubble:before{
+ position: absolute;
+ content: "";
+ width: 0;
+ height: 0;
+ right: 100%;
+ top: 8px;
+ border-top: 8px solid transparent;
+ border-right: 16px solid var(--theme-color);
+ border-bottom: 8px solid transparent;
+}
+.bubble:hover {
+ transform: translateY(-6px);
+ box-shadow: 2px 8px 17px #bababa;
+}
+
.pio-container .pio-dialog {
margin-bottom: -60px;
border-color: rgba(255,255,255,.9);
diff --git a/assets/js/main.js b/assets/js/main.js index 4cc371b..fb232a4 100644 --- a/assets/js/main.js +++ b/assets/js/main.js @@ -2,6 +2,10 @@ function Dark() {
$("body").toggleClass("body-dark");
}
+var h = myDate.getHours();
+if !(h > 6 && h < 19 && hasClass('body-dark')) {
+ Dark();
+}
//GoTop
function GoTop() {
$('body,html').animate({scrollTop:0},500);
diff --git a/saying.php b/saying.php new file mode 100644 index 0000000..2c24fcc --- /dev/null +++ b/saying.php @@ -0,0 +1,67 @@ +<?php if (!defined('__TYPECHO_ROOT_DIR__')) exit;
+/**
+ * 说说动态
+ *
+ * @package custom
+ */
+$this->need('includes/head.php');
+$this->need('includes/header.php');
+?>
+<?php function threadedComments($comments, $options) {
+ $commentClass = '';
+ if ($comments->authorId) {
+ if ($comments->authorId == $comments->ownerId) {
+ $commentClass .= ' comment-by-author'; //如果是文章作者的评论添加 .comment-by-author 样式
+ } else {
+ $commentClass .= ' comment-by-user'; //如果是评论作者的添加 .comment-by-user 样式
+ }
+ }
+ $commentLevelClass = $comments->_levels > 0 ? ' comment-child' : ' comment-parent'; //评论层数大于0为子级,否则是父级
+?>
+<div id="li-<?php $comments->theId(); ?>" class="bubble saying-body comment-body<?php
+if ($comments->_levels > 0) {
+ echo ' comment-child';
+ $comments->levelsAlt(' comment-level-odd', ' comment-level-even');
+} else {
+ echo ' comment-parent';
+}
+$comments->alt(' comment-odd', ' comment-even');
+echo $commentClass;
+?>">
+ <div class="saying-content">
+ <span class="saying-author"><?php $comments->author(); ?> said:</span>
+ <?php $comments->content(); ?>
+ <span class="saying-meta"><i class="iconfont icon-clock"></i> <?php $comments->date('F jS, Y'); ?></span>
+ </div>
+</div>
+<?php } ?>
+
+ <main class="main-container container">
+ <div class="post-body">
+ <div class="post-content">
+ <?php if($this->user->hasLogin()): ?>
+ <form method="post" action="<?php $this->commentUrl() ?>" id="comment-form" class="saying-form" role="form">
+ <textarea rows="8" cols="50" name="text" id="textarea" class="OwO-textarea comment-textarea textarea" required ><?php $this->remember('text'); ?></textarea>
+ <p class="saying-action">
+ <div title="OwO" class="saying-OwO OwO"></div>
+ <button type="submit" class="saying-submit submit"><?php _e('发表动态'); ?></button>
+ </p>
+ </form>
+ <hr>
+ <?php endif; ?>
+ <?php $this->comments()->to($comments); ?>
+ <h3 class="comment-title">
+ <span style="color:#ccc">- </span>
+ <?php $this->commentsNum(_t('暂无动态'), _t('仅有一条动态'), _t('已有 %d 条动态')); ?>
+ <span style="color:#ddd"> -</span>
+ </h3>
+ <?php if ($comments->have()): ?>
+ <?php $comments->listComments(); ?>
+ <?php $comments->pageNav('<i class="iconfont icon-chevron-left"></i>', '<i class="iconfont icon-chevron-right"></i>'); ?>
+ <?php endif; ?>
+ </div>
+ </div>
+ </main>
+
+
+<?php $this->need('includes/footer.php'); ?>
\ No newline at end of file |
