Skip to content

Commit

Permalink
opt mobile ui
Browse files Browse the repository at this point in the history
  • Loading branch information
Jamling committed Aug 5, 2016
1 parent ce4ce77 commit 0e278b4
Show file tree
Hide file tree
Showing 15 changed files with 54 additions and 32 deletions.
6 changes: 2 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,9 @@ Nova also provided lots of helper scripts as plugins to co-work with the theme,

Welcome to visit [My blog](http://www.ieclipse.cn) (http://www.ieclipse.cn) to see the demo.

## Branch
- master: The bootstrap style
## ScreenShot

![screenshot](https://raw.githubusercontent.com/Jamling/hexo-theme-nova/master/screenshots/bootstrap.png)
- material: The material style
![screenshot](https://raw.githubusercontent.com/Jamling/hexo-theme-nova/master/screenshots/material.png)

## Install
Cd to your blog root directory
Expand Down
6 changes: 2 additions & 4 deletions README_zh.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,9 @@ nova是使用swig模板引擎编写的[hexo](https://hexo.io)主题,旨在方

本主题还使用了一些插件作为辅助函数。如TOC目录生成,项目侧边导航栏等。详情请访问[我的主页](http://www.ieclipse.cn) (http://www.ieclipse.cn)。

## 分支
- master: 使用bootstrap css的分支
## 预览截屏

![screenshot](https://raw.githubusercontent.com/Jamling/hexo-theme-nova/master/screenshots/bootstrap.png)
- material: 使用materialize css的分支
![screenshot](https://raw.githubusercontent.com/Jamling/hexo-theme-nova/master/screenshots/material.png)

## 安装
Cd到博客/站点根目录,然后检出代码
Expand Down
1 change: 1 addition & 0 deletions layout/layout.swig
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
{{ head_jscss() }}
<!-- RSS -->
{{ feed_tag('atom.xml') }}
<link rel="shortcut icon" href="/image/favicon.ico" type="image/x-icon" />
</head>
<body>
<!-- header -->
Expand Down
2 changes: 1 addition & 1 deletion layout/partial/fab.swig
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

<div class="fab" style="bottom: 45px; right: 24px;">
<ul class="top-expand" id="top-expand">
<li><a class="fab-item large red " href="#top"><i class="icon nova-top"></i></a></li>
<li><a class="fab-item large red" href="#top"><i class="icon nova-top"></i></a></li>
<li><a class="fab-item large yellow " href="http://www.jiathis.com/share?uid={{theme.share.jiathis.uid}}" target="_blank"><i class="icon nova-share"></i></a></li>
</ul>
<a class="fab-item large red " onclick="$('#top-expand').toggle();">
Expand Down
5 changes: 5 additions & 0 deletions layout/partial/lc.swig
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
}
console.log(results._serverData);
update(results);
show(results);
},
error: function(error) {
// error is an instance of AV.Error.
Expand Down Expand Up @@ -66,6 +67,10 @@
console.log(error);
});
}

function show(data) {
$(".post-share .nova-eye .count").html(data.get('views'));
}
})();
</script>
{%- endif %}
2 changes: 1 addition & 1 deletion layout/partial/share_jiathis_footer.swig
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<a class="jiathis_button_copy">{{__('sns.copy')}}</a>
<a class="jiathis_button_ishare">{{__('sns.one')}}</a>
<a href="http://www.jiathis.com/share?uid={{theme.share.jiathis.uid}}" class="jiathis jiathis_txt jiathis_separator jtico jtico_jiathis" target="_blank">{{__('sns.more')}}</a>
<a class="jiathis_counter_style"></a>
<!-- <a class="jiathis_counter_style"></a> -->
</div>
<!-- JiaThis Button END -->
{{ partial('share_jiathis') }}
11 changes: 6 additions & 5 deletions layout/post/article.swig
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,15 @@
</h1>
{%- endif %}
<div class="post-header clearfix">
<span class="icon nova-calendar"><span class="hidden-xs">{{__('page.written_on')}}</span>
<span class="post-date"><span class="hidden-xs icon nova-calendar">{{__('page.written_on')}}</span>
<time datetime="{{ date_xml(post.date) }}" itemprop="datePublished">{{ time_tag(post.date) }}</time>
</span>
{{ post_tags(post) }}
<span class="post-share right">
<a href="#share" class="icon nova-share"><span class="hidden-xs">{{__('sns.share')}}</span></a>
<a href="#comment" class="icon nova-bubbles"><span class="hidden-xs">{{__('sns.comment')}}</span></a>
<a href="#like" class="icon nova-heart2-full"><span class="hidden-xs">{{__('sns.like')}}</span></a>
<span class="post-share">
<a href="#share" class="icon nova-share"><span class="hidden-xs">{{__('sns.share')}}</span><span class="jiathis_counter_style"></span></a>
<a href="#comment" class="icon nova-bubbles"><span class="ds-thread-count" data-thread-key="{{page_uid()}}"></span><!-- <span class="hidden-xs">{{__('sns.comment')}}</span> --></a>
<a href="#like" class="icon nova-heart2-full"><span class="count"></span><span class="hidden-xs">{{__('sns.like')}}</span></a>
<a href="#" class="icon nova-eye"><span class="count"></span><span class="hidden-xs">{{__('article.views')}}</span></a>
</span>
</div>
<div class="divider"></div>
Expand Down
5 changes: 3 additions & 2 deletions layout/post/index.swig
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,13 @@
<div class="card-content">
<h3 class="card-title {%- if u %} new{%- endif %}" itemprop="name headline"><a href="{{ url_for_lang(post.path) }}" class="article-title" {%- if u %} title="{{__('page.last_updated', date(post.updated)) }}" {%- endif %}>{{ post.title }}</a></h3>
<div class="divider"></div>
<div class="section post-header">
<div class="section post-header clearfix">
<!-- sub element must be span -->
<span class="icon nova-calendar" itemprop="datePublished" datetime="{{ date_xml(post.date) }}">{{ time_tag(post.date) }}</span>
<span class="post-date"><time class="icon nova-calendar" itemprop="datePublished" datetime="{{ date_xml(post.date) }}">{{ time_tag(post.date) }}</time></span>
{{ post_cates(post) }}
{{ post_tags(post) }}
</div>
<div class="divider"></div>
<div class="excerpt" itemprop="description articleBody">
{{ page_excerpt(post) }}
</div>
Expand Down
2 changes: 1 addition & 1 deletion layout/post/index_action_ds.swig
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@
<a class="icon nova-bubbles action-item" href="{{ url_for_lang(post.path) }}#comment" id="uyan_count_unit"><span class="count"></span><span class="hidden-xs">{{__('sns.comment')}}</span></a>
<a class="icon nova-heart2-full action-item fancybox.ajax" onclick="javascript:ds_vote(this, '.card-action', 1, '{{ url_for_lang(post.path) }}#comment')"><span class="count"></span><span class="hidden-xs">{{__('sns.like')}}</span></a>
<a class="icon nova-eye action-item" href="{{ url_for_lang(post.path) }}"><span class="count"></span><span class="hidden-xs">{{__('article.views')}}</span></a>
<a class="icon nova-hand-right action-item" href="{{ url_for_lang(post.path) }}" >{{__('page.more')}}</a>
<a class="icon nova-hand-right action-item" href="{{ url_for_lang(post.path) }}" ><span>{{__('page.more')}}</span></a>
</div>
5 changes: 3 additions & 2 deletions layout/post/index_script_ds.swig
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,9 @@
$(this).data("tid", r[tkey].thread_id);
if (o.p) {
for ( var key in o.p) {
var c = '' + r[tkey][key] + '';
$(this).find(o.p[key]).html(c);
var c = r[tkey][key];
var str = c <= 0 ? '' : c + '';
$(this).find(o.p[key]).html(str);
}
}
});
Expand Down
2 changes: 1 addition & 1 deletion layout/post/widget_about.swig
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<div>{{theme.about.desc}}</div>
<div id="widget-about" class="h3 text-center">
{%- if theme.about.github %}
<a class="yellow black-text icon-item" href="https://github.com/{{theme.about.github}}" title="{{theme.about.name}} on Github" target="_blank">
<a class="orange black-text icon-item" href="https://github.com/{{theme.about.github}}" title="{{theme.about.name}} on Github" target="_blank">
<i class="icon nova-github-alt icon-font"></i>
</a>
{%- endif %}{%- if theme.about.weibo %}
Expand Down
Binary file modified screenshots/bootstrap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
39 changes: 28 additions & 11 deletions source/css/bs/nova.scss
Original file line number Diff line number Diff line change
Expand Up @@ -245,15 +245,22 @@ img.donate {
}

