Skip to content

Commit a71ff68

Browse files
author
Xingr
committedApr 10, 2019
兼容IE,语法错误修正,细节优化
每日一句中文乱码修复欢迎反馈
1 parent e944809 commit a71ff68

9 files changed

+27
-27
lines changed
 

‎category.php

+3-3
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@
77
<header id="header">
88
<a href="<?php $this->options->siteUrl();?>">
99
<div id="logo" style="background-image: url(<?php if($this->options->logoimg): ?><?php $this->options->logoimg();?><?php else : ?><?php $this->options->themeUrl('images/logo.png'); ?><?php endif; ?>);"></div>
10-
<div id="title">
10+
</a>
11+
<div id="title">
1112
<h1><?php $this->category() ?></h1>
1213
</div>
13-
</a>
1414
<div id="nav">
1515
<ul>
1616
<li class="icon">
@@ -32,7 +32,7 @@
3232
<div id="theme-tagcloud" class="tagcloud-wrap">
3333
<?php $this->widget('Widget_Metas_Tag_Cloud', 'ignoreZeroCount=1&limit=30')->to($tags); ?>
3434
<?php while($tags->next()): ?>
35-
<a style="font-size:<?php echo(rand(10, 24)); ?>px; text-transform:capitalize;")" href="<?php $tags->permalink(); ?>"><?php $tags->name(); ?></a>
35+
<a style="font-size:<?php echo(rand(10, 24)); ?>px; text-transform:capitalize;" href="<?php $tags->permalink(); ?>"><?php $tags->name(); ?></a>
3636
<?php endwhile; ?>
3737
</div>
3838
<section id="wrapper" class="home">

‎css/style.css

