Skip to content

Commit

Permalink
feat: FriendLink added
Browse files Browse the repository at this point in the history
  • Loading branch information
shiyiya committed Sep 30, 2018
1 parent ad3b7dd commit d95b6b0
Show file tree
Hide file tree
Showing 6 changed files with 113 additions and 10 deletions.
4 changes: 2 additions & 2 deletions comments.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@
<?php $comments->gravatar('40', ''); ?>
<cite class="fn"><?php $comments->author(); ?></cite>
<div class="device-info">

<span><?php $comments->agent(); getBrowser($comments->agent); ?></span> <span><?php getOs($comments->agent); ?></span>
<span><?php getBrowser($comments->agent); ?></span>
<span><?php getOs($comments->agent); ?></span>
</div>
</div>
<div class="comment-content">
Expand Down
69 changes: 66 additions & 3 deletions css/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -191,8 +191,8 @@ a {
word-wrap: break-word;
}
a:hover {
color: #222;
border-bottom-color: #222;
color: crimson;
border-bottom-color: crimson;
}
blockquote {
margin: 0;
Expand Down Expand Up @@ -589,6 +589,26 @@ body,
color: #fff;
}
/* page-navigator end */
.post-content h1,
.post-content h2,
.post-content h3,
.post-content h4,
.post-content h5,
.post-content h6 {
position: relative;
}
.post-content h1::before,
.post-content h2::before,
.post-content h3::before,
.post-content h4::before,
.post-content h5::before,
.post-content h6::before {
position: absolute;
top: 0;
left: -15px;
content: '#';
color: #ec6149;
}
.post {
padding: 40px;
background: #fff;
Expand All @@ -605,6 +625,9 @@ body,
margin-bottom: 10px;
text-align: center;
}
.post-title {
text-align: center;
}
.post-title-link {
font-size: 25px;
font-weight: 700;
Expand Down Expand Up @@ -640,7 +663,9 @@ body,
border-radius: 20px;
}
.post-button a:hover {
background: #ccc;
background: crimson;
color: #fff;
border: none;
}
/* post php */
.free-reward {
Expand Down Expand Up @@ -930,3 +955,41 @@ ol.comment-list ol {
font-weight: 900;
color: #dc2f60;
}
/* page link */
#link ul {
padding: 0;
}
#link li {
box-sizing: border-box;
width: 40%;
display: inline-block;
border: 1px solid #dc2f60;
border-radius: 3px;
box-shadow: 4px 4px 20px 0px #eee;
padding: 32px 10px 10px 10px;
margin: 20px;
text-align: center;
position: relative;
}
@media (max-width: 991px) {
#link li {
width: 80%;
}
}
#link li a {
font-size: 16px;
font-weight: 600;
}
#link li hr {
margin: 10px;
}
#link img {
position: absolute;
left: 50%;
top: 0;
width: 64px;
height: 64px;
border-radius: 50%;
transform: translate(-50%, -50%);
border-bottom: #dc2f60 2px solid;
}
4 changes: 0 additions & 4 deletions functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,6 @@ function showThumb($obj,$size=null,$link=false){
}
}

function getLink(){

}

function getBrowser($agent){
if (preg_match('/MSIE\s([^\s|;]+)/i', $agent, $regs)) {
$browserVersion = 'IE';
Expand Down
File renamed without changes.
44 changes: 44 additions & 0 deletions page-link.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
<?php
/**
* Template Page of Link
*
* @package custom
*/
?>
<?php if (!defined('__TYPECHO_ROOT_DIR__')) exit; ?>

<?php $this->need('header.php'); ?>

<div id="main" class="main" role="main">
<div class="main-inner clearfix">
<?php $this->need('sidebar.php'); ?>
<div class="content-wrap">
<article class="post" itemscope itemtype="http://schema.org/BlogPosting">
<h1 class="post-title" itemprop="name headline"><a class="post-title-link" itemprop="url" href="<?php $this->permalink() ?>"><?php $this->title() ?></a></h1>
<div id="link" class="post-content" itemprop="articleBody">
<?php $this->content(); ?>
</div>
</article>
<?php $this->need('comments.php'); ?>
</div>
</div>
</div>


<?php $this->need('footer.php'); ?>

<script>
var warp = document.getElementById('link'),
br = [...warp.getElementsByTagName('BR')],
itemLink = [...document.querySelectorAll('#link ul li')]

br.forEach((v, k) => {
v.parentElement.removeChild(v)
})
itemLink.forEach((v,k)=>{
if(!!!v.querySelector('img')){
v.style.paddingTop = '10px'
}
})

</script>
2 changes: 1 addition & 1 deletion sidebar.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,5 +65,5 @@
</aside>

<?php if($this->is('post')||$this->is('page')): ?>
<script src="<?php $this->options->themeUrl('js/post-detail.js'); ?>"></script>
<script src="<?php $this->options->themeUrl('js/sidebar.js'); ?>"></script>
<?php endif; ?>

0 comments on commit d95b6b0

Please sign in to comment.