.post-header {
padding: 0.5rem 0;
clear: both;
}

.post-header .post-share {
float: right;
}

.post-header .post-share a{
margin-left: 1em;
}

.post-header>span:not(:first-child) {
margin-left: 1em;
.post-header>span {
margin-right: 1em;
padding: 0.5rem 0;
float: left;
display: inline-block;
}

article.article .article-edit-link {
Expand Down Expand Up @@ -292,23 +299,25 @@ footer.article-footer {
.tag-item {
display: inline-block;
position: relative;
padding: 0 10px;
padding: .1em 0.25em .1em .8em;
background: $tag-bg;
line-height: 1.5;
line-height: 1;
margin-left: 1em;
border-radius: 0;
color: $tag-color;
font-size: .8em;
}

.tag-item:before {
position: absolute;
content: " ";
border: transparent 0.75em solid;
border: transparent 0.5em solid;
border-right-color: $tag-bg;
top: 0;
left: -1.4em;
left: -1em;
height: 0;
width: 0;
font-size: 1.25em;
}

.tag-item:after {
Expand All @@ -317,7 +326,7 @@ footer.article-footer {
background: white;
width: 0.5em;
height: 0.5em;
top: 0.5em;
top: 0.35em;
left: -0.125em;
border-radius: 0.25em;
}
Expand Down Expand Up @@ -498,9 +507,10 @@ footer.post-item-footer {
@include animation(shink 1s);
padding: 2px;
border: dotted 1px #f00;
margin-left: 2px;
margin-bottom: 4px;
left: 2px;
bottom: 4px;
font-weight: bold;
position: relative;
}

.card-content {
Expand Down Expand Up @@ -543,7 +553,7 @@ footer.post-item-footer {
.fab-item {
width: 36px;
height: 36px;
color: white;
@extend .white-text;
border-radius: 50%;
list-style: none;
margin: 0;
Expand Down Expand Up @@ -659,6 +669,13 @@ footer.post-item-footer {
padding-right: 4px;
}

/* special */
.nova-eye::before {
font-size: 1.4em;
top: 0.15em;
position: relative;
}

@media (max-width: 767px) {
.hidden-xs {
display: none !important;
Expand Down
Binary file added source/image/favicon.ico
Binary file not shown.
Binary file added source/image/favicon_16x16.ico
Binary file not shown.

0 comments on commit 0e278b4

Please sign in to comment.