+2-1
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ a{-webkit-tap-highlight-color:transparent}
5151
.mr4,.mx4{margin-right:4rem}
5252
.mt4,.my4{margin-top:4rem}
5353
.mb4,.my4{margin-bottom:4rem}
54+
.my5{margin-top:8rem}
5455
.m4{margin:4rem}
5556
.mxn1{margin-left:-.5rem;margin-right:-.5rem}
5657
.mxn2{margin-left:-1rem;margin-right:-1rem}
@@ -101,7 +102,7 @@ a{-webkit-tap-highlight-color:transparent}
101102
.content th{font-size:13px;color:#eee;border-bottom:1px dashed #ccc;padding:8px}
102103
.content td{border-bottom:none;padding:9px 8px 0}
103104
html{height:100%}
104-
body{color:#c9cacc;background-color:#1d1f21;font-size:14px;font-weight:400;text-rendering:geometricPrecision;min-height:100%;display:flex;flex-direction:column}
105+
body{color:#c9cacc;background-color:#1d1f21;font-size:14px;font-weight:400;text-rendering:geometricPrecision;/* min-height:100%; *//* display:flex; */flex-direction:column;}
105106
.content{flex:1}
106107
.content p{-moz-hyphens:auto;-ms-hyphens:auto;-webkit-hyphens:auto;hyphens:auto;margin-bottom:.5rem;word-break:break-all}
107108
.content p code{color:#2bbc8a;padding:0}

‎files.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
<div id="theme-tagcloud" class="tagcloud-wrap">
3838
<?php $this->widget('Widget_Metas_Tag_Cloud', 'ignoreZeroCount=1&limit=30')->to($tags); ?>
3939
<?php while($tags->next()): ?>
40-
<a style="font-size:<?php echo(rand(10, 24)); ?>px; text-transform:capitalize;")" href="<?php $tags->permalink(); ?>"><?php $tags->name(); ?></a>
40+
<a style="font-size:<?php echo(rand(10, 24)); ?>px; text-transform:capitalize;" href="<?php $tags->permalink(); ?>"><?php $tags->name(); ?></a>
4141
<?php endwhile; ?>
4242
</div>
4343
<section id="wrapper" class="home">
@@ -56,7 +56,7 @@
5656
}
5757
$output .= '<li class="post-item"><div class="meta"><time datetime="'.date('Y-m-d ',$archives->created).'" itemprop="datePublished">'.date('Y-m-d ',$archives->created).'</time></div><span><a href="'.$archives->permalink .'">'. $archives->title .'</a></span></li>'; //输出文章日期和标题
5858
endwhile;
59-
$output .= '</ul></li></ul>';
59+
$output .= '</ul>';
6060
echo $output;
6161
?>
6262

‎footer.php

+11-12
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
<?php if (!defined('__TYPECHO_ROOT_DIR__')) exit; ?>
2+
<div class="mx-auto px3 my5">
23
<footer id="footer" style="display:block;">
34
<div class="footer-left">
45
Copyright © <?php echo date('Y'); ?> By <a href="http://www.typecho.org" target="_blank" rel="nofollow">Typecho</a> & <a href="http://www.xde.io" target="_blank">Xingr</a>
@@ -17,6 +18,7 @@
1718
</nav>
1819
</div>
1920
</footer>
21+
</div>
2022
<link rel="stylesheet" href="<?php $this->options->themeUrl('lib/font-awesome/css/font-awesome.min.css'); ?>">
2123
<script src="<?php $this->options->themeUrl('js/main.js'); ?>"></script>
2224
<?php if ($this->is('index')) : ?>
@@ -62,18 +64,15 @@
6264
</script>
6365
<?php endif; ?>
6466
<script>
65-
if ('serviceWorker'in navigator) {
66-
window.addEventListener('load', ()=>{
67-
navigator.serviceWorker.register('<?php $this->options->themeUrl('/sw.js'); ?>').then(registration=>{
68-
console.log('SW registered: ', registration);
69-
}
70-
).catch(registrationError=>{
71-
console.log('SW registration failed: ', registrationError);
72-
}
73-
);
74-
}
75-
);
76-
}
67+
if ('serviceWorker' in navigator) {
68+
window.addEventListener('load', function() {
69+
navigator.serviceWorker.register('<?php $this->options->themeUrl('/sw.js'); ?>').then(function(registration) {
70+
console.log('ServiceWorker registration successful with scope: ', registration.scope);
71+
}, function(err) {
72+
console.log('ServiceWorker registration failed: ', err);
73+
});
74+
});
75+
}
7776
</script>
7877
<?php $this->footer(); ?>
7978
</body>

‎functions.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -505,7 +505,7 @@ function today(){
505505
}
506506
$coverstory = date('Ymd').'.json'; //每日故事 json格式
507507
if (!file_exists($coverstory)) {
508-
$json = file_get_contents('https://rest.shanbay.com/api/v2/quote/quotes/today/');
508+
$json = file_get_contents("compress.zlib://".'https://rest.shanbay.com/api/v2/quote/quotes/today/');
509509
@file_put_contents($coverstory,$json); //写入文本
510510
}
511511
$coverstory = json_decode(file_get_contents($coverstory),true);

‎index.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@
1616
<?php $today = today(); ?>
1717
<a href="<?php $this->options->siteUrl();?>">
1818
<div id="logo" style="background-image: url(<?php if($this->options->logoimg): ?><?php $this->options->logoimg();?><?php else : ?><?php $this->options->themeUrl('images/logo.png'); ?><?php endif; ?>);"></div>
19+
</a>
1920
<div id="title">
2021
<h1><?php $this->options->title(); ?></h1>
2122
</div>
22-
</a>
2323
<div id="nav">
2424
<ul>
2525
<li class="icon">

‎page.php

+1
Original file line numberDiff line numberDiff line change
@@ -40,4 +40,5 @@
4040
<?php $this->need('comments.php'); ?>
4141
</section>
4242
</div>
43+
</div>
4344
<?php $this->need('footer.php'); ?>

‎sw.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ workbox.clientsClaim();
2424
self.__precacheManifest = [
2525
{
2626
"url": "css/style.css",
27-
"revision": "c73c22702e5dc14bb4b7a57cce1af0e0"
27+
"revision": "2535d0113496cc06bdc4ecb6ba4a01ec"
2828
},
2929
{
3030
"url": "css/lightbox.min.css",

‎tag.php

+5-6
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,12 @@
55
<body>
66
<div class="content index width mx-auto px3 my4">
77
<header id="header">
8-
<a href="<?php $this->options->siteUrl();?>">
8+
<a href="<?php $this->options->siteUrl();?>">
99
<div id="logo" style="background-image: url(<?php if($this->options->logoimg): ?><?php $this->options->logoimg();?><?php else : ?><?php $this->options->themeUrl('images/logo.png'); ?><?php endif; ?>);"></div>
10-
<div id="title">
10+
</a>
11+
<div id="title">
1112
<h1><?php $this->category() ?></h1>
1213
</div>
13-
</a>
1414
<div id="nav">
1515
<ul>
1616
<li class="icon">
@@ -29,10 +29,10 @@
2929
</ul>
3030
</div>
3131
</header>
32-
<div id="theme-tagcloud" class="tagcloud-wrap">
32+
<div id="theme-tagcloud" class="tagcloud-wrap">
3333
<?php $this->widget('Widget_Metas_Tag_Cloud', 'ignoreZeroCount=1&limit=30')->to($tags); ?>
3434
<?php while($tags->next()): ?>
35-
<a style="font-size:<?php echo(rand(10, 24)); ?>px; text-transform:capitalize;")" href="<?php $tags->permalink(); ?>"><?php $tags->name(); ?></a>
35+
<a style="font-size:<?php echo(rand(10, 24)); ?>px; text-transform:capitalize;" href="<?php $tags->permalink(); ?>"><?php $tags->name(); ?></a>
3636
<?php endwhile; ?>
3737
</div>
3838
<section id="wrapper" class="home">
@@ -59,7 +59,6 @@
5959
</div>
6060
</ul>
6161
</div>
62-
6362
</section>
6463
</div>
6564
<?php $this->need('footer.php'); ?>

0 commit comments

Comments
 (0)
Please sign in to comment.