Skip to content

Commit

Permalink
1.3.7
Browse files Browse the repository at this point in the history
  • Loading branch information
shiyiya committed May 28, 2023
1 parent dd946e9 commit 0595858
Show file tree
Hide file tree
Showing 6 changed files with 32 additions and 7 deletions.
24 changes: 22 additions & 2 deletions component/header.php
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,19 @@
</style>
<?php endif; ?>

<svg style="display:none">
<defs>
<g id="start-page"><svg viewBox="0 0 1024 1024"><path d="M512 165c191.6 0 347 155.3 347 347S703.6 859 512 859 165 703.6 165 512s155.4-347 347-347m0-100.4C265.3 64.6 64.6 265.3 64.6 512S265.3 959.4 512 959.4 959.4 758.7 959.4 512 758.7 64.6 512 64.6z"></path><path d="M512 709.1c-34.4 0-66.7-10.2-90.7-28.6-22-16.9-26.2-48.4-9.3-70.4 16.9-22 48.5-26.1 70.4-9.3 5 3.8 15.4 7.9 29.6 7.9 14.2 0 24.6-4.1 29.6-7.9 22-16.9 53.5-12.7 70.4 9.3 16.9 22 12.7 53.5-9.3 70.4-24.1 18.4-56.3 28.6-90.7 28.6z"></path><path d="M346.8 352.3c-27.7 0-50.2 22.5-50.2 50.2v47.2c0 27.7 22.5 50.2 50.2 50.2s50.2-22.5 50.2-50.2v-47.2c0.1-27.7-22.4-50.2-50.2-50.2zM677.2 352.3c-27.7 0-50.2 22.5-50.2 50.2v47.2c0 27.7 22.5 50.2 50.2 50.2s50.2-22.5 50.2-50.2v-47.2c0-27.7-22.5-50.2-50.2-50.2z"></path></svg></g>
<g id="关于"><use xlink:href="#start-page" /></g>
<g id="archive"><svg viewBox="0 0 22 22"><path fill="currentColor" d="M6 6h11.17l1 1l-1 1H6V6zm12 10H6.83l-1-1l1-1H18v2z" opacity=".3"></path><path fill="currentColor" d="M13 10h5l3-3l-3-3h-5V2h-2v2H4v6h7v2H6l-3 3l3 3h5v4h2v-4h7v-6h-7v-2zM6 6h11.17l1 1l-1 1H6V6zm12 10H6.83l-1-1l1-1H18v2z"></path></svg></g>
<g id="时间轴"><use xlink:href="#archive" /></g>
<g id="category"><svg viewBox="0 0 22 22"><path fill="currentColor" d="M6 22a3 3 0 0 1-3-3c0-.6.18-1.16.5-1.63L9 7.81V6a1 1 0 0 1-1-1V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v1a1 1 0 0 1-1 1v1.81l5.5 9.56c.32.47.5 1.03.5 1.63a3 3 0 0 1-3 3H6m-1-3a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1c0-.21-.07-.41-.18-.57l-2.29-3.96L14 17l-5.07-5.07l-3.75 6.5c-.11.16-.18.36-.18.57m8-9a1 1 0 0 0-1 1a1 1 0 0 0 1 1a1 1 0 0 0 1-1a1 1 0 0 0-1-1Z"></path></svg></g>
<g id="分类"><use xlink:href="#category" /></g>
<g id="search"><svg viewBox="0 0 1024 1024"><path d="M469.333333 768c-166.4 0-298.666667-132.266667-298.666666-298.666667s132.266667-298.666667 298.666666-298.666666 298.666667 132.266667 298.666667 298.666666-132.266667 298.666667-298.666667 298.666667z m0-85.333333c119.466667 0 213.333333-93.866667 213.333334-213.333334s-93.866667-213.333333-213.333334-213.333333-213.333333 93.866667-213.333333 213.333333 93.866667 213.333333 213.333333 213.333334z m251.733334 0l119.466666 119.466666-59.733333 59.733334-119.466667-119.466667 59.733334-59.733333z"></path></svg></g>
<g id="搜索"><use xlink:href="#search" /></g>
</defs>
</svg>

