@ -0,0 +1,41 @@ |
||||
menu: |
||||
home: Home |
||||
archives: Archives |
||||
tags: Tags |
||||
categories: Categories |
||||
about: About |
||||
|
||||
footer: |
||||
powered: "Powered by %s" |
||||
theme: Theme |
||||
|
||||
posts: |
||||
prev: Prev |
||||
next: Next |
||||
prev_post: Prev |
||||
next_post: Next |
||||
toc: Contents |
||||
readmore: Read more.. |
||||
visits: Visits |
||||
reward: 'Reward' |
||||
|
||||
copyright: |
||||
author: 'Author' |
||||
link: 'Link' |
||||
license: 'License' |
||||
|
||||
counter: |
||||
archives: |
||||
zero: No Posts |
||||
one: 1 Post |
||||
other: "%d Posts In Total" |
||||
|
||||
tagcloud: |
||||
zero: No tags |
||||
one: 1 Tag In Total |
||||
other: "%d Tags In Total" |
||||
|
||||
categories: |
||||
zero: No Categories |
||||
one: 1 Category In Total |
||||
other: "%d Categories In Total" |
@ -0,0 +1,41 @@ |
||||
menu: |
||||
home: Home |
||||
archives: Archives |
||||
tags: Tags |
||||
categories: Categories |
||||
about: About |
||||
|
||||
footer: |
||||
powered: "Powered by %s" |
||||
theme: Theme |
||||
|
||||
posts: |
||||
prev: Prev |
||||
next: Next |
||||
prev_post: Prev |
||||
next_post: Next |
||||
toc: Contents |
||||
readmore: Read more.. |
||||
visits: Visits |
||||
reward: 'Reward' |
||||
|
||||
copyright: |
||||
author: 'Author' |
||||
link: 'Link' |
||||
license: 'License' |
||||
|
||||
counter: |
||||
archives: |
||||
zero: No Posts |
||||
one: 1 Post |
||||
other: "%d Posts In Total" |
||||
|
||||
tagcloud: |
||||
zero: No tags |
||||
one: 1 Tag In Total |
||||
other: "%d Tags In Total" |
||||
|
||||
categories: |
||||
zero: No Categories |
||||
one: 1 Category In Total |
||||
other: "%d Categories In Total" |
@ -0,0 +1,41 @@ |
||||
menu: |
||||
home: 首页 |
||||
archives: 归档 |
||||
tags: 标签 |
||||
categories: 分类 |
||||
about: 关于 |
||||
|
||||
footer: |
||||
powered: "由 %s 强力驱动" |
||||
theme: 主题 |
||||
|
||||
posts: |
||||
prev: 上一页 |
||||
next: 下一页 |
||||
prev_post: 上一篇 |
||||
next_post: 下一篇 |
||||
toc: 文章目录 |
||||
readmore: 阅读更多 |
||||
visits: '阅读次数' |
||||
reward: '赞赏支持' |
||||
|
||||
copyright: |
||||
author: '原文作者' |
||||
link: '原文链接' |
||||
license: '许可协议' |
||||
|
||||
counter: |
||||
archives: |
||||
zero: 暂无日志 |
||||
one: 目前共计 1 篇日志 |
||||
other: "目前共计 %d 篇日志" |
||||
|
||||
tagcloud: |
||||
zero: 暂无标签 |
||||
one: 目前共计 1 个标签 |
||||
other: "目前共计 %d 个标签" |
||||
|
||||
categories: |
||||
zero: 暂无分类 |
||||
one: 目前共计 1 个分类 |
||||
other: "目前共计 %d 个分类" |
@ -0,0 +1,41 @@ |
||||
menu: |
||||
home: 首頁 |
||||
archives: 歸檔 |
||||
tags: 標籤 |
||||
categories: 分類 |
||||
about: 關於 |
||||
|
||||
footer: |
||||
powered: "由 %s 技術提供" |
||||
theme: 主題 |
||||
|
||||
posts: |
||||
prev: 上一頁 |
||||
next: 下一頁 |
||||
prev_post: 上一篇 |
||||
next_post: 下一篇 |
||||
toc: 文章目錄 |
||||
readmore: 閱讀更多 |
||||
visits: '閱讀次數' |
||||
reward: '讚賞支持' |
||||
|
||||
copyright: |
||||
author: '原文作者' |
||||
link: '原文鏈結' |
||||
license: '授權' |
||||
|
||||
counter: |
||||
archives: |
||||
zero: 暫無文章 |
||||
one: 目前總計 1 篇文章 |
||||
other: "目前總計 %d 篇文章" |
||||
|
||||
tagcloud: |
||||
zero: 暫無文章 |
||||
one: 目前總計 1 個標籤 |
||||
other: "目前總計 %d 個標籤" |
||||
|
||||
categories: |
||||
zero: 暫無分類 |
||||
one: 目前總計 1 個分類 |
||||
other: "目前總計 %d 個分類" |
@ -0,0 +1,38 @@ |
||||
<!DOCTYPE html> |
||||
<html lang="{{ config.language }}"> |
||||
<head> |
||||
{%- include '_partial/head.swig' %} |
||||
<title>{%- block title -%}{%- endblock -%}</title> |
||||
</head> |
||||
|
||||
<body> |
||||
{%- include '_partial/slideout.swig' -%} |
||||
<div class="container" id="mobile-panel"> |
||||
<header id="header" class="header"> |
||||
{%- include '_partial/header.swig' -%} |
||||
</header> |
||||
|
||||
<main id="main" class="main"> |
||||
<div class="content-wrapper"> |
||||
<div id="content" class="content"> |
||||
{%- block content -%}{%- endblock -%} |
||||
</div> |
||||
{%- include '_partial/comments.swig' -%} |
||||
</div> |
||||
</main> |
||||
|
||||
<footer id="footer" class="footer"> |
||||
{%- include '_partial/footer.swig' -%} |
||||
</footer> |
||||
|
||||
<div class="back-to-top" id="back-to-top"> |
||||
<i class="iconfont icon-up"></i> |
||||
</div> |
||||
</div> |
||||
|
||||
{%- include '_script/comments.swig' -%} |
||||
|
||||
{%- include '_script/libs.swig' -%} |
||||
{%- include '_script/theme.swig' -%} |
||||
</body> |
||||
</html> |
@ -0,0 +1,55 @@ |
||||
{%- macro render() -%} |
||||
{%- set isArchivesPage = !!page.archive -%} |
||||
{%- set isArchivesMode = theme.mode.toLowerCase() == 'archives' -%} |
||||
|
||||
<section id="archive" class="archive"> |
||||
{%- if not page.prev -%} |
||||
{%- if page.tag -%} |
||||
<div class="archive-title tag"> |
||||
<h2 class="archive-name">{{ page.tag }}</h2> |
||||
</div> |
||||
{%- elif page.category -%} |
||||
<div class="archive-title category"> |
||||
<h2 class="archive-name">{{ page.category }}</h2> |
||||
</div> |
||||
{%- elif isArchivesPage -%} |
||||
<div class="archive-title"> |
||||
<span class="archive-post-counter"> |
||||
{{ _p("counter.archives", site.posts.length) }} |
||||
</span> |
||||
</div> |
||||
{%- endif -%} |
||||
{%- endif -%} |
||||
|
||||
{%- for post in page.posts -%} |
||||
{%- if isArchivesPage or isArchivesMode -%} |
||||
{%- set year -%} |
||||
{%- set post.year = date(post.date, 'YYYY') -%} |
||||
|
||||
{%- if post.year !== year -%} |
||||
{%- set year = post.year -%} |
||||
<div class="collection-title"> |
||||
<h2 class="archive-year">{{ year }}</h2> |
||||
</div> |
||||
{%- endif -%} |
||||
{%- endif -%} |
||||
|
||||
<div class="archive-post"> |
||||
<span class="archive-post-time"> |
||||
{%- if isArchivesPage or isArchivesMode -%} |
||||
{{ date(post.date, 'MM-DD') }} |
||||
{%- else -%} |
||||
{{ date(post.date, 'YYYY-MM-DD') }} |
||||
{%- endif -%} |
||||
</span> |
||||
<span class="archive-post-title"> |
||||
<a href="{{ url_for(post.path) }}" class="archive-post-link"> |
||||
{{ post.title }} |
||||
</a> |
||||
</span> |
||||
</div> |
||||
{%- endfor -%} |
||||
</section> |
||||
|
||||
{%- include '../_partial/pagination.swig' -%} |
||||
{%- endmacro -%} |
@ -0,0 +1,81 @@ |
||||
{%- macro render(post) -%} |
||||
<article class="post"> |
||||
<header class="post-header"> |
||||
<h1 class="post-title"> |
||||
{%- if is_home() -%} |
||||
<a class="post-link" href="{{ url_for(post.path) }}">{{ post.title }}</a> |
||||
{%- else -%} |
||||
{{ post.title }} |
||||
{%- endif -%} |
||||
</h1> |
||||
|
||||
<div class="post-meta"> |
||||
<span class="post-time"> |
||||
{{ full_date(post.date, 'YYYY-MM-DD') }} |
||||
</span> |
||||
{%- if post.categories and post.categories.length -%} |
||||
<span class="post-category"> |
||||
{%- for category in post.categories -%} |
||||
<a href="{{ url_for(category.path) }}">{{ category.name }}</a> |
||||
{%- endfor -%} |
||||
</span> |
||||
{%- endif -%} |
||||
{%- if theme.leancloud.app_id and theme.leancloud.app_key -%} |
||||
<span class="post-visits" |
||||
data-url="{{ url_for(post.path) }}" |
||||
data-title="{{ post.title }}"> |
||||
{{ __('posts.visits') }} 0 |
||||
</span> |
||||
{%- endif -%} |
||||
</div> |
||||
</header> |
||||
|
||||
{#- Post TOC -#} |
||||
{%- include "../_partial/_post/toc.swig" -%} |
||||
|
||||
<div class="post-content"> |
||||
{%- if is_home() -%} |
||||
{%- set excerpt = "" -%} |
||||
{%- if post.description -%} |
||||
{%- set excerpt = '<p>' + post.description + '</p>' -%} |
||||
{%- elif post.excerpt -%} |
||||
{%- set excerpt = post.excerpt -%} |
||||
{%- endif -%} |
||||
|
||||
{%- if excerpt -%} |
||||
{{ excerpt }} |
||||
<div class="read-more"> |
||||
<a href="{{ url_for(post.path) }}" class="read-more-link">{{ __('posts.readmore') }}</a> |
||||
</div> |
||||
{%- else -%} |
||||
{{ post.content }} |
||||
{%- endif -%} |
||||
{%- else -%} |
||||
{{ post.content }} |
||||
{%- endif -%} |
||||
</div> |
||||
|
||||
{%- if not is_home() -%} |
||||
{#- Post Copyright -#} |
||||
{%- include "../_partial/_post/copyright.swig" -%} |
||||
|
||||
{#- Reward -#} |
||||
{%- include "../_partial/_post/reward.swig" -%} |
||||
{%- endif -%} |
||||
|
||||
{%- if not is_home() -%} |
||||
<footer class="post-footer"> |
||||
{%- if post.tags and post.tags.length -%} |
||||
<div class="post-tags"> |
||||
{%- for tag in post.tags -%} |
||||
<a href="{{ url_for(tag.path) }}">{{ tag.name }}</a> |
||||
{%- endfor -%} |
||||
</div> |
||||
{%- endif -%} |
||||
{#- Post Pagination -#} |
||||
{%- include "../_partial/pagination.swig" -%} |
||||
</footer> |
||||
{%- endif -%} |
||||
|
||||
</article> |
||||
{%- endmacro -%} |
@ -0,0 +1,22 @@ |
||||
{%- if theme.social -%} |
||||
<div class="social-links"> |
||||
{%- for name, path in theme.social -%} |
||||
{%- if path -%} |
||||
{%- if name != 'email' -%} |
||||
<a href="{{ url_for(path) }}" class="iconfont icon-{{ name }}" title="{{ name }}"></a> |
||||
{%- else -%} |
||||
<a href="mailto:{{ path }}" class="iconfont icon-{{ name }}" title="{{ name }}"></a> |
||||
{%- endif -%} |
||||
{%- endif -%} |
||||
{%- endfor -%} |
||||
|
||||
{%- if config.feed and config.feed.path and theme.rss === 'default' -%} |
||||
<a href="{{ url_for(config.feed.path) }}" class="iconfont icon-rss" title="rss"></a> |
||||
{%- elif theme.rss === 'default' -%} |
||||
{%- set rss_link = config.feed.path || 'atom.xml' -%} |
||||
<a href="{{ url_for(rss_link) }}" class="iconfont icon-rss" title="rss"></a> |
||||
{%- elif theme.rss -%} |
||||
<a href="{{ url_for(theme.rss) }}" class="iconfont icon-rss" title="rss"></a> |
||||
{%- endif -%} |
||||
</div> |
||||
{%- endif -%} |
@ -0,0 +1,39 @@ |
||||
<meta charset="UTF-8"/> |
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge" /> |
||||
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"/> |
||||
|
||||
{#- Disable transformation -#} |
||||
<meta http-equiv="Cache-Control" content="no-transform" /> |
||||
<meta http-equiv="Cache-Control" content="no-siteapp" /> |
||||
|
||||
<meta name="theme-color" content="#f8f5ec" /> |
||||
<meta name="msapplication-navbutton-color" content="#f8f5ec"> |
||||
<meta name="apple-mobile-web-app-capable" content="yes"> |
||||
<meta name="apple-mobile-web-app-status-bar-style" content="#f8f5ec"> |
||||
|
||||
{#- Website description -#} |
||||
{%- if page.description -%} |
||||
<meta name="description" content="{{ page.description }}"/> |
||||
{%- elif page.title -%} |
||||
<meta name="description" content="{{ page.title }}"/> |
||||
{%- elif config.description -%} |
||||
<meta name="description" content="{{ config.description }}"/> |
||||
{%- endif -%} |
||||
|
||||
{#- Website keywords -#} |
||||
{%- if page.keywords -%} |
||||
<meta name="keywords" content="{{ page.keywords }}" /> |
||||
{%- elif config.keywords -%} |
||||
<meta name="keywords" content="{{ config.keywords }}" /> |
||||
{%- elif page.tags and page.tags.length -%} |
||||
<meta name="keywords" content="{%- for tag in page.tags -%}{{ tag.name }}, {%- endfor -%}{{ config.title }}" /> |
||||
{%- endif -%} |
||||
|
||||
{%- if theme.baidu_verification -%} |
||||
<meta name="baidu-site-verification" content="{{ theme.baidu_verification }}" /> |
||||
{%- endif -%} |
||||
|
||||
{%- if theme.google_verification -%} |
||||
<meta name="google-site-verification" content="{{ theme.google_verification }}" /> |
||||
{%- endif -%} |
||||
|
@ -0,0 +1,18 @@ |
||||
{#- Post Copyright -#} |
||||
{%- if theme.copyright.enable and page.copyright !== false -%} |
||||
<div class="post-copyright"> |
||||
<p class="copyright-item"> |
||||
<span>{{ __('copyright.author') + ': ' }}</span> |
||||
<a href="{{ config.url }}">{{ config.author }}</a> |
||||
</p> |
||||
<p class="copyright-item"> |
||||
<span>{{ __('copyright.link') + ': ' }}</span> |
||||
<a href="{{ page.permalink }}">{{ page.permalink }}</a> |
||||
</p> |
||||
<p class="copyright-item"> |
||||
<span>{{ __('copyright.license') + ': ' }}</span> |
||||
{%- set license = page.license || theme.copyright.license -%} |
||||
{{ license }} |
||||
</p> |
||||
</div> |
||||
{%- endif -%} |
@ -0,0 +1,19 @@ |
||||
{%- if (theme.reward.enable and page.reward !== false) or page.reward === true -%} |
||||
<div class="post-reward"> |
||||
<input type="checkbox" name="reward" id="reward" hidden /> |
||||
<label class="reward-button" for="reward">{{ __('posts.reward') }}</label> |
||||
<div class="qr-code"> |
||||
{%- set qrCode = theme.reward.qrCode -%} |
||||
{%- if qrCode.wechat -%} |
||||
<label class="qr-code-image" for="reward"> |
||||
<img class="image" src="{{url_for(qrCode.wechat)}}" title="wechat"> |
||||
</label> |
||||
{%- endif -%} |
||||
{%- if qrCode.alipay -%} |
||||
<label class="qr-code-image" for="reward"> |
||||
<img class="image" src="{{url_for(qrCode.alipay)}}" title="alipay"> |
||||
</label> |
||||
{%- endif -%} |
||||
</div> |
||||
</div> |
||||
{%- endif -%} |
@ -0,0 +1,8 @@ |
||||
{%- if not is_home() and toc(page.content) and theme.toc -%} |
||||
<div class="post-toc" id="post-toc"> |
||||
<h2 class="post-toc-title">{{ __('posts.toc') }}</h2> |
||||
<div class="post-toc-content"> |
||||
{{ toc(page.content, {list_number: false}) }} |
||||
</div> |
||||
</div> |
||||
{%- endif -%} |
@ -0,0 +1,20 @@ |
||||
{%- if page.comments and not is_home() -%} |
||||
<div class="comments" id="comments"> |
||||
{%- if theme.disqus_shortname -%} |
||||
<div id="disqus_thread"> |
||||
<noscript> |
||||
Please enable JavaScript to view the |
||||
<a href="//disqus.com/?ref_noscript">comments powered by Disqus.</a> |
||||
</noscript> |
||||
</div> |
||||
{%- elif theme.livere_datauid -%} |
||||
<div id="lv-container" data-id="city" data-uid="{{ theme.livere_datauid }}"> |
||||
<noscript>为正常使用来必力评论功能请激活JavaScript</noscript> |
||||
</div> |
||||
{%- elif theme.gitalk.enable -%} |
||||
<div id="gitalk-container"></div> |
||||
{%- elif theme.utterances.enable -%} |
||||
<div id="utterances-container"></div> |
||||
{%- endif -%} |
||||
</div> |
||||
{%- endif -%} |
@ -0,0 +1,28 @@ |
||||
{#- Social Links -#} |
||||
{%- include "./_footer/social.swig" -%} |
||||
|
||||
<div class="copyright"> |
||||
<span class="power-by"> |
||||
{{ __('footer.powered', '<a class="hexo-link" href="https://hexo.io/">Hexo</a>') }} |
||||
</span> |
||||
<span class="division">|</span> |
||||
<span class="theme-info"> |
||||
{{ __('footer.theme') }} - |
||||
<a class="theme-link" href="https://github.com/iotcat/kayo">Kayo</a> |
||||
</span> |
||||
|
||||
<span class="copyright-year"> |
||||
{%- set current = date(Date.now(), "YYYY") -%} |
||||
© |
||||
{%- if theme.since and theme.since != current -%} |
||||
{{ theme.since }} - {{ current }} |
||||
{%- else -%} |
||||
{{ current }} |
||||
{%- endif -%} |
||||
|
||||
<span class="heart"> |
||||
<i class="iconfont icon-heart"></i> |
||||
</span> |
||||
<span class="author">{{ config.author }}</span> |
||||
</span> |
||||
</div> |
@ -0,0 +1,49 @@ |
||||
{#- Website mata -#} |
||||
{%- include "./_head/meta.swig" -%} |
||||
|
||||
{#- Website rss -#} |
||||
{%- if theme.rss === 'default' and config.feed and config.feed.path -%} |
||||
{{ feed_tag(config.feed.path) }} |
||||
{%- elif theme.rss -%} |
||||
{{ feed_tag(theme.rss) }} |
||||
{%- else -%} |
||||
{{ feed_tag('atom.xml') }} |
||||
{%- endif -%} |
||||
|
||||
{#- Website favicon -#} |
||||
{%- if theme.favicon -%} |
||||
<link rel="shortcut icon" type="image/x-icon" href="{{ url_for(theme.favicon) }}?v={{ theme.version }}" /> |
||||
{%- endif -%} |
||||
|
||||
{#- Canonical, good for google search engine -#} |
||||
<link rel="canonical" href="{{ config.url }}/{{ page.canonical_path.replace('index.html', '') }}"/> |
||||
|
||||
{#- Fancybox styling -#} |
||||
{%- if theme.fancybox -%} |
||||
<link rel="stylesheet" type="text/css" href="{{ url_for('lib/fancybox/jquery.fancybox.css') }}" /> |
||||
{%- endif -%} |
||||
|
||||
{#- MathJax (LaTeX) support -#} |
||||
{%- if theme.latex -%} |
||||
<script type="text/x-mathjax-config"> |
||||
MathJax.Hub.Config({ tex2jax: { inlineMath: [['$','$'], ['\\(','\\)']] } }); |
||||
</script> |
||||
<script type="text/javascript" async src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js?config=TeX-MML-AM_CHTML"></script> |
||||
{%- endif -%} |
||||
|
||||
{#- Theme styling -#} |
||||
<link rel="stylesheet" type="text/css" href="{{ url_for('css/style.css') }}?v={{ theme.version }}" /> |
||||
|
||||
{#- Analytics and push -#} |
||||
{%- if not env.debug -%} |
||||
{%- include "../_script/analytics.swig" -%} |
||||
{%- include "../_script/push.swig" -%} |
||||
{%- endif -%} |
||||
|
||||
{#- LeanCloud Counter -#} |
||||
{%- include "../_script/counter.swig"%} |
||||
|
||||
{%- set themeConfig = { leancloud: theme.leancloud, toc: theme.toc, fancybox: theme.fancybox, pjax: theme.pjax, latex: theme.latex } -%} |
||||
<script> |
||||
window.config = {{ JSON.stringify(themeConfig) }}; |
||||
</script> |
@ -0,0 +1,22 @@ |
||||
<div class="logo-wrapper"> |
||||
<a href="{{ url_for('.') }}" class="logo">{{ config.title }}</a> |
||||
</div> |
||||
|
||||
<nav class="site-navbar"> |
||||
{%- if theme.menu -%} |
||||
<ul id="menu" class="menu"> |
||||
{%- for name, path in theme.menu -%} |
||||
<li class="menu-item"> |
||||
<a class="menu-item-link" href="{{ url_for(path) }}"> |
||||
{%- set itemName = __('menu.' + name.toLowerCase()) -%} |
||||
{%- if itemName.startsWith('menu') -%} |
||||
{{ name }} |
||||
{%- else -%} |
||||
{{ itemName }} |
||||
{%- endif -%} |
||||
</a> |
||||
</li> |
||||
{%- endfor -%} |
||||
</ul> |
||||
{%- endif -%} |
||||
</nav> |
@ -0,0 +1,33 @@ |
||||
{%- if not is_post() -%} |
||||
<nav class="pagination"> |
||||
{%- if page.prev -%} |
||||
<a class="prev" href="{{ url_for(page.prev_link) }}"> |
||||
<i class="iconfont icon-left"></i> |
||||
<span class="prev-text">{{ __('posts.prev') }}</span> |
||||
</a> |
||||
{%- endif -%} |
||||
{%- if page.next -%} |
||||
<a class="next" href="{{ url_for(page.next_link) }}"> |
||||
<span class="next-text">{{ __('posts.next') }}</span> |
||||
<i class="iconfont icon-right"></i> |
||||
</a> |
||||
{%- endif -%} |
||||
</nav> |
||||
{%- else -%} |
||||
<nav class="post-nav"> |
||||
{%- if page.prev.path -%} |
||||
<a class="prev" href="{{ url_for(page.prev.path) }}"> |
||||
<i class="iconfont icon-left"></i> |
||||
<span class="prev-text nav-default">{{ page.prev.title }}</span> |
||||
<span class="prev-text nav-mobile">{{ __('posts.prev_post') }}</span> |
||||
</a> |
||||
{%- endif -%} |
||||
{%- if page.next.path -%} |
||||
<a class="next" href="{{ url_for(page.next.path) }}"> |
||||
<span class="next-text nav-default">{{ page.next.title }}</span> |
||||
<span class="prev-text nav-mobile">{{ __('posts.next_post') }}</span> |
||||
<i class="iconfont icon-right"></i> |
||||
</a> |
||||
{%- endif -%} |
||||
</nav> |
||||
{%- endif -%} |
@ -0,0 +1,27 @@ |
||||
<div id="mobile-navbar" class="mobile-navbar"> |
||||
<div class="mobile-header-logo"> |
||||
<a href="{{ url_for('.') }}" class="logo">{{ config.title }}</a> |
||||
</div> |
||||
<div class="mobile-navbar-icon"> |
||||
<span></span> |
||||
<span></span> |
||||
<span></span> |
||||
</div> |
||||
</div> |
||||
|
||||
<nav id="mobile-menu" class="mobile-menu slideout-menu"> |
||||
<ul class="mobile-menu-list"> |
||||
{%- for name, path in theme.menu -%} |
||||
<a href="{{ url_for(path) }}"> |
||||
<li class="mobile-menu-item"> |
||||
{%- set itemName = __('menu.' + name.toLowerCase()) -%} |
||||
{%- if itemName.startsWith('menu') -%} |
||||
{{ name }} |
||||
{%- else -%} |
||||
{{ itemName }} |
||||
{%- endif -%} |
||||
</li> |
||||
</a> |
||||
{%- endfor -%} |
||||
</ul> |
||||
</nav> |
@ -0,0 +1,11 @@ |
||||
{%- if theme.baidu_analytics -%} |
||||
<script id="baidu_analytics"> |
||||
var _hmt = _hmt || []; |
||||
(function() { |
||||
var hm = document.createElement("script"); |
||||
hm.src = "https://hm.baidu.com/hm.js?{{ theme.baidu_analytics }}"; |
||||
var s = document.getElementsByTagName("script")[0]; |
||||
s.parentNode.insertBefore(hm, s); |
||||
})(); |
||||
</script> |
||||
{%- endif -%} |
@ -0,0 +1,11 @@ |
||||
{%- if theme.google_analytics -%} |
||||
<!-- Global site tag (gtag.js) - Google Analytics --> |
||||
<script async src="https://www.googletagmanager.com/gtag/js?id={{ theme.google_analytics }}"></script> |
||||
<script> |
||||
window.dataLayer = window.dataLayer || []; |
||||
function gtag(){dataLayer.push(arguments);} |
||||
gtag('js', new Date()); |
||||
|
||||
gtag('config', '{{ theme.google_analytics }}'); |
||||
</script> |
||||
{%- endif -%} |
@ -0,0 +1,11 @@ |
||||
{%- if theme.changyan.appid and theme.changyan.appkey -%} |
||||
<!-- SOHUCS Comments --> |
||||
<div id="SOHUCS"></div> |
||||
<script type="text/javascript"> |
||||
(function(){ |
||||
var appid = '{{theme.changyan.appid}}'; |
||||
var conf = '{{theme.changyan.appkey}}'; |
||||
var width = window.innerWidth || document.documentElement.clientWidth; |
||||
if (width < 960) {window.document.write('<script id="changyan_mobile_js" charset="utf-8" type="text/javascript" src="https://changyan.sohu.com/upload/mobile/wap-js/changyan_mobile.js?client_id=' + appid + '&conf=' + conf + '"><\/script>'); } else { var loadJs=function(d,a){var c=document.getElementsByTagName("head")[0]||document.head||document.documentElement;var b=document.createElement("script");b.setAttribute("type","text/javascript");b.setAttribute("charset","UTF-8");b.setAttribute("src",d);if(typeof a==="function"){if(window.attachEvent){b.onreadystatechange=function(){var e=b.readyState;if(e==="loaded"||e==="complete"){b.onreadystatechange=null;a()}}}else{b.onload=a}}c.appendChild(b)};loadJs("https://changyan.sohu.com/upload/changyan.js",function(){window.changyan.api.config({appid:appid,conf:conf})}); } })(); |
||||
</script> |
||||
{%- endif -%} |
@ -0,0 +1,17 @@ |
||||
{%- if theme.disqus_shortname -%} |
||||
<script type="text/javascript"> |
||||
var disqus_config = function () { |
||||
this.page.url = '{{ page.permalink }}'; |
||||
this.page.identifier = '{{ page.path }}'; |
||||
this.page.title = '{{ page.title }}'; |
||||
}; |
||||
(function() { |
||||
var d = document, s = d.createElement('script'); |
||||
|
||||
s.src = '//{{theme.disqus_shortname}}.disqus.com/embed.js'; |
||||
|
||||
s.setAttribute('data-timestamp', +new Date()); |
||||
(d.head || d.body).appendChild(s); |
||||
})(); |
||||
</script> |
||||
{%- endif -%} |
@ -0,0 +1,29 @@ |
||||
{%- if theme.gitalk.enable -%} |
||||
{% set gitalk_js_url = '//cdn.jsdelivr.net/npm/gitalk@1/dist/gitalk.min.js' %} |
||||
<script src="{{ gitalk_js_url }}"></script> |
||||
|
||||
{% set gitalk_css_url = '//cdn.jsdelivr.net/npm/gitalk@1/dist/gitalk.min.css' %} |
||||
<link rel="stylesheet" href="{{ gitalk_css_url }}"/> |
||||
|
||||
{% set md5_url = '//cdn.jsdelivr.net/npm/js-md5@0.7.3/src/md5.min.js' %} |
||||
<script src="{{ md5_url }}"></script> |
||||
|
||||
<script> |
||||
var gitalk = new Gitalk({ |
||||
clientID: '{{ theme.gitalk.client_id }}', |
||||
clientSecret: '{{ theme.gitalk.client_secret }}', |
||||
repo: '{{ theme.gitalk.repo }}', |
||||
owner: '{{ theme.gitalk.github_id }}', |
||||
admin: ['{{ theme.gitalk.admin_user }}'], |
||||
id: md5(location.pathname), |
||||
{% if theme.gitalk.language == '' %} |
||||
language: window.navigator.language || window.navigator.userLanguage, |
||||
{% else %} |
||||
language: '{{ theme.gitalk.language }}', |
||||
{% endif %} |
||||
distractionFreeMode: '{{ theme.gitalk.distraction_free_mode }}' |
||||
}); |
||||
gitalk.render('gitalk-container'); |
||||
</script> |
||||
|
||||
{%- endif -%} |
@ -0,0 +1,15 @@ |
||||
{%- if theme.livere_datauid -%} |
||||
<script type="text/javascript"> |
||||
(function(d, s) { |
||||
var j, e = d.getElementsByTagName(s)[0]; |
||||
|
||||
if (typeof LivereTower === 'function') { return; } |
||||
|
||||
j = d.createElement(s); |
||||
j.src = 'https://cdn-city.livere.com/js/embed.dist.js'; |
||||
j.async = true; |
||||
|
||||
e.parentNode.insertBefore(j, e); |
||||
})(document, 'script'); |
||||
</script> |
||||
{%- endif -%} |
@ -0,0 +1,15 @@ |
||||
{%- if theme.utterances.enable -%} |
||||
<script> |
||||
var container = document.getElementById('utterances-container') |
||||
var script = document.createElement('script') |
||||
script.src = 'https://utteranc.es/client.js' |
||||
script.setAttribute('repo', '{{ theme.utterances.repo }}') |
||||
script.setAttribute('issue-term', '{{ theme.utterances.issueTerm }}') |
||||
script.setAttribute('theme', '{{ theme.utterances.theme }}') |
||||
script.setAttribute('label', '{{ theme.utterances.label }}') |
||||
script.crossorigin = 'anonymous' |
||||
script.async = true |
||||
|
||||
container.appendChild(script) |
||||
</script> |
||||
{%- endif -%} |
@ -0,0 +1,2 @@ |
||||
{%- include "_analytics/baidu-analytics.swig" -%} |
||||
{%- include "_analytics/google-analytics.swig" -%} |
@ -0,0 +1,7 @@ |
||||
{%- if !is_home() and !is_archive() -%} |
||||
{%- include "_comments/disqus.swig" -%} |
||||
{%- include "_comments/changyan.swig" -%} |
||||
{%- include "_comments/livere.swig" -%} |
||||
{%- include "_comments/gitalk.swig" -%} |
||||
{%- include "_comments/utterances.swig" -%} |
||||
{%- endif -%} |
@ -0,0 +1,10 @@ |
||||
{%- if theme.leancloud.app_id and theme.leancloud.app_key -%} |
||||
<script src="//cdn1.lncld.net/static/js/3.1.1/av-min.js"></script> |
||||
<script id="leancloud"> |
||||
AV.init({ |
||||
appId: "{{ theme.leancloud.app_id }}", |
||||
appKey: "{{ theme.leancloud.app_key }}" |
||||
}); |
||||
</script> |
||||
{%- endif -%} |
||||
|
@ -0,0 +1,18 @@ |
||||
{%- if theme.fancybox -%} |
||||
{%- set fancybox_js = 'fancybox/jquery.fancybox.pack.js' -%} |
||||
{%- endif -%} |
||||
|
||||
{%- |
||||
set js_libs = { |
||||
jquery: 'jquery/jquery.min.js', |
||||
slideout: 'slideout/slideout.js', |
||||
fancybox: fancybox_js, |
||||
nprogress: nprogress_js, |
||||
} |
||||
-%} |
||||
|
||||
{%- for lib in js_libs -%} |
||||
{%- if lib -%} |
||||
<script type="text/javascript" src="{{ url_for('lib') }}/{{ lib }}"></script> |
||||
{%- endif -%} |
||||
{%- endfor -%} |
@ -0,0 +1,14 @@ |
||||
<script id="baidu_push"> |
||||
(function(){ |
||||
var bp = document.createElement('script'); |
||||
var curProtocol = window.location.protocol.split(':')[0]; |
||||
if (curProtocol === 'https') { |
||||
bp.src = 'https://zz.bdstatic.com/linksubmit/push.js'; |
||||
} |
||||
else { |
||||
bp.src = 'http://push.zhanzhang.baidu.com/push.js'; |
||||
} |
||||
var s = document.getElementsByTagName("script")[0]; |
||||
s.parentNode.insertBefore(bp, s); |
||||
})(); |
||||
</script> |
@ -0,0 +1 @@ |
||||
<script type="text/javascript" src="{{ url_for('js/src') }}/kayo.js?v={{ theme.version }}"></script> |
@ -0,0 +1,16 @@ |
||||
{%- extends "_layout.swig" -%} |
||||
{%- import '_macro/archive.swig' as archive_template -%} |
||||
|
||||
{%- block title -%} |
||||
{%- if page.archive -%} |
||||
{{ __('menu.archives') }} - {{ config.title }} |
||||
{%- elif page.tag -%} |
||||
{{ page.tag }} · {{ config.title }} |
||||
{%- elif page.category -%} |
||||
{{ page.category }} · {{ config.title }} |
||||
{%- endif -%} |
||||
{%- endblock -%} |
||||
|
||||
{%- block content -%} |
||||
{{ archive_template.render() }} |
||||
{%- endblock -%} |
@ -0,0 +1,14 @@ |
||||
{%- extends "_layout.swig" -%} |
||||
|
||||
{%- block title -%} {{ __('menu.categories') }} - {{ config.title }} {%- endblock -%} |
||||
|
||||
{%- block content -%} |
||||
<div class="categories"> |
||||
<div class="categories-title"> |
||||
{{ _p('counter.categories', site.categories.length) }} |
||||
</div> |
||||
<div class="categories-tags"> |
||||
{{ list_categories({style: null, separator: ' ', depth: '-1'}) }} |
||||
</div> |
||||
</div> |
||||
{%- endblock -%} |
@ -0,0 +1,19 @@ |
||||
{%- extends "_layout.swig" -%} |
||||
{%- import '_macro/post.swig' as post_template -%} |
||||
{%- import '_macro/archive.swig' as archive_template -%} |
||||
|
||||
{%- block title -%} {{ config.title }} {%- endblock -%} |
||||
|
||||
{%- block content -%} |
||||
{%- set mode = theme.mode.toLowerCase() -%} |
||||
<section id="posts" class="posts"> |
||||
{%- if mode == 'default' -%} |
||||
{%- for post in page.posts -%} |
||||
{{ post_template.render(post) }} |
||||
{%- endfor -%} |
||||
{%- include "_partial/pagination.swig" -%} |
||||
{%- else -%} |
||||
{{ archive_template.render() }} |
||||
{%- endif -%} |
||||
</section> |
||||
{%- endblock -%} |
@ -0,0 +1,11 @@ |
||||
{%- extends "_layout.swig" -%} |
||||
|
||||
{%- block title -%} {{ page.title }} - {{ config.title }} {%- endblock -%} |
||||
|
||||
{%- block content -%} |
||||
<article class="post"> |
||||
<div class="post-content"> |
||||
{{ page.content }} |
||||
</div> |
||||
</article> |
||||
{%- endblock -%} |
@ -0,0 +1,8 @@ |
||||
{%- extends "_layout.swig" -%} |
||||
{%- import '_macro/post.swig' as post_template -%} |
||||
|
||||
{%- block title -%} {{ page.title }} - {{ config.title }} {%- endblock -%} |
||||
|
||||
{%- block content -%} |
||||
{{ post_template.render(page) }} |
||||
{%- endblock -%} |
@ -0,0 +1,14 @@ |
||||
{%- extends "_layout.swig" -%} |
||||
|
||||
{%- block title -%} {{ __('menu.tags') }} - {{ config.title }} {%- endblock -%} |
||||
|
||||
{%- block content -%} |
||||
<div class="tag-cloud"> |
||||
<div class="tag-cloud-title"> |
||||
{{ _p('counter.tagcloud', site.tags.length) }} |
||||
</div> |
||||
<div class="tag-cloud-tags"> |
||||
{{ tagcloud({min_font: 16, max_font: 28, amount: 100, orderby: 'count'}) }} |
||||
</div> |
||||
</div> |
||||
{%- endblock -%} |
@ -0,0 +1,102 @@ |
||||
@import '_common/normalize'; |
||||
|
||||
html { |
||||
font-size: $global-font-size; |
||||
box-sizing: border-box; |
||||
} |
||||
|
||||
body { |
||||
padding: 0; |
||||
margin: 0; |
||||
font-family: $global-font-family; |
||||
font-weight: normal; |
||||
-webkit-font-smoothing: antialiased; |
||||
-moz-osx-font-smoothing: grayscale; |
||||
line-height: $global-lineheight; |
||||
color: $global-font-color; |
||||
background: $global-background; |
||||
scroll-behavior: smooth; |
||||
border-top: 3px solid $theme-color; |
||||
|
||||
&.hide-top { |
||||
border-top: 3px solid transparent; |
||||
} |
||||
} |
||||
|
||||
@include max-screen() { |
||||
body { |
||||
border-top: 0; |
||||
} |
||||
} |
||||
|
||||
::selection { |
||||
background: $theme-color; |
||||
color: #fff; |
||||
} |
||||
|
||||
// ::-webkit-scrollbar { |
||||
// width: 8px; |
||||
// height: 6px; |
||||
// } |
||||
|
||||
// ::-webkit-scrollbar-thumb { |
||||
// background: lighten($theme-color, 10%); |
||||
// border-radius: 5px; |
||||
// } |
||||
|
||||
// ::-webkit-scrollbar-track { |
||||
// background: rgba(211, 211, 211, 0.4); |
||||
// border-radius: 5px; |
||||
// } |
||||
|
||||
img { |
||||
max-width: 100%; |
||||
height: auto; |
||||
display: inline-block; |
||||
vertical-align: middle; |
||||
} |
||||
|
||||
a { |
||||
color: $global-font-color; |
||||
text-decoration: none; |
||||
} |
||||
|
||||
@each $header, $size in $global-headings { |
||||
#{$header} { |
||||
font-size: $size; |
||||
font-family: $global-serif-font-family; |
||||
} |
||||
} |
||||
|
||||
.container { |
||||
margin: 0 auto; |
||||
width: $global-body-width; |
||||
} |
||||
|
||||
@include max-screen() { |
||||
.container { |
||||
width: 100%; |
||||
box-shadow: -1px -5px 5px $gray; |
||||
} |
||||
} |
||||
|
||||
.content-wrapper { |
||||
padding: $global-container-padding; |
||||
} |
||||
|
||||
// make video fluid: |
||||
// https://css-tricks.com/NetMag/FluidWidthVideo/Article-FluidWidthVideo.php |
||||
// class video-container is the wrapper used by hexo youtube tag plugin |
||||
.video-container { |
||||
position: relative; |
||||
padding-bottom: 56.25%; /* 16:9 */ |
||||
padding-top: 25px; |
||||
height: 0; |
||||
} |
||||
.video-container iframe { |
||||
position: absolute; |
||||
top: 0; |
||||
left: 0; |
||||
width: 100%; |
||||
height: 100%; |
||||
} |
@ -0,0 +1,153 @@ |
||||
@mixin underline-from-center() { |
||||
display: inline-block; |
||||
vertical-align: middle; |
||||
transform: translateZ(0); |
||||
backface-visibility: hidden; |
||||
box-shadow: 0 0 1px transparent; |
||||
position: relative; |
||||
overflow: hidden; |
||||
|
||||
&:before { |
||||
content: ''; |
||||
position: absolute; |
||||
z-index: -1; |
||||
height: 2px; |
||||
bottom: 0; |
||||
left: 51%; |
||||
right: 51%; |
||||
background: $theme-color; |
||||
transition-duration: 0.2s; |
||||
transition-property: right, left; |
||||
transition-timing-function: ease-out; |
||||
} |
||||
|
||||
&.active, |
||||
&:active, |
||||
&:focus, |
||||
&:hover { |
||||
&:before { |
||||
right: 0; |
||||
left: 0; |
||||
} |
||||
} |
||||
} |
||||
|
||||
@mixin mobile-menu-icon() { |
||||
@keyframes clickfirst { |
||||
0% { |
||||
transform: translateY(6px) rotate(0deg); |
||||
|
||||
} |
||||
|
||||
100% { |
||||
transform: translateY(0) rotate(45deg); |
||||
} |
||||
} |
||||
|
||||
@keyframes clickmid { |
||||
0% { |
||||
opacity: 1; |
||||
} |
||||
|
||||
100% { |
||||
opacity: 0; |
||||
} |
||||
} |
||||
|
||||
@keyframes clicklast { |
||||
0% { |
||||
transform: translateY(-6px) rotate(0deg); |
||||
} |
||||
|
||||
100% { |
||||
transform: translateY(0) rotate(-45deg); |
||||
} |
||||
} |
||||
|
||||
@keyframes outfirst { |
||||
0% { |
||||
transform: translateY(0) rotate(-45deg); |
||||
} |
||||
|
||||
100% { |
||||
transform: translateY(-6px) rotate(0deg); |
||||
} |
||||
} |
||||
|
||||
@keyframes outmid { |
||||
0% { |
||||
opacity: 0; |
||||
} |
||||
|
||||
100% { |
||||
opacity: 1; |
||||
} |
||||
} |
||||
|
||||
@keyframes outlast { |
||||
0% { |
||||
transform: translateY(0) rotate(45deg); |
||||
} |
||||
|
||||
100% { |
||||
transform: translateY(6px) rotate(0deg); |
||||
} |
||||
} |
||||
|
||||
span { |
||||
position: absolute; |
||||
left: calc((100% - 20px) / 2); |
||||
top: calc((100% - 1px) / 2); |
||||
width: 20px; |
||||
height: 1px; |
||||
background-color: $theme-color; |
||||
|
||||
&:nth-child(1) { |
||||
transform: translateY(6px) rotate(0deg); |
||||
} |
||||
|
||||
&:nth-child(3) { |
||||
transform: translateY(-6px) rotate(0deg); |
||||
} |
||||
} |
||||
|
||||
&.icon-click { |
||||
span:nth-child(1) { |
||||
animation-duration: 0.5s; |
||||
animation-fill-mode: both; |
||||
animation-name: clickfirst; |
||||
} |
||||
|
||||
span:nth-child(2) { |
||||
animation-duration: 0.2s; |
||||
animation-fill-mode: both; |
||||
animation-name: clickmid; |
||||
} |
||||
|
||||
span:nth-child(3) { |
||||
animation-duration: 0.5s; |
||||
animation-fill-mode: both; |
||||
animation-name: clicklast; |
||||
} |
||||
} |
||||
|
||||
&.icon-out { |
||||
span:nth-child(1) { |
||||
animation-duration: 0.5s; |
||||
animation-fill-mode: both; |
||||
animation-name: outfirst; |
||||
} |
||||
|
||||
span:nth-child(2) { |
||||
animation-duration: 0.2s; |
||||
animation-fill-mode: both; |
||||
animation-name: outmid; |
||||
} |
||||
|
||||
span:nth-child(3) { |
||||
animation-duration: 0.5s; |
||||
animation-fill-mode: both; |
||||
animation-name: outlast; |
||||
} |
||||
} |
||||
} |
@ -0,0 +1,427 @@ |
||||
/*! normalize.css v3.0.2 | MIT License | git.io/normalize */ |
||||
|
||||
/** |
||||
* 1. Set default font family to sans-serif. |
||||
* 2. Prevent iOS text size adjust after orientation change, without disabling |
||||
* user zoom. |
||||
*/ |
||||
|
||||
html { |
||||
font-family: sans-serif; /* 1 */ |
||||
-ms-text-size-adjust: 100%; /* 2 */ |
||||
-webkit-text-size-adjust: 100%; /* 2 */ |
||||
} |
||||
|
||||
/** |
||||
* Remove default margin. |
||||
*/ |
||||
|
||||
body { |
||||
margin: 0; |
||||
} |
||||
|
||||
/* HTML5 display definitions |
||||
========================================================================== */ |
||||
|
||||
/** |
||||
* Correct `block` display not defined for any HTML5 element in IE 8/9. |
||||
* Correct `block` display not defined for `details` or `summary` in IE 10/11 |
||||
* and Firefox. |
||||
* Correct `block` display not defined for `main` in IE 11. |
||||
*/ |
||||
|
||||
article, |
||||
aside, |
||||
details, |
||||
figcaption, |
||||
figure, |
||||
footer, |
||||
header, |
||||
hgroup, |
||||
main, |
||||
menu, |
||||
nav, |
||||
section, |
||||
summary { |
||||
display: block; |
||||
} |
||||
|
||||
/** |
||||
* 1. Correct `inline-block` display not defined in IE 8/9. |
||||
* 2. Normalize vertical alignment of `progress` in Chrome, Firefox, and Opera. |
||||
*/ |
||||
|
||||
audio, |
||||
canvas, |
||||
progress, |
||||
video { |
||||
display: inline-block; /* 1 */ |
||||
vertical-align: baseline; /* 2 */ |
||||
} |
||||
|
||||
/** |
||||
* Prevent modern browsers from displaying `audio` without controls. |
||||
* Remove excess height in iOS 5 devices. |
||||
*/ |
||||
|
||||
audio:not([controls]) { |
||||
display: none; |
||||
height: 0; |
||||
} |
||||
|
||||
/** |
||||
* Address `[hidden]` styling not present in IE 8/9/10. |
||||
* Hide the `template` element in IE 8/9/11, Safari, and Firefox < 22. |
||||
*/ |
||||
|
||||
[hidden], |
||||
template { |
||||
display: none; |
||||
} |
||||
|
||||
/* Links |
||||
========================================================================== */ |
||||
|
||||
/** |
||||
* Remove the gray background color from active links in IE 10. |
||||
*/ |
||||
|
||||
a { |
||||
background-color: transparent; |
||||
} |
||||
|
||||
/** |
||||
* Improve readability when focused and also mouse hovered in all browsers. |
||||
*/ |
||||
|
||||
a:active, |
||||
a:hover { |
||||
outline: 0; |
||||
} |
||||
|
||||
/* Text-level semantics |
||||
========================================================================== */ |
||||
|
||||
/** |
||||
* Address styling not present in IE 8/9/10/11, Safari, and Chrome. |
||||
*/ |
||||
|
||||
abbr[title] { |
||||
border-bottom: 1px dotted; |
||||
} |
||||
|
||||
/** |
||||
* Address style set to `bolder` in Firefox 4+, Safari, and Chrome. |
||||
*/ |
||||
|
||||
b, |
||||
strong { |
||||
font-weight: bold; |
||||
} |
||||
|
||||
/** |
||||
* Address styling not present in Safari and Chrome. |
||||
*/ |
||||
|
||||
dfn { |
||||
font-style: italic; |
||||
} |
||||
|
||||
/** |
||||
* Address variable `h1` font-size and margin within `section` and `article` |
||||
* contexts in Firefox 4+, Safari, and Chrome. |
||||
*/ |
||||
|
||||
h1 { |
||||
font-size: 2em; |
||||
margin: 0.67em 0; |
||||
} |
||||
|
||||
/** |
||||
* Address styling not present in IE 8/9. |
||||
*/ |
||||
|
||||
mark { |
||||
background: #ff0; |
||||
color: #000; |
||||
} |
||||
|
||||
/** |
||||
* Address inconsistent and variable font size in all browsers. |
||||
*/ |
||||
|
||||
small { |
||||
font-size: 80%; |
||||
} |
||||
|
||||
/** |
||||
* Prevent `sub` and `sup` affecting `line-height` in all browsers. |
||||
*/ |
||||
|
||||
sub, |
||||
sup { |
||||
font-size: 75%; |
||||
line-height: 0; |
||||
position: relative; |
||||
vertical-align: baseline; |
||||
} |
||||
|
||||
sup { |
||||
top: -0.5em; |
||||
} |
||||
|
||||
sub { |
||||
bottom: -0.25em; |
||||
} |
||||
|
||||
/* Embedded content |
||||
========================================================================== */ |
||||
|
||||
/** |
||||
* Remove border when inside `a` element in IE 8/9/10. |
||||
*/ |
||||
|
||||
img { |
||||
border: 0; |
||||
} |
||||
|
||||
/** |
||||
* Correct overflow not hidden in IE 9/10/11. |
||||
*/ |
||||
|
||||
svg:not(:root) { |
||||
overflow: hidden; |
||||
} |
||||
|
||||
/* Grouping content |
||||
========================================================================== */ |
||||
|
||||
/** |
||||
* Address margin not present in IE 8/9 and Safari. |
||||
*/ |
||||
|
||||
figure { |
||||
margin: 1em 40px; |
||||
} |
||||
|
||||
/** |
||||
* Address differences between Firefox and other browsers. |
||||
*/ |
||||
|
||||
hr { |
||||
-moz-box-sizing: content-box; |
||||
box-sizing: content-box; |
||||
height: 0; |
||||
} |
||||
|
||||
/** |
||||
* Contain overflow in all browsers. |
||||
*/ |
||||
|
||||
pre { |
||||
overflow: auto; |
||||
} |
||||
|
||||
/** |
||||
* Address odd `em`-unit font size rendering in all browsers. |
||||
*/ |
||||
|
||||
code, |
||||
kbd, |
||||
pre, |
||||
samp { |
||||
font-family: monospace, monospace; |
||||
font-size: 1em; |
||||
} |
||||
|
||||
/* Forms |
||||
========================================================================== */ |
||||
|
||||
/** |
||||
* Known limitation: by default, Chrome and Safari on OS X allow very limited |
||||
* styling of `select`, unless a `border` property is set. |
||||
*/ |
||||
|
||||
/** |
||||
* 1. Correct color not being inherited. |
||||
* Known issue: affects color of disabled elements. |
||||
* 2. Correct font properties not being inherited. |
||||
* 3. Address margins set differently in Firefox 4+, Safari, and Chrome. |
||||
*/ |
||||
|
||||
button, |
||||
input, |
||||
optgroup, |
||||
select, |
||||
textarea { |
||||
color: inherit; /* 1 */ |
||||
font: inherit; /* 2 */ |
||||
margin: 0; /* 3 */ |
||||
} |
||||
|
||||
/** |
||||
* Address `overflow` set to `hidden` in IE 8/9/10/11. |
||||
*/ |
||||
|
||||
button { |
||||
overflow: visible; |
||||
} |
||||
|
||||
/** |
||||
* Address inconsistent `text-transform` inheritance for `button` and `select`. |
||||
* All other form control elements do not inherit `text-transform` values. |
||||
* Correct `button` style inheritance in Firefox, IE 8/9/10/11, and Opera. |
||||
* Correct `select` style inheritance in Firefox. |
||||
*/ |
||||
|
||||
button, |
||||
select { |
||||
text-transform: none; |
||||
} |
||||
|
||||
/** |
||||
* 1. Avoid the WebKit bug in Android 4.0.* where (2) destroys native `audio` |
||||
* and `video` controls. |
||||
* 2. Correct inability to style clickable `input` types in iOS. |
||||
* 3. Improve usability and consistency of cursor style between image-type |
||||
* `input` and others. |
||||
*/ |
||||
|
||||
button, |
||||
html input[type="button"], /* 1 */ |
||||
input[type="reset"], |
||||
input[type="submit"] { |
||||
-webkit-appearance: button; /* 2 */ |
||||
cursor: pointer; /* 3 */ |
||||
} |
||||
|
||||
/** |
||||
* Re-set default cursor for disabled elements. |
||||
*/ |
||||
|
||||
button[disabled], |
||||
html input[disabled] { |
||||
cursor: default; |
||||
} |
||||
|
||||
/** |
||||
* Remove inner padding and border in Firefox 4+. |
||||
*/ |
||||
|
||||
button::-moz-focus-inner, |
||||
input::-moz-focus-inner { |
||||
border: 0; |
||||
padding: 0; |
||||
} |
||||
|
||||
/** |
||||
* Address Firefox 4+ setting `line-height` on `input` using `!important` in |
||||
* the UA stylesheet. |
||||
*/ |
||||
|
||||
input { |
||||
line-height: normal; |
||||
} |
||||
|
||||
/** |
||||
* It's recommended that you don't attempt to style these elements. |
||||
* Firefox's implementation doesn't respect box-sizing, padding, or width. |
||||
* |
||||
* 1. Address box sizing set to `content-box` in IE 8/9/10. |
||||
* 2. Remove excess padding in IE 8/9/10. |
||||
*/ |
||||
|
||||
input[type="checkbox"], |
||||
input[type="radio"] { |
||||
box-sizing: border-box; /* 1 */ |
||||
padding: 0; /* 2 */ |
||||
} |
||||
|
||||
/** |
||||
* Fix the cursor style for Chrome's increment/decrement buttons. For certain |
||||
* `font-size` values of the `input`, it causes the cursor style of the |
||||
* decrement button to change from `default` to `text`. |
||||
*/ |
||||
|
||||
input[type="number"]::-webkit-inner-spin-button, |
||||
input[type="number"]::-webkit-outer-spin-button { |
||||
height: auto; |
||||
} |
||||
|
||||
/** |
||||
* 1. Address `appearance` set to `searchfield` in Safari and Chrome. |
||||
* 2. Address `box-sizing` set to `border-box` in Safari and Chrome |
||||
* (include `-moz` to future-proof). |
||||
*/ |
||||
|
||||
input[type="search"] { |
||||
-webkit-appearance: textfield; /* 1 */ |
||||
-moz-box-sizing: content-box; |
||||
-webkit-box-sizing: content-box; /* 2 */ |
||||
box-sizing: content-box; |
||||
} |
||||
|
||||
/** |
||||
* Remove inner padding and search cancel button in Safari and Chrome on OS X. |
||||
* Safari (but not Chrome) clips the cancel button when the search input has |
||||
* padding (and `textfield` appearance). |
||||
*/ |
||||
|
||||
input[type="search"]::-webkit-search-cancel-button, |
||||
input[type="search"]::-webkit-search-decoration { |
||||
-webkit-appearance: none; |
||||
} |
||||
|
||||
/** |
||||
* Define consistent border, margin, and padding. |
||||
*/ |
||||
|
||||
fieldset { |
||||
border: 1px solid #c0c0c0; |
||||
margin: 0 2px; |
||||
padding: 0.35em 0.625em 0.75em; |
||||
} |
||||
|
||||
/** |
||||
* 1. Correct `color` not being inherited in IE 8/9/10/11. |
||||
* 2. Remove padding so people aren't caught out if they zero out fieldsets. |
||||
*/ |
||||
|
||||
legend { |
||||
border: 0; /* 1 */ |
||||
padding: 0; /* 2 */ |
||||
} |
||||
|
||||
/** |
||||
* Remove default vertical scrollbar in IE 8/9/10/11. |
||||
*/ |
||||
|
||||
textarea { |
||||
overflow: auto; |
||||
} |
||||
|
||||
/** |
||||
* Don't inherit the `font-weight` (applied by a rule above). |
||||
* NOTE: the default cannot safely be changed in Chrome and Safari on OS X. |
||||
*/ |
||||
|
||||
optgroup { |
||||
font-weight: bold; |
||||
} |
||||
|
||||
/* Tables |
||||
========================================================================== */ |
||||
|
||||
/** |
||||
* Remove most spacing between table cells. |
||||
*/ |
||||
|
||||
table { |
||||
border-collapse: collapse; |
||||
border-spacing: 0; |
||||
} |
||||
|
||||
td, |
||||
th { |
||||
padding: 0; |
||||
} |
@ -0,0 +1,23 @@ |
||||
@mixin clearfix() { |
||||
&:before, |
||||
&:after { |
||||
content: " "; |
||||
display: table; |
||||
} |
||||
|
||||
&:after { |
||||
clear: both; |
||||
} |
||||
} |
||||
|
||||
@mixin min-screen($min-width: $global-body-width) { |
||||
@media screen and (min-width: $min-width) { |
||||
@content; |
||||
} |
||||
} |
||||
|
||||
@mixin max-screen($max-width: $global-body-width) { |
||||
@media screen and (max-width: $max-width) { |
||||
@content; |
||||
} |
||||
} |
@ -0,0 +1,4 @@ |
||||
// ============================== |
||||
// Custom style |
||||
// ============================== |
||||
// You can override the variables in _variables.scss to customize the style |
@ -0,0 +1,100 @@ |
||||
// ============================== |
||||
// Archive |
||||
// ============================= |
||||
|
||||
.archive { |
||||
margin: $archive-margin; |
||||
max-width: $archive-max-width; |
||||
|
||||
.archive-title { |
||||
font-family: $global-serif-font-family; |
||||
|
||||
&.tag, |
||||
&.category { |
||||
margin: 15px 0; |
||||
} |
||||
|
||||
.archive-name { |
||||
margin: 0; |
||||
display: inline-block; |
||||
font-weight: 400; |
||||
font-size: $archive-name-font-size; |
||||
line-height: $archive-name-font-size + 2px; |
||||
} |
||||
|
||||
.archive-post-counter { |
||||
display: none; |
||||
color: $dark-gray; |
||||
} |
||||
} |
||||
|
||||
.collection-title { |
||||
font-family: $global-serif-font-family; |
||||
|
||||
.archive-year { |
||||
margin: 15px 0; |
||||
font-weight: 400; |
||||
font-size: $collection-title-font-size; |
||||
line-height: $collection-title-font-size + 2px; |
||||
} |
||||
} |
||||
|
||||
.archive-post { |
||||
padding: $archive-post-padding; |
||||
border-left: $archive-post-border-left; |
||||
|
||||
.archive-post-time { |
||||
margin-right: 10px; |
||||
color: $dark-gray; |
||||
} |
||||
|
||||
.archive-post-title { |
||||
.archive-post-link { |
||||
color: $theme-color; |
||||
} |
||||
} |
||||
|
||||
&::first-child { |
||||
margin-top: 10px; |
||||
} |
||||
|
||||
&:hover { |
||||
border-left: $archive-post-hover-border-left; |
||||
transition: $archive-post-hover-transition; |
||||
transform: $archive-post-hover-transform; |
||||
|
||||
.archive-post-time { |
||||
color: darken($dark-gray, 10%); |
||||
} |
||||
|
||||
.archive-post-title .archive-post-link { |
||||
color: darken($theme-color, 10%); |
||||
} |
||||
} |
||||
} |
||||
} |
||||
|
||||
@include max-screen() { |
||||
.archive { |
||||
margin-left: auto; |
||||
margin-right: auto; |
||||
|
||||
.archive-title .archive-name { |
||||
font-size: $archive-name-font-size - 4px; |
||||
} |
||||
|
||||
.collection-title .archive-year { |
||||
margin: 10px 0; |
||||
font-size: $collection-title-font-size - 4px; |
||||
} |
||||
|
||||
.archive-post { |
||||
padding: $archive-post-mobile-padding; |
||||
|
||||
.archive-post-time { |
||||
font-size: $archive-post-mobile-time-font-size; |
||||
display: block; |
||||
} |
||||
} |
||||
} |
||||
} |
@ -0,0 +1,24 @@ |
||||
// ============================== |
||||
// Back to top |
||||
// ============================= |
||||
|
||||
.back-to-top { |
||||
display: none; |
||||
position: fixed; |
||||
right: 20px; |
||||
bottom: 20px; |
||||
transition-property: transform; |
||||
transition-timing-function: ease-out; |
||||
transition-duration: 0.3s; |
||||
z-index: 10; |
||||
|
||||
&:hover { |
||||
transform: translateY(-5px); |
||||
} |
||||
} |
||||
|
||||
@include max-screen() { |
||||
.back-to-top { |
||||
display: none !important; |
||||
} |
||||
} |
@ -0,0 +1,43 @@ |
||||
|
||||
.categories { |
||||
margin: 2em 0 3em; |
||||
text-align: center; |
||||
font-family: $global-serif-font-family; |
||||
|
||||
.categories-title { |
||||
display: inline-block; |
||||
font-size: $categories-title-size; |
||||
color: $theme-color; |
||||
border-bottom: $categories-title-border-bottom; |
||||
} |
||||
|
||||
.categories-tags { |
||||
margin: 10px 0; |
||||
|
||||
.category-link { |
||||
display: inline-block; |
||||
position: relative; |
||||
margin: $categories-tags-link-margin; |
||||
word-wrap: break-word; |
||||
transition-duration: 0.2s; |
||||
transition-property: transform; |
||||
transition-timing-function: ease-out; |
||||
|
||||
.category-count { |
||||
display: inline-block; |
||||
position: relative; |
||||
top: -8px; |
||||
right: -2px; |
||||
color: $theme-color; |
||||
font-size: $category-count-font-size; |
||||
} |
||||
|
||||
&:active, |
||||
&:focus, |
||||
&:hover { |
||||
color: $theme-color; |
||||
transform: scale(1.1); |
||||
} |
||||
} |
||||
} |
||||
} |
@ -0,0 +1,10 @@ |
||||
// ============================== |
||||
// Post footer |
||||
// ============================= |
||||
|
||||
.footer { |
||||
margin-top: $footer-margin-top; |
||||
|
||||
@import "_footer/social"; |
||||
@import "_footer/copyright"; |
||||
} |
@ -0,0 +1,23 @@ |
||||
// ============================== |
||||
// Copyright |
||||
// ============================= |
||||
|
||||
.copyright { |
||||
margin: $copyright-margin; |
||||
color: $dark-gray; |
||||
text-align: center; |
||||
font-family: $global-serif-font-family; |
||||
|
||||
.hexo-link, |
||||
.theme-link { |
||||
color: $theme-color; |
||||
} |
||||
|
||||
.copyright-year { |
||||
display: block; |
||||
|
||||
.heart { |
||||
font-size: 14px; |
||||
} |
||||
} |
||||
} |
@ -0,0 +1,19 @@ |
||||
// ============================== |
||||
// Social |
||||
// ============================= |
||||
|
||||
.social-links { |
||||
text-align: center; |
||||
|
||||
.iconfont { |
||||
font-size: $social-icon-font-size; |
||||
|
||||
& + .iconfont { |
||||
margin-left: $social-link-margin-left; |
||||
} |
||||
|
||||
&:hover { |
||||
color: $theme-color; |
||||
} |
||||
} |
||||
} |
@ -0,0 +1,19 @@ |
||||
// ============================== |
||||
// Header |
||||
// ============================== |
||||
|
||||
.header { |
||||
@include clearfix; |
||||
padding: $header-padding; |
||||
|
||||
@import '_header/logo'; |
||||
@import '_header/menu'; |
||||
} |
||||
|
||||
|
||||
@include max-screen() { |
||||
.header { |
||||
padding: 50px 0 0; |
||||
text-align: center; |
||||
} |
||||
} |
@ -0,0 +1,18 @@ |
||||
// ============================== |
||||
// Logo |
||||
// ============================= |
||||
|
||||
.logo-wrapper { |
||||
float: left; |
||||
|
||||
.logo { |
||||
font-size: $logo-font-size; |
||||
font-family: $logo-font-family; |
||||
} |
||||
} |
||||
|
||||
@include max-screen() { |
||||
.logo-wrapper { |
||||
display: none; |
||||
} |
||||
} |
@ -0,0 +1,35 @@ |
||||
// ============================== |
||||
// Menu |
||||
// ============================= |
||||
|
||||
.site-navbar { |
||||
float: right; |
||||
|
||||
.menu { |
||||
display: inline-block; |
||||
position: relative; |
||||
padding-left: 0; |
||||
padding-right: 25px; |
||||
font-family: $global-serif-font-family; |
||||
|
||||
.menu-item { |
||||
display: inline-block; |
||||
|
||||
& + .menu-item { |
||||
margin-left: $menu-item-margin-left;; |
||||
} |
||||
|
||||
@include underline-from-center; |
||||
} |
||||
|
||||
.menu-item-link { |
||||
font-size: $menu-link-font-size; |
||||
} |
||||
} |
||||
} |
||||
|
||||
@include max-screen() { |
||||
.site-navbar { |
||||
display: none; |
||||
} |
||||
} |
@ -0,0 +1,102 @@ |
||||
// ============================== |
||||
// Iconfont |
||||
// ============================== |
||||
|
||||
@font-face { |
||||
font-family: 'iconfont'; /* project id 96542 */ |
||||
src: url('//at.alicdn.com/t/font_96542_ixz9jngnf1sb57b9.eot'); |
||||
src: url('//at.alicdn.com/t/font_96542_ixz9jngnf1sb57b9.eot?#iefix') format('embedded-opentype'), |
||||
url('//at.alicdn.com/t/font_96542_ixz9jngnf1sb57b9.woff') format('woff'), |
||||
url('//at.alicdn.com/t/font_96542_ixz9jngnf1sb57b9.ttf') format('truetype'), |
||||
url('//at.alicdn.com/t/font_96542_ixz9jngnf1sb57b9.svg#iconfont') format('svg'); |
||||
} |
||||
|
||||
.iconfont { |
||||
font-family: "iconfont" !important; |
||||
font-style: normal; |
||||
-webkit-font-smoothing: antialiased; |
||||
-webkit-text-stroke-width: 0.2px; |
||||
-moz-osx-font-smoothing: grayscale; |
||||
cursor: pointer; |
||||
} |
||||
|
||||
.icon-instagram:before { |
||||
font-size: .95em; |
||||
content: "\e611"; |
||||
position: relative; |
||||
top: -1px; |
||||
} |
||||
.icon-douban:before { |
||||
content: "\e610"; |
||||
} |
||||
.icon-tumblr:before { |
||||
content: "\e69f"; |
||||
font-size: .85em; |
||||
position: relative; |
||||
top: -4px; |
||||
} |
||||
.icon-linkedin:before { |
||||
content: "\e60d"; |
||||
position: relative; |
||||
top: -4px; |
||||
} |
||||
.icon-twitter:before { |
||||
content: "\e600"; |
||||
} |
||||
.icon-weibo:before { |
||||
content: "\e602"; |
||||
} |
||||
.icon-stack-overflow:before { |
||||
content: "\e603"; |
||||
font-size: .85em; |
||||
position: relative; |
||||
top: -4px; |
||||
} |
||||
.icon-email:before { |
||||
content: "\e605"; |
||||
position: relative; |
||||
top: -2px; |
||||
} |
||||
.icon-facebook:before { |
||||
content: "\e601"; |
||||
font-size: .95em; |
||||
position: relative; |
||||
top: -2px; |
||||
} |
||||
.icon-github:before { |
||||
content: "\e606"; |
||||
position: relative; |
||||
top: -3px; |
||||
} |
||||
.icon-rss:before { |
||||
content: "\e604"; |
||||
} |
||||
.icon-google:before { |
||||
content: "\e609"; |
||||
} |
||||
.icon-zhihu:before { |
||||
content: "\e607"; |
||||
font-size: .9em; |
||||
position: relative; |
||||
top: -2px; |
||||
} |
||||
.icon-pocket:before { |
||||
content: "\e856"; |
||||
} |
||||
|
||||
/* Generic Icon */ |
||||
.icon-heart:before { |
||||
content: "\e608"; |
||||
} |
||||
.icon-right:before { |
||||
content: "\e60a"; |
||||
} |
||||
.icon-left:before { |
||||
content: "\e60b"; |
||||
} |
||||
.icon-up:before { |
||||
content: "\e60c"; |
||||
} |
||||
.icon-close:before { |
||||
content: "\e60f"; |
||||
} |
@ -0,0 +1,4 @@ |
||||
.mjx-chtml:focus { |
||||
padding: 1px 0; |
||||
outline: none; |
||||
} |
@ -0,0 +1,77 @@ |
||||
// ============================== |
||||
// Mobile Navbar |
||||
// ============================== |
||||
|
||||
.mobile-navbar { |
||||
display: none; |
||||
position: fixed; |
||||
top: 0; |
||||
left: 0; |
||||
width: 100%; |
||||
height: $mobile-navbar-height; |
||||
background: $white; |
||||
box-shadow: 0px 2px 2px $gray; |
||||
text-align: center; |
||||
transition: transform 300ms ease; |
||||
z-index: 99; |
||||
|
||||
&.fixed-open { |
||||
transform: translate3d(180px, 0px, 0px); |
||||
} |
||||
|
||||
.mobile-header-logo { |
||||
display: inline-block; |
||||
margin-right: 50px; |
||||
|
||||
.logo { |
||||
font-size: 22px; |
||||
line-height: $mobile-navbar-height; |
||||
font-family: $logo-font-family; |
||||
} |
||||
} |
||||
|
||||
.mobile-navbar-icon { |
||||
color: $theme-color; |
||||
height: $mobile-navbar-height; |
||||
width: $mobile-navbar-height; |
||||
font-size: 24px; |
||||
text-align: center; |
||||
float: left; |
||||
position: relative; |
||||
transition: background 0.5s; |
||||
|
||||
@include mobile-menu-icon(); |
||||
} |
||||
} |
||||
|
||||
.mobile-menu { |
||||
background-color: rgba($deputy-color, 0.5); |
||||
|
||||
.mobile-menu-list { |
||||
position: relative; |
||||
list-style: none; |
||||
margin-top: 50px; |
||||
padding: 0; |
||||
border-top: 1px solid $deputy-color; |
||||
|
||||
.mobile-menu-item { |
||||
padding: 10px 30px; |
||||
border-bottom: 1px solid $deputy-color; |
||||
} |
||||
|
||||
a { |
||||
font-size: 18px; |
||||
font-family: $global-serif-font-family; |
||||
|
||||
&:hover { |
||||
color: $theme-color; |
||||
} |
||||
} |
||||
} |
||||
} |
||||
|
||||
@include max-screen() { |
||||
.mobile-navbar { |
||||
display: block; |
||||
} |
||||
} |
@ -0,0 +1,36 @@ |
||||
// ============================== |
||||
// Pagination |
||||
// ============================== |
||||
|
||||
.pagination { |
||||
margin: $pagination-margin; |
||||
@include clearfix; |
||||
|
||||
.prev, |
||||
.next { |
||||
font-weight: 600; |
||||
font-size: $pagination-font-size; |
||||
font-family: $global-serif-font-family; |
||||
transition-property: transform; |
||||
transition-timing-function: ease-out; |
||||
transition-duration: 0.3s; |
||||
} |
||||
|
||||
.prev { |
||||
float: left; |
||||
|
||||
&:hover { |
||||
color: $theme-color; |
||||
transform: translateX(-4px); |
||||
} |
||||
} |
||||
|
||||
.next { |
||||
float: right; |
||||
|
||||
&:hover { |
||||
color: $theme-color; |
||||
transform: translateX(4px); |
||||
} |
||||
} |
||||
} |
@ -0,0 +1,22 @@ |
||||
// ============================== |
||||
// Post |
||||
// ============================== |
||||
|
||||
.posts { |
||||
margin-bottom: $post-list-margin-bottom; |
||||
} |
||||
|
||||
.post { |
||||
padding: $post-padding; |
||||
|
||||
& + .post { |
||||
border-top: $post-border; |
||||
} |
||||
|
||||
@import '_post/header'; |
||||
@import '_post/toc'; |
||||
@import '_post/content'; |
||||
@import '_post/copyright'; |
||||
@import '_post/reward'; |
||||
@import '_post/footer'; |
||||
} |
@ -0,0 +1,166 @@ |
||||
code, pre { |
||||
padding: 7px; |
||||
font-size: $code-font-size; |
||||
font-family: $code-font-family; |
||||
background: $code-background; |
||||
} |
||||
|
||||
code { |
||||
padding: 3px 5px; |
||||
border-radius: 4px; |
||||
color: $code-color; |
||||
} |
||||
|
||||
.highlight { |
||||
margin: 1em 0; |
||||
border-radius: 5px; |
||||
overflow-x: auto; |
||||
box-shadow: 1px 1px 2px rgba(0,0,0,0.125); |
||||
position: relative; |
||||
|
||||
table { |
||||
position: relative; |
||||
max-width: none; |
||||
|
||||
&::after { |
||||
position: absolute; |
||||
top: 0; |
||||
right: 0; |
||||
left: 0; |
||||
padding: 2px 7px; |
||||
font-size: $code-font-size; |
||||
font-weight: bold; |
||||
color: darken($gray, 10%); |
||||
background: darken($code-background, 3%); |
||||
content: 'Code'; |
||||
} |
||||
} |
||||
|
||||
@each $sign, $text in $code-type-list { |
||||
&.#{$sign} > table::after { |
||||
content: $text; |
||||
} |
||||
|
||||
&.#{$sign} > figcaption > span::after { |
||||
content: ' · ' + $text; |
||||
} |
||||
|
||||
&.#{$sign} figcaption + table { |
||||
&::after { |
||||
display: none; |
||||
} |
||||
} |
||||
} |
||||
|
||||
figcaption { |
||||
position: absolute; |
||||
top: 0; |
||||
width: 100%; |
||||
padding: 2px 7px; |
||||
font-size: $code-font-size; |
||||
font-weight: bold; |
||||
color: darken($gray, 10%); |
||||
background: darken($code-background, 3%); |
||||
z-index: 20; |
||||
overflow-x: hidden; |
||||
box-sizing: border-box; |
||||
|
||||
& > a { |
||||
position: absolute; |
||||
right: 0; |
||||
display: inline-box; |
||||
margin-right: 7px; |
||||
font-weight: 400; |
||||
|
||||
&:hover { |
||||
text-decoration: none; |
||||
border: 0; |
||||
} |
||||
} |
||||
} |
||||
|
||||
.code { |
||||
pre { |
||||
margin: 0; |
||||
padding: 30px 10px 10px; |
||||
} |
||||
} |
||||
|
||||
.gutter { |
||||
width: 10px; |
||||
color: $gray; |
||||
|
||||
pre { |
||||
margin: 0; |
||||
padding: 30px 7px 10px; |
||||
} |
||||
} |
||||
|
||||
.line { |
||||
// Fix code block null line height and |
||||
// Synchronous gutter and code line highly. |
||||
height: round($code-font-size * 1.5); |
||||
} |
||||
|
||||
table, tr, td { |
||||
margin: 0; |
||||
padding: 0; |
||||
width: 100%; |
||||
border-collapse: collapse; |
||||
} |
||||
|
||||
.code { |
||||
.comment, |
||||
.quote { |
||||
color: map-get($code-highlight-color, comment); |
||||
} |
||||
|
||||
.keyword, |
||||
.selector-tag, |
||||
.addition { |
||||
color: map-get($code-highlight-color, keyword); |
||||
} |
||||
|
||||
.number, |
||||
.string, |
||||
.meta .meta-string, |
||||
.literal, |
||||
.doctag, |
||||
.regexp { |
||||
color: map-get($code-highlight-color, number); |
||||
} |
||||
|
||||
.title, |
||||
.section, |
||||
.name, |
||||
.selector-id, |
||||
.selector-class { |
||||
color: map-get($code-highlight-color, title); |
||||
} |
||||
|
||||
.attribute, |
||||
.attr, |
||||
.variable, |
||||
.template-variable, |
||||
.class .title, |
||||
.type { |
||||
color: map-get($code-highlight-color, attribute); |
||||
} |
||||
|
||||
.symbol, |
||||
.bullet, |
||||
.subst, |
||||
.meta, |
||||
.meta .keyword, |
||||
.selector-attr, |
||||
.selector-pseudo, |
||||
.link { |
||||
color: map-get($code-highlight-color, symbol); |
||||
} |
||||
|
||||
.built_in, |
||||
.deletion { |
||||
color: map-get($code-highlight-color, built_in); |
||||
} |
||||
} |
||||
} |
@ -0,0 +1,107 @@ |
||||
// ============================== |
||||
// Post content |
||||
// ============================== |
||||
|
||||
.post-content { |
||||
@for $i from 1 through 6 { |
||||
h#{$i} { |
||||
font-weight: 400; |
||||
font-family: $global-serif-font-family; |
||||
} |
||||
} |
||||
|
||||
.headerlink { |
||||
&:hover { |
||||
border-bottom: 0; |
||||
} |
||||
|
||||
@if $content-headings-anchor != "" { |
||||
&::before { |
||||
content: $content-headings-anchor; |
||||
margin-right: 5px; |
||||
font-size: 1.1em; |
||||
color: $theme-color; |
||||
} |
||||
} |
||||
} |
||||
|
||||
a { |
||||
color: $theme-color; |
||||
word-break: break-all; |
||||
|
||||
&:hover { |
||||
border-bottom: $content-link-border; |
||||
} |
||||
|
||||
&.fancybox { |
||||
border: 0; |
||||
} |
||||
} |
||||
|
||||
ul { |
||||
padding-left: 0; |
||||
list-style: inside; |
||||
|
||||
li { |
||||
input[type="checkbox"] { |
||||
margin-right: 5px; |
||||
} |
||||
} |
||||
} |
||||
|
||||
blockquote { |
||||
margin: 2em 0; |
||||
padding: 10px 20px; |
||||
position: relative; |
||||
color: rgba(#34495e, 0.8); |
||||
background-color: $content-blockquote-backgroud; |
||||
border-left: $content-blockquote-border-left; |
||||
box-shadow: 1px 1px 2px rgba(0,0,0,0.125); |
||||
|
||||
p { |
||||
margin: 0; |
||||
} |
||||
} |
||||
|
||||
img { |
||||
display: inline-block; |
||||
max-width: 100%; |
||||
} |
||||
|
||||
.table-responsive { |
||||
width: 100%; |
||||
margin-bottom: 20px; |
||||
overflow: auto; |
||||
border: 3px double $content-table-border-color; |
||||
} |
||||
|
||||
table { |
||||
width: 100%; |
||||
max-width: 100%; |
||||
border-spacing: 0; |
||||
box-shadow: 2px 2px 3px rgba(0,0,0,.125); |
||||
|
||||
thead { |
||||
background: $deputy-color; |
||||
} |
||||
|
||||
th, td { |
||||
padding: 5px 15px; |
||||
border: 1px double $content-table-border-color; |
||||
} |
||||
} |
||||
|
||||
@import 'code'; |
||||
|
||||
.read-more { |
||||
.read-more-link { |
||||
color: $theme-color; |
||||
font-size: 1.1em; |
||||
font-family: $global-serif-font-family; |
||||
|
||||
&:hover { |
||||
border-bottom: $post-readMore-border-bottom; |
||||
} |
||||
} |
||||
} |
||||
} |
@ -0,0 +1,13 @@ |
||||
.post-copyright { |
||||
margin-top: 20px; |
||||
padding-top: 10px; |
||||
border-top: 1px dashed $light-gray; |
||||
|
||||
.copyright-item { |
||||
margin: 5px 0; |
||||
|
||||
a { |
||||
color: $theme-color; |
||||
} |
||||
} |
||||
} |
@ -0,0 +1,74 @@ |
||||
// ============================== |
||||
// Post footer |
||||
// ============================== |
||||
|
||||
.post-footer { |
||||
margin-top: $post-footer-margin-top; |
||||
border-top: $post-footer-border-top; |
||||
font-family: $global-serif-font-family; |
||||
|
||||
.post-tags { |
||||
padding: $post-tags-padding; |
||||
|
||||
a { |
||||
margin-right: 5px; |
||||
color: $theme-color; |
||||
word-break: break-all; |
||||
|
||||
&::before { |
||||
content: '#'; |
||||
} |
||||
} |
||||
} |
||||
|
||||
.post-nav { |
||||
margin: 1em 0; |
||||
@include clearfix; |
||||
|
||||
.prev, |
||||
.next { |
||||
font-weight: 600; |
||||
font-size: $post-nav-font-size; |
||||
font-family: $global-serif-font-family; |
||||
transition-property: transform; |
||||
transition-timing-function: ease-out; |
||||
transition-duration: 0.3s; |
||||
} |
||||
|
||||
.prev { |
||||
float: left; |
||||
|
||||
&:hover { |
||||
color: $theme-color; |
||||
transform: translateX(-4px); |
||||
} |
||||
} |
||||
|
||||
.next { |
||||
float: right; |
||||
|
||||
&:hover { |
||||
color: $theme-color; |
||||
transform: translateX(4px); |
||||
} |
||||
} |
||||
|
||||
.nav-mobile { |
||||
display: none; |
||||
} |
||||
} |
||||
} |
||||
|
||||
@include max-screen() { |
||||
.post-footer { |
||||
.post-nav { |
||||
.nav-default { |
||||
display: none; |
||||
} |
||||
|
||||
.nav-mobile { |
||||
display: inline; |
||||
} |
||||
} |
||||
} |
||||
} |
@ -0,0 +1,57 @@ |
||||
.post-header { |
||||
margin-bottom: 20px; |
||||
|
||||
.post-title { |
||||
margin: 0; |
||||
font-size: $post-title-font-size; |
||||
font-weight: $post-title-font-weight; |
||||
font-family: $global-serif-font-family; |
||||
} |
||||
|
||||
.post-link { |
||||
@include underline-from-center; |
||||
} |
||||
|
||||
.post-meta { |
||||
.post-time { |
||||
font-size: 15px; |
||||
color: $post-meta-font-color; |
||||
} |
||||
|
||||
.post-category { |
||||
display: inline; |
||||
font-size: 14px; |
||||
color: $post-meta-font-color; |
||||
|
||||
&::before { |
||||
content: '·'; |
||||
} |
||||
|
||||
a { |
||||
color: inherit; |
||||
|
||||
& + a { |
||||
&::before { |
||||
content: '/'; |
||||
margin-right: 3px; |
||||
color: $post-meta-font-color !important; |
||||
} |
||||
} |
||||
|
||||
&:hover { |
||||
color: $theme-color; |
||||
} |
||||
} |
||||
} |
||||
|
||||
.post-visits { |
||||
display: inline-block; |
||||
font-size: 14px; |
||||
color: $post-meta-font-color; |
||||
|
||||
&::before { |
||||
content: '·'; |
||||
} |
||||
} |
||||
} |
||||
} |
@ -0,0 +1,48 @@ |
||||
.post-reward { |
||||
margin-top: 20px; |
||||
padding-top: 10px; |
||||
text-align: center; |
||||
border-top: 1px dashed $light-gray; |
||||
|
||||
.reward-button { |
||||
margin: 15px 0; |
||||
padding: 3px 7px; |
||||
display: inline-block; |
||||
color: $theme-color; |
||||
border: 1px solid $theme-color; |
||||
border-radius: 5px; |
||||
cursor: pointer; |
||||
|
||||
&:hover { |
||||
color: $white; |
||||
background-color: $theme-color; |
||||
transition: 0.5s; |
||||
} |
||||
} |
||||
|
||||
#reward:checked { |
||||
& ~ .qr-code { |
||||
display: block; |
||||
} |
||||
|
||||
& ~ .reward-button { |
||||
display: none; |
||||
} |
||||
} |
||||
|
||||
.qr-code { |
||||
display: none; |
||||
margin-top: 15px; |
||||
|
||||
.qr-code-image { |
||||
display: inline-block; |
||||
min-width: 200px; |
||||
width: 40%; |
||||
} |
||||
|
||||
.image { |
||||
width: 200px; |
||||
height: 200px; |
||||
} |
||||
} |
||||
} |
@ -0,0 +1,47 @@ |
||||
.post-toc { |
||||
position: absolute; |
||||
width: $post-toc-width; |
||||
margin-left: $post-toc-margin-left; |
||||
padding: 10px; |
||||
font-family: $global-serif-font-family; |
||||
border-radius: 5px; |
||||
background: $post-toc-backgroud; |
||||
box-shadow: 1px 1px 2px rgba(0,0,0,0.125); |
||||
word-wrap: break-word; |
||||
box-sizing: border-box; |
||||
|
||||
.post-toc-title { |
||||
margin: 0 10px; |
||||
font-size: $post-toc-title-size; |
||||
font-weight: 400; |
||||
text-transform: uppercase; |
||||
} |
||||
|
||||
.post-toc-content { |
||||
font-size: $post-toc-content; |
||||
|
||||
.toc, |
||||
.toc-child { |
||||
list-style: $post-toc-list-style; |
||||
} |
||||
|
||||
.toc { |
||||
margin: 10px 0; |
||||
padding-left: 20px; |
||||
|
||||
.toc-child { |
||||
padding-left: 15px; |
||||
} |
||||
} |
||||
|
||||
.toc-link.active { |
||||
color: $theme-color; |
||||
} |
||||
} |
||||
} |
||||
|
||||
@include max-screen($toc-max-sreen-width) { |
||||
.post-toc { |
||||
display: none; |
||||
} |
||||
} |
@ -0,0 +1,33 @@ |
||||
// ============================== |
||||
// slideout (https://github.com/mango/slideout) |
||||
// ============================== |
||||
|
||||
.slideout-menu { |
||||
position: fixed; |
||||
top: 0; |
||||
left: 0px; |
||||
bottom: 0; |
||||
width: 180px; |
||||
min-height: 100vh; |
||||
overflow-y: hidden; |
||||
-webkit-overflow-scrolling: touch; |
||||
z-index: 0; |
||||
display: none; |
||||
} |
||||
|
||||
.slideout-panel { |
||||
position: relative; |
||||
z-index: 1; |
||||
background-color: $white; |
||||
min-height: 100vh; |
||||
} |
||||
|
||||
.slideout-open, |
||||
.slideout-open body, |
||||
.slideout-open .slideout-panel { |
||||
overflow: hidden; |
||||
} |
||||
|
||||
.slideout-open .slideout-menu { |
||||
display: block; |
||||
} |
@ -0,0 +1,37 @@ |
||||
// ============================== |
||||
// Tags |
||||
// ============================= |
||||
|
||||
.tag-cloud { |
||||
margin: 2em 0 3em; |
||||
text-align: center; |
||||
font-family: $global-serif-font-family; |
||||
|
||||
.tag-cloud-title { |
||||
display: inline-block; |
||||
font-size: $tag-cloud-title-size; |
||||
color: $theme-color; |
||||
border-bottom: $tag-cloud-title-border-bottom; |
||||
} |
||||
|
||||
.tag-cloud-tags { |
||||
margin: 10px 0; |
||||
|
||||
a { |
||||
display: inline-block; |
||||
position: relative; |
||||
margin: $tag-cloud-tags-link-margin; |
||||
word-wrap: break-word; |
||||
transition-duration: 0.2s; |
||||
transition-property: transform; |
||||
transition-timing-function: ease-out; |
||||
|
||||
&:active, |
||||
&:focus, |
||||
&:hover { |
||||
color: $theme-color; |
||||
transform: scale(1.1); |
||||
} |
||||
} |
||||
} |
||||
} |
@ -0,0 +1,314 @@ |
||||
// ============================== |
||||
// Variables |
||||
// ============================== |
||||
|
||||
// ========== Theme Color ========== // |
||||
// Theme color config from `even/_config.yml` |
||||
$theme-color-config: to-lower-case(hexo-theme-config('color')); |
||||
|
||||
// Default theme color map |
||||
$theme-color-map: ( |
||||
'default': #c05b4d #f8f5ec, |
||||
'mint green': #16982B #f5f5f5, |
||||
'cobalt blue': #0047AB #f0f2f5, |
||||
'hot pink': #FF69B4 #f8f5f5, |
||||
'dark violet': #9932CC #f5f4fa |
||||
); |
||||
|
||||
// Check theme color config. |
||||
// if it does not exist, use default theme color. |
||||
@if not(map-has-key($theme-color-map, $theme-color-config)) { |
||||
$theme-color-config: 'default'; |
||||
} |
||||
$theme-color-list: map-get($theme-color-map, $theme-color-config); |
||||
|
||||
// Default theme color of the site. |
||||
$theme-color: nth($theme-color-list, 1) !default; |
||||
|
||||
// Deputy theme color of the site. |
||||
$deputy-color: nth($theme-color-list, 2) !default; |
||||
|
||||
// ========== Color ========== // |
||||
$black: #0a0a0a !default; |
||||
$white: #fefefe !default; |
||||
$light-gray: #e6e6e6 !default; |
||||
$gray: #cacaca !default; |
||||
$dark-gray: #8a8a8a !default; |
||||
|
||||
|
||||
// ========== Global ========== // |
||||
// Text color of the body. |
||||
$global-font-color: #34495e !default; |
||||
|
||||
// Font size attribute applied to '<html>' and '<body>'. |
||||
$global-font-size: 16px !default; |
||||
|
||||
// Global width of '<body>'. |
||||
$global-body-width: 800px !default; |
||||
|
||||
// Padding of container main |
||||
$global-container-padding: 0 20px !default; |
||||
|
||||
// Default line height for all type. `$global-lineheight` is 24px while `$global-font-size` is 16px. |
||||
$global-lineheight: 1.5 !default; |
||||
|
||||
// Font family of the site. |
||||
$global-font-family: 'Source Sans Pro', 'Helvetica Neue', Arial, sans-serif !default; |
||||
|
||||
// Serif font family of the site. |
||||
$global-serif-font-family: Athelas, STHeiti, Microsoft Yahei, serif !default; |
||||
|
||||
// Background color of the site. |
||||
$global-background: $white !default; |
||||
|
||||
// Headings font size of the site. |
||||
$global-headings: ( |
||||
h1: 26px, |
||||
h2: 24px, |
||||
h3: 20px, |
||||
h4: 16px, |
||||
h5: 14px, |
||||
h6: 14px |
||||
) !default; |
||||
|
||||
|
||||
// ========== Header ========== // |
||||
// Padding of the site header. |
||||
$header-padding: 20px 20px !default; |
||||
|
||||
// Font family: Chancery |
||||
@font-face { |
||||
font-family: 'Chancery'; |
||||
src: url('../fonts/chancery/apple-chancery-webfont.eot'); |
||||
src: local('Apple Chancery'), url('../fonts/chancery/apple-chancery-webfont.eot?#iefix') format('embedded-opentype'), |
||||
url('../fonts/chancery/apple-chancery-webfont.woff2') format('woff2'), |
||||
url('../fonts/chancery/apple-chancery-webfont.woff') format('woff'), |
||||
url('../fonts/chancery/apple-chancery-webfont.ttf') format('truetype'), |
||||
url('../fonts/chancery/apple-chancery-webfont.svg#apple-chancery') format('svg'); |
||||
font-weight: lighter; |
||||
font-style: normal; |
||||
} |
||||
|
||||
// Font size of the logo. |
||||
$logo-font-size: 48px !default; |
||||
|
||||
// Font family of the logo. |
||||
$logo-font-family: 'Chancery', cursive, LiSu, sans-serif !default; |
||||
|
||||
// Margin of menu item. |
||||
$menu-item-margin-left: 10px !default; |
||||
|
||||
// Margin of menu item in mobile. |
||||
$menu-item-mobile-margin: 5px !default; |
||||
|
||||
// Font size of menu item link. |
||||
$menu-link-font-size: 18px !default; |
||||
|
||||
// Height of the mobile header. |
||||
$mobile-navbar-height: 50px !default; |
||||
|
||||
// ========== Post ========== // |
||||
// Margin bottom of post list. |
||||
$post-list-margin-bottom: 20px !default; |
||||
|
||||
// Padding of the post. |
||||
$post-padding: 1.5em 0 !default; |
||||
|
||||
// Border top of the post + post. |
||||
$post-border: 1px solid $light-gray !default; |
||||
|
||||
// Font size of post title. |
||||
$post-title-font-size: 27px !default; |
||||
|
||||
// Font weight of post title. |
||||
$post-title-font-weight: 400 !default; |
||||
|
||||
// Margin top of the post meta (post time). |
||||
$post-meta-margin-top: 5px !default; |
||||
|
||||
// Font color of the post meta. |
||||
$post-meta-font-color: $dark-gray !default; |
||||
|
||||
// Border bottom of the read more link when hover it. |
||||
$post-readMore-border-bottom: 1px solid $theme-color !default; |
||||
|
||||
// Margin top of the post footer. |
||||
$post-footer-margin-top: 20px !default; |
||||
|
||||
// Border top of post footer. |
||||
$post-footer-border-top: 1px solid $light-gray !default; |
||||
|
||||
// Padding of the post tags. |
||||
$post-tags-padding: 15px 0 !default; |
||||
|
||||
// Font size of post pagination. |
||||
$post-nav-font-size: 18px !default; |
||||
|
||||
|
||||
// ========== TOC ========== // |
||||
// Width of the post toc. |
||||
$post-toc-width: 200px !default; |
||||
|
||||
// Backgroud color of the post toc. |
||||
$post-toc-backgroud: rgba($deputy-color, 0.6) !default; |
||||
|
||||
// Margin left of the post toc. |
||||
$post-toc-margin-left: $global-body-width - 15px !default; |
||||
|
||||
// Font size of the post toc title. |
||||
$post-toc-title-size: 20px !default; |
||||
|
||||
// Font size of the post toc content. |
||||
$post-toc-content: 15px !default; |
||||
|
||||
// List style of the post toc list. |
||||
$post-toc-list-style: square !default; |
||||
|
||||
// Max screen media of the post toc. |
||||
$toc-max-sreen-width: 2 * $post-toc-width + $post-toc-margin-left !default; |
||||
|
||||
// ========== Content ========== // |
||||
// Headings anchor. |
||||
$content-headings-anchor: "" !default; |
||||
|
||||
// Border bottom of the link when hover it. |
||||
$content-link-border: 1px solid $theme-color !default; |
||||
|
||||
// Background color of the blockquote. |
||||
$content-blockquote-backgroud: rgba($theme-color, 0.05) !default; |
||||
|
||||
// Border left of the blockquote. |
||||
$content-blockquote-border-left: 3px solid rgba($theme-color, 0.3) !default; |
||||
|
||||
// Border color of the table. |
||||
$content-table-border-color: darken($deputy-color, 3%) !default; |
||||
|
||||
// ========== Code ========== // |
||||
// Color of the code. |
||||
$code-color: #c7254e !default; |
||||
|
||||
// Font size of code. |
||||
$code-font-size: 13px !default; |
||||
|
||||
// Font family of the code. |
||||
$code-font-family: Consolas, Monaco, Menlo, Consolas, monospace !default; |
||||
|
||||
// Color of code highlight, solarized. |
||||
$code-highlight-color: ( |
||||
comment: #93a1a1, |
||||
keyword: #859900, |
||||
number: #2aa198, |
||||
title: #268bd2, |
||||
attribute: #b58900, |
||||
symbol: #cb4b16, |
||||
built_in: #dc322f |
||||
) !default; |
||||
|
||||
// Code type list. |
||||
$code-type-list: ( |
||||
html: "HTML", |
||||
js: "JavaScript", |
||||
bash: "Bash", |
||||
css: "CSS", |
||||
scss: "Scss", |
||||
java: "Java", |
||||
xml: "XML", |
||||
python: "Python", |
||||
json: "JSON", |
||||
swift: "Swift", |
||||
ruby: "Ruby", |
||||
php: "PHP", |
||||
c: "C", |
||||
cpp: "C++", |
||||
scheme: "Scheme", |
||||
objectivec: "Objective-C", |
||||
yml: "YAML", |
||||
stylus: "Stylus", |
||||
sql: "SQL", |
||||
http: "HTTP", |
||||
go: "Go", |
||||
kotlin: "Kotlin" |
||||
) !default; |
||||
|
||||
// Color of the code background. |
||||
$code-background: $deputy-color !default; |
||||
|
||||
|
||||
// ========== Pagination ========== // |
||||
// Margin of the pagination. |
||||
$pagination-margin: 2em 0 !default; |
||||
|
||||
// Font size of the pagination (Without post, post pagination see line 140). |
||||
$pagination-font-size: 20px !default; |
||||
|
||||
|
||||
// ========== Footer ========== // |
||||
// Margin top of the footer. |
||||
$footer-margin-top: 2em !default; |
||||
|
||||
// Margin left of the social link. |
||||
$social-link-margin-left: 10px !default; |
||||
|
||||
// Font size of the social icon. |
||||
$social-icon-font-size: 30px !default; |
||||
|
||||
// Margin of the copyright. |
||||
$copyright-margin: 10px 0 !default; |
||||
|
||||
|
||||
// ========== Archive ========== // |
||||
// Margin of the archive. |
||||
$archive-margin: 2em 0px !default; |
||||
|
||||
// Max width of the archive. |
||||
$archive-max-width: 550px !default; |
||||
|
||||
// Font size of the archive name. |
||||
$archive-name-font-size: 30px !default; |
||||
|
||||
// Font size of the collection title. |
||||
$collection-title-font-size: 28px !default; |
||||
|
||||
// Padding of the archive post. |
||||
$archive-post-padding: 3px 20px !default; |
||||
|
||||
// Padding of the archive post in mobile. |
||||
$archive-post-mobile-padding: 5px 10px !default; |
||||
|
||||
// Font size of the archive post time in mobile. |
||||
$archive-post-mobile-time-font-size: 13px !default; |
||||
|
||||
// Border left of the archive post, use $archive-post-hover-border-left when hover it. |
||||
$archive-post-border-left: 1px solid $gray !default; |
||||
$archive-post-hover-border-left: 3px solid $theme-color !default; |
||||
|
||||
// Transition of the archive post when hover it. |
||||
$archive-post-hover-transition: 0.2s ease-out !default; |
||||
|
||||
// Transform of the archive post when hover it. |
||||
$archive-post-hover-transform: translateX(4px) !default; |
||||
|
||||
|
||||
// ========== Tags ========== // |
||||
// Font soze of the tag cloud title. |
||||
$tag-cloud-title-size: 18px !default; |
||||
|
||||
// Border bottom of the tag cloud title. |
||||
$tag-cloud-title-border-bottom: 2px solid $theme-color !default; |
||||
|
||||
// Margin of the tag cloud tags link. |
||||
$tag-cloud-tags-link-margin: 5px 10px !default; |
||||
|
||||
|
||||
// ========== Categories ========== // |
||||
// Font soze of the categories title. |
||||
$categories-title-size: 18px !default; |
||||
|
||||
// Border bottom of the categories title. |
||||
$categories-title-border-bottom: 2px solid $theme-color !default; |
||||
|
||||
// Margin of the categories tags link. |
||||
$categories-tags-link-margin: 5px 10px !default; |
||||
|
||||
// Font size of the category count |
||||
$category-count-font-size: 12px !default; |
@ -0,0 +1,19 @@ |
||||
@import "_variables"; |
||||
@import "_custom/custom"; |
||||
|
||||
@import "_common/utils"; |
||||
@import "_common/animation"; |
||||
|
||||
@import "_base"; |
||||
@import "_partial/header"; |
||||
@import "_partial/post"; |
||||
@import "_partial/pagination"; |
||||
@import "_partial/footer"; |
||||
@import "_partial/archive"; |
||||
@import "_partial/tags"; |
||||
@import "_partial/categories"; |
||||
@import "_partial/iconfont"; |
||||
@import "_partial/slideout"; |
||||
@import "_partial/mobile"; |
||||
@import "_partial/back-to-top"; |
||||
@import "_partial/mathjax"; |
After Width: | Height: | Size: 17 KiB |
After Width: | Height: | Size: 72 KiB |
@ -0,0 +1,253 @@ |
||||
(function (window) { |
||||
'use strict'; |
||||
|
||||
function Kayo(config) { |
||||
this.config = config; |
||||
} |
||||
|
||||
Kayo.prototype.setup = function() { |
||||
var leancloud = this.config.leancloud; |
||||
|
||||
this.navbar(); |
||||
this.responsiveTable(); |
||||
|
||||
if (this.config.toc) { |
||||
this.scrollToc(); |
||||
this.tocFollow(); |
||||
} |
||||
if (this.config.fancybox) { |
||||
this.fancybox(); |
||||
} |
||||
if (leancloud.app_id && leancloud.app_key) { |
||||
this.recordReadings(); |
||||
} |
||||
if(this.config.latex) { |
||||
this.renderLaTeX(); |
||||
} |
||||
this.backToTop(); |
||||
}; |
||||
|
||||
Kayo.prototype.navbar = function () { |
||||
var $nav = $('#mobile-navbar'); |
||||
var $navIcon = $('.mobile-navbar-icon'); |
||||
|
||||
var slideout = new Slideout({ |
||||
'panel': document.getElementById('mobile-panel'), |
||||
'menu': document.getElementById('mobile-menu'), |
||||
'padding': 180, |
||||
'tolerance': 70 |
||||
}); |
||||
slideout.disableTouch(); |
||||
|
||||
$navIcon.click(function () { |
||||
slideout.toggle(); |
||||
}); |
||||
|
||||
slideout.on('beforeopen', function () { |
||||
$nav.addClass('fixed-open'); |
||||
$navIcon.addClass('icon-click').removeClass('icon-out'); |
||||
}); |
||||
|
||||
slideout.on('beforeclose', function () { |
||||
$nav.removeClass('fixed-open'); |
||||
$navIcon.addClass('icon-out').removeClass('icon-click'); |
||||
}); |
||||
|
||||
$('#mobile-panel').on('touchend', function () { |
||||
slideout.isOpen() && $navIcon.click(); |
||||
}); |
||||
}; |
||||
|
||||
Kayo.prototype.responsiveTable = function () { |
||||
var tables = $('.post-content > table') |
||||
tables.wrap('<div class="table-responsive">') |
||||
}; |
||||
|
||||
Kayo.prototype.scrollToc = function () { |
||||
var SPACING = 20; |
||||
var $toc = $('.post-toc'); |
||||
var $footer = $('.post-footer'); |
||||
|
||||
if ($toc.length) { |
||||
var minScrollTop = $toc.offset().top - SPACING; |
||||
var maxScrollTop = $footer.offset().top - $toc.height() - SPACING; |
||||
|
||||
var tocState = { |
||||
start: { |
||||
'position': 'absolute', |
||||
'top': minScrollTop |
||||
}, |
||||
process: { |
||||
'position': 'fixed', |
||||
'top': SPACING |
||||
}, |
||||
end: { |
||||
'position': 'absolute', |
||||
'top': maxScrollTop |
||||
} |
||||
} |
||||
|
||||
$(window).scroll(function () { |
||||
var scrollTop = $(window).scrollTop(); |
||||
|
||||
if (scrollTop < minScrollTop) { |
||||
$toc.css(tocState.start); |
||||
} else if (scrollTop > maxScrollTop) { |
||||
$toc.css(tocState.end); |
||||
} else { |
||||
$toc.css(tocState.process); |
||||
} |
||||
}) |
||||
} |
||||
}; |
||||
|
||||
Kayo.prototype.tocFollow = function () { |
||||
var HEADERFIX = 30; |
||||
var $toclink = $('.toc-link'), |
||||
$headerlink = $('.headerlink'); |
||||
|
||||
$(window).scroll(function () { |
||||
var headerlinkTop = $.map($headerlink, function (link) { |
||||
return $(link).offset().top; |
||||
}); |
||||
var scrollTop = $(window).scrollTop(); |
||||
|
||||
for (var i = 0; i < $toclink.length; i++) { |
||||
var isLastOne = i + 1 === $toclink.length, |
||||
currentTop = headerlinkTop[i] - HEADERFIX, |
||||
nextTop = isLastOne ? Infinity : headerlinkTop[i + 1] - HEADERFIX; |
||||
|
||||
if (currentTop < scrollTop && scrollTop <= nextTop) { |
||||
$($toclink[i]).addClass('active'); |
||||
} else { |
||||
$($toclink[i]).removeClass('active'); |
||||
} |
||||
} |
||||
}); |
||||
}; |
||||
|
||||
Kayo.prototype.fancybox = function () { |
||||
if ($.fancybox) { |
||||
$('.post').each(function () { |
||||
$(this).find('img').each(function () { |
||||
var href = 'href="' + this.src + '"'; |
||||
var title = 'title="' + this.alt + '"'; |
||||
$(this).wrap('<a class="fancybox" ' + href + ' ' + title + '></a>'); |
||||
}); |
||||
}); |
||||
|
||||
$('.fancybox').fancybox({ |
||||
openEffect: 'elastic', |
||||
closeEffect: 'elastic' |
||||
}); |
||||
} |
||||
}; |
||||
|
||||
Kayo.prototype.recordReadings = function () { |
||||
if (typeof AV !== 'object') return; |
||||
|
||||
var $visits = $('.post-visits'); |
||||
var Counter = AV.Object.extend('Counter'); |
||||
if ($visits.length === 1) { |
||||
addCounter(Counter); |
||||
} else { |
||||
showTime(Counter); |
||||
} |
||||
|
||||
function updateVisits(dom, time) { |
||||
var readText = dom.text().replace(/(\d+)/i, time) |
||||
dom.text(readText); |
||||
} |
||||
|
||||
function addCounter(Counter) { |
||||
var query = new AV.Query(Counter); |
||||
|
||||
var url = $visits.data('url').trim(); |
||||
var title = $visits.data('title').trim(); |
||||
|
||||
query.equalTo('url', url); |
||||
query.find().then(function (results) { |
||||
if (results.length > 0) { |
||||
var counter = results[0]; |
||||
counter.save(null, { |
||||
fetchWhenSave: true |
||||
}).then(function (counter) { |
||||
counter.increment('time', 1); |
||||
return counter.save(); |
||||
}).then(function (counter) { |
||||
updateVisits($visits, counter.get('time')); |
||||
}); |
||||
} else { |
||||
var newcounter = new Counter(); |
||||
newcounter.set('title', title); |
||||
newcounter.set('url', url); |
||||
newcounter.set('time', 1); |
||||
|
||||
var acl = new AV.ACL(); |
||||
acl.setWriteAccess('*', true) |
||||
acl.setReadAccess('*', true) |
||||
newcounter.setACL(acl) |
||||
|
||||
newcounter.save().then(function () { |
||||
updateVisits($visits, newcounter.get('time')); |
||||
}); |
||||
} |
||||
}, function (error) { |
||||
// eslint-disable-next-line
|
||||
console.log('Error:' + error.code + ' ' + error.message); |
||||
}); |
||||
} |
||||
|
||||
function showTime(Counter) { |
||||
$visits.each(function () { |
||||
var $this = $(this); |
||||
var query = new AV.Query(Counter); |
||||
var url = $this.data('url').trim(); |
||||
|
||||
query.equalTo('url', url); |
||||
query.find().then(function (results) { |
||||
if (results.length === 0) { |
||||
updateVisits($this, 0); |
||||
} else { |
||||
var counter = results[0]; |
||||
updateVisits($this, counter.get('time')); |
||||
} |
||||
}, function (error) { |
||||
// eslint-disable-next-line
|
||||
console.log('Error:' + error.code + ' ' + error.message); |
||||
}); |
||||
}) |
||||
} |
||||
}; |
||||
|
||||
Kayo.prototype.backToTop = function () { |
||||
var $backToTop = $('#back-to-top'); |
||||
|
||||
$(window).scroll(function () { |
||||
if ($(window).scrollTop() > 100) { |
||||
$backToTop.fadeIn(1000); |
||||
} else { |
||||
$backToTop.fadeOut(1000); |
||||
} |
||||
}); |
||||
|
||||
$backToTop.click(function () { |
||||
$('body,html').animate({ scrollTop: 0 }); |
||||
}); |
||||
}; |
||||
|
||||
Kayo.prototype.renderLaTeX = function () { |
||||
var loopID = setInterval(function () { |
||||
if(window.MathJax) { |
||||
var jax = window.MathJax; |
||||
jax.Hub.Config({ tex2jax: { inlineMath: [['$', '$'], ['\\(', '\\)']] }}); |
||||
jax.Hub.Queue(['Typeset', jax.Hub, $(document.body)[0]]); |
||||
clearInterval(loopID); |
||||
} |
||||
}, 500); |
||||
} |
||||
|
||||
var config = window.config; |
||||
var kayo = new Kayo(config); |
||||
kayo.setup(); |
||||
}(window)) |
After Width: | Height: | Size: 43 B |
After Width: | Height: | Size: 6.4 KiB |
After Width: | Height: | Size: 14 KiB |
After Width: | Height: | Size: 1003 B |
After Width: | Height: | Size: 1.3 KiB |
After Width: | Height: | Size: 6.4 KiB |
After Width: | Height: | Size: 1.1 KiB |
@ -0,0 +1,97 @@ |
||||
#fancybox-buttons { |
||||
position: fixed; |
||||
left: 0; |
||||
width: 100%; |
||||
z-index: 8050; |
||||
} |
||||
|
||||
#fancybox-buttons.top { |
||||
top: 10px; |
||||
} |
||||
|
||||
#fancybox-buttons.bottom { |
||||
bottom: 10px; |
||||
} |
||||
|
||||
#fancybox-buttons ul { |
||||
display: block; |
||||
width: 166px; |
||||
height: 30px; |
||||
margin: 0 auto; |
||||
padding: 0; |
||||
list-style: none; |
||||
border: 1px solid #111; |
||||
border-radius: 3px; |
||||
-webkit-box-shadow: inset 0 0 0 1px rgba(255,255,255,.05); |
||||
-moz-box-shadow: inset 0 0 0 1px rgba(255,255,255,.05); |
||||
box-shadow: inset 0 0 0 1px rgba(255,255,255,.05); |
||||
background: rgb(50,50,50); |
||||
background: -moz-linear-gradient(top, rgb(68,68,68) 0%, rgb(52,52,52) 50%, rgb(41,41,41) 50%, rgb(51,51,51) 100%); |
||||
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,rgb(68,68,68)), color-stop(50%,rgb(52,52,52)), color-stop(50%,rgb(41,41,41)), color-stop(100%,rgb(51,51,51))); |
||||
background: -webkit-linear-gradient(top, rgb(68,68,68) 0%,rgb(52,52,52) 50%,rgb(41,41,41) 50%,rgb(51,51,51) 100%); |
||||
background: -o-linear-gradient(top, rgb(68,68,68) 0%,rgb(52,52,52) 50%,rgb(41,41,41) 50%,rgb(51,51,51) 100%); |
||||
background: -ms-linear-gradient(top, rgb(68,68,68) 0%,rgb(52,52,52) 50%,rgb(41,41,41) 50%,rgb(51,51,51) 100%); |
||||
background: linear-gradient(top, rgb(68,68,68) 0%,rgb(52,52,52) 50%,rgb(41,41,41) 50%,rgb(51,51,51) 100%); |
||||
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#444444', endColorstr='#222222',GradientType=0 ); |
||||
} |
||||
|
||||
#fancybox-buttons ul li { |
||||
float: left; |
||||
margin: 0; |
||||
padding: 0; |
||||
} |
||||
|
||||
#fancybox-buttons a { |
||||
display: block; |
||||
width: 30px; |
||||
height: 30px; |
||||
text-indent: -9999px; |
||||
background-color: transparent; |
||||
background-image: url('fancybox_buttons.png'); |
||||
background-repeat: no-repeat; |
||||
outline: none; |
||||
opacity: 0.8; |
||||
} |
||||
|
||||
#fancybox-buttons a:hover { |
||||
opacity: 1; |
||||
} |
||||
|
||||
#fancybox-buttons a.btnPrev { |
||||
background-position: 5px 0; |
||||
} |
||||
|
||||
#fancybox-buttons a.btnNext { |
||||
background-position: -33px 0; |
||||
border-right: 1px solid #3e3e3e; |
||||
} |
||||
|
||||
#fancybox-buttons a.btnPlay { |
||||
background-position: 0 -30px; |
||||
} |
||||
|
||||
#fancybox-buttons a.btnPlayOn { |
||||
background-position: -30px -30px; |
||||
} |
||||
|
||||
#fancybox-buttons a.btnToggle { |
||||
background-position: 3px -60px; |
||||
border-left: 1px solid #111; |
||||
border-right: 1px solid #3e3e3e; |
||||
width: 35px |
||||
} |
||||
|
||||
#fancybox-buttons a.btnToggleOn { |
||||
background-position: -27px -60px; |
||||
} |
||||
|
||||
#fancybox-buttons a.btnClose { |
||||
border-left: 1px solid #111; |
||||
width: 35px; |
||||
background-position: -56px 0px; |
||||
} |
||||
|
||||
#fancybox-buttons a.btnDisabled { |
||||
opacity : 0.4; |
||||
cursor: default; |
||||
} |
@ -0,0 +1,122 @@ |
||||
/*! |
||||
* Buttons helper for fancyBox |
||||
* version: 1.0.5 (Mon, 15 Oct 2012) |
||||
* @requires fancyBox v2.0 or later |
||||
* |
||||
* Usage: |
||||
* $(".fancybox").fancybox({ |
||||
* helpers : { |
||||
* buttons: { |
||||
* position : 'top' |
||||
* } |
||||
* } |
||||
* }); |
||||
* |
||||
*/ |
||||
(function ($) { |
||||
//Shortcut for fancyBox object
|
||||
var F = $.fancybox; |
||||
|
||||
//Add helper object
|
||||
F.helpers.buttons = { |
||||
defaults : { |
||||
skipSingle : false, // disables if gallery contains single image
|
||||
position : 'top', // 'top' or 'bottom'
|
||||
tpl : '<div id="fancybox-buttons"><ul><li><a class="btnPrev" title="Previous" href="javascript:;"></a></li><li><a class="btnPlay" title="Start slideshow" href="javascript:;"></a></li><li><a class="btnNext" title="Next" href="javascript:;"></a></li><li><a class="btnToggle" title="Toggle size" href="javascript:;"></a></li><li><a class="btnClose" title="Close" href="javascript:;"></a></li></ul></div>' |
||||
}, |
||||
|
||||
list : null, |
||||
buttons: null, |
||||
|
||||
beforeLoad: function (opts, obj) { |
||||
//Remove self if gallery do not have at least two items
|
||||
|
||||
if (opts.skipSingle && obj.group.length < 2) { |
||||
obj.helpers.buttons = false; |
||||
obj.closeBtn = true; |
||||
|
||||
return; |
||||
} |
||||
|
||||
//Increase top margin to give space for buttons
|
||||
obj.margin[ opts.position === 'bottom' ? 2 : 0 ] += 30; |
||||
}, |
||||
|
||||
onPlayStart: function () { |
||||
if (this.buttons) { |
||||
this.buttons.play.attr('title', 'Pause slideshow').addClass('btnPlayOn'); |
||||
} |
||||
}, |
||||
|
||||
onPlayEnd: function () { |
||||
if (this.buttons) { |
||||
this.buttons.play.attr('title', 'Start slideshow').removeClass('btnPlayOn'); |
||||
} |
||||
}, |
||||
|
||||
afterShow: function (opts, obj) { |
||||
var buttons = this.buttons; |
||||
|
||||
if (!buttons) { |
||||
this.list = $(opts.tpl).addClass(opts.position).appendTo('body'); |
||||
|
||||
buttons = { |
||||
prev : this.list.find('.btnPrev').click( F.prev ), |
||||
next : this.list.find('.btnNext').click( F.next ), |
||||
play : this.list.find('.btnPlay').click( F.play ), |
||||
toggle : this.list.find('.btnToggle').click( F.toggle ), |
||||
close : this.list.find('.btnClose').click( F.close ) |
||||
} |
||||
} |
||||
|
||||
//Prev
|
||||
if (obj.index > 0 || obj.loop) { |
||||
buttons.prev.removeClass('btnDisabled'); |
||||
} else { |
||||
buttons.prev.addClass('btnDisabled'); |
||||
} |
||||
|
||||
//Next / Play
|
||||
if (obj.loop || obj.index < obj.group.length - 1) { |
||||
buttons.next.removeClass('btnDisabled'); |
||||
buttons.play.removeClass('btnDisabled'); |
||||
|
||||
} else { |
||||
buttons.next.addClass('btnDisabled'); |
||||
buttons.play.addClass('btnDisabled'); |
||||
} |
||||
|
||||
this.buttons = buttons; |
||||
|
||||
this.onUpdate(opts, obj); |
||||
}, |
||||
|
||||
onUpdate: function (opts, obj) { |
||||
var toggle; |
||||
|
||||
if (!this.buttons) { |
||||
return; |
||||
} |
||||
|
||||
toggle = this.buttons.toggle.removeClass('btnDisabled btnToggleOn'); |
||||
|
||||
//Size toggle button
|
||||
if (obj.canShrink) { |
||||
toggle.addClass('btnToggleOn'); |
||||
|
||||
} else if (!obj.canExpand) { |
||||
toggle.addClass('btnDisabled'); |
||||
} |
||||
}, |
||||
|
||||
beforeClose: function () { |
||||
if (this.list) { |
||||
this.list.remove(); |
||||
} |
||||
|
||||
this.list = null; |
||||
this.buttons = null; |
||||
} |
||||
}; |
||||
|
||||
}(jQuery)); |
@ -0,0 +1,199 @@ |
||||
/*! |
||||
* Media helper for fancyBox |
||||
* version: 1.0.6 (Fri, 14 Jun 2013) |
||||
* @requires fancyBox v2.0 or later |
||||
* |
||||
* Usage: |
||||
* $(".fancybox").fancybox({ |
||||
* helpers : { |
||||
* media: true |
||||
* } |
||||
* }); |
||||
* |
||||
* Set custom URL parameters: |
||||
* $(".fancybox").fancybox({ |
||||
* helpers : { |
||||
* media: { |
||||
* youtube : { |
||||
* params : { |
||||
* autoplay : 0 |
||||
* } |
||||
* } |
||||
* } |
||||
* } |
||||
* }); |
||||
* |
||||
* Or: |
||||
* $(".fancybox").fancybox({, |
||||
* helpers : { |
||||
* media: true |
||||
* }, |
||||
* youtube : { |
||||
* autoplay: 0 |
||||
* } |
||||
* }); |
||||
* |
||||
* Supports: |
||||
* |
||||
* Youtube |
||||
* http://www.youtube.com/watch?v=opj24KnzrWo
|
||||
* http://www.youtube.com/embed/opj24KnzrWo
|
||||
* http://youtu.be/opj24KnzrWo
|
||||
* http://www.youtube-nocookie.com/embed/opj24KnzrWo
|
||||
* Vimeo |
||||
* http://vimeo.com/40648169
|
||||
* http://vimeo.com/channels/staffpicks/38843628
|
||||
* http://vimeo.com/groups/surrealism/videos/36516384
|
||||
* http://player.vimeo.com/video/45074303
|
||||
* Metacafe |
||||
* http://www.metacafe.com/watch/7635964/dr_seuss_the_lorax_movie_trailer/
|
||||
* http://www.metacafe.com/watch/7635964/
|
||||
* Dailymotion |
||||
* http://www.dailymotion.com/video/xoytqh_dr-seuss-the-lorax-premiere_people
|
||||
* Twitvid |
||||
* http://twitvid.com/QY7MD
|
||||
* Twitpic |
||||
* http://twitpic.com/7p93st
|
||||
* Instagram |
||||
* http://instagr.am/p/IejkuUGxQn/
|
||||
* http://instagram.com/p/IejkuUGxQn/
|
||||
* Google maps |
||||
* http://maps.google.com/maps?q=Eiffel+Tower,+Avenue+Gustave+Eiffel,+Paris,+France&t=h&z=17
|
||||
* http://maps.google.com/?ll=48.857995,2.294297&spn=0.007666,0.021136&t=m&z=16
|
||||
* http://maps.google.com/?ll=48.859463,2.292626&spn=0.000965,0.002642&t=m&z=19&layer=c&cbll=48.859524,2.292532&panoid=YJ0lq28OOy3VT2IqIuVY0g&cbp=12,151.58,,0,-15.56
|
||||
*/ |
||||
(function ($) { |
||||
"use strict"; |
||||
|
||||
//Shortcut for fancyBox object
|
||||
var F = $.fancybox, |
||||
format = function( url, rez, params ) { |
||||
params = params || ''; |
||||
|
||||
if ( $.type( params ) === "object" ) { |
||||
params = $.param(params, true); |
||||
} |
||||
|
||||
$.each(rez, function(key, value) { |
||||
url = url.replace( '$' + key, value || '' ); |
||||
}); |
||||
|
||||
if (params.length) { |
||||
url += ( url.indexOf('?') > 0 ? '&' : '?' ) + params; |
||||
} |
||||
|
||||
return url; |
||||
}; |
||||
|
||||
//Add helper object
|
||||
F.helpers.media = { |
||||
defaults : { |
||||
youtube : { |
||||
matcher : /(youtube\.com|youtu\.be|youtube-nocookie\.com)\/(watch\?v=|v\/|u\/|embed\/?)?(videoseries\?list=(.*)|[\w-]{11}|\?listType=(.*)&list=(.*)).*/i, |
||||
params : { |
||||
autoplay : 1, |
||||
autohide : 1, |
||||
fs : 1, |
||||
rel : 0, |
||||
hd : 1, |
||||
wmode : 'opaque', |
||||
enablejsapi : 1 |
||||
}, |
||||
type : 'iframe', |
||||
url : '//www.youtube.com/embed/$3' |
||||
}, |
||||
vimeo : { |
||||
matcher : /(?:vimeo(?:pro)?.com)\/(?:[^\d]+)?(\d+)(?:.*)/, |
||||
params : { |
||||
autoplay : 1, |
||||
hd : 1, |
||||
show_title : 1, |
||||
show_byline : 1, |
||||
show_portrait : 0, |
||||
fullscreen : 1 |
||||
}, |
||||
type : 'iframe', |
||||
url : '//player.vimeo.com/video/$1' |
||||
}, |
||||
metacafe : { |
||||
matcher : /metacafe.com\/(?:watch|fplayer)\/([\w\-]{1,10})/, |
||||
params : { |
||||
autoPlay : 'yes' |
||||
}, |
||||
type : 'swf', |
||||
url : function( rez, params, obj ) { |
||||
obj.swf.flashVars = 'playerVars=' + $.param( params, true ); |
||||
|
||||
return '//www.metacafe.com/fplayer/' + rez[1] + '/.swf'; |
||||
} |
||||
}, |
||||
dailymotion : { |
||||
matcher : /dailymotion.com\/video\/(.*)\/?(.*)/, |
||||
params : { |
||||
additionalInfos : 0, |
||||
autoStart : 1 |
||||
}, |
||||
type : 'swf', |
||||
url : '//www.dailymotion.com/swf/video/$1' |
||||
}, |
||||
twitvid : { |
||||
matcher : /twitvid\.com\/([a-zA-Z0-9_\-\?\=]+)/i, |
||||
params : { |
||||
autoplay : 0 |
||||
}, |
||||
type : 'iframe', |
||||
url : '//www.twitvid.com/embed.php?guid=$1' |
||||
}, |
||||
twitpic : { |
||||
matcher : /twitpic\.com\/(?!(?:place|photos|events)\/)([a-zA-Z0-9\?\=\-]+)/i, |
||||
type : 'image', |
||||
url : '//twitpic.com/show/full/$1/' |
||||
}, |
||||
instagram : { |
||||
matcher : /(instagr\.am|instagram\.com)\/p\/([a-zA-Z0-9_\-]+)\/?/i, |
||||
type : 'image', |
||||
url : '//$1/p/$2/media/?size=l' |
||||
}, |
||||
google_maps : { |
||||
matcher : /maps\.google\.([a-z]{2,3}(\.[a-z]{2})?)\/(\?ll=|maps\?)(.*)/i, |
||||
type : 'iframe', |
||||
url : function( rez ) { |
||||
return '//maps.google.' + rez[1] + '/' + rez[3] + '' + rez[4] + '&output=' + (rez[4].indexOf('layer=c') > 0 ? 'svembed' : 'embed'); |
||||
} |
||||
} |
||||
}, |
||||
|
||||
beforeLoad : function(opts, obj) { |
||||
var url = obj.href || '', |
||||
type = false, |
||||
what, |
||||
item, |
||||
rez, |
||||
params; |
||||
|
||||
for (what in opts) { |
||||
if (opts.hasOwnProperty(what)) { |
||||
item = opts[ what ]; |
||||
rez = url.match( item.matcher ); |
||||
|
||||
if (rez) { |
||||
type = item.type; |
||||
params = $.extend(true, {}, item.params, obj[ what ] || ($.isPlainObject(opts[ what ]) ? opts[ what ].params : null)); |
||||
|
||||
url = $.type( item.url ) === "function" ? item.url.call( this, rez, params, obj ) : format( item.url, rez, params ); |
||||
|
||||
break; |
||||
} |
||||
} |
||||
} |
||||
|
||||
if (type) { |
||||
obj.href = url; |
||||
obj.type = type; |
||||
|
||||
obj.autoHeight = false; |
||||
} |
||||
} |
||||
}; |
||||
|
||||
}(jQuery)); |
@ -0,0 +1,55 @@ |
||||
#fancybox-thumbs { |
||||
position: fixed; |
||||
left: 0; |
||||
width: 100%; |
||||
overflow: hidden; |
||||
z-index: 8050; |
||||
} |
||||
|
||||
#fancybox-thumbs.bottom { |
||||
bottom: 2px; |
||||
} |
||||
|
||||
#fancybox-thumbs.top { |
||||
top: 2px; |
||||
} |
||||
|
||||
#fancybox-thumbs ul { |
||||
position: relative; |
||||
list-style: none; |
||||
margin: 0; |
||||
padding: 0; |
||||
} |
||||
|
||||
#fancybox-thumbs ul li { |
||||
float: left; |
||||
padding: 1px; |
||||
opacity: 0.5; |
||||
} |
||||
|
||||
#fancybox-thumbs ul li.active { |
||||
opacity: 0.75; |
||||
padding: 0; |
||||
border: 1px solid #fff; |
||||
} |
||||
|
||||
#fancybox-thumbs ul li:hover { |
||||
opacity: 1; |
||||
} |
||||
|
||||
#fancybox-thumbs ul li a { |
||||
display: block; |
||||
position: relative; |
||||
overflow: hidden; |
||||
border: 1px solid #222; |
||||
background: #111; |
||||
outline: none; |
||||
} |
||||
|
||||
#fancybox-thumbs ul li img { |
||||
display: block; |
||||
position: relative; |
||||
border: 0; |
||||
padding: 0; |
||||
max-width: none; |
||||
} |
@ -0,0 +1,162 @@ |
||||
/*! |
||||
* Thumbnail helper for fancyBox |
||||
* version: 1.0.7 (Mon, 01 Oct 2012) |
||||
* @requires fancyBox v2.0 or later |
||||
* |
||||
* Usage: |
||||
* $(".fancybox").fancybox({ |
||||
* helpers : { |
||||
* thumbs: { |
||||
* width : 50, |
||||
* height : 50 |
||||
* } |
||||
* } |
||||
* }); |
||||
* |
||||
*/ |
||||
(function ($) { |
||||
//Shortcut for fancyBox object
|
||||
var F = $.fancybox; |
||||
|
||||
//Add helper object
|
||||
F.helpers.thumbs = { |
||||
defaults : { |
||||
width : 50, // thumbnail width
|
||||
height : 50, // thumbnail height
|
||||
position : 'bottom', // 'top' or 'bottom'
|
||||
source : function ( item ) { // function to obtain the URL of the thumbnail image
|
||||
var href; |
||||
|
||||
if (item.element) { |
||||
href = $(item.element).find('img').attr('src'); |
||||
} |
||||
|
||||
if (!href && item.type === 'image' && item.href) { |
||||
href = item.href; |
||||
} |
||||
|
||||
return href; |
||||
} |
||||
}, |
||||
|
||||
wrap : null, |
||||
list : null, |
||||
width : 0, |
||||
|
||||
init: function (opts, obj) { |
||||
var that = this, |
||||
list, |
||||
thumbWidth = opts.width, |
||||
thumbHeight = opts.height, |
||||
thumbSource = opts.source; |
||||
|
||||
//Build list structure
|
||||
list = ''; |
||||
|
||||
for (var n = 0; n < obj.group.length; n++) { |
||||
list += '<li><a style="width:' + thumbWidth + 'px;height:' + thumbHeight + 'px;" href="javascript:jQuery.fancybox.jumpto(' + n + ');"></a></li>'; |
||||
} |
||||
|
||||
this.wrap = $('<div id="fancybox-thumbs"></div>').addClass(opts.position).appendTo('body'); |
||||
this.list = $('<ul>' + list + '</ul>').appendTo(this.wrap); |
||||
|
||||
//Load each thumbnail
|
||||
$.each(obj.group, function (i) { |
||||
var href = thumbSource( obj.group[ i ] ); |
||||
|
||||
if (!href) { |
||||
return; |
||||
} |
||||
|
||||
$("<img />").load(function () { |
||||
var width = this.width, |
||||
height = this.height, |
||||
widthRatio, heightRatio, parent; |
||||
|
||||
if (!that.list || !width || !height) { |
||||
return; |
||||
} |
||||
|
||||
//Calculate thumbnail width/height and center it
|
||||
widthRatio = width / thumbWidth; |
||||
heightRatio = height / thumbHeight; |
||||
|
||||
parent = that.list.children().eq(i).find('a'); |
||||
|
||||
if (widthRatio >= 1 && heightRatio >= 1) { |
||||
if (widthRatio > heightRatio) { |
||||
width = Math.floor(width / heightRatio); |
||||
height = thumbHeight; |
||||
|
||||
} else { |
||||
width = thumbWidth; |
||||
height = Math.floor(height / widthRatio); |
||||
} |
||||
} |
||||
|
||||
$(this).css({ |
||||
width : width, |
||||
height : height, |
||||
top : Math.floor(thumbHeight / 2 - height / 2), |
||||
left : Math.floor(thumbWidth / 2 - width / 2) |
||||
}); |
||||
|
||||
parent.width(thumbWidth).height(thumbHeight); |
||||
|
||||
$(this).hide().appendTo(parent).fadeIn(300); |
||||
|
||||
}).attr('src', href); |
||||
}); |
||||
|
||||
//Set initial width
|
||||
this.width = this.list.children().eq(0).outerWidth(true); |
||||
|
||||
this.list.width(this.width * (obj.group.length + 1)).css('left', Math.floor($(window).width() * 0.5 - (obj.index * this.width + this.width * 0.5))); |
||||
}, |
||||
|
||||
beforeLoad: function (opts, obj) { |
||||
//Remove self if gallery do not have at least two items
|
||||
if (obj.group.length < 2) { |
||||
obj.helpers.thumbs = false; |
||||
|
||||
return; |
||||
} |
||||
|
||||
//Increase bottom margin to give space for thumbs
|
||||
obj.margin[ opts.position === 'top' ? 0 : 2 ] += ((opts.height) + 15); |
||||
}, |
||||
|
||||
afterShow: function (opts, obj) { |
||||
//Check if exists and create or update list
|
||||
if (this.list) { |
||||
this.onUpdate(opts, obj); |
||||
|
||||
} else { |
||||
this.init(opts, obj); |
||||
} |
||||
|
||||
//Set active element
|
||||
this.list.children().removeClass('active').eq(obj.index).addClass('active'); |
||||
}, |
||||
|
||||
//Center list
|
||||
onUpdate: function (opts, obj) { |
||||
if (this.list) { |
||||
this.list.stop(true).animate({ |
||||
'left': Math.floor($(window).width() * 0.5 - (obj.index * this.width + this.width * 0.5)) |
||||
}, 150); |
||||
} |
||||
}, |
||||
|
||||
beforeClose: function () { |
||||
if (this.wrap) { |
||||
this.wrap.remove(); |
||||
} |
||||
|
||||
this.wrap = null; |
||||
this.list = null; |
||||
this.width = 0; |
||||
} |
||||
} |
||||
|
||||
}(jQuery)); |
@ -0,0 +1,274 @@ |
||||
/*! fancyBox v2.1.5 fancyapps.com | fancyapps.com/fancybox/#license */ |
||||
.fancybox-wrap, |
||||
.fancybox-skin, |
||||
.fancybox-outer, |
||||
.fancybox-inner, |
||||
.fancybox-image, |
||||
.fancybox-wrap iframe, |
||||
.fancybox-wrap object, |
||||
.fancybox-nav, |
||||
.fancybox-nav span, |
||||
.fancybox-tmp |
||||
{ |
||||
padding: 0; |
||||
margin: 0; |
||||
border: 0; |
||||
outline: none; |
||||
vertical-align: top; |
||||
} |
||||
|
||||
.fancybox-wrap { |
||||
position: absolute; |
||||
top: 0; |
||||
left: 0; |
||||
z-index: 8020; |
||||
} |
||||
|
||||
.fancybox-skin { |
||||
position: relative; |
||||
background: #f9f9f9; |
||||
color: #444; |
||||
text-shadow: none; |
||||
-webkit-border-radius: 4px; |
||||
-moz-border-radius: 4px; |
||||
border-radius: 4px; |
||||
} |
||||
|
||||
.fancybox-opened { |
||||
z-index: 8030; |
||||
} |
||||
|
||||
.fancybox-opened .fancybox-skin { |
||||
-webkit-box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5); |
||||
-moz-box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5); |
||||
box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5); |
||||
} |
||||
|
||||
.fancybox-outer, .fancybox-inner { |
||||
position: relative; |
||||
} |
||||
|
||||
.fancybox-inner { |
||||
overflow: hidden; |
||||
} |
||||
|
||||
.fancybox-type-iframe .fancybox-inner { |
||||
-webkit-overflow-scrolling: touch; |
||||
} |
||||
|
||||
.fancybox-error { |
||||
color: #444; |
||||
font: 14px/20px "Helvetica Neue",Helvetica,Arial,sans-serif; |
||||
margin: 0; |
||||
padding: 15px; |
||||
white-space: nowrap; |
||||
} |
||||
|
||||
.fancybox-image, .fancybox-iframe { |
||||
display: block; |
||||
width: 100%; |
||||
height: 100%; |
||||
} |
||||
|
||||
.fancybox-image { |
||||
max-width: 100%; |
||||
max-height: 100%; |
||||
} |
||||
|
||||
#fancybox-loading, .fancybox-close, .fancybox-prev span, .fancybox-next span { |
||||
background-image: url('fancybox_sprite.png'); |
||||
} |
||||
|
||||
#fancybox-loading { |
||||
position: fixed; |
||||
top: 50%; |
||||
left: 50%; |
||||
margin-top: -22px; |
||||
margin-left: -22px; |
||||
background-position: 0 -108px; |
||||
opacity: 0.8; |
||||
cursor: pointer; |
||||
z-index: 8060; |
||||
} |
||||
|
||||
#fancybox-loading div { |
||||
width: 44px; |
||||
height: 44px; |
||||
background: url('fancybox_loading.gif') center center no-repeat; |
||||
} |
||||
|
||||
.fancybox-close { |
||||
position: absolute; |
||||
top: -18px; |
||||
right: -18px; |
||||
width: 36px; |
||||
height: 36px; |
||||
cursor: pointer; |
||||
z-index: 8040; |
||||
} |
||||
|
||||
.fancybox-nav { |
||||
position: absolute; |
||||
top: 0; |
||||
width: 40%; |
||||
height: 100%; |
||||
cursor: pointer; |
||||
text-decoration: none; |
||||
background: transparent url('blank.gif'); /* helps IE */ |
||||
-webkit-tap-highlight-color: rgba(0,0,0,0); |
||||
z-index: 8040; |
||||
} |
||||
|
||||
.fancybox-prev { |
||||
left: 0; |
||||
} |
||||
|
||||
.fancybox-next { |
||||
right: 0; |
||||
} |
||||
|
||||
.fancybox-nav span { |
||||
position: absolute; |
||||
top: 50%; |
||||
width: 36px; |
||||
height: 34px; |
||||
margin-top: -18px; |
||||
cursor: pointer; |
||||
z-index: 8040; |
||||
visibility: hidden; |
||||
} |
||||
|
||||
.fancybox-prev span { |
||||
left: 10px; |
||||
background-position: 0 -36px; |
||||
} |
||||
|
||||
.fancybox-next span { |
||||
right: 10px; |
||||
background-position: 0 -72px; |
||||
} |
||||
|
||||
.fancybox-nav:hover span { |
||||
visibility: visible; |
||||
} |
||||
|
||||
.fancybox-tmp { |
||||
position: absolute; |
||||
top: -99999px; |
||||
left: -99999px; |
||||
visibility: hidden; |
||||
max-width: 99999px; |
||||
max-height: 99999px; |
||||
overflow: visible !important; |
||||
} |
||||
|
||||
/* Overlay helper */ |
||||
|
||||
.fancybox-lock { |
||||
overflow: hidden !important; |
||||
width: auto; |
||||
} |
||||
|
||||
.fancybox-lock body { |
||||
overflow: hidden !important; |
||||
} |
||||
|
||||
.fancybox-lock-test { |
||||
overflow-y: hidden !important; |
||||
} |
||||
|
||||
.fancybox-overlay { |
||||
position: absolute; |
||||
top: 0; |
||||
left: 0; |
||||
overflow: hidden; |
||||
display: none; |
||||
z-index: 8010; |
||||
background: url('fancybox_overlay.png'); |
||||
} |
||||
|
||||
.fancybox-overlay-fixed { |
||||
position: fixed; |
||||
bottom: 0; |
||||
right: 0; |
||||
} |
||||
|
||||
.fancybox-lock .fancybox-overlay { |
||||
overflow: auto; |
||||
overflow-y: scroll; |
||||
} |
||||
|
||||
/* Title helper */ |
||||
|
||||
.fancybox-title { |
||||
visibility: hidden; |
||||
font: normal 13px/20px "Helvetica Neue",Helvetica,Arial,sans-serif; |
||||
position: relative; |
||||
text-shadow: none; |
||||
z-index: 8050; |
||||
} |
||||
|
||||
.fancybox-opened .fancybox-title { |
||||
visibility: visible; |
||||
} |
||||
|
||||
.fancybox-title-float-wrap { |
||||
position: absolute; |
||||
bottom: 0; |
||||
right: 50%; |
||||
margin-bottom: -35px; |
||||
z-index: 8050; |
||||
text-align: center; |
||||
} |
||||
|
||||
.fancybox-title-float-wrap .child { |
||||
display: inline-block; |
||||
margin-right: -100%; |
||||
padding: 2px 20px; |
||||
background: transparent; /* Fallback for web browsers that doesn't support RGBa */ |
||||
background: rgba(0, 0, 0, 0.8); |
||||
-webkit-border-radius: 15px; |
||||
-moz-border-radius: 15px; |
||||
border-radius: 15px; |
||||
text-shadow: 0 1px 2px #222; |
||||
color: #FFF; |
||||
font-weight: bold; |
||||
line-height: 24px; |
||||
white-space: nowrap; |
||||
} |
||||
|
||||
.fancybox-title-outside-wrap { |
||||
position: relative; |
||||
margin-top: 10px; |
||||
color: #fff; |
||||
} |
||||
|
||||
.fancybox-title-inside-wrap { |
||||
padding-top: 10px; |
||||
} |
||||
|
||||
.fancybox-title-over-wrap { |
||||
position: absolute; |
||||
bottom: 0; |
||||
left: 0; |
||||
color: #fff; |
||||
padding: 10px; |
||||
background: #000; |
||||
background: rgba(0, 0, 0, .8); |
||||
} |
||||
|
||||
/*Retina graphics!*/ |
||||
@media only screen and (-webkit-min-device-pixel-ratio: 1.5), |
||||
only screen and (min--moz-device-pixel-ratio: 1.5), |
||||
only screen and (min-device-pixel-ratio: 1.5){ |
||||
|
||||
#fancybox-loading, .fancybox-close, .fancybox-prev span, .fancybox-next span { |
||||
background-image: url('fancybox_sprite@2x.png'); |
||||
background-size: 44px 152px; /*The size of the normal image, half the size of the hi-res image*/ |
||||
} |
||||
|
||||
#fancybox-loading div { |
||||
background-image: url('fancybox_loading@2x.gif'); |
||||
background-size: 24px 24px; /*The size of the normal image, half the size of the hi-res image*/ |
||||
} |
||||
} |
@ -0,0 +1,46 @@ |
||||
/*! fancyBox v2.1.5 fancyapps.com | fancyapps.com/fancybox/#license */ |
||||
(function(r,G,f,v){var J=f("html"),n=f(r),p=f(G),b=f.fancybox=function(){b.open.apply(this,arguments)},I=navigator.userAgent.match(/msie/i),B=null,s=G.createTouch!==v,t=function(a){return a&&a.hasOwnProperty&&a instanceof f},q=function(a){return a&&"string"===f.type(a)},E=function(a){return q(a)&&0<a.indexOf("%")},l=function(a,d){var e=parseInt(a,10)||0;d&&E(a)&&(e*=b.getViewport()[d]/100);return Math.ceil(e)},w=function(a,b){return l(a,b)+"px"};f.extend(b,{version:"2.1.5",defaults:{padding:15,margin:20, |
||||
width:800,height:600,minWidth:100,minHeight:100,maxWidth:9999,maxHeight:9999,pixelRatio:1,autoSize:!0,autoHeight:!1,autoWidth:!1,autoResize:!0,autoCenter:!s,fitToView:!0,aspectRatio:!1,topRatio:0.5,leftRatio:0.5,scrolling:"auto",wrapCSS:"",arrows:!0,closeBtn:!0,closeClick:!1,nextClick:!1,mouseWheel:!0,autoPlay:!1,playSpeed:3E3,preload:3,modal:!1,loop:!0,ajax:{dataType:"html",headers:{"X-fancyBox":!0}},iframe:{scrolling:"auto",preload:!0},swf:{wmode:"transparent",allowfullscreen:"true",allowscriptaccess:"always"}, |
||||
keys:{next:{13:"left",34:"up",39:"left",40:"up"},prev:{8:"right",33:"down",37:"right",38:"down"},close:[27],play:[32],toggle:[70]},direction:{next:"left",prev:"right"},scrollOutside:!0,index:0,type:null,href:null,content:null,title:null,tpl:{wrap:'<div class="fancybox-wrap" tabIndex="-1"><div class="fancybox-skin"><div class="fancybox-outer"><div class="fancybox-inner"></div></div></div></div>',image:'<img class="fancybox-image" src="{href}" alt="" />',iframe:'<iframe id="fancybox-frame{rnd}" name="fancybox-frame{rnd}" class="fancybox-iframe" frameborder="0" vspace="0" hspace="0" webkitAllowFullScreen mozallowfullscreen allowFullScreen'+ |
||||
(I?' allowtransparency="true"':"")+"></iframe>",error:'<p class="fancybox-error">The requested content cannot be loaded.<br/>Please try again later.</p>',closeBtn:'<a title="Close" class="fancybox-item fancybox-close" href="javascript:;"></a>',next:'<a title="Next" class="fancybox-nav fancybox-next" href="javascript:;"><span></span></a>',prev:'<a title="Previous" class="fancybox-nav fancybox-prev" href="javascript:;"><span></span></a>'},openEffect:"fade",openSpeed:250,openEasing:"swing",openOpacity:!0, |
||||
openMethod:"zoomIn",closeEffect:"fade",closeSpeed:250,closeEasing:"swing",closeOpacity:!0,closeMethod:"zoomOut",nextEffect:"elastic",nextSpeed:250,nextEasing:"swing",nextMethod:"changeIn",prevEffect:"elastic",prevSpeed:250,prevEasing:"swing",prevMethod:"changeOut",helpers:{overlay:!0,title:!0},onCancel:f.noop,beforeLoad:f.noop,afterLoad:f.noop,beforeShow:f.noop,afterShow:f.noop,beforeChange:f.noop,beforeClose:f.noop,afterClose:f.noop},group:{},opts:{},previous:null,coming:null,current:null,isActive:!1, |
||||
isOpen:!1,isOpened:!1,wrap:null,skin:null,outer:null,inner:null,player:{timer:null,isActive:!1},ajaxLoad:null,imgPreload:null,transitions:{},helpers:{},open:function(a,d){if(a&&(f.isPlainObject(d)||(d={}),!1!==b.close(!0)))return f.isArray(a)||(a=t(a)?f(a).get():[a]),f.each(a,function(e,c){var k={},g,h,j,m,l;"object"===f.type(c)&&(c.nodeType&&(c=f(c)),t(c)?(k={href:c.data("fancybox-href")||c.attr("href"),title:c.data("fancybox-title")||c.attr("title"),isDom:!0,element:c},f.metadata&&f.extend(!0,k, |
||||
c.metadata())):k=c);g=d.href||k.href||(q(c)?c:null);h=d.title!==v?d.title:k.title||"";m=(j=d.content||k.content)?"html":d.type||k.type;!m&&k.isDom&&(m=c.data("fancybox-type"),m||(m=(m=c.prop("class").match(/fancybox\.(\w+)/))?m[1]:null));q(g)&&(m||(b.isImage(g)?m="image":b.isSWF(g)?m="swf":"#"===g.charAt(0)?m="inline":q(c)&&(m="html",j=c)),"ajax"===m&&(l=g.split(/\s+/,2),g=l.shift(),l=l.shift()));j||("inline"===m?g?j=f(q(g)?g.replace(/.*(?=#[^\s]+$)/,""):g):k.isDom&&(j=c):"html"===m?j=g:!m&&(!g&& |
||||
k.isDom)&&(m="inline",j=c));f.extend(k,{href:g,type:m,content:j,title:h,selector:l});a[e]=k}),b.opts=f.extend(!0,{},b.defaults,d),d.keys!==v&&(b.opts.keys=d.keys?f.extend({},b.defaults.keys,d.keys):!1),b.group=a,b._start(b.opts.index)},cancel:function(){var a=b.coming;a&&!1!==b.trigger("onCancel")&&(b.hideLoading(),b.ajaxLoad&&b.ajaxLoad.abort(),b.ajaxLoad=null,b.imgPreload&&(b.imgPreload.onload=b.imgPreload.onerror=null),a.wrap&&a.wrap.stop(!0,!0).trigger("onReset").remove(),b.coming=null,b.current|| |
||||
b._afterZoomOut(a))},close:function(a){b.cancel();!1!==b.trigger("beforeClose")&&(b.unbindEvents(),b.isActive&&(!b.isOpen||!0===a?(f(".fancybox-wrap").stop(!0).trigger("onReset").remove(),b._afterZoomOut()):(b.isOpen=b.isOpened=!1,b.isClosing=!0,f(".fancybox-item, .fancybox-nav").remove(),b.wrap.stop(!0,!0).removeClass("fancybox-opened"),b.transitions[b.current.closeMethod]())))},play:function(a){var d=function(){clearTimeout(b.player.timer)},e=function(){d();b.current&&b.player.isActive&&(b.player.timer= |
||||
setTimeout(b.next,b.current.playSpeed))},c=function(){d();p.unbind(".player");b.player.isActive=!1;b.trigger("onPlayEnd")};if(!0===a||!b.player.isActive&&!1!==a){if(b.current&&(b.current.loop||b.current.index<b.group.length-1))b.player.isActive=!0,p.bind({"onCancel.player beforeClose.player":c,"onUpdate.player":e,"beforeLoad.player":d}),e(),b.trigger("onPlayStart")}else c()},next:function(a){var d=b.current;d&&(q(a)||(a=d.direction.next),b.jumpto(d.index+1,a,"next"))},prev:function(a){var d=b.current; |
||||
d&&(q(a)||(a=d.direction.prev),b.jumpto(d.index-1,a,"prev"))},jumpto:function(a,d,e){var c=b.current;c&&(a=l(a),b.direction=d||c.direction[a>=c.index?"next":"prev"],b.router=e||"jumpto",c.loop&&(0>a&&(a=c.group.length+a%c.group.length),a%=c.group.length),c.group[a]!==v&&(b.cancel(),b._start(a)))},reposition:function(a,d){var e=b.current,c=e?e.wrap:null,k;c&&(k=b._getPosition(d),a&&"scroll"===a.type?(delete k.position,c.stop(!0,!0).animate(k,200)):(c.css(k),e.pos=f.extend({},e.dim,k)))},update:function(a){var d= |
||||
a&&a.type,e=!d||"orientationchange"===d;e&&(clearTimeout(B),B=null);b.isOpen&&!B&&(B=setTimeout(function(){var c=b.current;c&&!b.isClosing&&(b.wrap.removeClass("fancybox-tmp"),(e||"load"===d||"resize"===d&&c.autoResize)&&b._setDimension(),"scroll"===d&&c.canShrink||b.reposition(a),b.trigger("onUpdate"),B=null)},e&&!s?0:300))},toggle:function(a){b.isOpen&&(b.current.fitToView="boolean"===f.type(a)?a:!b.current.fitToView,s&&(b.wrap.removeAttr("style").addClass("fancybox-tmp"),b.trigger("onUpdate")), |
||||
b.update())},hideLoading:function(){p.unbind(".loading");f("#fancybox-loading").remove()},showLoading:function(){var a,d;b.hideLoading();a=f('<div id="fancybox-loading"><div></div></div>').click(b.cancel).appendTo("body");p.bind("keydown.loading",function(a){if(27===(a.which||a.keyCode))a.preventDefault(),b.cancel()});b.defaults.fixed||(d=b.getViewport(),a.css({position:"absolute",top:0.5*d.h+d.y,left:0.5*d.w+d.x}))},getViewport:function(){var a=b.current&&b.current.locked||!1,d={x:n.scrollLeft(), |
||||
y:n.scrollTop()};a?(d.w=a[0].clientWidth,d.h=a[0].clientHeight):(d.w=s&&r.innerWidth?r.innerWidth:n.width(),d.h=s&&r.innerHeight?r.innerHeight:n.height());return d},unbindEvents:function(){b.wrap&&t(b.wrap)&&b.wrap.unbind(".fb");p.unbind(".fb");n.unbind(".fb")},bindEvents:function(){var a=b.current,d;a&&(n.bind("orientationchange.fb"+(s?"":" resize.fb")+(a.autoCenter&&!a.locked?" scroll.fb":""),b.update),(d=a.keys)&&p.bind("keydown.fb",function(e){var c=e.which||e.keyCode,k=e.target||e.srcElement; |
||||
if(27===c&&b.coming)return!1;!e.ctrlKey&&(!e.altKey&&!e.shiftKey&&!e.metaKey&&(!k||!k.type&&!f(k).is("[contenteditable]")))&&f.each(d,function(d,k){if(1<a.group.length&&k[c]!==v)return b[d](k[c]),e.preventDefault(),!1;if(-1<f.inArray(c,k))return b[d](),e.preventDefault(),!1})}),f.fn.mousewheel&&a.mouseWheel&&b.wrap.bind("mousewheel.fb",function(d,c,k,g){for(var h=f(d.target||null),j=!1;h.length&&!j&&!h.is(".fancybox-skin")&&!h.is(".fancybox-wrap");)j=h[0]&&!(h[0].style.overflow&&"hidden"===h[0].style.overflow)&& |
||||
(h[0].clientWidth&&h[0].scrollWidth>h[0].clientWidth||h[0].clientHeight&&h[0].scrollHeight>h[0].clientHeight),h=f(h).parent();if(0!==c&&!j&&1<b.group.length&&!a.canShrink){if(0<g||0<k)b.prev(0<g?"down":"left");else if(0>g||0>k)b.next(0>g?"up":"right");d.preventDefault()}}))},trigger:function(a,d){var e,c=d||b.coming||b.current;if(c){f.isFunction(c[a])&&(e=c[a].apply(c,Array.prototype.slice.call(arguments,1)));if(!1===e)return!1;c.helpers&&f.each(c.helpers,function(d,e){if(e&&b.helpers[d]&&f.isFunction(b.helpers[d][a]))b.helpers[d][a](f.extend(!0, |
||||
{},b.helpers[d].defaults,e),c)});p.trigger(a)}},isImage:function(a){return q(a)&&a.match(/(^data:image\/.*,)|(\.(jp(e|g|eg)|gif|png|bmp|webp|svg)((\?|#).*)?$)/i)},isSWF:function(a){return q(a)&&a.match(/\.(swf)((\?|#).*)?$/i)},_start:function(a){var d={},e,c;a=l(a);e=b.group[a]||null;if(!e)return!1;d=f.extend(!0,{},b.opts,e);e=d.margin;c=d.padding;"number"===f.type(e)&&(d.margin=[e,e,e,e]);"number"===f.type(c)&&(d.padding=[c,c,c,c]);d.modal&&f.extend(!0,d,{closeBtn:!1,closeClick:!1,nextClick:!1,arrows:!1, |
||||
mouseWheel:!1,keys:null,helpers:{overlay:{closeClick:!1}}});d.autoSize&&(d.autoWidth=d.autoHeight=!0);"auto"===d.width&&(d.autoWidth=!0);"auto"===d.height&&(d.autoHeight=!0);d.group=b.group;d.index=a;b.coming=d;if(!1===b.trigger("beforeLoad"))b.coming=null;else{c=d.type;e=d.href;if(!c)return b.coming=null,b.current&&b.router&&"jumpto"!==b.router?(b.current.index=a,b[b.router](b.direction)):!1;b.isActive=!0;if("image"===c||"swf"===c)d.autoHeight=d.autoWidth=!1,d.scrolling="visible";"image"===c&&(d.aspectRatio= |
||||
!0);"iframe"===c&&s&&(d.scrolling="scroll");d.wrap=f(d.tpl.wrap).addClass("fancybox-"+(s?"mobile":"desktop")+" fancybox-type-"+c+" fancybox-tmp "+d.wrapCSS).appendTo(d.parent||"body");f.extend(d,{skin:f(".fancybox-skin",d.wrap),outer:f(".fancybox-outer",d.wrap),inner:f(".fancybox-inner",d.wrap)});f.each(["Top","Right","Bottom","Left"],function(a,b){d.skin.css("padding"+b,w(d.padding[a]))});b.trigger("onReady");if("inline"===c||"html"===c){if(!d.content||!d.content.length)return b._error("content")}else if(!e)return b._error("href"); |
||||
"image"===c?b._loadImage():"ajax"===c?b._loadAjax():"iframe"===c?b._loadIframe():b._afterLoad()}},_error:function(a){f.extend(b.coming,{type:"html",autoWidth:!0,autoHeight:!0,minWidth:0,minHeight:0,scrolling:"no",hasError:a,content:b.coming.tpl.error});b._afterLoad()},_loadImage:function(){var a=b.imgPreload=new Image;a.onload=function(){this.onload=this.onerror=null;b.coming.width=this.width/b.opts.pixelRatio;b.coming.height=this.height/b.opts.pixelRatio;b._afterLoad()};a.onerror=function(){this.onload= |
||||
this.onerror=null;b._error("image")};a.src=b.coming.href;!0!==a.complete&&b.showLoading()},_loadAjax:function(){var a=b.coming;b.showLoading();b.ajaxLoad=f.ajax(f.extend({},a.ajax,{url:a.href,error:function(a,e){b.coming&&"abort"!==e?b._error("ajax",a):b.hideLoading()},success:function(d,e){"success"===e&&(a.content=d,b._afterLoad())}}))},_loadIframe:function(){var a=b.coming,d=f(a.tpl.iframe.replace(/\{rnd\}/g,(new Date).getTime())).attr("scrolling",s?"auto":a.iframe.scrolling).attr("src",a.href); |
||||
f(a.wrap).bind("onReset",function(){try{f(this).find("iframe").hide().attr("src","//about:blank").end().empty()}catch(a){}});a.iframe.preload&&(b.showLoading(),d.one("load",function(){f(this).data("ready",1);s||f(this).bind("load.fb",b.update);f(this).parents(".fancybox-wrap").width("100%").removeClass("fancybox-tmp").show();b._afterLoad()}));a.content=d.appendTo(a.inner);a.iframe.preload||b._afterLoad()},_preloadImages:function(){var a=b.group,d=b.current,e=a.length,c=d.preload?Math.min(d.preload, |
||||
e-1):0,f,g;for(g=1;g<=c;g+=1)f=a[(d.index+g)%e],"image"===f.type&&f.href&&((new Image).src=f.href)},_afterLoad:function(){var a=b.coming,d=b.current,e,c,k,g,h;b.hideLoading();if(a&&!1!==b.isActive)if(!1===b.trigger("afterLoad",a,d))a.wrap.stop(!0).trigger("onReset").remove(),b.coming=null;else{d&&(b.trigger("beforeChange",d),d.wrap.stop(!0).removeClass("fancybox-opened").find(".fancybox-item, .fancybox-nav").remove());b.unbindEvents();e=a.content;c=a.type;k=a.scrolling;f.extend(b,{wrap:a.wrap,skin:a.skin, |
||||
outer:a.outer,inner:a.inner,current:a,previous:d});g=a.href;switch(c){case "inline":case "ajax":case "html":a.selector?e=f("<div>").html(e).find(a.selector):t(e)&&(e.data("fancybox-placeholder")||e.data("fancybox-placeholder",f('<div class="fancybox-placeholder"></div>').insertAfter(e).hide()),e=e.show().detach(),a.wrap.bind("onReset",function(){f(this).find(e).length&&e.hide().replaceAll(e.data("fancybox-placeholder")).data("fancybox-placeholder",!1)}));break;case "image":e=a.tpl.image.replace("{href}", |
||||
g);break;case "swf":e='<object id="fancybox-swf" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="100%" height="100%"><param name="movie" value="'+g+'"></param>',h="",f.each(a.swf,function(a,b){e+='<param name="'+a+'" value="'+b+'"></param>';h+=" "+a+'="'+b+'"'}),e+='<embed src="'+g+'" type="application/x-shockwave-flash" width="100%" height="100%"'+h+"></embed></object>"}(!t(e)||!e.parent().is(a.inner))&&a.inner.append(e);b.trigger("beforeShow");a.inner.css("overflow","yes"===k?"scroll": |
||||
"no"===k?"hidden":k);b._setDimension();b.reposition();b.isOpen=!1;b.coming=null;b.bindEvents();if(b.isOpened){if(d.prevMethod)b.transitions[d.prevMethod]()}else f(".fancybox-wrap").not(a.wrap).stop(!0).trigger("onReset").remove();b.transitions[b.isOpened?a.nextMethod:a.openMethod]();b._preloadImages()}},_setDimension:function(){var a=b.getViewport(),d=0,e=!1,c=!1,e=b.wrap,k=b.skin,g=b.inner,h=b.current,c=h.width,j=h.height,m=h.minWidth,u=h.minHeight,n=h.maxWidth,p=h.maxHeight,s=h.scrolling,q=h.scrollOutside? |
||||
h.scrollbarWidth:0,x=h.margin,y=l(x[1]+x[3]),r=l(x[0]+x[2]),v,z,t,C,A,F,B,D,H;e.add(k).add(g).width("auto").height("auto").removeClass("fancybox-tmp");x=l(k.outerWidth(!0)-k.width());v=l(k.outerHeight(!0)-k.height());z=y+x;t=r+v;C=E(c)?(a.w-z)*l(c)/100:c;A=E(j)?(a.h-t)*l(j)/100:j;if("iframe"===h.type){if(H=h.content,h.autoHeight&&1===H.data("ready"))try{H[0].contentWindow.document.location&&(g.width(C).height(9999),F=H.contents().find("body"),q&&F.css("overflow-x","hidden"),A=F.outerHeight(!0))}catch(G){}}else if(h.autoWidth|| |
||||
h.autoHeight)g.addClass("fancybox-tmp"),h.autoWidth||g.width(C),h.autoHeight||g.height(A),h.autoWidth&&(C=g.width()),h.autoHeight&&(A=g.height()),g.removeClass("fancybox-tmp");c=l(C);j=l(A);D=C/A;m=l(E(m)?l(m,"w")-z:m);n=l(E(n)?l(n,"w")-z:n);u=l(E(u)?l(u,"h")-t:u);p=l(E(p)?l(p,"h")-t:p);F=n;B=p;h.fitToView&&(n=Math.min(a.w-z,n),p=Math.min(a.h-t,p));z=a.w-y;r=a.h-r;h.aspectRatio?(c>n&&(c=n,j=l(c/D)),j>p&&(j=p,c=l(j*D)),c<m&&(c=m,j=l(c/D)),j<u&&(j=u,c=l(j*D))):(c=Math.max(m,Math.min(c,n)),h.autoHeight&& |
||||
"iframe"!==h.type&&(g.width(c),j=g.height()),j=Math.max(u,Math.min(j,p)));if(h.fitToView)if(g.width(c).height(j),e.width(c+x),a=e.width(),y=e.height(),h.aspectRatio)for(;(a>z||y>r)&&(c>m&&j>u)&&!(19<d++);)j=Math.max(u,Math.min(p,j-10)),c=l(j*D),c<m&&(c=m,j=l(c/D)),c>n&&(c=n,j=l(c/D)),g.width(c).height(j),e.width(c+x),a=e.width(),y=e.height();else c=Math.max(m,Math.min(c,c-(a-z))),j=Math.max(u,Math.min(j,j-(y-r)));q&&("auto"===s&&j<A&&c+x+q<z)&&(c+=q);g.width(c).height(j);e.width(c+x);a=e.width(); |
||||
y=e.height();e=(a>z||y>r)&&c>m&&j>u;c=h.aspectRatio?c<F&&j<B&&c<C&&j<A:(c<F||j<B)&&(c<C||j<A);f.extend(h,{dim:{width:w(a),height:w(y)},origWidth:C,origHeight:A,canShrink:e,canExpand:c,wPadding:x,hPadding:v,wrapSpace:y-k.outerHeight(!0),skinSpace:k.height()-j});!H&&(h.autoHeight&&j>u&&j<p&&!c)&&g.height("auto")},_getPosition:function(a){var d=b.current,e=b.getViewport(),c=d.margin,f=b.wrap.width()+c[1]+c[3],g=b.wrap.height()+c[0]+c[2],c={position:"absolute",top:c[0],left:c[3]};d.autoCenter&&d.fixed&& |
||||
!a&&g<=e.h&&f<=e.w?c.position="fixed":d.locked||(c.top+=e.y,c.left+=e.x);c.top=w(Math.max(c.top,c.top+(e.h-g)*d.topRatio));c.left=w(Math.max(c.left,c.left+(e.w-f)*d.leftRatio));return c},_afterZoomIn:function(){var a=b.current;a&&(b.isOpen=b.isOpened=!0,b.wrap.css("overflow","visible").addClass("fancybox-opened"),b.update(),(a.closeClick||a.nextClick&&1<b.group.length)&&b.inner.css("cursor","pointer").bind("click.fb",function(d){!f(d.target).is("a")&&!f(d.target).parent().is("a")&&(d.preventDefault(), |
||||
b[a.closeClick?"close":"next"]())}),a.closeBtn&&f(a.tpl.closeBtn).appendTo(b.skin).bind("click.fb",function(a){a.preventDefault();b.close()}),a.arrows&&1<b.group.length&&((a.loop||0<a.index)&&f(a.tpl.prev).appendTo(b.outer).bind("click.fb",b.prev),(a.loop||a.index<b.group.length-1)&&f(a.tpl.next).appendTo(b.outer).bind("click.fb",b.next)),b.trigger("afterShow"),!a.loop&&a.index===a.group.length-1?b.play(!1):b.opts.autoPlay&&!b.player.isActive&&(b.opts.autoPlay=!1,b.play()))},_afterZoomOut:function(a){a= |
||||
a||b.current;f(".fancybox-wrap").trigger("onReset").remove();f.extend(b,{group:{},opts:{},router:!1,current:null,isActive:!1,isOpened:!1,isOpen:!1,isClosing:!1,wrap:null,skin:null,outer:null,inner:null});b.trigger("afterClose",a)}});b.transitions={getOrigPosition:function(){var a=b.current,d=a.element,e=a.orig,c={},f=50,g=50,h=a.hPadding,j=a.wPadding,m=b.getViewport();!e&&(a.isDom&&d.is(":visible"))&&(e=d.find("img:first"),e.length||(e=d));t(e)?(c=e.offset(),e.is("img")&&(f=e.outerWidth(),g=e.outerHeight())): |
||||
(c.top=m.y+(m.h-g)*a.topRatio,c.left=m.x+(m.w-f)*a.leftRatio);if("fixed"===b.wrap.css("position")||a.locked)c.top-=m.y,c.left-=m.x;return c={top:w(c.top-h*a.topRatio),left:w(c.left-j*a.leftRatio),width:w(f+j),height:w(g+h)}},step:function(a,d){var e,c,f=d.prop;c=b.current;var g=c.wrapSpace,h=c.skinSpace;if("width"===f||"height"===f)e=d.end===d.start?1:(a-d.start)/(d.end-d.start),b.isClosing&&(e=1-e),c="width"===f?c.wPadding:c.hPadding,c=a-c,b.skin[f](l("width"===f?c:c-g*e)),b.inner[f](l("width"=== |
||||
f?c:c-g*e-h*e))},zoomIn:function(){var a=b.current,d=a.pos,e=a.openEffect,c="elastic"===e,k=f.extend({opacity:1},d);delete k.position;c?(d=this.getOrigPosition(),a.openOpacity&&(d.opacity=0.1)):"fade"===e&&(d.opacity=0.1);b.wrap.css(d).animate(k,{duration:"none"===e?0:a.openSpeed,easing:a.openEasing,step:c?this.step:null,complete:b._afterZoomIn})},zoomOut:function(){var a=b.current,d=a.closeEffect,e="elastic"===d,c={opacity:0.1};e&&(c=this.getOrigPosition(),a.closeOpacity&&(c.opacity=0.1));b.wrap.animate(c, |
||||
{duration:"none"===d?0:a.closeSpeed,easing:a.closeEasing,step:e?this.step:null,complete:b._afterZoomOut})},changeIn:function(){var a=b.current,d=a.nextEffect,e=a.pos,c={opacity:1},f=b.direction,g;e.opacity=0.1;"elastic"===d&&(g="down"===f||"up"===f?"top":"left","down"===f||"right"===f?(e[g]=w(l(e[g])-200),c[g]="+=200px"):(e[g]=w(l(e[g])+200),c[g]="-=200px"));"none"===d?b._afterZoomIn():b.wrap.css(e).animate(c,{duration:a.nextSpeed,easing:a.nextEasing,complete:b._afterZoomIn})},changeOut:function(){var a= |
||||
b.previous,d=a.prevEffect,e={opacity:0.1},c=b.direction;"elastic"===d&&(e["down"===c||"up"===c?"top":"left"]=("up"===c||"left"===c?"-":"+")+"=200px");a.wrap.animate(e,{duration:"none"===d?0:a.prevSpeed,easing:a.prevEasing,complete:function(){f(this).trigger("onReset").remove()}})}};b.helpers.overlay={defaults:{closeClick:!0,speedOut:200,showEarly:!0,css:{},locked:!s,fixed:!0},overlay:null,fixed:!1,el:f("html"),create:function(a){a=f.extend({},this.defaults,a);this.overlay&&this.close();this.overlay= |
||||
f('<div class="fancybox-overlay"></div>').appendTo(b.coming?b.coming.parent:a.parent);this.fixed=!1;a.fixed&&b.defaults.fixed&&(this.overlay.addClass("fancybox-overlay-fixed"),this.fixed=!0)},open:function(a){var d=this;a=f.extend({},this.defaults,a);this.overlay?this.overlay.unbind(".overlay").width("auto").height("auto"):this.create(a);this.fixed||(n.bind("resize.overlay",f.proxy(this.update,this)),this.update());a.closeClick&&this.overlay.bind("click.overlay",function(a){if(f(a.target).hasClass("fancybox-overlay"))return b.isActive? |
||||
b.close():d.close(),!1});this.overlay.css(a.css).show()},close:function(){var a,b;n.unbind("resize.overlay");this.el.hasClass("fancybox-lock")&&(f(".fancybox-margin").removeClass("fancybox-margin"),a=n.scrollTop(),b=n.scrollLeft(),this.el.removeClass("fancybox-lock"),n.scrollTop(a).scrollLeft(b));f(".fancybox-overlay").remove().hide();f.extend(this,{overlay:null,fixed:!1})},update:function(){var a="100%",b;this.overlay.width(a).height("100%");I?(b=Math.max(G.documentElement.offsetWidth,G.body.offsetWidth), |
||||
p.width()>b&&(a=p.width())):p.width()>n.width()&&(a=p.width());this.overlay.width(a).height(p.height())},onReady:function(a,b){var e=this.overlay;f(".fancybox-overlay").stop(!0,!0);e||this.create(a);a.locked&&(this.fixed&&b.fixed)&&(e||(this.margin=p.height()>n.height()?f("html").css("margin-right").replace("px",""):!1),b.locked=this.overlay.append(b.wrap),b.fixed=!1);!0===a.showEarly&&this.beforeShow.apply(this,arguments)},beforeShow:function(a,b){var e,c;b.locked&&(!1!==this.margin&&(f("*").filter(function(){return"fixed"=== |
||||
f(this).css("position")&&!f(this).hasClass("fancybox-overlay")&&!f(this).hasClass("fancybox-wrap")}).addClass("fancybox-margin"),this.el.addClass("fancybox-margin")),e=n.scrollTop(),c=n.scrollLeft(),this.el.addClass("fancybox-lock"),n.scrollTop(e).scrollLeft(c));this.open(a)},onUpdate:function(){this.fixed||this.update()},afterClose:function(a){this.overlay&&!b.coming&&this.overlay.fadeOut(a.speedOut,f.proxy(this.close,this))}};b.helpers.title={defaults:{type:"float",position:"bottom"},beforeShow:function(a){var d= |
||||
b.current,e=d.title,c=a.type;f.isFunction(e)&&(e=e.call(d.element,d));if(q(e)&&""!==f.trim(e)){d=f('<div class="fancybox-title fancybox-title-'+c+'-wrap">'+e+"</div>");switch(c){case "inside":c=b.skin;break;case "outside":c=b.wrap;break;case "over":c=b.inner;break;default:c=b.skin,d.appendTo("body"),I&&d.width(d.width()),d.wrapInner('<span class="child"></span>'),b.current.margin[2]+=Math.abs(l(d.css("margin-bottom")))}d["top"===a.position?"prependTo":"appendTo"](c)}}};f.fn.fancybox=function(a){var d, |
||||
e=f(this),c=this.selector||"",k=function(g){var h=f(this).blur(),j=d,k,l;!g.ctrlKey&&(!g.altKey&&!g.shiftKey&&!g.metaKey)&&!h.is(".fancybox-wrap")&&(k=a.groupAttr||"data-fancybox-group",l=h.attr(k),l||(k="rel",l=h.get(0)[k]),l&&(""!==l&&"nofollow"!==l)&&(h=c.length?f(c):e,h=h.filter("["+k+'="'+l+'"]'),j=h.index(this)),a.index=j,!1!==b.open(h,a)&&g.preventDefault())};a=a||{};d=a.index||0;!c||!1===a.live?e.unbind("click.fb-start").bind("click.fb-start",k):p.undelegate(c,"click.fb-start").delegate(c+ |
||||
":not('.fancybox-item, .fancybox-nav')","click.fb-start",k);this.filter("[data-fancybox-start=1]").trigger("click");return this};p.ready(function(){var a,d;f.scrollbarWidth===v&&(f.scrollbarWidth=function(){var a=f('<div style="width:50px;height:50px;overflow:auto"><div/></div>').appendTo("body"),b=a.children(),b=b.innerWidth()-b.height(99).innerWidth();a.remove();return b});if(f.support.fixedPosition===v){a=f.support;d=f('<div style="position:fixed;top:20px;"></div>').appendTo("body");var e=20=== |
||||
d[0].offsetTop||15===d[0].offsetTop;d.remove();a.fixedPosition=e}f.extend(b.defaults,{scrollbarWidth:f.scrollbarWidth(),fixed:f.support.fixedPosition,parent:f("body")});a=f(r).width();J.addClass("fancybox-lock-test");d=f(r).width();J.removeClass("fancybox-lock-test");f("<style type='text/css'>.fancybox-margin{margin-right:"+(d-a)+"px;}</style>").appendTo("head")})})(window,document,jQuery); |
@ -0,0 +1,4 @@ |
||||
User-agent: * |
||||
Disallow: /tags/ |
||||
Disallow: /page/ |
||||
Disallow: /categories/ |