<!-- Custom Style -->
<?php if (!empty($this->options->customCss)) : ?>
<?php _e($this->options->customCss) ?>
Expand All @@ -96,21 +109,28 @@
<ul id='menu' class="menu">
<li class="menu-item">
<a <?php if ($this->is('index')) : ?> class="current" <?php endif; ?> href="<?php $this->options->siteUrl(); ?>">
<svg width="1em" height="1em" viewBox="0 0 512 512" class="inline"><path fill="currentColor" d="M256 56c110.532 0 200 89.451 200 200 0 110.532-89.451 200-200 200-110.532 0-200-89.451-200-200 0-110.532 89.451-200 200-200m0-48C119.033 8 8 119.033 8 256s111.033 248 248 248 248-111.033 248-248S392.967 8 256 8zm0 168c-44.183 0-80 35.817-80 80s35.817 80 80 80 80-35.817 80-80-35.817-80-80-80z"></path></svg>
<?php i18n('首页'); ?>
</a>
</li>
<?php $this->widget('Widget_Contents_Page_List')->to($pages); ?>
<?php while ($pages->next()) : ?>
<li class="menu-item">
<!-- svg use -->
<a <?php if ($this->is('page', $pages->slug)) : ?> class="current" <?php endif; ?> href="<?php $pages->permalink(); ?>" title="<?php $pages->title(); ?>" rel="section">
<?php if(in_array($pages->title, array('关于', 'about' , '时间轴', 'archive', '分类', 'category','search','搜索'))) : ?>
<svg width="1em" height="1em">
<use xlink:href="#<?php $pages->title(); ?>" />
</svg>
<?php endif; ?>
<?php i18n($pages->title); ?>
</a>
</li>
<?php endwhile; ?>
<li class="menu-item search">
<a href="<?php $this->options->rewrite ? $this->options->siteUrl('search.html') : $this->options->siteUrl('index.php/search.html') ?>" alt="<?php i18n('搜索') ?>" aria-label="<?php i18n('搜索') ?>">
<svg width="1em" height="1em" viewBox="0 0 1024 1024" ><path d="M469.333333 768c-166.4 0-298.666667-132.266667-298.666666-298.666667s132.266667-298.666667 298.666666-298.666666 298.666667 132.266667 298.666667 298.666666-132.266667 298.666667-298.666667 298.666667z m0-85.333333c119.466667 0 213.333333-93.866667 213.333334-213.333334s-93.866667-213.333333-213.333334-213.333333-213.333333 93.866667-213.333333 213.333333 93.866667 213.333333 213.333333 213.333334z m251.733334 0l119.466666 119.466666-59.733333 59.733334-119.466667-119.466667 59.733334-59.733333z"></path></svg>
<svg width="1em" height="1em">
<use xlink:href="#<?php $pages->title(); ?>" />
</svg>
</a>
</li>
</ul>
Expand Down
2 changes: 1 addition & 1 deletion css/mix.min.css

Large diffs are not rendered by default.

7 changes: 6 additions & 1 deletion css/modules/header.css
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,18 @@
height: 50px;
line-height: 50px;
margin: 0 20px 0 0;
vertical-align: bottom;
}

@media (max-width: 991px) {
.menu li.menu-item {
flex: 1;
margin: 0;
}
.menu .menu-item a svg,
.menu .menu-item.search {
display: none;
}
}

.menu .menu-item a {
Expand All @@ -57,7 +62,7 @@
}

.menu .menu-item a svg {
margin-right: 0.2em;
margin-right: 0.4em;
}

.menu .menu-item a:active {
Expand Down
2 changes: 1 addition & 1 deletion index.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
*
* @package Sagiri
* @author shiyi
* @version 1.3.7-unreleased
* @version 1.3.7
* @link https://github.com/shiyiya/typecho-theme-sagiri
*/

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@bylin/typecho-theme-sagiri",
"version": "1.3.6",
"version": "1.3.7",
"description": "Lovely theme for Typecho.",
"main": "js/index.min.js",
"files": [
Expand Down
2 changes: 1 addition & 1 deletion page-search.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
<form id="search" method="post" action="<?php $this->options->siteUrl(); ?>" role="search">
<input type="text" id="s" name="s" class="text" placeholder="<?php _e('输入关键字搜索'); ?>" required />
<button type="submit" class="submit">
<svg width="100%" height="100%" viewBox="0 0 1024 1024" ><path d="M469.333333 768c-166.4 0-298.666667-132.266667-298.666666-298.666667s132.266667-298.666667 298.666666-298.666666 298.666667 132.266667 298.666667 298.666666-132.266667 298.666667-298.666667 298.666667z m0-85.333333c119.466667 0 213.333333-93.866667 213.333334-213.333334s-93.866667-213.333333-213.333334-213.333333-213.333333 93.866667-213.333333 213.333333 93.866667 213.333333 213.333333 213.333334z m251.733334 0l119.466666 119.466666-59.733333 59.733334-119.466667-119.466667 59.733334-59.733333z"></path></svg>
<svg width="100%" height="100%"><use xlink:href="#search" /></svg>
</button>
</form>
<div class="search-placeholder">
Expand Down

0 comments on commit 0595858

Please sign in to comment.