76 |
--------------------------------------------------------------------------------
/layout/_partial/post/date.ejs:
--------------------------------------------------------------------------------
1 | <% if (post.date) { %>
2 |
3 | <% if (is_post()) { %>
4 |
5 | <% if (theme.post.show_updated && post.date !== post.updated) { %>
6 | (Updated: )
7 | <% } %>
8 | <% } else { %>
9 | <% if (is_home() && theme.posts_overview.sort_updated || is_archive() && theme.archive.sort_updated ) { %>
10 |
11 | <% } else { %>
12 |
13 | <% } %>
14 | <% } %>
15 |
16 | <% } %>
17 |
--------------------------------------------------------------------------------
/layout/_partial/post/gitalk.ejs:
--------------------------------------------------------------------------------
1 | <% if (theme.gitalk != undefined){ %>
2 |
12 | <%}%>
13 |
--------------------------------------------------------------------------------
/layout/_partial/post/header.ejs:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
<%- page.title %>
6 |
14 |
15 |
16 |
--------------------------------------------------------------------------------
/layout/_partial/post/item.ejs:
--------------------------------------------------------------------------------
1 |
2 |
">
3 | <%- image_tag(post.cover || theme.cover[Math.floor(Math.random() * theme.cover.length)], {class: "cover", width: 680, height: 440}) %>
4 |
5 |
6 |
<%- post.date.locale("zh-cn").format("MMMM DD, YYYY") %>
7 |
<%- link_to(post.path, post.title || "Untitled", {class: "posttitle"}) %>
8 |
<%- truncate(strip_html(post.content), {length: 80, omission: '...'}) %>
9 |
10 |
11 |
--------------------------------------------------------------------------------
/layout/_partial/post/tag.ejs:
--------------------------------------------------------------------------------
1 | <% if (post.tags && post.tags.length){ %>
2 | <%- list_tags(post.tags, {
3 | show_count: false,
4 | class: 'post-tags'
5 | }) %>
6 | <% } %>
7 |
--------------------------------------------------------------------------------
/layout/_partial/post/title.ejs:
--------------------------------------------------------------------------------
1 | <% if (index) { %>
2 | <% if (post.link) { %>
3 |
<%= post.title %>
4 | <% } else if (post.title) { %>
5 |
<%= post.title %>
6 | <% } else { %>
7 |
Untitled
8 | <% } %>
9 | <% } else { %>
10 |
11 | <%= post.title %>
12 |
13 | <% } %>
14 |
--------------------------------------------------------------------------------
/layout/_partial/screen.ejs:
--------------------------------------------------------------------------------
1 | <% var first = page.posts.sort("date", "desc").eq(0); %>
2 |
3 |
4 |
5 | <%- image_tag(theme.welcome_cover || first.cover || "/img/welcome-cover.jpg", {id: "cover", crossorigin: "anonymous", width: 1920, height: 1080}) %>
6 |
7 |
8 |
14 |
23 | <% if ( first ) { %>
24 |
25 |
<%- first.date.locale("zh-cn").format("MMMM DD, YYYY") %>
26 |
<%- link_to(first.path, first.title || config.title, {class: "posttitle"}) %>
27 |
<%- truncate(strip_html(first.content), {length: 60, omission: '...'}) %>
28 |
29 | <% } %>
30 |
31 |
--------------------------------------------------------------------------------
/layout/_partial/scripts.ejs:
--------------------------------------------------------------------------------
1 | <% if (theme.gitalk.enable){ %><%- js(['//cdn.jsdelivr.net/npm/gitalk@1/dist/gitalk.min.js'])%><%}%>
2 | <%- js(['//lib.baomitu.com/jquery/1.8.3/jquery.min.js', 'js/plugin.js', 'js/typed.js', 'js/diaspora.js'])%>
3 | <%- partial('photoswipe') %>
4 |
--------------------------------------------------------------------------------
/layout/_partial/search.ejs:
--------------------------------------------------------------------------------
1 |
8 |
--------------------------------------------------------------------------------
/layout/_partial/tags.ejs:
--------------------------------------------------------------------------------
1 |
2 |
标签
3 | <%- tagcloud({min_font: 14, max_font: 36, amount: 200, color: true, start_color: '#9E9E9E', end_color: 'gray'}) %>
4 |
5 |
--------------------------------------------------------------------------------
/layout/archive.ejs:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
7 |
8 |
9 |
10 |
归档: <%= site.posts.length %>篇
11 | <% var posts = site.posts.sort('date', 'desc'); %>
12 | <% for(let i = 0, year = -1; i < posts.data.length; ++i) { %>
13 | <%
14 | const psg = posts.data[i];
15 | if(psg.date.year() !== year) {
16 | year = psg.date.year();
17 | %>
18 |
<%= year %>
19 | <% } %>
20 |
24 | <% } %>
25 |
26 |
27 |
28 |
29 |
30 |
31 |
--------------------------------------------------------------------------------
/layout/category.ejs:
--------------------------------------------------------------------------------
1 | <%- partial('index', {pagination: config.tag, index: false}) %>
2 |
--------------------------------------------------------------------------------
/layout/index.ejs:
--------------------------------------------------------------------------------
1 | <%- partial("_partial/menu", null, {cache: true}) %>
2 |
3 | <%- partial("_partial/screen", null, {cache: false}) %>
4 |
5 | <%- partial('_partial/list', {start: 1}) %>
6 |
7 | <% if (page.total > 1 && page.next_link){ %>
8 |
9 | <% } %>
10 |
11 |
12 | <% if (theme.beian.enable && theme.beian.enableFooter){ %>
13 |
<%=theme.beian.beianInfo%>
14 | <%}%>
15 |
16 |
--------------------------------------------------------------------------------
/layout/layout.ejs:
--------------------------------------------------------------------------------
1 | <%- partial('_partial/head') %>
2 |
3 |
<%= config.title %>
4 |
5 | <%- body %>
6 |
7 | <%- partial('_partial/scripts', null, {cache: true}) %>
8 | <%- partial('_partial/mathjax', null, {cache: true}) %>
9 | <%- partial("_partial/google-analytics", {cache: true}) %>
10 |
11 |
--------------------------------------------------------------------------------
/layout/page.ejs:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
7 |
8 |
9 | <% if (page.search || page.type === "search") { %>
10 | <%- partial('_partial/search') %>
11 | <% } else if (page.type === "tags") { %>
12 | <%- partial('_partial/tags') %>
13 | <% } else if (page.type === 'categories') { %>
14 | <%- partial('_partial/categories') %>
15 | <% } else { %>
16 | <%- page.content %>
17 | <% } %>
18 |
19 |
20 |
21 |
22 |
23 |
--------------------------------------------------------------------------------
/layout/post.ejs:
--------------------------------------------------------------------------------
1 |
2 | <%- partial("_partial/post/header")%>
3 |
4 | <%- partial("_partial/post/article")%>
5 |
6 |
--------------------------------------------------------------------------------
/layout/tag.ejs:
--------------------------------------------------------------------------------
1 | <%- partial('index', {pagination: config.tag, index: false}) %>
--------------------------------------------------------------------------------
/scripts/page_title.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Page Title Helper
3 | * @description Generate page title.
4 | * @example
5 | * <%- page_title() %>
6 | */
7 | hexo.extend.helper.register("page_title", function () {
8 | var title = this.config.title
9 | if (this.config.subtitle) {
10 | title += ' - ' + this.config.subtitle;
11 | }
12 |
13 | if (this.is_archive()) {
14 | title = this.__("nav.archive");
15 |
16 | if (this.is_month()) {
17 | title += ": " + this.page.year + "/" + this.page.month;
18 | } else if (this.is_year()) {
19 | title += ": " + this.page.year;
20 | }
21 | } else if (this.is_category()) {
22 | title = this.__("nav.category") + ": " + this.page.category + ' - ' + this.config.title;
23 | } else if (this.is_tag()) {
24 | title = this.__("nav.tag") + ": " + this.page.tag + ' - ' + this.config.title;
25 | } else if (this.is_post()) {
26 | title = this.page.title + ' - ' + this.config.title;
27 | }
28 |
29 | return title;
30 | });
31 |
--------------------------------------------------------------------------------
/source/css/diaspora.css:
--------------------------------------------------------------------------------
1 | body,div,h1,h2,h3,h4,h5,p,ul,li {margin:0;padding:0;font-weight:normal;list-style:none;}
2 | html {-webkit-text-size-adjust:100%;}
3 | html,body {-webkit-tap-highlight-color:rgba(0,0,0,0);-webkit-font-smoothing:antialiased;background:#fff;}
4 | body {font-family:'PingFang SC','Hiragino Sans GB','Microsoft Yahei','WenQuanYi Micro Hei',sans-serif;font-size:14px;position:relative;overflow-x:hidden;}
5 | body:before {background:grey;position:absolute;content:'';display:block;width:14px;height:14px;left:50%;top:50%;margin-left:-7px;margin-top:-7px;border-radius:50%;-webkit-border-radius:50%;-moz-border-radius:50%;-webkit-animation:loading 2s ease-out forwards infinite;-moz-animation:loading 2s ease-out forwards infinite;display:none;}
6 | body.loading:before {display:block;}
7 | @-webkit-keyframes loading {
8 | 0% {-webkit-transform:scale(0.3);}
9 | 50% {-webkit-transform:scale(1.0);}
10 | 100% {-webkit-transform:scale(0.3);}
11 | }
12 | @-moz-keyframes loading {
13 | 0% {-moz-transform:scale(0.3);}
14 | 50% {-moz-transform:scale(1.0);}
15 | 100% {-moz-transform:scale(0.3);}
16 | }
17 | body.loading #container,body.loading #single,body.loading .nav {opacity:0;}
18 | html.loading,body.loading {height:100%;overflow:hidden;}
19 | a,a:hover {text-decoration:none;}
20 | img {display:block;max-width:100%;height:auto;}
21 | audio {display:none;visibility:hidden;opacity:0;width:0;height:0;}
22 | #screen {position:relative;}
23 | #mark {width:100%;height:560px;overflow:hidden;}
24 | .layer {position:relative;}
25 | #cover {position:absolute;max-width:none;}
26 | #header {position:absolute;top:70px;width:100%;}
27 | #header > div {margin:0 60px;position:relative;}
28 | .icon-menu {font-size:20px;padding:6px 6px 5px;border-radius:2px;cursor:pointer;position:absolute;z-index:4;right:0;top:0;margin-top:-3px;background:rgba(255,255,255,.9);}
29 | .icon-search {font-size:20px;padding:6px 6px 5px;border-radius:2px;cursor:pointer;position:absolute;z-index:4;right:40px;top:0;margin-top:-3px;background:rgba(255,255,255,.9);}
30 | .image-logo {z-index:4;position:relative;display:inline-block;-webkit-background-size:75px 32px;-moz-background-size:75px 32px;background-size:75px 32px;background-repeat:no-repeat;background-position:center center;-webkit-mask-box-image:url("/img/logo.png");background-color:white;width:75px;height:32px;mask-image:url("/img/logo.png");mask-size:contain;transition: background-color 0.5s ease-in-out;}
31 | body.mu .image-logo {background-color:black;}
32 | #vibrant {position:absolute;top:0;left:0;width:100%;height:100%;}
33 | #vibrant div {position:absolute;top:0;left:0;width:100%;height:100%;opacity:0;background-color:#000;}
34 | #post0 {width:28%;position:absolute;top:42%;left:10%;}
35 | #post0 p:first-child {color:#fff;font-size:12px;}
36 | #post0 h2 {font-size:28px;margin-top:15px;}
37 | #post0 h2 a {color:#fff;}
38 | #post0 h2 + p {color:#fff;font-size:14px;margin-top:30px;}
39 | .post {margin:100px auto 0;width:1200px;position:relative;}
40 | .post > a {display:inline-block;width:680px;height:440px;overflow:hidden;position:relative;z-index:3;}
41 | .else {position:absolute;background:#fff;text-align:left;top:20px;height:398px;width:498px;border:1px solid #eaeaea;}
42 | .post:nth-child(odd) {text-align:left;}
43 | .post:nth-child(even) {text-align:right;}
44 | .post:nth-child(odd) .else {left:660px;}
45 | .post:nth-child(even) .else {right:660px;}
46 | .else p:first-child {color:#999;font-size:12px;margin:80px 0 0 80px;}
47 | .else h3 {font-size:30px;line-height:1.1;margin:10px 100px 0 80px;}
48 | .else h3 a {color:#333;}
49 | .else h3 + p {color:#555;margin:10px 100px 0 80px;font-size:14px;line-height:1.8;}
50 | .here {position:absolute;left:80px;bottom:80px;color:#999;font-size:13px;}
51 | .here span {display:inline-block;vertical-align:middle;margin-right:10px;font-family:"icomoon","Hiragino Sans GB","Hiragino Sans GB W3","Microsoft YaHei","WenQuanYi Micro Hei",sans-serif;}
52 | .here span:before {display:inline-block;vertical-align:top;margin-right:7px;font-size:16px;}
53 | .here a {display:inline-block;cursor:default;}
54 | #pager {text-align:center;margin:70px 0 0;position:relative;}
55 | #pager a {font-size:14px;letter-spacing:5px;color:#666;border:1px solid #dadada;padding:10px 40px;background:#fff;}
56 | #loader {display:none;position:fixed;top:0;width:100%;height:3px;z-index:100;background-image:-webkit-linear-gradient(left,#F16F5C 0%,#F16F5C 12.5%,#5B56DD 12.5%,#5B56DD 25%,#E15CED 25%,#E15CED 37.5%,#27E559 37.5%,#27E559 50%,#18C8C9 50%,#18C8C9 62.5%,#DC8987 62.5%,#DC8987 75%,#BB83D6 75%,#BB83D6 87.5%,#E774BD 87.5%,#E774BD 100%);background-image:-moz-linear-gradient(left,#F16F5C 0%,#F16F5C 12.5%,#5B56DD 12.5%,#5B56DD 25%,#E15CED 25%,#E15CED 37.5%,#27E559 37.5%,#27E559 50%,#18C8C9 50%,#18C8C9 62.5%,#DC8987 62.5%,#DC8987 75%,#BB83D6 75%,#BB83D6 87.5%,#E774BD 87.5%,#E774BD 100%);}
57 | #top {height:50px;text-align:center;border-bottom:1px solid #f7f7f7;background:#fefefe;width:100%;position:fixed;top:0;z-index:10;display:none;}
58 | body.touch #top {position:relative;}
59 | .icon-icon {color:#333;font-size:20px;position:absolute;left:14px;top:16px;}
60 | .image-icon {-webkit-background-size:24px 24px;-moz-background-size:24px 24px;background-size:24px 24px;background-position:center center;background-repeat:no-repeat;width:24px;height:24px;position:absolute;left:14px;top:15px;color:#333;}
61 | .image-icon:hover {color:black;}
62 | .subtitle {color:#666;font-size:14px;margin-top:16px;display:none;}
63 | .icon-play,.icon-pause,.icon-images {position:absolute;left:70px;color:#666;top:17px;font-size:18px;cursor:pointer;}
64 | .icon-images {left:100px;}
65 | .icon-images.active {color:#EF6D57;}
66 | #top .count {display:none;}
67 | .social {position:absolute;right:0;height:30px;top:12px;}
68 | .share a {display:inline-block;color:#666;margin-right:15px;}
69 | .share a:hover {color:#333;}
70 | .share {position:relative;}
71 | .social > div {display:inline-block;font-size:20px;color:#666;cursor:pointer;margin-left:15px;}
72 | #qr {z-index:10;display:none;position:absolute;background:#fff;padding:16px;border:1px solid #f7f7f7;right:10px;top:50px;}
73 | .bar {position:absolute;height:100%;background:rgba(0,0,0,.07);z-index:-1;width:0;-webkit-transition:width .5s ease;-moz-transition:width .5s ease;transition:width .5s ease;}
74 | .scrollbar {position:absolute;height:2px;width:10px;top:0;background-color:#50bcb6;-webkit-transition:width .5s ease;-moz-transition:width .5s ease;transition:width .5s ease;}
75 | body.touch .scrollbar {display:none;}
76 | .nav {position:fixed;height:100%;width:100%;background:rgba(255,255,255,.97);z-index:3;top:-100%;-webkit-transition:top 0.3s cubic-bezier(0.4,0,0.2,1);-moz-transition:top 0.3s cubic-bezier(0.4,0,0.2,1);transition:top 0.3s cubic-bezier(0.4,0,0.2,1);}
77 | body.mu {overflow:hidden;height:100%;}
78 | html.mu {height:100%;}
79 | body.mu .icon-menu {color:#333;background: none;}
80 | body.mu .icon-search {color:#333;background: none;}
81 | body.mu .icon-menu:before {content:"\e689";}
82 | body.mu .nav {top:0;}
83 | body.mu .icon-logo {color:#333;}
84 | .menu {text-align:center;margin-top:200px;}
85 | .menu ul {display: -webkit-box;display: -ms-flexbox;display: flex;-webkit-box-pack: center;-ms-flex-pack: center;justify-content: center;-ms-flex-wrap: wrap;flex-wrap: wrap;list-style-type: none;padding: 0;}
86 | .menu li {font-size:18px;display:inline-block;margin:0 2px 2px 0;}
87 | .menu li:not(:last-child) {margin-right: 5px;}
88 | .menu a {display: block;font-size: 20px;color: #666;text-decoration: none;padding: 5px;margin: auto 10px;border-bottom: .1em solid transparent;}
89 | .menu a:hover {color:#333; border-bottom: .1em solid #9e1900; padding-bottom: .15em; transition: 150ms ease-in-out;}
90 | .nav p {color:#999;font-size:12px;position:absolute;width:100%;text-align:center;bottom:30px;}
91 | .nav p a {color:#999;text-decoration:underline;}
92 | .nav p:first-letter {font-family:sans-serif;}
93 | .nav .hitokoto {text-align:center;font-size: 16px;margin: 10% auto 10px;padding: 10px 20px 10px;color: darkgray;max-width:800;}
94 | .nav .footerlinks {font-size: 45px; margin: 20px 1px 30px;padding: 10px 1px 10px;}
95 | .nav .footerlinks a {font-size: 35px; text-decoration:none;}
96 | .nav .footerlinks a:hover { color: #737373;}/* 鼠标移动到链接上 */
97 |
98 | .set {display:block;max-width:768px;margin:0 auto 30px;line-height:2;padding-left:30px}
99 | .set h3 {font-size:22px;font-weight:500;margin:15px 0 20px}
100 | .set a {display:inline-block;position:relative;color:#424242;padding:5px 5px;}
101 | .set a::before {content:"";position:absolute;width:0;right:0;bottom:0;height:2px;background:#2196F3}
102 | .set a:hover {color:#2196F3!important}
103 | .set .category-list-item,.set .tag-list-item {display:inline-block;font-size:17px;text-align:left}
104 | .set .category-list-item .category-list-count,.set .category-list-item .tag-list-count,.set .tag-list-item .category-list-count,.set .tag-list-item .tag-list-count {color:#9E9E9E;font-style:normal}
105 | .set .category-list-item .category-list-count::before,.set .category-list-item .tag-list-count::before,.set .tag-list-item .category-list-count::before,.set .tag-list-item .tag-list-count::before {content:"["}
106 | .set .category-list-item .category-list-count::after,.set .category-list-item .tag-list-count::after,.set .tag-list-item .category-list-count::after,.set .tag-list-item .tag-list-count::after {content:"]"}
107 | .set .category-list-item {width:30%;margin:5px 0}@media screen and (max-width:768px) {.set .category-list-item {width:100%}}
108 | .set .tag-list-item {margin:10px 20px}
109 | .set .search .search-input {width: 100%;height: 42px;background: transparent;border: 0px;border-bottom:2px solid #6558BC;font-size:20px;padding-top: 20px;}
110 | .set .search .search-input[type=text]:focus{outline: none;border: 0px;border-bottom:2px solid #6558BC;}
111 | .set .search .local-search-result {margin-top:30px;}
112 | .set .search .search-result-list {padding:0;margin: 0;}
113 | .set .search .search-result-title {font-size:23px;}
114 | .set .search .search-result {}
115 | .set .search .search-keyword {background:yellow;padding:2px auto 2px;}
116 | .set .search li {list-style: none; margin: 0;border-bottom:1px dashed #E3E3E3;}
117 | .timeline {display:block;max-width:768px;margin:30px auto 40px;padding-left:30px;border-left:3px solid #B0BEC5}
118 | .timeline .timeline-title::before,.timeline .timeline-subtitle::before,.timeline .timeline-item::before {position:absolute;top:50%;transform:translateY(-50%);border-style:solid;border-color:#B0BEC5;border-radius:50%;background:white;content:"";transition:all .3s ease}
119 | .timeline-title,.timeline-subtitle,.timeline-item {position:relative;margin-bottom:25px;line-height:32px}
120 | .timeline-title:hover::before,.timeline-subtitle:hover::before,.timeline-item:hover::before {border-color:#2196F3}
121 | .timeline-title:hover a,.timeline-subtitle:hover a,.timeline-item:hover a {color:#2196F3}
122 | .timeline-title {font-size:28px}
123 | .timeline-title::before {width:12px;height:12px;border-width:4px;left:-42px}
124 | .timeline-subtitle {font-weight:400;font-size:22px}
125 | .timeline-subtitle::before {width:11px;height:11px;border-width:3px;left:-40px}
126 | .timeline-item {font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen,Ubuntu,Cantarell,Fira Sans,Droid Sans,Helvetica Neue,sans-serif;position:relative;padding-left:100px}
127 | .timeline-item time {position:absolute;left:0;top:50%;transform:translateY(-50%);display:inline-block;font-weight:300;color:#616161;width:100px}
128 | .timeline-item a {color:#212121;font-weight:400;transition:all .3s ease}
129 | .timeline-item::before {width:9px;height:9px;border-width:2px;left:-38px}
130 | #container {padding-bottom:100px;overflow:hidden;position:relative;}
131 | #container:before {content:'';display:block;width:1px;height:200%;position:absolute;left:50%;background:#eaeaea;top:-50%;z-index:0;}
132 | #primary {position:relative;}
133 | #single {background:#fff;position:relative;overflow-x:hidden;}
134 | .section {position:relative;width:100%;overflow:hidden;-webkit-transition:all 0.3s cubic-bezier(0.25,0.5,0.5,0.9);-moz-transition:all 0.3s cubic-bezier(0.25,0.5,0.5,0.9);transition:all 0.3s cubic-bezier(0.25,0.5,0.5,0.9);}
135 | body.touch,body.touch .article {margin-top:0;}
136 | .zoom:before {opacity:0;color:#fff;font-size:20px;display:block;z-index:3;left:50%;top:70%;padding:5px;margin-top:-15px;margin-left:-15px;position:absolute;background:rgba(0,0,0,.7);-webkit-transition:all 0.3s cubic-bezier(0.25,0.5,0.5,0.9);-moz-transition:all 0.3s cubic-bezier(0.25,0.5,0.5,0.9);transition:all 0.3s cubic-bezier(0.25,0.5,0.5,0.9);}
137 | .zoom:hover:before {opacity:1;top:50%;}
138 | .touch .zoom:hover:before {opacity:0;}
139 | .icon-arrow-left:before {content:'\e606';position:absolute;left:0;top:50%;margin-top:-30px;color:#666;}
140 | .icon-arrow-right:before {content:'\e605';position:absolute;right:0;top:50%;margin-top:-30px;color:#666;}
141 | h1.title {font-size:30px;color:#333;line-height:1.3;position:relative;font-weight:bold;}
142 | .page .content:before {display:none;}
143 | .stuff {margin-top:20px;color:#666;font-size:13px;}
144 | .stuff span {display:inline-block;margin-right:20px;}
145 | .stuff .likeThis {pointer-events:none;}
146 | .stuff .icon-like {display:none;}
147 | .stuff .count {color:#666;}
148 | .comment {margin:50px auto;}
149 | .comment.link,.downloadlink {cursor:pointer;letter-spacing:5px;border:1px solid #dadada;width:170px;text-align:center;color:#666;font-size:14px;padding:10px 0;}
150 | .comment .gt-comments-null{display:none;}
151 | .comment .gt-header-textarea{border-radius:0;background: white;}
152 | .comment .gt-popup{margin-top:8px;}
153 | .comment .gt-counts a{color:black;border-bottom:0;pointer-events:none;}
154 | .comment .gt-avatar-github{display:none;}
155 | .comment .gt-header-avatar{display:none;}
156 | .comment .gt-header-comment{margin-left: 0;!important;}
157 | .comment .gt-header-preview{border-radius:0;}
158 | .comment .gt-btn-public{border-radius:0;}
159 | .comment .gt-btn-preview{border-radius:0;}
160 | .comment .gt-btn-login{border-radius:0;}
161 | .comment .gt-ico-tip{display:none;}
162 | .comment .gt-btn-public .gt-btn-text:after{content:"(Cmd | Ctrl + Enter)";}
163 | .comment .gt-meta{margin:0; border:0;}
164 | #preview {position:fixed;top:0;width:100%;height:100%;z-index:5;background:#fff;left:100%;-moz-transition:all 0.3s cubic-bezier(0,0,0.2,1);-webkit-transition:all 0.3s cubic-bezier(0,0,0.2,1);transition:all 0.3s cubic-bezier(0,0,0.2,1);overflow-y:scroll;}
165 | #preview.show {left:0;}
166 | #preview + canvas {display:none;}
167 | .article {width:70%;margin:0 auto;margin-top:50px;display:-webkit-flex;display:flex;-webkit-align-items:center;align-items:center;-webkit-justify-content:flex-start;justify-content:flex-start;}
168 | .article > div {width:100%;padding:30px 0;margin:0 auto;}
169 | .article .main {width:700px;}
170 | .article .side {align-self:flex-start;flex:0 0 220px;}
171 | .article .toc {width:200px;height:100%;/*position:fixed;*/top:60px;right:100px;padding:1em;line-height:2.3;overflow-y:auto;}
172 | .article .toc .toc-item:hover {font-weight:900;}
173 | .article .toc li a {display:inline-block;color:#737373;text-decoration:none;transition:color,padding 0.2s ease-in-out;}
174 | .article .toc li a:hover {padding-left:8px;border-left:3px solid black;}
175 | .page .main{padding:0px;}
176 |
177 | /* Icon font style */
178 | @font-face{font-family:"iconfont";src:url(//at.alicdn.com/t/font_1679264_tle9h9614mq.eot?t=1583722241347);src:url(//at.alicdn.com/t/font_1679264_tle9h9614mq.eot?t=1583722241347#iefix) format("embedded-opentype"),url(data:application/x-font-woff2;charset=utf-8;base64,d09GMgABAAAAAAi8AAsAAAAAECAAAAhtAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHEIGVgCEbgqQdI0WATYCJAM8CyAABCAFhG0HgRkbVw3Inpo8CYIQIpAQFdqG+3gInq/9Xs+9uw8+oUtSRgVECtF2KoOqgOAAHQGEbes6+wNt898F4Z31ldA+7aWxbFgFsSjEIzbg2HHMZQlbH7lIY7iKIFbhj+gckPwvEvGDNVdFtDOxtl7e5AYcpp5UkyYiIYloHUk1QyNkSm+AgHg2w8FyPnoIJ0OAKKW0BhmuGKoCMRYpCZVWmY06EA+EYad4CmGQ79nRgmwGj1Br0XvApvTnpYleIgYUz4A81eQlA6qhdy3U1ppF/1cwy/BQsb4YoLYYGKALgK2ZLntDzoIsHW+MaE1LDVAkOfgL/Fr7Wfazgs/afFb52eDPhn427rNJn9U6B7VAW3JuoUiO+gceECFKnARJLIYYHgEhPoqA+IAcD22v5iehFowBEahFkCiAgsQBDCQB4NDLQQoSo1CAxHzQBiQGVIJ4wGCQABgKEgLjQHxgEogCtbD3lJxyO5QCdAC0CjAzQZqmp3GCXmnZ3H0JipeXDZA2KSxeLirsLPESmzR8II4LRTQeH6+jZfGiZHOSTC4kxDkM3vo9vD8gpasjLU9dg9xIa/k2B2UGIzllAYnaLXf4FstYb3E8oUfqmTvDPoWoDy1uKiHr9i5qtCbGVkmedsLlSZJu56REq6Su2Oe9wNzqNka6TMP7pai/kHB5EWSxV0bwPGA2lxFeL4L5gjLeD3qgA+me8KRJ0uOB6QdI8iSCLQ4aEyN/1LHPtdHPNOFmK4ESGIGQyLaYloTo2j1pQM5NwhN10agm+lIb+6iORNTh5skSXrLn3I50V3FUE2rplfFp/p0tPB4pLwvNL9tyuEVdEX9CFjhfVFfCF55qv+dYsbSu6HiH47FOsZh2e06rplbH2vvkTbmSxvahO4U7IMSkg/tNDlS8V7n2ldr76J6xmL2c0Uc19eHG/A3XcG8oWhhWP4KKN+rGrHDf6EC+7rQ027P39PVOh1ibd8miL6aTOGGk2TuPpCWKFbLGORI2UqVkSF54EOQOUD0pnJFVAkFFjp4eaZh7EjzDzSrzxD4fywMVZ4oSGpoyMa9Xomp0tdR4ecbC81La45YbfcG5i5VwhbtfiBIL1/QAB7pKI++L/Edp+Kj1yeW+zO25iM/I1wc3y8nTEs6ry43dAdixW+3yBn2kry7gl5CR5WJLD7Mbi6ndndSVZ2O50WjV4DF2RrqotHXHSTKYEYupyejbSfsmavfzQBBunoskGkdX02MMoqOjRtWo1f/riWpGjSrGV/+v8BwYDnQV6eeuOZl9cu7qmweSWcmbU9FUv2y22h6Ory2jaktqqbLkQEngEPSq0G67SJey1NrS2tSylEBp4HBli4Yc257Zq0MLk37jwMh9fvU0lLsk73QwGKgI/eKXif+v9/1twov4p+lFl4ajg0H3/N0oVEs+2tOtzS2pZPQhtxjuJrTd86j1WGQU/F8O/qEF9RwXk6gW+PPy4HO/nTjCNaLvzL5DM7tMGIMa2MFEa1WYICQPsyikDm2F/40DNnTd2LWFzW63tci+zvqejf/IAfxZi1zjqx+/OTv+a2v2SU3qgE69cbVibR/ba6X61oBF7OPINfTPG12ruJE714RuF1P/dui9El1SWZdR0tN0eyJ6b2HugnVyy6z03suy2vbX08921/+gT/vLwJplI8+vWnV+5CNNJETxTE0NVwh/O7FThCPI4h4hNnXGkknahb0yFIf7yH6+f2jTuoYryozLmUppb0Y7iVnskLzyT5ek9JyQbsjpvDYyxI36+1ULsPypopG+9hfE0Pdlv/p+I+vsQtDlcEbzgO3bB3y3zQjNeSwxorkaNqL/mI349v3bw9ZKHr1xF/NgvBP5mCAA5VHPop6xHBoIoBzqCAStJxoM/iIXDEyeJJHMTJUAZRadYqa8sh77k+atkzaVR8o345nh56sf3FF1GX3/nvOzLCcJh6+ZxVj/pP5iQafJ0G0qgjLr+Olo+9ktOnY0QvucGHgiKCMQYaRcB22k/jhwNfvUEHg2dqWyU6eFIz8KBQIY/2PjuHG7LyVccvHIf0e4OcF87Gp84g+JLt/77SS+1ovEkrgx6zcuamjkDhIb/1xYbejq8YhjKqJUd+6cOhYpjffLI4u7KrqgA2omDzxmQtx2VF1ZMfpG+kBVS81yuXS2WKByGlWQEeu/crzw33eaXyZ+prGy/Gfi9iuy+LMSCtofmTCi/yfJNYzdzhhSUmB2IwDukzpMCrgXFFgxAOYk+gW4WldMBuC2WASbBQD6SJ/6rIOn+20b1hfA/XMJIwAwY9Gf/7dWot+TL7pNSer+N4z9lmV+dD9H0pT/m69YX0UeIES/UMC/FFqYYuH4LifFVK8LmCG6Zj8DvabAFPMRxSm8LfvAf1RSljfbCy58W2OEcICpKZWAEqUhpI2lte2i9IjRR+kTMkgZpTPK3WPkYMEQGwfQieVCKaQ5qFSSXBONz/a+aLF9rfQo8q3g4yqYMspMST1gjHZiJvqxtI6jq6mq2ZRZz9gMOpIjssqjaaPTomMDLlpLQ7MOM2OjKtqW9wuVtI1m17GJY6axkuMMlIFlrJRCbEBbLAxlZ5lptJ5ra6LA3rWszNDYtK2esQLBMFhodHBOuxqKKmYbm9HDYMMwMQcx8v2joTHixIIOdkqrHWMNNCwOzPOnqKAt5XNYKmXbXK3uS00HMzFSCRfEGKBMQxYGKxSKIIbGovIYKOz+5aZBo4ejLaYlcux0pSzoyDCv3Hb7JuvtPguIIo+QEhTBEBwRIEJEhIiROORzf7F4JAFJRJKQZAQLLYyDxu0W3WzcStucuIlJDiI26PR0FcNMF3E1Zo6jWaFRlDQ5qwR2nXPGS3HodTahg9axepOAturMFtxink4La2i9ScfhFtrAAQAAAA==) format("woff2"),url(//at.alicdn.com/t/font_1679264_tle9h9614mq.woff?t=1583722241347) format("woff"),url(//at.alicdn.com/t/font_1679264_tle9h9614mq.ttf?t=1583722241347) format("truetype"),url(//at.alicdn.com/t/font_1679264_tle9h9614mq.svg?t=1583722241347#iconfont) format("svg")}
179 | .iconfont{font-family:"iconfont"!important;font-size:22px;font-style:normal;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}
180 | .icon-close:before{content:"\e689"}
181 | .icon-play:before{content:"\e65d"}
182 | .icon-menu:before{content:"\e623"}
183 | .icon-home:before{content:"\e612"}
184 | /*.icon-facebook:before{content:"\e632"}*/
185 | /*.icon-twitter:before{content:"\e659"}*/
186 | /*.icon-github:before{content:"\e64a"}*/
187 | .icon-pause:before{content:"\e64c"}
188 | .icon-scan:before{content:"\e600"}
189 | .icon-search:before{content:"\e601"}
190 | /*.icon-email:before{content:"\e62d"}*/
191 | .icon-like:before{content:"\e602"}
192 | /*.icon-wechat:before{content:"\e603"}*/
193 | .icon-left:before{content:"\e604"}
194 |
195 | @font-face {
196 | font-family: "iconfont"; /* Project id 2609542 */
197 | src: url('//at.alicdn.com/t/font_2609542_9phvm77zuvw.woff2?t=1623581069201') format('woff2'),
198 | url('//at.alicdn.com/t/font_2609542_9phvm77zuvw.woff?t=1623581069201') format('woff'),
199 | url('//at.alicdn.com/t/font_2609542_9phvm77zuvw.ttf?t=1623581069201') format('truetype');
200 | }
201 |
202 | .iconfont {
203 | font-family: "iconfont" !important;
204 | font-size: 22px;
205 | font-style: normal;
206 | -webkit-font-smoothing: antialiased;
207 | -moz-osx-font-smoothing: grayscale;
208 | }
209 |
210 | .icon-github:before {
211 | content: "\e7d1";
212 | }
213 |
214 | .icon-email:before {
215 | content: "\e6da";
216 | }
217 |
218 | .icon-wechat:before {
219 | content: "\e7e3";
220 | }
221 |
222 | .icon-twitter:before {
223 | content: "\e7e2";
224 | }
225 |
226 |
227 | /* tags style */
228 | .post-tags-list {margin-top:10px;display:table;}
229 | .post-tags-list-item {float:left;margin-right:10px;background:rgba(102,128,153,0.075);border-radius:0;padding:2px 5px;}
230 | .post-tags-list-link {color:rgba(44,63,81,0.5);}
231 |
232 | /* Post or Page content style */
233 | .content {margin-top:50px;font-size:15px;line-height:2;color:#232323;}
234 | .content h1 {font-size:39px}
235 | .content h2 {font-size:32px}
236 | .content h3 {font-size:26px}
237 | .content h4 {font-size:19px}
238 | .content h5 {font-size:15px}
239 | .content h6 {font-size:13px}
240 | .content strong {font-weight:500;}
241 | .content a {background:transparent;color:#1980e6;text-decoration:none;}
242 | .content a:hover {color:#518dca;}
243 | .content hr {margin-top:21px;margin-bottom:21px;border:0;border-top:1px solid rgba(102,128,153,0.1)}
244 | .content p {margin:0 0 .8em;}
245 | .content ul,.content ol {margin:10px 0;padding-left:20px;}
246 | .content ul li {list-style:disc;margin:5px 0;}
247 | .content ol li {list-style:decimal;margin:5px 0;}
248 | .content > h1,.content > h2,.content > h3,.content > h4,.content > h5,.content > h6 {margin-top:2rem;margin-bottom:0.8rem;color:#000;}
249 | .content > h1:first-child,.content > h2:first-child,.content > h3:first-child,.content > h4:first-child,.content > h5:first-child,.content > h6:first-child {margin-top:0;}
250 | .content img {cursor:pointer;}
251 | .content pre,.content .highlight {background:#2d2d2d;margin:1.6rem 0;padding:0.8rem 0.8rem;border-style:solid;border-width:1px 0;overflow:auto;color:#ccc;line-height:20px;}
252 | .content .gutter {display:none;}
253 | .content .highlight .gutter pre {color:#666;font-size:0.9rem;}
254 | .content code,.content pre {font-family:"Source Code Pro",monospace}
255 | .content code {background:rgba(99,99,99,0.07);color:#ef459c;padding:1px 2px;border-radius:2px;}
256 | .content pre code {background:none;text-shadow:none;padding:0;}
257 | .content blockquote {color:#656565;margin:0 0 1.1em;border-left:3px solid #efefef;border-left-width:6px;background-color:rgba(119,119,119,0.05);border-top-right-radius:5px;border-bottom-right-radius:5px;padding:15px 20px;}
258 | .content blockquote p {margin:0;}
259 | .content table {margin:15px 0;border-collapse:collapse;display:table;width:100%;table-layout:fixed;word-wrap:break-word;}
260 | .content table tr {border-top:1px solid #ccc;background-color:#fff;}
261 | .content table th,.content table td {border:1px solid #ddd;padding:6px 13px;}
262 | .content .highlight pre {border:none;margin:0;padding:0;}
263 | .content .highlight table {margin:0;width:auto;}
264 | .content .highlight td {border:none;padding:0;}
265 | .content .highlight tr {border:0;}
266 | .content .highlight figcaption {font-size:0.85em;color:#999;line-height:1em;margin-bottom:1em;}
267 | .content .highlight figcaption a {float:right;}
268 | .content .highlight .gutter pre {text-align:right;padding-right:20px;}
269 | .content .highlight .line {height:20px;}
270 | .content .video-container {position:relative;padding-bottom:56.25%;padding-top:25px;height:0;}
271 | .content .video-container iframe {position:absolute;top:0;left:0;width:100%;height:100%;}
272 | pre .comment,pre .title {color:#999;}
273 | pre .variable,pre .attribute,pre .tag,pre .regexp,pre .ruby .constant,pre .xml .tag,pre .title,pre .xml .pi,pre .xml .doctype,pre .html .doctype,pre .css .id,pre .css .class,pre .css .pseudo {color:#f2777a;}
274 | pre .number,pre .preprocessor,pre .built_in,pre .literal,pre .params,pre .constant {color:#f99157;}
275 | pre .class,pre .ruby .class .title,pre .css .rules .attribute {color:#99cc99;}
276 | pre .string,pre .value,pre .inheritance,pre .header,pre .ruby .symbol,pre .xml .cdata {color:#99cc99;}
277 | pre .css .hexcolor {color:#66cccc;}
278 | pre .function,pre .python .decorator,pre .python .title,pre .ruby .function .title,pre .ruby .title .keyword,pre .perl .sub,pre .javascript .title,pre .coffeescript .title {color:#6699cc;}
279 | pre .keyword,pre .javascript .function {color:#cc99cc;}
280 |
281 | /* Responsive style */
282 | @media screen and (max-width:1200px) {
283 | #header > div {width:900px;margin:0 auto;}
284 | #post0 {width:32%;}
285 | #post0 h2 {font-size:24px;}
286 | .post {width:900px;}
287 | .post > a {width:480px;height:310px;}
288 | .else {top:10px;width:420px;height:290px;}
289 | .post:nth-child(odd) .else {left:450px;}
290 | .post:nth-child(even) .else {right:450px;}
291 | .else p:first-child {font-size:12px;margin:50px 0 0 60px;}
292 | .else h3 {font-size:24px;margin:10px 60px 0 60px;}
293 | .else h3 + p {margin:10px 60px 0 60px;}
294 | .here {left:60px;bottom:50px;}
295 | .article{width:100%;}
296 | .article .main{width:94%;}
297 | .article .side {display:none}
298 | .comment .gt-btn-public .gt-btn-text:after{content:"";}
299 | }
300 | @media screen and (max-width:900px) {
301 | #mark {height:480px;}
302 | #header > div {width:90%;}
303 | #vibrant polygon {transform:translateX(-10%);-moz-transform:translateX(-10%);-webkit-transform:translateX(-10%);}
304 | #post0 {width:40%;}
305 | #post0 h2 {font-size:20px;}
306 | .post {width:100%;margin-top:60px;background:#fff;padding-bottom:30px;border-bottom:1px solid #eaeaea;}
307 | .post > a {display:block;margin:0 auto;width:100%;height:auto;}
308 | .post > a img {margin:0 auto;}
309 | .else {height:auto;position:static;width:100%;margin:0 auto;background:transparent;border:none;}
310 | .else p:first-child {margin:30px 0 0 20px;}
311 | .else h3 {font-size:24px;margin:10px 30px 0 20px;}
312 | .else h3 + p {margin:10px 30px 0 20px;}
313 | .here {position:static;margin:20px 0 20px 20px;}
314 | .article{width:100%;}
315 | .article .main{width:94%;}
316 | .article .side {display:none}
317 | .comment .gt-btn-public .gt-btn-text:after{content:"";}
318 | }
319 | @media screen and (max-width:780px) {
320 | #header {top:40px;}
321 | #vibrant svg {display:none;}
322 | #vibrant div {opacity:0.3;}
323 | #container {padding-bottom:50px;}
324 | #post0 {bottom:60px;top:auto;width:70%;left:5%;}
325 | .menu {width:90%;margin:160px auto 0;}
326 | .menu li {font-size:16px;}
327 | #pager {margin:30px 0 0;}
328 | h1.title {font-size:24px;}
329 | .tab {display:none;}
330 | .icon-scan {display:none!important;}
331 | .icon-images {left:80px;}
332 | .icon-pause,.icon-play {left:50px;}
333 | .comment.link {width:140px;padding:5px 0;}
334 | .article{width:100%;}
335 | .article .main{width:94%;}
336 | .article .side {display:none}
337 | .comment .gt-btn-public .gt-btn-text:after{content:"";}
338 | }
339 | @media screen and (max-width:480px) {
340 | #post0 p:first-child {display:block;}
341 | #container:before {display:none;}
342 | #post0 h2 {text-align:left;margin:0 10px 0 0;}
343 | #post0 h2 + p {text-align:left;margin:10px 20px 0 0;color:#f2f2f2;font-size:14px;}
344 | #post0 h2 a {color:#fff;}
345 | #post0 .summary {display:none;}
346 | .stuff span {margin-right:10px;}
347 | .stuff span:first-child {display:none;}
348 | .content table {font-size:smaller;}
349 | .content table tr td {padding:6px;}
350 | .article {width:100%;}
351 | .article .main{width:94%;}
352 | .article .side {display:none}
353 | .comment .gt-btn-public .gt-btn-text:after{content:"";}
354 | }
355 |
--------------------------------------------------------------------------------
/source/img/cover.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Fechin/hexo-theme-diaspora/a175c972d49c0ddd0106e7391d46f5bc3cc16a98/source/img/cover.jpg
--------------------------------------------------------------------------------
/source/img/favicon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Fechin/hexo-theme-diaspora/a175c972d49c0ddd0106e7391d46f5bc3cc16a98/source/img/favicon.png
--------------------------------------------------------------------------------
/source/img/logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Fechin/hexo-theme-diaspora/a175c972d49c0ddd0106e7391d46f5bc3cc16a98/source/img/logo.png
--------------------------------------------------------------------------------
/source/img/welcome-cover.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Fechin/hexo-theme-diaspora/a175c972d49c0ddd0106e7391d46f5bc3cc16a98/source/img/welcome-cover.jpg
--------------------------------------------------------------------------------
/source/js/diaspora.js:
--------------------------------------------------------------------------------
1 | var Home = location.href,
2 | Pages = 4,
3 | xhr,
4 | xhrUrl = '';
5 |
6 | var Diaspora = {
7 | L: function(url, f, err) {
8 | if (url == xhrUrl) {
9 | return false;
10 | }
11 | xhrUrl = url;
12 | if (xhr) {
13 | xhr.abort();
14 | }
15 | xhr = $.ajax({
16 | type: 'GET',
17 | url: url,
18 | timeout: 10000,
19 | success: function(data) {
20 | f(data);
21 | xhrUrl = '';
22 | },
23 | error: function(a, b, c) {
24 | if (b == 'abort') {
25 | err && err()
26 | } else {
27 | window.location.href = url;
28 | }
29 | xhrUrl = '';
30 | }
31 | });
32 | },
33 | P: function() {
34 | return !!('ontouchstart' in window);
35 | },
36 | PS: function() {
37 | if (!(window.history && history.pushState)){
38 | return;
39 | }
40 | history.replaceState({u: Home, t: document.title}, document.title, Home);
41 | window.addEventListener('popstate', function(e) {
42 | var state = e.state;
43 | if (!state) return;
44 | document.title = state.t;
45 |
46 | if (state.u == Home) {
47 | $('#preview').css('position', 'fixed');
48 | setTimeout(function() {
49 | $('#preview').removeClass('show');
50 | $('#container').show();
51 | window.scrollTo(0, parseInt($('#container').data('scroll')));
52 | setTimeout(function() {
53 | $('#preview').html('');
54 | $(window).trigger('resize');
55 | }, 300);
56 | }, 0);
57 | } else {
58 | Diaspora.loading();
59 | Diaspora.L(state.u, function(data) {
60 | document.title = state.t;
61 | $('#preview').html($(data).filter('#single'));
62 | Diaspora.preview();
63 | setTimeout(function() { Diaspora.player(); }, 0);
64 | });
65 | }
66 | });
67 | },
68 | HS: function(tag, flag) {
69 | var id = tag.data('id') || 0,
70 | url = tag.attr('href'),
71 | title = tag.attr('title') + " - " + $("#config-title").text();
72 |
73 | if (!$('#preview').length || !(window.history && history.pushState)) location.href = url;
74 | Diaspora.loading()
75 | var state = {d: id, t: title, u: url};
76 | Diaspora.L(url, function(data) {
77 | if (!$(data).filter('#single').length) {
78 | location.href = url;
79 | return
80 | }
81 | switch (flag) {
82 | case 'push':
83 | history.pushState(state, title, url)
84 | break;
85 | case 'replace':
86 | history.replaceState(state, title, url)
87 | break;
88 | }
89 | document.title = title;
90 | $('#preview').html($(data).filter('#single'))
91 | switch (flag) {
92 | case 'push':
93 | Diaspora.preview()
94 | break;
95 | case 'replace':
96 | window.scrollTo(0, 0)
97 | Diaspora.loaded()
98 | break;
99 | }
100 | setTimeout(function() {
101 | Diaspora.player();
102 | $('#top').show();
103 | comment = $("#gitalk-container");
104 | if (comment.data('ae') == true){
105 | comment.click();
106 | }
107 | }, 0)
108 | if (window.MathJax) {
109 | var math = document.getElementById("single")
110 | MathJax.Hub.Queue(["Typeset", MathJax.Hub, math])
111 | }
112 | })
113 | },
114 | preview: function() {
115 | // preview toggle
116 | $("#preview").one('transitionend webkitTransitionEnd oTransitionEnd otransitionend MSTransitionEnd', function() {
117 | var previewVisible = $('#preview').hasClass('show');
118 | if (!!previewVisible) {
119 | $('#container').hide();
120 | }else{
121 | $('#container').show();
122 | }
123 | Diaspora.loaded();
124 | });
125 | setTimeout(function() {
126 | $('#preview').addClass('show');
127 | $('#container').data('scroll', window.scrollY);
128 | setTimeout(function() {
129 | $('#preview').css({
130 | 'position': 'static',
131 | 'overflow-y': 'auto'
132 | });
133 | }, 500);
134 | }, 0);
135 | },
136 | player: function() {
137 | var p = $('#audio');
138 | if (!p.length) {
139 | $('.icon-play').css({
140 | 'color': '#dedede',
141 | 'cursor': 'not-allowed'
142 | })
143 | return
144 | }
145 | var sourceSrc= $("#audio source").eq(0).attr('src')
146 | if (sourceSrc == '' && p[0].src == ''){
147 | audiolist = $('#audio-list li');
148 | mp3 = audiolist.eq([Math.floor(Math.random() * audiolist.size())])
149 | p[0].src = mp3.data('url')
150 | }
151 |
152 | if (p.eq(0).data("autoplay") == true) {
153 | p[0].play();
154 | }
155 |
156 | p.on({
157 | 'timeupdate': function() {
158 | var progress = p[0].currentTime / p[0].duration * 100;
159 | $('.bar').css('width', progress + '%');
160 | if (progress / 5 <= 1) {
161 | p[0].volume = progress / 5;
162 | }else {
163 | p[0].volume = 1;
164 | }
165 | },
166 | 'ended': function() {
167 | $('.icon-pause').removeClass('icon-pause').addClass('icon-play')
168 | },
169 | 'playing': function() {
170 | $('.icon-play').removeClass('icon-play').addClass('icon-pause')
171 | }
172 | })
173 | },
174 | loading: function() {
175 | var w = window.innerWidth;
176 | var css = '';
181 | $('.loaderstyle').remove()
182 | $('head').append(css)
183 | $('#loader').removeClass().addClass('loader'+ w).show()
184 | },
185 | loaded: function() {
186 | $('#loader').removeClass().hide()
187 | },
188 | F: function(id, w, h) {
189 | var _height = $(id).parent().height(),
190 | _width = $(id).parent().width(),
191 | ratio = h / w;
192 | if (_height / _width > ratio) {
193 | id.style.height = _height +'px';
194 | id.style.width = _height / ratio +'px';
195 | } else {
196 | id.style.width = _width +'px';
197 | id.style.height = _width * ratio +'px';
198 | }
199 | id.style.left = (_width - parseInt(id.style.width)) / 2 +'px';
200 | id.style.top = (_height - parseInt(id.style.height)) / 2 +'px';
201 | }
202 | };
203 |
204 | $(function() {
205 | if (Diaspora.P()) {
206 | $('body').addClass('touch')
207 | }
208 | if ($('#preview').length) {
209 | var cover = {};
210 | cover.t = $('#cover');
211 | cover.w = cover.t.attr('width');
212 | cover.h = cover.t.attr('height');
213 | ;(cover.o = function() {
214 | $('#mark').height(window.innerHeight)
215 | })();
216 | if (cover.t.prop('complete')) {
217 | // why setTimeout ?
218 | setTimeout(function() { cover.t.load() }, 0)
219 | }
220 | cover.t.on('load', function() {
221 | ;(cover.f = function() {
222 | var _w = $('#mark').width(), _h = $('#mark').height(), x, y, i, e;
223 | e = (_w >= 1000 || _h >= 1000) ? 1000 : 500;
224 | if (_w >= _h) {
225 | i = _w / e * 50;
226 | y = i;
227 | x = i * _w / _h;
228 | } else {
229 | i = _h / e * 50;
230 | x = i;
231 | y = i * _h / _w;
232 | }
233 | $('.layer').css({
234 | 'width': _w + x,
235 | 'height': _h + y,
236 | 'marginLeft': - 0.5 * x,
237 | 'marginTop': - 0.5 * y
238 | })
239 | if (!cover.w) {
240 | cover.w = cover.t.width();
241 | cover.h = cover.t.height();
242 | }
243 | Diaspora.F($('#cover')[0], cover.w, cover.h)
244 | })();
245 | setTimeout(function() {
246 | $('html, body').removeClass('loading')
247 | }, 1000)
248 | $('#mark').parallax()
249 | var vibrant = new Vibrant(cover.t[0]);
250 | var swatches = vibrant.swatches()
251 | if (swatches['DarkVibrant']) {
252 | $('#vibrant polygon').css('fill', swatches['DarkVibrant'].getHex())
253 | $('#vibrant div').css('background-color', swatches['DarkVibrant'].getHex())
254 | }
255 | if (swatches['Vibrant']) {
256 | $('.icon-menu').css('color', swatches['Vibrant'].getHex())
257 | $('.icon-search').css('color', swatches['Vibrant'].getHex())
258 | }
259 | })
260 | if (!cover.t.attr('src')) {
261 | alert('Please set the post thumbnail')
262 | }
263 | $('#preview').css('min-height', window.innerHeight)
264 | Diaspora.PS()
265 | $('.pview a').addClass('pviewa')
266 | var T;
267 | $(window).on('resize', function() {
268 | clearTimeout(T)
269 | T = setTimeout(function() {
270 | if (!Diaspora.P() && location.href == Home) {
271 | cover.o()
272 | cover.f()
273 | }
274 | if ($('#loader').attr('class')) {
275 | Diaspora.loading()
276 | }
277 | }, 500)
278 | })
279 | } else {
280 | $('#single').css('min-height', window.innerHeight)
281 | setTimeout(function() {
282 | $('html, body').removeClass('loading')
283 | }, 1000)
284 | window.addEventListener('popstate', function(e) {
285 | if (e.state) location.href = e.state.u;
286 | })
287 | Diaspora.player();
288 | $('.icon-icon, .image-icon').attr('href', '/')
289 | $('#top').show()
290 | }
291 | $(window).on('scroll', function() {
292 | if ($('.scrollbar').length && !Diaspora.P() && !$('.icon-images').hasClass('active')) {
293 | var wt = $(window).scrollTop(),
294 | tw = $('#top').width(),
295 | dh = document.body.scrollHeight,
296 | wh = $(window).height();
297 | var width = tw / (dh - wh) * wt;
298 | $('.scrollbar').width(width)
299 | if (wt > 80 && window.innerWidth > 800) {
300 | $('.subtitle').fadeIn()
301 | } else {
302 | $('.subtitle').fadeOut()
303 | }
304 | }
305 | })
306 | $(window).on('touchmove', function(e) {
307 | if ($('body').hasClass('mu')) {
308 | e.preventDefault()
309 | }
310 | })
311 |
312 | //搜搜
313 | var searchFunc = function(path, search_id, content_id) {
314 | 'use strict'; //使用严格模式
315 | $.ajax({
316 | url: path,
317 | dataType: "xml",
318 | success: function( xmlResponse ) {
319 | // 从xml中获取相应的标题等数据
320 | var datas = $( "entry", xmlResponse ).map(function() {
321 | return {
322 | title: $( "title", this ).text(),
323 | content: $("content",this).text(),
324 | url: $( "url" , this).text()
325 | };
326 | }).get();
327 | //ID选择器
328 | var $input = document.getElementById(search_id);
329 | var $resultContent = document.getElementById(content_id);
330 | $input.addEventListener('input', function(){
331 | var str='
';
332 | var keywords = this.value.trim().toLowerCase().split(/[\s\-]+/);
333 | $resultContent.innerHTML = "";
334 | if (this.value.trim().length <= 0) {
335 | return;
336 | }
337 | // 本地搜索主要部分
338 | datas.forEach(function(data) {
339 | var isMatch = true;
340 | var content_index = [];
341 | var data_title = data.title.trim().toLowerCase();
342 | var data_content = data.content.trim().replace(/<[^>]+>/g,"").toLowerCase();
343 | var data_url = data.url;
344 | var index_title = -1;
345 | var index_content = -1;
346 | var first_occur = -1;
347 | // 只匹配非空文章
348 | if(data_title != '' && data_content != '') {
349 | keywords.forEach(function(keyword, i) {
350 | index_title = data_title.indexOf(keyword);
351 | index_content = data_content.indexOf(keyword);
352 | if( index_title < 0 && index_content < 0 ){
353 | isMatch = false;
354 | } else {
355 | if (index_content < 0) {
356 | index_content = 0;
357 | }
358 | if (i == 0) {
359 | first_occur = index_content;
360 | }
361 | }
362 | });
363 | }
364 | // 返回搜索结果
365 | if (isMatch) {
366 | //结果标签
367 | str += "- "+ data_title +"";
368 | var content = data.content.trim().replace(/<[^>]+>/g,"");
369 | if (first_occur >= 0) {
370 | // 拿出含有搜索字的部分
371 | var start = first_occur - 6;
372 | var end = first_occur + 6;
373 | if(start < 0){
374 | start = 0;
375 | }
376 | if(start == 0){
377 | end = 10;
378 | }
379 | if(end > content.length){
380 | end = content.length;
381 | }
382 | var match_content = content.substr(start, end);
383 | // 列出搜索关键字,定义class加高亮
384 | keywords.forEach(function(keyword){
385 | var regS = new RegExp(keyword, "gi");
386 | match_content = match_content.replace(regS, ""+keyword+"");
387 | })
388 | str += "
" + match_content +"...
"
389 | }
390 | }
391 | })
392 | $resultContent.innerHTML = str;
393 | })
394 | }
395 | })
396 | };
397 | var path = window.searchDbPath || "/search.xml";
398 | if(document.getElementById('local-search-input') !== null){
399 | searchFunc(path, 'local-search-input', 'local-search-result');
400 | }
401 |
402 |
403 | var typed = null;
404 | $('body').on('click', function(e) {
405 | var tag = $(e.target).attr('class') || '',
406 | rel = $(e.target).attr('rel') || '';
407 | // .content > ... > img
408 | if (e.target.nodeName == "IMG" && $(e.target).parents('div.content').length > 0) {
409 | tag = 'pimg';
410 | }
411 | if (!tag && !rel) return;
412 | switch (true) {
413 | // nav menu
414 | case (tag.indexOf('switchmenu') != -1):
415 | window.scrollTo(0, 0)
416 |
417 | $('html, body').toggleClass('mu');
418 | if(typed !== null)
419 | {typed.destroy(); typed = null;}
420 | else{
421 | if($("#hitokoto").data('st') == true){
422 | $.get("https://v1.hitokoto.cn/", function (data) {
423 | var data = data;
424 | var str = data.hitokoto + " —— By "
425 | var options = {
426 | strings: [
427 | //str + "Who??^1000",
428 | //str + "It's me^2000",
429 | //str +'Haha, make a joke',
430 | str + data.from,
431 | ],
432 | typeSpeed: 90,
433 | startDelay: 500,
434 | //backDelay: 500,
435 | //backSpeed: 50,//回退速度
436 | //loop: true,
437 | }
438 | typed = new Typed(".hitokoto .typed", options);
439 | })
440 | }
441 | }
442 | return false;
443 | break;
444 | //search
445 | case (tag.indexOf('switchsearch') != -1):
446 | $('body').removeClass('mu')
447 | if(typed !== null){typed.destroy(); typed = null;}
448 | setTimeout(function() {
449 | Diaspora.HS($(e.target), 'push')
450 | $('.toc').fadeIn(1000);
451 | searchFunc(path, 'local-search-input', 'local-search-result');
452 | }, 300)
453 | return false;
454 | break;
455 | // next page
456 | case (tag.indexOf('more') != -1):
457 | tag = $('.more');
458 | if (tag.data('status') == 'loading') {
459 | return false
460 | }
461 | var num = parseInt(tag.data('page')) || 1;
462 | if (num == 1) {
463 | tag.data('page', 1)
464 | }
465 | if (num >= Pages) {
466 | return
467 | }
468 | tag.html('加载中...').data('status', 'loading')
469 | Diaspora.loading()
470 | Diaspora.L(tag.attr('href'), function(data) {
471 | var link = $(data).find('.more').attr('href');
472 | if (link != undefined) {
473 | tag.attr('href', link).html('加载更多').data('status', 'loaded')
474 | tag.data('page', parseInt(tag.data('page')) + 1)
475 | } else {
476 | $('#pager').remove()
477 | }
478 | var tempScrollTop = $(window).scrollTop();
479 | $('#primary').append($(data).find('.post'))
480 | $(window).scrollTop(tempScrollTop + 100);
481 | Diaspora.loaded()
482 | $('html,body').animate({ scrollTop: tempScrollTop + 400 }, 500);
483 | }, function() {
484 | tag.html('加载更多').data('status', 'loaded')
485 | })
486 | return false;
487 | break;
488 | // home
489 | case (tag.indexOf('icon-home') != -1):
490 | $('.toc').fadeOut(100);
491 | if ($('#preview').hasClass('show')) {
492 | history.back();
493 | } else {
494 | location.href = $('.icon-home').data('url')
495 | }
496 | return false;
497 | break;
498 | // qrcode
499 | case (tag.indexOf('icon-scan') != -1):
500 | if ($('.icon-scan').hasClass('tg')) {
501 | $('#qr').toggle()
502 | } else {
503 | $('.icon-scan').addClass('tg')
504 | $('#qr').qrcode({ width: 128, height: 128, text: location.href}).toggle()
505 | }
506 | return false;
507 | break;
508 | // audio play
509 | case (tag.indexOf('icon-play') != -1):
510 | $('#audio')[0].play()
511 | $('.icon-play').removeClass('icon-play').addClass('icon-pause')
512 | return false;
513 | break;
514 | // audio pause
515 | case (tag.indexOf('icon-pause') != -1):
516 | $('#audio')[0].pause()
517 | $('.icon-pause').removeClass('icon-pause').addClass('icon-play')
518 | return false;
519 | break;
520 | // history state
521 | case (tag.indexOf('cover') != -1):
522 | Diaspora.HS($(e.target).parent(), 'push')
523 | return false;
524 | break;
525 | // history state
526 | case (tag.indexOf('posttitle') != -1):
527 | Diaspora.HS($(e.target), 'push')
528 | return false;
529 | break;
530 | // prev, next post
531 | case (rel == 'prev' || rel == 'next'):
532 | if (rel == 'prev') {
533 | var t = $('#prev_next a')[0].text
534 | } else {
535 | var t = $('#prev_next a')[1].text
536 | }
537 | $(e.target).attr('title', t)
538 | Diaspora.HS($(e.target), 'replace')
539 | return false;
540 | break;
541 | // toc
542 | case (tag.indexOf('toc-text') != -1 || tag.indexOf('toc-link') != -1
543 | || tag.indexOf('toc-number') != -1):
544 | hash = '';
545 | if (e.target.nodeName == 'SPAN'){
546 | hash = $(e.target).parent().attr('href')
547 | }else{
548 | hash = $(e.target).attr('href')
549 | }
550 | to = $(decodeURI(hash))
551 | $("html,body").animate({
552 | scrollTop: to.offset().top - 50
553 | }, 300);
554 | return false;
555 | break;
556 | // quick view
557 | case (tag.indexOf('pviewa') != -1):
558 | $('body').removeClass('mu')
559 | if(typed !== null){typed.destroy(); typed = null;}
560 | setTimeout(function() {
561 | Diaspora.HS($(e.target), 'push')
562 | $('.toc').fadeIn(1000);
563 | }, 300)
564 | return false;
565 | break;
566 | // photoswipe
567 | case (tag.indexOf('pimg') != -1):
568 | var pswpElement = $('.pswp').get(0);
569 | if (pswpElement) {
570 | var items = [];
571 | var index = 0;
572 | var imgs = [];
573 | $('.content img').each(function(i, v){
574 | // get index
575 | if (e.target.src == v.src) {
576 | index = i;
577 | }
578 | var item = {
579 | src: v.src,
580 | w: v.naturalWidth,
581 | h: v.naturalHeight
582 | };
583 | imgs.push(v);
584 | items.push(item);
585 | });
586 | var options = {
587 | index: index,
588 | shareEl: false,
589 | zoomEl: false,
590 | allowRotationOnUserZoom: true,
591 | history: false,
592 | getThumbBoundsFn: function(index) {
593 | // See Options -> getThumbBoundsFn section of documentation for more info
594 | var thumbnail = imgs[index],
595 | pageYScroll = window.pageYOffset || document.documentElement.scrollTop,
596 | rect = thumbnail.getBoundingClientRect();
597 |
598 | return {x:rect.left, y:rect.top + pageYScroll, w:rect.width};
599 | }
600 | };
601 | var lightBox= new PhotoSwipe(pswpElement, PhotoSwipeUI_Default, items, options);
602 | lightBox.init();
603 | }
604 | return false;
605 | break;
606 | // comment
607 | case - 1 != tag.indexOf("comment"):
608 | if($('#gitalk-container').data('enable') == true){
609 | Diaspora.loading(),
610 | comment = $('#gitalk-container');
611 | gitalk = new Gitalk({
612 | clientID: comment.data('ci'),
613 | clientSecret: comment.data('cs'),
614 | repo: comment.data('r'),
615 | owner: comment.data('o'),
616 | admin: comment.data('a'),
617 | id: decodeURI(window.location.pathname),
618 | distractionFreeMode: comment.data('d')
619 | })
620 | $(".comment").removeClass("link")
621 | gitalk.render('gitalk-container')
622 | Diaspora.loaded();
623 | }else{
624 | $('#gitalk-container').html("评论已关闭");
625 | }
626 | return false;
627 | break;
628 | default:
629 | return true;
630 | break;
631 | }
632 | })
633 | // 是否自动展开评论
634 | comment = $("#gitalk-container");
635 | if (comment.data('ae') == true){
636 | comment.click();
637 | }
638 |
639 | console.log("%c Github %c","background:#24272A; color:#ffffff","","https://github.com/Fechin/hexo-theme-diaspora")
640 | })
641 |
642 |
--------------------------------------------------------------------------------
/source/js/plugin.js:
--------------------------------------------------------------------------------
1 | /**
2 | * jQuery || Zepto Parallax Plugin
3 | * @author Matthew Wagerfield - @wagerfield
4 | * @description Creates a parallax effect between an array of layers,
5 | * driving the motion from the gyroscope output of a smartdevice.
6 | * If no gyroscope is available, the cursor position is used.
7 | */
8 | ;(function(c,e,f,b){var i="parallax";var g=30;var d={relativeInput:false,clipRelativeInput:false,calibrationThreshold:100,calibrationDelay:500,supportDelay:1000,calibrateX:false,calibrateY:true,invertX:true,invertY:true,limitX:false,limitY:false,scalarX:10,scalarY:10,frictionX:0.1,frictionY:0.1,originX:0.5,originY:0.5};function h(l,j){this.element=l;this.$context=c(l).data("api",this);this.$layers=this.$context.find(".layer");var m={calibrateX:this.$context.data("calibrate-x")||null,calibrateY:this.$context.data("calibrate-y")||null,invertX:this.$context.data("invert-x")||null,invertY:this.$context.data("invert-y")||null,limitX:parseFloat(this.$context.data("limit-x"))||null,limitY:parseFloat(this.$context.data("limit-y"))||null,scalarX:parseFloat(this.$context.data("scalar-x"))||null,scalarY:parseFloat(this.$context.data("scalar-y"))||null,frictionX:parseFloat(this.$context.data("friction-x"))||null,frictionY:parseFloat(this.$context.data("friction-y"))||null,originX:parseFloat(this.$context.data("origin-x"))||null,originY:parseFloat(this.$context.data("origin-y"))||null};for(var k in m){if(m[k]===null){delete m[k]}}c.extend(this,d,j,m);this.calibrationTimer=null;this.calibrationFlag=true;this.enabled=false;this.depths=[];this.raf=null;this.bounds=null;this.ex=0;this.ey=0;this.ew=0;this.eh=0;this.ecx=0;this.ecy=0;this.erx=0;this.ery=0;this.cx=0;this.cy=0;this.ix=0;this.iy=0;this.mx=0;this.my=0;this.vx=0;this.vy=0;this.onMouseMove=this.onMouseMove.bind(this);this.onDeviceOrientation=this.onDeviceOrientation.bind(this);this.onOrientationTimer=this.onOrientationTimer.bind(this);this.onCalibrationTimer=this.onCalibrationTimer.bind(this);this.onAnimationFrame=this.onAnimationFrame.bind(this);this.onWindowResize=this.onWindowResize.bind(this);this.initialise()}h.prototype.transformSupport=function(w){var p=f.createElement("div");var t=false;var o=null;var s=false;var u=null;var k=null;for(var q=0,n=this.vendors.length;q0&&o!=="none";v.style.overflow=m;r.removeChild(p);if(j){r.removeAttribute("style");r.parentNode.removeChild(r)}}break}return s};h.prototype.ww=null;h.prototype.wh=null;h.prototype.wcx=null;h.prototype.wcy=null;h.prototype.wrx=null;h.prototype.wry=null;h.prototype.portrait=null;h.prototype.desktop=!navigator.userAgent.match(/(iPhone|iPod|iPad|Android|BlackBerry|BB10|mobi|tablet|opera mini|nexus 7)/i);h.prototype.vendors=[null,["-webkit-","webkit"],["-moz-","Moz"],["-o-","O"],["-ms-","ms"]];h.prototype.motionSupport=!!e.DeviceMotionEvent;h.prototype.orientationSupport=!!e.DeviceOrientationEvent;h.prototype.orientationStatus=0;h.prototype.transform2DSupport=h.prototype.transformSupport("2D");h.prototype.transform3DSupport=h.prototype.transformSupport("3D");h.prototype.propertyCache={};h.prototype.initialise=function(){if(this.$context.css("position")==="static"){this.$context.css({position:"relative"})}this.accelerate(this.$context);this.updateLayers();this.updateDimensions();this.enable();this.queueCalibration(this.calibrationDelay)};h.prototype.updateLayers=function(){this.$layers=this.$context.find(".layer");this.depths=[];this.$layers.css({position:"absolute",display:"block",left:0,top:0});this.$layers.first().css({position:"relative"});this.accelerate(this.$layers);this.$layers.each(c.proxy(function(j,k){this.depths.push(c(k).data("depth")||0)},this))};h.prototype.updateDimensions=function(){this.ww=e.innerWidth;this.wh=e.innerHeight;this.wcx=this.ww*this.originX;this.wcy=this.wh*this.originY;this.wrx=Math.max(this.wcx,this.ww-this.wcx);this.wry=Math.max(this.wcy,this.wh-this.wcy)};h.prototype.updateBounds=function(){this.bounds=this.element.getBoundingClientRect();this.ex=this.bounds.left;this.ey=this.bounds.top;this.ew=this.bounds.width;this.eh=this.bounds.height;this.ecx=this.ew*this.originX;this.ecy=this.eh*this.originY;this.erx=Math.max(this.ecx,this.ew-this.ecx);this.ery=Math.max(this.ecy,this.eh-this.ecy)};h.prototype.queueCalibration=function(j){clearTimeout(this.calibrationTimer);this.calibrationTimer=setTimeout(this.onCalibrationTimer,j)};h.prototype.enable=function(){if(!this.enabled){this.enabled=true;if(this.orientationSupport){this.portrait=null;e.addEventListener("deviceorientation",this.onDeviceOrientation);setTimeout(this.onOrientationTimer,this.supportDelay)}else{this.cx=0;this.cy=0;this.portrait=false;e.addEventListener("mousemove",this.onMouseMove)}e.addEventListener("resize",this.onWindowResize);this.raf=requestAnimationFrame(this.onAnimationFrame)}};h.prototype.disable=function(){if(this.enabled){this.enabled=false;if(this.orientationSupport){e.removeEventListener("deviceorientation",this.onDeviceOrientation)}else{e.removeEventListener("mousemove",this.onMouseMove)}e.removeEventListener("resize",this.onWindowResize);cancelAnimationFrame(this.raf)}};h.prototype.calibrate=function(j,k){this.calibrateX=j===b?this.calibrateX:j;this.calibrateY=k===b?this.calibrateY:k};h.prototype.invert=function(j,k){this.invertX=j===b?this.invertX:j;this.invertY=k===b?this.invertY:k};h.prototype.friction=function(j,k){this.frictionX=j===b?this.frictionX:j;this.frictionY=k===b?this.frictionY:k};h.prototype.scalar=function(j,k){this.scalarX=j===b?this.scalarX:j;this.scalarY=k===b?this.scalarY:k};h.prototype.limit=function(j,k){this.limitX=j===b?this.limitX:j;this.limitY=k===b?this.limitY:k};h.prototype.origin=function(j,k){this.originX=j===b?this.originX:j;this.originY=k===b?this.originY:k};h.prototype.clamp=function(l,k,j){l=Math.max(l,k);l=Math.min(l,j);return l};h.prototype.css=function(m,p,o){var n=this.propertyCache[p];if(!n){for(var k=0,j=this.vendors.length;kthis.calibrationThreshold)||(Math.abs(k)>this.calibrationThreshold)){this.queueCalibration(0)}if(this.portrait){this.mx=this.calibrateX?k:this.iy;this.my=this.calibrateY?m:this.ix}else{this.mx=this.calibrateX?m:this.ix;this.my=this.calibrateY?k:this.iy}this.mx*=this.ew*(this.scalarX/100);this.my*=this.eh*(this.scalarY/100);if(!isNaN(parseFloat(this.limitX))){this.mx=this.clamp(this.mx,-this.limitX,this.limitX)}if(!isNaN(parseFloat(this.limitY))){this.my=this.clamp(this.my,-this.limitY,this.limitY)}this.vx+=(this.mx-this.vx)*this.frictionX;this.vy+=(this.my-this.vy)*this.frictionY;for(var o=0,j=this.$layers.length;oe.innerWidth;if(this.portrait!==l){this.portrait=l;this.calibrationFlag=true}if(this.calibrationFlag){this.calibrationFlag=false;this.cx=j;this.cy=m}this.ix=j;this.iy=m}};h.prototype.onMouseMove=function(l){var k=l.clientX;var j=l.clientY;if(!this.orientationSupport&&this.relativeInput){if(this.clipRelativeInput){k=Math.max(k,this.ex);k=Math.min(k,this.ex+this.ew);j=Math.max(j,this.ey);j=Math.min(j,this.ey+this.eh)}this.ix=(k-this.ex-this.ecx)/this.erx;this.iy=(j-this.ey-this.ecy)/this.ery}else{this.ix=(k-this.wcx)/this.wrx;this.iy=(j-this.wcy)/this.wry}};var a={enable:h.prototype.enable,disable:h.prototype.disable,updateLayers:h.prototype.updateLayers,calibrate:h.prototype.calibrate,friction:h.prototype.friction,invert:h.prototype.invert,scalar:h.prototype.scalar,limit:h.prototype.limit,origin:h.prototype.origin};c.fn[i]=function(k){var j=arguments;return this.each(function(){var m=c(this);var l=m.data(i);if(!l){l=new h(this,k);m.data(i,l)}if(a[k]){l[k].apply(l,Array.prototype.slice.call(j,1))}})}})(window.jQuery||window.Zepto,window,document);(function(){var b=0;var c=["ms","moz","webkit","o"];for(var a=0;aa||this.moduleCount<=a||0>c||this.moduleCount<=c)throw Error(a+","+c);return this.modules[a][c]},getModuleCount:function(){return this.moduleCount},make:function(){if(1>this.typeNumber){for(var a=1,a=1;40>a;a++){for(var c=p.getRSBlocks(a,this.errorCorrectLevel),d=new t,b=0,e=0;e=d;d++)if(!(-1>=a+d||this.moduleCount<=a+d))for(var b=-1;7>=b;b++)-1>=c+b||this.moduleCount<=c+b||(this.modules[a+d][c+b]=
14 | 0<=d&&6>=d&&(0==b||6==b)||0<=b&&6>=b&&(0==d||6==d)||2<=d&&4>=d&&2<=b&&4>=b?!0:!1)},getBestMaskPattern:function(){for(var a=0,c=0,d=0;8>d;d++){this.makeImpl(!0,d);var b=j.getLostPoint(this);if(0==d||a>b)a=b,c=d}return c},createMovieClip:function(a,c,d){a=a.createEmptyMovieClip(c,d);this.make();for(c=0;c=f;f++)for(var i=-2;2>=i;i++)this.modules[b+f][e+i]=-2==f||2==f||-2==i||2==i||0==f&&0==i?!0:!1}},setupTypeNumber:function(a){for(var c=
16 | j.getBCHTypeNumber(this.typeNumber),d=0;18>d;d++){var b=!a&&1==(c>>d&1);this.modules[Math.floor(d/3)][d%3+this.moduleCount-8-3]=b}for(d=0;18>d;d++)b=!a&&1==(c>>d&1),this.modules[d%3+this.moduleCount-8-3][Math.floor(d/3)]=b},setupTypeInfo:function(a,c){for(var d=j.getBCHTypeInfo(this.errorCorrectLevel<<3|c),b=0;15>b;b++){var e=!a&&1==(d>>b&1);6>b?this.modules[b][8]=e:8>b?this.modules[b+1][8]=e:this.modules[this.moduleCount-15+b][8]=e}for(b=0;15>b;b++)e=!a&&1==(d>>b&1),8>b?this.modules[8][this.moduleCount-
17 | b-1]=e:9>b?this.modules[8][15-b-1+1]=e:this.modules[8][15-b-1]=e;this.modules[this.moduleCount-8][8]=!a},mapData:function(a,c){for(var d=-1,b=this.moduleCount-1,e=7,f=0,i=this.moduleCount-1;0g;g++)if(null==this.modules[b][i-g]){var n=!1;f>>e&1));j.getMask(c,b,i-g)&&(n=!n);this.modules[b][i-g]=n;e--; -1==e&&(f++,e=7)}b+=d;if(0>b||this.moduleCount<=b){b-=d;d=-d;break}}}};o.PAD0=236;o.PAD1=17;o.createData=function(a,c,d){for(var c=p.getRSBlocks(a,
18 | c),b=new t,e=0;e8*a)throw Error("code length overflow. ("+b.getLengthInBits()+">"+8*a+")");for(b.getLengthInBits()+4<=8*a&&b.put(0,4);0!=b.getLengthInBits()%8;)b.putBit(!1);for(;!(b.getLengthInBits()>=8*a);){b.put(o.PAD0,8);if(b.getLengthInBits()>=8*a)break;b.put(o.PAD1,8)}return o.createBytes(b,c)};o.createBytes=function(a,c){for(var d=
19 | 0,b=0,e=0,f=Array(c.length),i=Array(c.length),g=0;g>>=1;return c},getPatternPosition:function(a){return j.PATTERN_POSITION_TABLE[a-1]},getMask:function(a,c,d){switch(a){case 0:return 0==(c+d)%2;case 1:return 0==c%2;case 2:return 0==d%3;case 3:return 0==(c+d)%3;case 4:return 0==(Math.floor(c/2)+Math.floor(d/3))%2;case 5:return 0==c*d%2+c*d%3;case 6:return 0==(c*d%2+c*d%3)%2;case 7:return 0==(c*d%3+(c+d)%2)%2;default:throw Error("bad maskPattern:"+
23 | a);}},getErrorCorrectPolynomial:function(a){for(var c=new q([1],0),d=0;dc)switch(a){case 1:return 10;case 2:return 9;case s:return 8;case 8:return 8;default:throw Error("mode:"+a);}else if(27>c)switch(a){case 1:return 12;case 2:return 11;case s:return 16;case 8:return 10;default:throw Error("mode:"+a);}else if(41>c)switch(a){case 1:return 14;case 2:return 13;case s:return 16;case 8:return 12;default:throw Error("mode:"+
24 | a);}else throw Error("type:"+c);},getLostPoint:function(a){for(var c=a.getModuleCount(),d=0,b=0;b=g;g++)if(!(0>b+g||c<=b+g))for(var h=-1;1>=h;h++)0>e+h||c<=e+h||0==g&&0==h||i==a.isDark(b+g,e+h)&&f++;5a)throw Error("glog("+a+")");return l.LOG_TABLE[a]},gexp:function(a){for(;0>a;)a+=255;for(;256<=a;)a-=255;return l.EXP_TABLE[a]},EXP_TABLE:Array(256),
26 | LOG_TABLE:Array(256)},m=0;8>m;m++)l.EXP_TABLE[m]=1<m;m++)l.EXP_TABLE[m]=l.EXP_TABLE[m-4]^l.EXP_TABLE[m-5]^l.EXP_TABLE[m-6]^l.EXP_TABLE[m-8];for(m=0;255>m;m++)l.LOG_TABLE[l.EXP_TABLE[m]]=m;q.prototype={get:function(a){return this.num[a]},getLength:function(){return this.num.length},multiply:function(a){for(var c=Array(this.getLength()+a.getLength()-1),d=0;d
27 | this.getLength()-a.getLength())return this;for(var c=l.glog(this.get(0))-l.glog(a.get(0)),d=Array(this.getLength()),b=0;b>>7-a%8&1)},put:function(a,c){for(var d=0;d>>c-d-1&1))},getLengthInBits:function(){return this.length},putBit:function(a){var c=Math.floor(this.length/8);this.buffer.length<=c&&this.buffer.push(0);a&&(this.buffer[c]|=128>>>this.length%8);this.length++}};"string"===typeof h&&(h={text:h});h=r.extend({},{render:"canvas",width:256,height:256,typeNumber:-1,
35 | correctLevel:2,background:"#ffffff",foreground:"#000000"},h);return this.each(function(){var a;if("canvas"==h.render){a=new o(h.typeNumber,h.correctLevel);a.addData(h.text);a.make();var c=document.createElement("canvas");c.width=h.width;c.height=h.height;for(var d=c.getContext("2d"),b=h.width/a.getModuleCount(),e=h.height/a.getModuleCount(),f=0;f").css("width",h.width+"px").css("height",h.height+"px").css("border","0px").css("border-collapse","collapse").css("background-color",h.background);d=h.width/a.getModuleCount();b=h.height/a.getModuleCount();for(e=0;e").css("height",b+"px").appendTo(c);for(i=0;i").css("width",
37 | d+"px").css("background-color",a.isDark(e,i)?h.foreground:h.background).appendTo(f)}}a=c;jQuery(a).appendTo(this)})}})(jQuery);
38 |
39 | (function e$$0(x,z,l){function h(p,b){if(!z[p]){if(!x[p]){var a="function"==typeof require&&require;if(!b&&a)return a(p,!0);if(g)return g(p,!0);a=Error("Cannot find module '"+p+"'");throw a.code="MODULE_NOT_FOUND",a;}a=z[p]={exports:{}};x[p][0].call(a.exports,function(a){var b=x[p][1][a];return h(b?b:a)},a,a.exports,e$$0,x,z,l)}return z[p].exports}for(var g="function"==typeof require&&require,w=0;wg?1:0},sum:function(h,g){var l={};return h.reduce(g?function(h,b,a){l.index=a;return h+g.call(l,b)}:function(h,b){return h+b},0)},max:function(h,g){return Math.max.apply(null,g?l.map(h,g):h)}};A=function(){function h(f,c,a){return(f<<2*d)+(c<>e;m=f[1]>>e;r=f[2]>>e;a=h(b,m,r);c[a]=(c[a]||0)+1});return c}
42 | function a(f,c){var a=1E6,b=0,m=1E6,d=0,q=1E6,n=0,h,k,l;f.forEach(function(c){h=c[0]>>e;k=c[1]>>e;l=c[2]>>e;hb&&(b=h);kd&&(d=k);ln&&(n=l)});return new w(a,b,m,d,q,n,c)}function n(a,c){function b(a){var f=a+"1";a+="2";var v,d,m,e;d=0;for(k=c[f];k<=c[a];k++)if(y[k]>n/2){m=c.copy();e=c.copy();v=k-c[f];d=c[a]-k;for(v=v<=d?Math.min(c[a]-1,~~(k+d/2)):Math.max(c[f],~~(k-1-v/2));!y[v];)v++;for(d=s[v];!d&&y[v-1];)d=s[--v];m[a]=v;e[f]=m[a]+1;return[m,e]}}if(c.count()){var d=c.r2-
43 | c.r1+1,m=c.g2-c.g1+1,e=l.max([d,m,c.b2-c.b1+1]);if(1==c.count())return[c.copy()];var n=0,y=[],s=[],k,g,t,u,p;if(e==d)for(k=c.r1;k<=c.r2;k++){u=0;for(g=c.g1;g<=c.g2;g++)for(t=c.b1;t<=c.b2;t++)p=h(k,g,t),u+=a[p]||0;n+=u;y[k]=n}else if(e==m)for(k=c.g1;k<=c.g2;k++){u=0;for(g=c.r1;g<=c.r2;g++)for(t=c.b1;t<=c.b2;t++)p=h(g,k,t),u+=a[p]||0;n+=u;y[k]=n}else for(k=c.b1;k<=c.b2;k++){u=0;for(g=c.r1;g<=c.r2;g++)for(t=c.g1;t<=c.g2;t++)p=h(g,t,k),u+=a[p]||0;n+=u;y[k]=n}y.forEach(function(a,c){s[c]=n-a});return e==
44 | d?b("r"):e==m?b("g"):b("b")}}var d=5,e=8-d;w.prototype={volume:function(a){if(!this._volume||a)this._volume=(this.r2-this.r1+1)*(this.g2-this.g1+1)*(this.b2-this.b1+1);return this._volume},count:function(a){var c=this.histo;if(!this._count_set||a){a=0;var b,d,n;for(b=this.r1;b<=this.r2;b++)for(d=this.g1;d<=this.g2;d++)for(n=this.b1;n<=this.b2;n++)index=h(b,d,n),a+=c[index]||0;this._count=a;this._count_set=!0}return this._count},copy:function(){return new w(this.r1,this.r2,this.g1,this.g2,this.b1,
45 | this.b2,this.histo)},avg:function(a){var c=this.histo;if(!this._avg||a){a=0;var b=1<<8-d,n=0,e=0,g=0,q,l,s,k;for(l=this.r1;l<=this.r2;l++)for(s=this.g1;s<=this.g2;s++)for(k=this.b1;k<=this.b2;k++)q=h(l,s,k),q=c[q]||0,a+=q,n+=q*(l+0.5)*b,e+=q*(s+0.5)*b,g+=q*(k+0.5)*b;this._avg=a?[~~(n/a),~~(e/a),~~(g/a)]:[~~(b*(this.r1+this.r2+1)/2),~~(b*(this.g1+this.g2+1)/2),~~(b*(this.b1+this.b2+1)/2)]}return this._avg},contains:function(a){var c=a[0]>>e;gval=a[1]>>e;bval=a[2]>>e;return c>=this.r1&&c<=this.r2&&
46 | gval>=this.g1&&gval<=this.g2&&bval>=this.b1&&bval<=this.b2}};p.prototype={push:function(a){this.vboxes.push({vbox:a,color:a.avg()})},palette:function(){return this.vboxes.map(function(a){return a.color})},size:function(){return this.vboxes.size()},map:function(a){for(var c=this.vboxes,b=0;bb[0]&&5>b[1]&&5>b[2]&&(a[0].color=[0,0,0]);var b=a.length-1,n=a[b].color;251d;)if(f=a.pop(),f.count()){var m=n(h,f);f=m[0];m=m[1];if(!f)break;
48 | a.push(f);m&&(a.push(m),c++);if(c>=b)break;if(1E3c||256this.yiq?"#fff":"#000"};b.prototype.getBodyTextColor=function(){this._ensureTextColors();return 150>this.yiq?"#fff":"#000"};b.prototype._ensureTextColors=function(){if(!this.yiq)return this.yiq=(299*this.rgb[0]+587*this.rgb[1]+114*this.rgb[2])/1E3};return b}();window.Vibrant=g=function(){function b(a,b,d){this.swatches=w(this.swatches,this);var e,f,
51 | c,g,p,m,r,q;"undefined"===typeof b&&(b=64);"undefined"===typeof d&&(d=5);p=new l(a);r=p.getImageData().data;m=p.getPixelCount();a=[];for(g=0;g=f&&s<=c&&m>=b&&m<=d&&!this.isAlreadySelected(k)&&(m=this.createComparisonValue(s,e,m,a,
57 | k.getPopulation(),this.HighestPopulation),void 0===l||m>q))l=k,q=m;return l};b.prototype.createComparisonValue=function(a,b,d,e,f,c){return this.weightedMean(this.invertDiff(a,b),this.WEIGHT_SATURATION,this.invertDiff(d,e),this.WEIGHT_LUMA,f/c,this.WEIGHT_POPULATION)};b.prototype.invertDiff=function(a,b){return 1-Math.abs(a-b)};b.prototype.weightedMean=function(){var a,b,d,e,f,c;f=1<=arguments.length?p.call(arguments,0):[];for(a=d=b=0;ac&&(c+=1);1c?b:c<2/3?a+(b-a)*(2/3-c)*6:a};0===b?c=f=e=d:(b=0.5>d?d*(1+b):d+b-d*b,d=2*d-b,c=e(d,b,a+1/3),f=e(d,b,a),e=e(d,b,a-1/3));return[255*c,255*f,255*e]};return b}();window.CanvasImage=l=function(){function b(a){this.canvas=
60 | document.createElement("canvas");this.context=this.canvas.getContext("2d");document.body.appendChild(this.canvas);this.width=this.canvas.width=a.width;this.height=this.canvas.height=a.height;this.context.drawImage(a,0,0,this.width,this.height)}b.prototype.clear=function(){return this.context.clearRect(0,0,this.width,this.height)};b.prototype.update=function(a){return this.context.putImageData(a,0,0)};b.prototype.getPixelCount=function(){return this.width*this.height};b.prototype.getImageData=function(){return this.context.getImageData(0,
61 | 0,this.width,this.height)};b.prototype.removeCanvas=function(){return this.canvas.parentNode.removeChild(this.canvas)};return b}()}).call(this)},{quantize:1}]},{},[2]);
62 |
--------------------------------------------------------------------------------
/source/js/typed.js:
--------------------------------------------------------------------------------
1 | /*!
2 | *
3 | * typed.js - A JavaScript Typing Animation Library
4 | * Author: Matt Boldt
5 | * Version: v2.0.9
6 | * Url: https://github.com/mattboldt/typed.js
7 | * License(s): MIT
8 | *
9 | */
10 | (function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.Typed=e():t.Typed=e()})(this,function(){return function(t){function e(n){if(s[n])return s[n].exports;var i=s[n]={exports:{},id:n,loaded:!1};return t[n].call(i.exports,i,i.exports,e),i.loaded=!0,i.exports}var s={};return e.m=t,e.c=s,e.p="",e(0)}([function(t,e,s){"use strict";function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0});var i=function(){function t(t,e){for(var s=0;st.length)););var u=t.substring(0,e),l=t.substring(u.length+1,e+i),c=t.substring(e+i+1);t=u+l+c,i--}s.timeout=setTimeout(function(){s.toggleBlinking(!1),e===t.length?s.doneTyping(t,e):s.keepTyping(t,e,i),s.temporaryPause&&(s.temporaryPause=!1,s.options.onTypingResumed(s.arrayPos,s))},n)},n))}},{key:"keepTyping",value:function(t,e,s){0===e&&(this.toggleBlinking(!1),this.options.preStringTyped(this.arrayPos,this)),e+=s;var n=t.substr(0,e);this.replaceText(n),this.typewrite(t,e)}},{key:"doneTyping",value:function(t,e){var s=this;this.options.onStringTyped(this.arrayPos,this),this.toggleBlinking(!0),this.arrayPos===this.strings.length-1&&(this.complete(),this.loop===!1||this.curLoop===this.loopCount)||(this.timeout=setTimeout(function(){s.backspace(t,e)},this.backDelay))}},{key:"backspace",value:function(t,e){var s=this;if(this.pause.status===!0)return void this.setPauseStatus(t,e,!0);if(this.fadeOut)return this.initFadeOut();this.toggleBlinking(!1);var n=this.humanizer(this.backSpeed);this.timeout=setTimeout(function(){e=o.htmlParser.backSpaceHtmlChars(t,e,s);var n=t.substr(0,e);if(s.replaceText(n),s.smartBackspace){var i=s.strings[s.arrayPos+1];i&&n===i.substr(0,e)?s.stopNum=e:s.stopNum=0}e>s.stopNum?(e--,s.backspace(t,e)):e<=s.stopNum&&(s.arrayPos++,s.arrayPos===s.strings.length?(s.arrayPos=0,s.options.onLastStringBackspaced(),s.shuffleStringsIfNeeded(),s.begin()):s.typewrite(s.strings[s.sequence[s.arrayPos]],e))},n)}},{key:"complete",value:function(){this.options.onComplete(this),this.loop?this.curLoop++:this.typingComplete=!0}},{key:"setPauseStatus",value:function(t,e,s){this.pause.typewrite=s,this.pause.curString=t,this.pause.curStrPos=e}},{key:"toggleBlinking",value:function(t){this.cursor&&(this.pause.status||this.cursorBlinking!==t&&(this.cursorBlinking=t,t?this.cursor.classList.add("typed-cursor--blink"):this.cursor.classList.remove("typed-cursor--blink")))}},{key:"humanizer",value:function(t){return Math.round(Math.random()*t/2)+t}},{key:"shuffleStringsIfNeeded",value:function(){this.shuffle&&(this.sequence=this.sequence.sort(function(){return Math.random()-.5}))}},{key:"initFadeOut",value:function(){var t=this;return this.el.className+=" "+this.fadeOutClass,this.cursor&&(this.cursor.className+=" "+this.fadeOutClass),setTimeout(function(){t.arrayPos++,t.replaceText(""),t.strings.length>t.arrayPos?t.typewrite(t.strings[t.sequence[t.arrayPos]],0):(t.typewrite(t.strings[0],0),t.arrayPos=0)},this.fadeOutDelay)}},{key:"replaceText",value:function(t){this.attr?this.el.setAttribute(this.attr,t):this.isInput?this.el.value=t:"html"===this.contentType?this.el.innerHTML=t:this.el.textContent=t}},{key:"bindFocusEvents",value:function(){var t=this;this.isInput&&(this.el.addEventListener("focus",function(e){t.stop()}),this.el.addEventListener("blur",function(e){t.el.value&&0!==t.el.value.length||t.start()}))}},{key:"insertCursor",value:function(){this.showCursor&&(this.cursor||(this.cursor=document.createElement("span"),this.cursor.className="typed-cursor",this.cursor.innerHTML=this.cursorChar,this.el.parentNode&&this.el.parentNode.insertBefore(this.cursor,this.el.nextSibling)))}}]),t}();e["default"]=a,t.exports=e["default"]},function(t,e,s){"use strict";function n(t){return t&&t.__esModule?t:{"default":t}}function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0});var r=Object.assign||function(t){for(var e=1;e":";";t.substr(e+1).charAt(0)!==i&&(e++,!(e+1>t.length)););e++}return e}},{key:"backSpaceHtmlChars",value:function(t,e,s){if("html"!==s.contentType)return e;var n=t.substr(e).charAt(0);if(">"===n||";"===n){var i="";for(i=">"===n?"<":"&";t.substr(e-1).charAt(0)!==i&&(e--,!(e<0)););e--}return e}}]),t}();e["default"]=i;var r=new i;e.htmlParser=r}])});
11 |
--------------------------------------------------------------------------------
/source/photoswipe/default-skin/default-skin.css:
--------------------------------------------------------------------------------
1 | /*! PhotoSwipe Default UI CSS by Dmitry Semenov | photoswipe.com | MIT license */
2 | /*
3 |
4 | Contents:
5 |
6 | 1. Buttons
7 | 2. Share modal and links
8 | 3. Index indicator ("1 of X" counter)
9 | 4. Caption
10 | 5. Loading indicator
11 | 6. Additional styles (root element, top bar, idle state, hidden state, etc.)
12 |
13 | */
14 | /*
15 |
16 | 1. Buttons
17 |
18 | */
19 | /*
",q.parseShareButtonOut&&(f=q.parseShareButtonOut(a,f));i.children[0].innerHTML=f,i.children[0].onclick=G},I=function(a){for(var c=0;c=.95&&v.showControls()});var a;l("onPinchClose",function(b){x&&b<.9?(v.hideControls(),a=!0):a&&!x&&b>.9&&v.showControls()}),l("zoomGestureEnded",function(){a=!1,a&&!x&&v.showControls()})},S=[{name:"caption",option:"captionEl",onInit:function(a){e=a}},{name:"share-modal",option:"shareEl",onInit:function(a){i=a},onTap:function(){F()}},{name:"button--share",option:"shareEl",onInit:function(a){h=a},onTap:function(){F()}},{name:"button--zoom",option:"zoomEl",onTap:a.toggleDesktopZoom},{name:"counter",option:"counterEl",onInit:function(a){g=a}},{name:"button--close",option:"closeEl",onTap:a.close},{name:"button--arrow--left",option:"arrowEl",onTap:a.prev},{name:"button--arrow--right",option:"arrowEl",onTap:a.next},{name:"button--fs",option:"fullscreenEl",onTap:function(){c.isFullscreen()?c.exit():c.enter()}},{name:"preloader",option:"preloaderEl",onInit:function(a){m=a}}],T=function(){var a,c,e,f=function(d){if(d)for(var f=d.length,g=0;g-1&&(q[e.option]?(b.removeClass(a,"pswp__element--disabled"),e.onInit&&e.onInit(a)):b.addClass(a,"pswp__element--disabled"))}};f(d.children);var g=b.getChildByClass(d,"pswp__top-bar");g&&f(g.children)};v.init=function(){b.extend(a.options,z,!0),q=a.options,d=b.getChildByClass(a.scrollWrap,"pswp__ui"),l=a.listen,R(),l("beforeChange",v.update),l("doubleTap",function(b){var c=a.currItem.initialZoomLevel;a.getZoomLevel()!==c?a.zoomTo(c,b,333):a.zoomTo(q.getDoubleTapZoom(!1,a.currItem),b,333)}),l("preventDragEvent",function(a,b,c){var d=a.target||a.srcElement;d&&d.getAttribute("class")&&a.type.indexOf("mouse")>-1&&(d.getAttribute("class").indexOf("__caption")>0||/(SMALL|STRONG|EM)/i.test(d.tagName))&&(c.prevent=!1)}),l("bindEvents",function(){b.bind(d,"pswpTap click",A),b.bind(a.scrollWrap,"pswpTap",v.onGlobalTap),a.likelyTouchDevice||b.bind(a.scrollWrap,"mouseover",v.onMouseOver)}),l("unbindEvents",function(){y||F(),t&&clearInterval(t),b.unbind(document,"mouseout",L),b.unbind(document,"mousemove",K),b.unbind(d,"pswpTap click",A),b.unbind(a.scrollWrap,"pswpTap",v.onGlobalTap),b.unbind(a.scrollWrap,"mouseover",v.onMouseOver),c&&(b.unbind(document,c.eventK,v.updateFullscreen),c.isFullscreen()&&(q.hideAnimationDuration=0,c.exit()),c=null)}),l("destroy",function(){q.captionEl&&(f&&d.removeChild(f),b.removeClass(e,"pswp__caption--empty")),i&&(i.children[0].onclick=null),b.removeClass(d,"pswp__ui--over-close"),b.addClass(d,"pswp__ui--hidden"),v.setIdle(!1)}),q.showAnimationDuration||b.removeClass(d,"pswp__ui--hidden"),l("initialZoomIn",function(){q.showAnimationDuration&&b.removeClass(d,"pswp__ui--hidden")}),l("initialZoomOut",function(){b.addClass(d,"pswp__ui--hidden")}),l("parseVerticalMargin",P),T(),q.shareEl&&h&&i&&(y=!0),D(),Q(),M(),N()},v.setIdle=function(a){k=a,C(d,"ui--idle",a)},v.update=function(){x&&a.currItem?(v.updateIndexIndicator(),q.captionEl&&(q.addCaptionHTMLFn(a.currItem,e),C(e,"caption--empty",!a.currItem.title)),w=!0):w=!1,y||F(),D()},v.updateFullscreen=function(d){d&&setTimeout(function(){a.setScrollOffset(0,b.getScrollY())},50),b[(c.isFullscreen()?"add":"remove")+"Class"](a.template,"pswp--fs")},v.updateIndexIndicator=function(){q.counterEl&&(g.innerHTML=a.getCurrentIndex()+1+q.indexIndicatorSep+q.getNumItemsFn())},v.onGlobalTap=function(c){c=c||window.event;var d=c.target||c.srcElement;if(!r)if(c.detail&&"mouse"===c.detail.pointerType){if(I(d))return void a.close();b.hasClass(d,"pswp__img")&&(1===a.getZoomLevel()&&a.getZoomLevel()<=a.currItem.fitRatio?q.clickToCloseNonZoomable&&a.close():a.toggleDesktopZoom(c.detail.releasePoint))}else if(q.tapToToggleControls&&(x?v.hideControls():v.showControls()),q.tapToClose&&(b.hasClass(d,"pswp__img")||I(d)))return void a.close()},v.onMouseOver=function(a){a=a||window.event;var b=a.target||a.srcElement;C(d,"ui--over-close",I(b))},v.hideControls=function(){b.addClass(d,"pswp__ui--hidden"),x=!1},v.showControls=function(){x=!0,w||v.update(),b.removeClass(d,"pswp__ui--hidden")},v.supportsFullscreen=function(){var a=document;return!!(a.exitFullscreen||a.mozCancelFullScreen||a.webkitExitFullscreen||a.msExitFullscreen)},v.getFullscreenAPI=function(){var b,c=document.documentElement,d="fullscreenchange";return c.requestFullscreen?b={enterK:"requestFullscreen",exitK:"exitFullscreen",elementK:"fullscreenElement",eventK:d}:c.mozRequestFullScreen?b={enterK:"mozRequestFullScreen",exitK:"mozCancelFullScreen",elementK:"mozFullScreenElement",eventK:"moz"+d}:c.webkitRequestFullscreen?b={enterK:"webkitRequestFullscreen",exitK:"webkitExitFullscreen",elementK:"webkitFullscreenElement",eventK:"webkit"+d}:c.msRequestFullscreen&&(b={enterK:"msRequestFullscreen",exitK:"msExitFullscreen",elementK:"msFullscreenElement",eventK:"MSFullscreenChange"}),b&&(b.enter=function(){return j=q.closeOnScroll,q.closeOnScroll=!1,"webkitRequestFullscreen"!==this.enterK?a.template[this.enterK]():void a.template[this.enterK](Element.ALLOW_KEYBOARD_INPUT)},b.exit=function(){return q.closeOnScroll=j,document[this.exitK]()},b.isFullscreen=function(){return document[this.elementK]}),b}};return a});
--------------------------------------------------------------------------------
/source/photoswipe/photoswipe.css:
--------------------------------------------------------------------------------
1 | /*! PhotoSwipe main CSS by Dmitry Semenov | photoswipe.com | MIT license */
2 | /*
3 | Styles for basic PhotoSwipe functionality (sliding area, open/close transitions)
4 | */
5 | /* pswp = photoswipe */
6 | .pswp {
7 | display: none;
8 | position: absolute;
9 | width: 100%;
10 | height: 100%;
11 | left: 0;
12 | top: 0;
13 | overflow: hidden;
14 | -ms-touch-action: none;
15 | touch-action: none;
16 | z-index: 1500;
17 | -webkit-text-size-adjust: 100%;
18 | /* create separate layer, to avoid paint on window.onscroll in webkit/blink */
19 | -webkit-backface-visibility: hidden;
20 | outline: none; }
21 | .pswp * {
22 | -webkit-box-sizing: border-box;
23 | box-sizing: border-box; }
24 | .pswp img {
25 | max-width: none; }
26 |
27 | /* style is added when JS option showHideOpacity is set to true */
28 | .pswp--animate_opacity {
29 | /* 0.001, because opacity:0 doesn't trigger Paint action, which causes lag at start of transition */
30 | opacity: 0.001;
31 | will-change: opacity;
32 | /* for open/close transition */
33 | -webkit-transition: opacity 333ms cubic-bezier(0.4, 0, 0.22, 1);
34 | transition: opacity 333ms cubic-bezier(0.4, 0, 0.22, 1); }
35 |
36 | .pswp--open {
37 | display: block; }
38 |
39 | .pswp--zoom-allowed .pswp__img {
40 | /* autoprefixer: off */
41 | cursor: -webkit-zoom-in;
42 | cursor: -moz-zoom-in;
43 | cursor: zoom-in; }
44 |
45 | .pswp--zoomed-in .pswp__img {
46 | /* autoprefixer: off */
47 | cursor: -webkit-grab;
48 | cursor: -moz-grab;
49 | cursor: grab; }
50 |
51 | .pswp--dragging .pswp__img {
52 | /* autoprefixer: off */
53 | cursor: -webkit-grabbing;
54 | cursor: -moz-grabbing;
55 | cursor: grabbing; }
56 |
57 | /*
58 | Background is added as a separate element.
59 | As animating opacity is much faster than animating rgba() background-color.
60 | */
61 | .pswp__bg {
62 | position: absolute;
63 | left: 0;
64 | top: 0;
65 | width: 100%;
66 | height: 100%;
67 | background: #000;
68 | opacity: 0;
69 | -webkit-transform: translateZ(0);
70 | transform: translateZ(0);
71 | -webkit-backface-visibility: hidden;
72 | will-change: opacity; }
73 |
74 | .pswp__scroll-wrap {
75 | position: absolute;
76 | left: 0;
77 | top: 0;
78 | width: 100%;
79 | height: 100%;
80 | overflow: hidden; }
81 |
82 | .pswp__container,
83 | .pswp__zoom-wrap {
84 | -ms-touch-action: none;
85 | touch-action: none;
86 | position: absolute;
87 | left: 0;
88 | right: 0;
89 | top: 0;
90 | bottom: 0; }
91 |
92 | /* Prevent selection and tap highlights */
93 | .pswp__container,
94 | .pswp__img {
95 | -webkit-user-select: none;
96 | -moz-user-select: none;
97 | -ms-user-select: none;
98 | user-select: none;
99 | -webkit-tap-highlight-color: transparent;
100 | -webkit-touch-callout: none; }
101 |
102 | .pswp__zoom-wrap {
103 | position: absolute;
104 | width: 100%;
105 | -webkit-transform-origin: left top;
106 | -ms-transform-origin: left top;
107 | transform-origin: left top;
108 | /* for open/close transition */
109 | -webkit-transition: -webkit-transform 333ms cubic-bezier(0.4, 0, 0.22, 1);
110 | transition: transform 333ms cubic-bezier(0.4, 0, 0.22, 1); }
111 |
112 | .pswp__bg {
113 | will-change: opacity;
114 | /* for open/close transition */
115 | -webkit-transition: opacity 333ms cubic-bezier(0.4, 0, 0.22, 1);
116 | transition: opacity 333ms cubic-bezier(0.4, 0, 0.22, 1); }
117 |
118 | .pswp--animated-in .pswp__bg,
119 | .pswp--animated-in .pswp__zoom-wrap {
120 | -webkit-transition: none;
121 | transition: none; }
122 |
123 | .pswp__container,
124 | .pswp__zoom-wrap {
125 | -webkit-backface-visibility: hidden; }
126 |
127 | .pswp__item {
128 | position: absolute;
129 | left: 0;
130 | right: 0;
131 | top: 0;
132 | bottom: 0;
133 | overflow: hidden; }
134 |
135 | .pswp__img {
136 | position: absolute;
137 | width: auto;
138 | height: auto;
139 | top: 0;
140 | left: 0; }
141 |
142 | /*
143 | stretched thumbnail or div placeholder element (see below)
144 | style is added to avoid flickering in webkit/blink when layers overlap
145 | */
146 | .pswp__img--placeholder {
147 | -webkit-backface-visibility: hidden; }
148 |
149 | /*
150 | div element that matches size of large image
151 | large image loads on top of it
152 | */
153 | .pswp__img--placeholder--blank {
154 | background: #222; }
155 |
156 | .pswp--ie .pswp__img {
157 | width: 100% !important;
158 | height: auto !important;
159 | left: 0;
160 | top: 0; }
161 |
162 | /*
163 | Error message appears when image is not loaded
164 | (JS option errorMsg controls markup)
165 | */
166 | .pswp__error-msg {
167 | position: absolute;
168 | left: 0;
169 | top: 50%;
170 | width: 100%;
171 | text-align: center;
172 | font-size: 14px;
173 | line-height: 16px;
174 | margin-top: -8px;
175 | color: #CCC; }
176 |
177 | .pswp__error-msg a {
178 | color: #CCC;
179 | text-decoration: underline; }
180 |
--------------------------------------------------------------------------------
/source/photoswipe/photoswipe.min.js:
--------------------------------------------------------------------------------
1 | /*! PhotoSwipe - v4.1.2 - 2017-04-05
2 | * http://photoswipe.com
3 | * Copyright (c) 2017 Dmitry Semenov; */
4 | !function(a,b){"function"==typeof define&&define.amd?define(b):"object"==typeof exports?module.exports=b():a.PhotoSwipe=b()}(this,function(){"use strict";var a=function(a,b,c,d){var e={features:null,bind:function(a,b,c,d){var e=(d?"remove":"add")+"EventListener";b=b.split(" ");for(var f=0;f0&&(g=parseInt(g[1],10),g>=1&&g<8&&(d.isOldIOSPhone=!0))}var h=f.match(/Android\s([0-9\.]*)/),i=h?h[1]:0;i=parseFloat(i),i>=1&&(i<4.4&&(d.isOldAndroid=!0),d.androidVersion=i),d.isMobileOpera=/opera mini|opera mobi/i.test(f)}for(var j,k,l=["transform","perspective","animationName"],m=["","webkit","Moz","ms","O"],n=0;n<4;n++){c=m[n];for(var o=0;o<3;o++)j=l[o],k=c+(c?j.charAt(0).toUpperCase()+j.slice(1):j),!d[j]&&k in b&&(d[j]=k);c&&!d.raf&&(c=c.toLowerCase(),d.raf=window[c+"RequestAnimationFrame"],d.raf&&(d.caf=window[c+"CancelAnimationFrame"]||window[c+"CancelRequestAnimationFrame"]))}if(!d.raf){var p=0;d.raf=function(a){var b=(new Date).getTime(),c=Math.max(0,16-(b-p)),d=window.setTimeout(function(){a(b+c)},c);return p=b+c,d},d.caf=function(a){clearTimeout(a)}}return d.svg=!!document.createElementNS&&!!document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGRect,e.features=d,d}};e.detectFeatures(),e.features.oldIE&&(e.bind=function(a,b,c,d){b=b.split(" ");for(var e,f=(d?"detach":"attach")+"Event",g=function(){c.handleEvent.call(c)},h=0;hb-1?a-b:a<0?b+a:a},Ba={},Ca=function(a,b){return Ba[a]||(Ba[a]=[]),Ba[a].push(b)},Da=function(a){var b=Ba[a];if(b){var c=Array.prototype.slice.call(arguments);c.shift();for(var d=0;df.currItem.fitRatio?ya||(mc(f.currItem,!1,!0),ya=!0):ya&&(mc(f.currItem),ya=!1)),Ga(ea,pa.x,pa.y,s))},Ia=function(a){a.container&&Ga(a.container.style,a.initialPosition.x,a.initialPosition.y,a.initialZoomLevel,a)},Ja=function(a,b){b[E]=u+a+"px, 0px"+v},Ka=function(a,b){if(!i.loop&&b){var c=m+(ta.x*ra-a)/ta.x,d=Math.round(a-tb.x);(c<0&&d>0||c>=ac()-1&&d<0)&&(a=tb.x+d*i.mainScrollEndFriction)}tb.x=a,Ja(a,n)},La=function(a,b){var c=ub[a]-sa[a];return oa[a]+na[a]+c-c*(b/t)},Ma=function(a,b){a.x=b.x,a.y=b.y,b.id&&(a.id=b.id)},Na=function(a){a.x=Math.round(a.x),a.y=Math.round(a.y)},Oa=null,Pa=function(){Oa&&(e.unbind(document,"mousemove",Pa),e.addClass(a,"pswp--has_mouse"),i.mouseUsed=!0,Da("mouseUsed")),Oa=setTimeout(function(){Oa=null},100)},Qa=function(){e.bind(document,"keydown",f),N.transform&&e.bind(f.scrollWrap,"click",f),i.mouseUsed||e.bind(document,"mousemove",Pa),e.bind(window,"resize scroll orientationchange",f),Da("bindEvents")},Ra=function(){e.unbind(window,"resize scroll orientationchange",f),e.unbind(window,"scroll",r.scroll),e.unbind(document,"keydown",f),e.unbind(document,"mousemove",Pa),N.transform&&e.unbind(f.scrollWrap,"click",f),V&&e.unbind(window,p,f),clearTimeout(O),Da("unbindEvents")},Sa=function(a,b){var c=ic(f.currItem,qa,a);return b&&(da=c),c},Ta=function(a){return a||(a=f.currItem),a.initialZoomLevel},Ua=function(a){return a||(a=f.currItem),a.w>0?i.maxSpreadZoom:1},Va=function(a,b,c,d){return d===f.currItem.initialZoomLevel?(c[a]=f.currItem.initialPosition[a],!0):(c[a]=La(a,d),c[a]>b.min[a]?(c[a]=b.min[a],!0):c[a]1?1:a.fitRatio,c=a.container.style,d=b*a.w,e=b*a.h;c.width=d+"px",c.height=e+"px",c.left=a.initialPosition.x+"px",c.top=a.initialPosition.y+"px"},Ha=function(){if(ea){var a=ea,b=f.currItem,c=b.fitRatio>1?1:b.fitRatio,d=c*b.w,e=c*b.h;a.width=d+"px",a.height=e+"px",a.left=pa.x+"px",a.top=pa.y+"px"}}},Xa=function(a){var b="";i.escKey&&27===a.keyCode?b="close":i.arrowKeys&&(37===a.keyCode?b="prev":39===a.keyCode&&(b="next")),b&&(a.ctrlKey||a.altKey||a.shiftKey||a.metaKey||(a.preventDefault?a.preventDefault():a.returnValue=!1,f[b]()))},Ya=function(a){a&&(Y||X||fa||T)&&(a.preventDefault(),a.stopPropagation())},Za=function(){f.setScrollOffset(0,e.getScrollY())},$a={},_a=0,ab=function(a){$a[a]&&($a[a].raf&&I($a[a].raf),_a--,delete $a[a])},bb=function(a){$a[a]&&ab(a),$a[a]||(_a++,$a[a]={})},cb=function(){for(var a in $a)$a.hasOwnProperty(a)&&ab(a)},db=function(a,b,c,d,e,f,g){var h,i=Ea();bb(a);var j=function(){if($a[a]){if(h=Ea()-i,h>=d)return ab(a),f(c),void(g&&g());f((c-b)*e(h/d)+b),$a[a].raf=H(j)}};j()},eb={shout:Da,listen:Ca,viewportSize:qa,options:i,isMainScrollAnimating:function(){return fa},getZoomLevel:function(){return s},getCurrentIndex:function(){return m},isDragging:function(){return V},isZooming:function(){return aa},setScrollOffset:function(a,b){sa.x=a,M=sa.y=b,Da("updateScrollOffset",sa)},applyZoomPan:function(a,b,c,d){pa.x=b,pa.y=c,s=a,Ha(d)},init:function(){if(!j&&!k){var c;f.framework=e,f.template=a,f.bg=e.getChildByClass(a,"pswp__bg"),J=a.className,j=!0,N=e.detectFeatures(),H=N.raf,I=N.caf,E=N.transform,L=N.oldIE,f.scrollWrap=e.getChildByClass(a,"pswp__scroll-wrap"),f.container=e.getChildByClass(f.scrollWrap,"pswp__container"),n=f.container.style,f.itemHolders=y=[{el:f.container.children[0],wrap:0,index:-1},{el:f.container.children[1],wrap:0,index:-1},{el:f.container.children[2],wrap:0,index:-1}],y[0].el.style.display=y[2].el.style.display="none",Wa(),r={resize:f.updateSize,orientationchange:function(){clearTimeout(O),O=setTimeout(function(){qa.x!==f.scrollWrap.clientWidth&&f.updateSize()},500)},scroll:Za,keydown:Xa,click:Ya};var d=N.isOldIOSPhone||N.isOldAndroid||N.isMobileOpera;for(N.animationName&&N.transform&&!d||(i.showAnimationDuration=i.hideAnimationDuration=0),c=0;c=ac())&&(m=0),f.currItem=_b(m),(N.isOldIOSPhone||N.isOldAndroid)&&(va=!1),a.setAttribute("aria-hidden","false"),i.modal&&(va?a.style.position="fixed":(a.style.position="absolute",a.style.top=e.getScrollY()+"px")),void 0===M&&(Da("initialLayout"),M=K=e.getScrollY());var l="pswp--open ";for(i.mainClass&&(l+=i.mainClass+" "),i.showHideOpacity&&(l+="pswp--animate_opacity "),l+=G?"pswp--touch":"pswp--notouch",l+=N.animationName?" pswp--css_animation":"",l+=N.svg?" pswp--svg":"",e.addClass(a,l),f.updateSize(),o=-1,ua=null,c=0;cda.min.x?a=da.min.x:ada.min.y?b=da.min.y:b=h&&(o+=ua+(ua>0?-h:h),c=h);for(var d=0;d0?(b=y.shift(),y[h-1]=b,o++,Ja((o+2)*ta.x,b.el.style),f.setContent(b,m-c+d+1+1)):(b=y.pop(),y.unshift(b),o--,Ja(o*ta.x,b.el.style),f.setContent(b,m+c-d-1-1));if(ea&&1===Math.abs(ua)){var e=_b(z);e.initialZoomLevel!==s&&(ic(e,qa),mc(e),Ia(e))}ua=0,f.updateCurrZoomItem(),z=m,Da("afterChange")}}},updateSize:function(b){if(!va&&i.modal){var c=e.getScrollY();if(M!==c&&(a.style.top=c+"px",M=c),!b&&xa.x===window.innerWidth&&xa.y===window.innerHeight)return;xa.x=window.innerWidth,xa.y=window.innerHeight,a.style.height=xa.y+"px"}if(qa.x=f.scrollWrap.clientWidth,qa.y=f.scrollWrap.clientHeight,Za(),ta.x=qa.x+Math.round(qa.x*i.spacing),ta.y=qa.y,Ka(ta.x*ra),Da("beforeResize"),void 0!==o){for(var d,g,j,k=0;k2&&(j=Aa(j)),g=_b(j),g&&(x||g.needsUpdate||!g.bounds)?(f.cleanSlide(g),f.setContent(d,j),1===k&&(f.currItem=g,f.updateCurrZoomItem(!0)),g.needsUpdate=!1):d.index===-1&&j>=0&&f.setContent(d,j),g&&g.container&&(ic(g,qa),mc(g),Ia(g));x=!1}t=s=f.currItem.initialZoomLevel,da=f.currItem.bounds,da&&(pa.x=da.center.x,pa.y=da.center.y,Ha(!0)),Da("resize")},zoomTo:function(a,b,c,d,f){b&&(t=s,ub.x=Math.abs(b.x)-pa.x,ub.y=Math.abs(b.y)-pa.y,Ma(oa,pa));var g=Sa(a,!1),h={};Va("x",g,h,a),Va("y",g,h,a);var i=s,j={x:pa.x,y:pa.y};Na(h);var k=function(b){1===b?(s=a,pa.x=h.x,pa.y=h.y):(s=(a-i)*b+i,pa.x=(h.x-j.x)*b+j.x,pa.y=(h.y-j.y)*b+j.y),f&&f(b),Ha(1===b)};c?db("customZoomTo",0,1,c,d||e.easing.sine.inOut,k):k(1)}},fb=30,gb=10,hb={},ib={},jb={},kb={},lb={},mb=[],nb={},ob=[],pb={},qb=0,rb=ma(),sb=0,tb=ma(),ub=ma(),vb=ma(),wb=function(a,b){return a.x===b.x&&a.y===b.y},xb=function(a,b){return Math.abs(a.x-b.x)-1)&&(b(a)?a:Cb(a.parentNode,b)))},Db={},Eb=function(a,b){return Db.prevent=!Cb(a.target,i.isClickableElement),Da("preventDragEvent",a,b,Db),Db.prevent},Fb=function(a,b){return b.x=a.pageX,b.y=a.pageY,b.id=a.identifier,b},Gb=function(a,b,c){c.x=.5*(a.x+b.x),c.y=.5*(a.y+b.y)},Hb=function(a,b,c){if(a-Q>50){var d=ob.length>2?ob.shift():{};d.x=b,d.y=c,ob.push(d),Q=a}},Ib=function(){var a=pa.y-f.currItem.initialPosition.y;return 1-Math.abs(a/(qa.y/2))},Jb={},Kb={},Lb=[],Mb=function(a){for(;Lb.length>0;)Lb.pop();return F?(la=0,mb.forEach(function(a){0===la?Lb[0]=a:1===la&&(Lb[1]=a),la++})):a.type.indexOf("touch")>-1?a.touches&&a.touches.length>0&&(Lb[0]=Fb(a.touches[0],Jb),a.touches.length>1&&(Lb[1]=Fb(a.touches[1],Kb))):(Jb.x=a.pageX,Jb.y=a.pageY,Jb.id="",Lb[0]=Jb),Lb},Nb=function(a,b){var c,d,e,g,h=0,j=pa[a]+b[a],k=b[a]>0,l=tb.x+b.x,m=tb.x-nb.x;return c=j>da.min[a]||jda.min[a]&&(c=i.panEndFriction,h=da.min[a]-j,d=da.min[a]-oa[a]),(d<=0||m<0)&&ac()>1?(g=l,m<0&&l>nb.x&&(g=nb.x)):da.min.x!==da.max.x&&(e=j)):(j0)&&ac()>1?(g=l,m>0&&lf.currItem.fitRatio&&(pa[a]+=b[a]*c)):(void 0!==g&&(Ka(g,!0),$=g!==nb.x),da.min.x!==da.max.x&&(void 0!==e?pa.x=e:$||(pa.x+=b.x*c)),void 0!==g)},Ob=function(a){if(!("mousedown"===a.type&&a.button>0)){if($b)return void a.preventDefault();if(!U||"mousedown"!==a.type){if(Eb(a,!0)&&a.preventDefault(),Da("pointerDown"),F){var b=e.arraySearch(mb,a.pointerId,"id");b<0&&(b=mb.length),mb[b]={x:a.pageX,y:a.pageY,id:a.pointerId}}var c=Mb(a),d=c.length;_=null,cb(),V&&1!==d||(V=ha=!0,e.bind(window,p,f),S=ka=ia=T=$=Y=W=X=!1,ga=null,Da("firstTouchStart",c),Ma(oa,pa),na.x=na.y=0,Ma(kb,c[0]),Ma(lb,kb),nb.x=ta.x*ra,ob=[{x:kb.x,y:kb.y}],Q=P=Ea(),Sa(s,!0),zb(),Ab()),!aa&&d>1&&!fa&&!$&&(t=s,X=!1,aa=W=!0,na.y=na.x=0,Ma(oa,pa),Ma(hb,c[0]),Ma(ib,c[1]),Gb(hb,ib,vb),ub.x=Math.abs(vb.x)-pa.x,ub.y=Math.abs(vb.y)-pa.y,ba=ca=yb(hb,ib))}}},Pb=function(a){if(a.preventDefault(),F){var b=e.arraySearch(mb,a.pointerId,"id");if(b>-1){var c=mb[b];c.x=a.pageX,c.y=a.pageY}}if(V){var d=Mb(a);if(ga||Y||aa)_=d;else if(tb.x!==ta.x*ra)ga="h";else{var f=Math.abs(d[0].x-kb.x)-Math.abs(d[0].y-kb.y);Math.abs(f)>=gb&&(ga=f>0?"h":"v",_=d)}}},Qb=function(){if(_){var a=_.length;if(0!==a)if(Ma(hb,_[0]),jb.x=hb.x-kb.x,jb.y=hb.y-kb.y,aa&&a>1){if(kb.x=hb.x,kb.y=hb.y,!jb.x&&!jb.y&&wb(_[1],ib))return;Ma(ib,_[1]),X||(X=!0,Da("zoomGestureStarted"));var b=yb(hb,ib),c=Vb(b);c>f.currItem.initialZoomLevel+f.currItem.initialZoomLevel/15&&(ka=!0);var d=1,e=Ta(),g=Ua();if(c1&&(d=1),c=e-d*(e/3);else c>g&&(d=(c-g)/(6*e),d>1&&(d=1),c=g+d*e);d<0&&(d=0),ba=b,Gb(hb,ib,rb),na.x+=rb.x-vb.x,na.y+=rb.y-vb.y,Ma(vb,rb),pa.x=La("x",c),pa.y=La("y",c),S=c>s,s=c,Ha()}else{if(!ga)return;if(ha&&(ha=!1,Math.abs(jb.x)>=gb&&(jb.x-=_[0].x-lb.x),Math.abs(jb.y)>=gb&&(jb.y-=_[0].y-lb.y)),kb.x=hb.x,kb.y=hb.y,0===jb.x&&0===jb.y)return;if("v"===ga&&i.closeOnVerticalDrag&&!Bb()){na.y+=jb.y,pa.y+=jb.y;var k=Ib();return T=!0,Da("onVerticalDrag",k),Fa(k),void Ha()}Hb(Ea(),hb.x,hb.y),Y=!0,da=f.currItem.bounds;var l=Nb("x",jb);l||(Nb("y",jb),Na(pa),Ha())}}},Rb=function(a){if(N.isOldAndroid){if(U&&"mouseup"===a.type)return;a.type.indexOf("touch")>-1&&(clearTimeout(U),U=setTimeout(function(){U=0},600))}Da("pointerUp"),Eb(a,!1)&&a.preventDefault();var b;if(F){var c=e.arraySearch(mb,a.pointerId,"id");if(c>-1)if(b=mb.splice(c,1)[0],navigator.pointerEnabled)b.type=a.pointerType||"mouse";else{var d={4:"mouse",2:"touch",3:"pen"};b.type=d[a.pointerType],b.type||(b.type=a.pointerType||"mouse")}}var g,h=Mb(a),j=h.length;if("mouseup"===a.type&&(j=0),2===j)return _=null,!0;1===j&&Ma(lb,h[0]),0!==j||ga||fa||(b||("mouseup"===a.type?b={x:a.pageX,y:a.pageY,type:"mouse"}:a.changedTouches&&a.changedTouches[0]&&(b={x:a.changedTouches[0].pageX,y:a.changedTouches[0].pageY,type:"touch"})),Da("touchRelease",a,b));var k=-1;if(0===j&&(V=!1,e.unbind(window,p,f),zb(),aa?k=0:sb!==-1&&(k=Ea()-sb)),sb=1===j?Ea():-1,g=k!==-1&&k<150?"zoom":"swipe",aa&&j<2&&(aa=!1,1===j&&(g="zoomPointerUp"),Da("zoomGestureEnded")),_=null,Y||X||fa||T)if(cb(),R||(R=Sb()),R.calculateSwipeSpeed("x"),T){var l=Ib();if(lf.currItem.fitRatio&&Tb(R))}},Sb=function(){var a,b,c={lastFlickOffset:{},lastFlickDist:{},lastFlickSpeed:{},slowDownRatio:{},slowDownRatioReverse:{},speedDecelerationRatio:{},speedDecelerationRatioAbs:{},distanceOffset:{},backAnimDestination:{},backAnimStarted:{},calculateSwipeSpeed:function(d){ob.length>1?(a=Ea()-Q+50,b=ob[ob.length-2][d]):(a=Ea()-P,b=lb[d]),c.lastFlickOffset[d]=kb[d]-b,c.lastFlickDist[d]=Math.abs(c.lastFlickOffset[d]),c.lastFlickDist[d]>20?c.lastFlickSpeed[d]=c.lastFlickOffset[d]/a:c.lastFlickSpeed[d]=0,Math.abs(c.lastFlickSpeed[d])<.1&&(c.lastFlickSpeed[d]=0),c.slowDownRatio[d]=.95,c.slowDownRatioReverse[d]=1-c.slowDownRatio[d],c.speedDecelerationRatio[d]=1},calculateOverBoundsAnimOffset:function(a,b){c.backAnimStarted[a]||(pa[a]>da.min[a]?c.backAnimDestination[a]=da.min[a]:pa[a]fb&&(h||b.lastFlickOffset.x>20)?d=-1:g<-fb&&(h||b.lastFlickOffset.x<-20)&&(d=1)}var j;d&&(m+=d,m<0?(m=i.loop?ac()-1:0,j=!0):m>=ac()&&(m=i.loop?0:ac()-1,j=!0),j&&!i.loop||(ua+=d,ra-=d,c=!0));var k,l=ta.x*ra,n=Math.abs(l-tb.x);return c||l>tb.x==b.lastFlickSpeed.x>0?(k=Math.abs(b.lastFlickSpeed.x)>0?n/Math.abs(b.lastFlickSpeed.x):333,k=Math.min(k,400),k=Math.max(k,250)):k=333,qb===m&&(c=!1),fa=!0,Da("mainScrollAnimStart"),db("mainScroll",tb.x,l,k,e.easing.cubic.out,Ka,function(){cb(),fa=!1,qb=-1,(c||qb!==m)&&f.updateCurrItem(),Da("mainScrollAnimComplete")}),c&&f.updateCurrItem(!0),c},Vb=function(a){return 1/ca*a*t},Wb=function(){var a=s,b=Ta(),c=Ua();sc&&(a=c);var d,g=1,h=ja;return ia&&!S&&!ka&&s1||navigator.msMaxTouchPoints>1),f.likelyTouchDevice=G,r[A]=Ob,r[B]=Pb,r[C]=Rb,D&&(r[D]=r[C]),N.touch&&(q+=" mousedown",p+=" mousemove mouseup",r.mousedown=r[A],r.mousemove=r[B],r.mouseup=r[C]),G||(i.allowPanToNext=!1)}}});var Xb,Yb,Zb,$b,_b,ac,bc,cc=function(b,c,d,g){Xb&&clearTimeout(Xb),$b=!0,Zb=!0;var h;b.initialLayout?(h=b.initialLayout,b.initialLayout=null):h=i.getThumbBoundsFn&&i.getThumbBoundsFn(m);var j=d?i.hideAnimationDuration:i.showAnimationDuration,k=function(){ab("initialZoom"),d?(f.template.removeAttribute("style"),f.bg.removeAttribute("style")):(Fa(1),c&&(c.style.display="block"),e.addClass(a,"pswp--animated-in"),Da("initialZoom"+(d?"OutEnd":"InEnd"))),g&&g(),$b=!1};if(!j||!h||void 0===h.x)return Da("initialZoom"+(d?"Out":"In")),s=b.initialZoomLevel,Ma(pa,b.initialPosition),Ha(),a.style.opacity=d?0:1,Fa(1),void(j?setTimeout(function(){k()},j):k());var n=function(){var c=l,g=!f.currItem.src||f.currItem.loadError||i.showHideOpacity;b.miniImg&&(b.miniImg.style.webkitBackfaceVisibility="hidden"),d||(s=h.w/b.w,pa.x=h.x,pa.y=h.y-K,f[g?"template":"bg"].style.opacity=.001,Ha()),bb("initialZoom"),d&&!c&&e.removeClass(a,"pswp--animated-in"),g&&(d?e[(c?"remove":"add")+"Class"](a,"pswp--animate_opacity"):setTimeout(function(){e.addClass(a,"pswp--animate_opacity")},30)),Xb=setTimeout(function(){if(Da("initialZoom"+(d?"Out":"In")),d){var f=h.w/b.w,i={x:pa.x,y:pa.y},l=s,m=ja,n=function(b){1===b?(s=f,pa.x=h.x,pa.y=h.y-M):(s=(f-l)*b+l,pa.x=(h.x-i.x)*b+i.x,pa.y=(h.y-M-i.y)*b+i.y),Ha(),g?a.style.opacity=1-b:Fa(m-b*m)};c?db("initialZoom",0,1,j,e.easing.cubic.out,n,k):(n(1),Xb=setTimeout(k,j+20))}else s=b.initialZoomLevel,Ma(pa,b.initialPosition),Ha(),Fa(1),g?a.style.opacity=1:Fa(1),Xb=setTimeout(k,j+20)},d?25:90)};n()},dc={},ec=[],fc={index:0,errorMsg:'',forceProgressiveLoading:!1,preload:[1,1],getNumItemsFn:function(){return Yb.length}},gc=function(){return{center:{x:0,y:0},max:{x:0,y:0},min:{x:0,y:0}}},hc=function(a,b,c){var d=a.bounds;d.center.x=Math.round((dc.x-b)/2),d.center.y=Math.round((dc.y-c)/2)+a.vGap.top,d.max.x=b>dc.x?Math.round(dc.x-b):d.center.x,d.max.y=c>dc.y?Math.round(dc.y-c)+a.vGap.top:d.center.y,d.min.x=b>dc.x?0:d.center.x,d.min.y=c>dc.y?a.vGap.top:d.center.y},ic=function(a,b,c){if(a.src&&!a.loadError){var d=!c;if(d&&(a.vGap||(a.vGap={top:0,bottom:0}),Da("parseVerticalMargin",a)),dc.x=b.x,dc.y=b.y-a.vGap.top-a.vGap.bottom,d){var e=dc.x/a.w,f=dc.y/a.h;a.fitRatio=e1&&(c=1),a.initialZoomLevel=c,a.bounds||(a.bounds=gc())}if(!c)return;return hc(a,a.w*c,a.h*c),d&&c===a.initialZoomLevel&&(a.initialPosition=a.bounds.center),a.bounds}return a.w=a.h=0,a.initialZoomLevel=a.fitRatio=1,a.bounds=gc(),a.initialPosition=a.bounds.center,a.bounds},jc=function(a,b,c,d,e,g){b.loadError||d&&(b.imageAppended=!0,mc(b,d,b===f.currItem&&ya),c.appendChild(d),g&&setTimeout(function(){b&&b.loaded&&b.placeholder&&(b.placeholder.style.display="none",b.placeholder=null)},500))},kc=function(a){a.loading=!0,a.loaded=!1;var b=a.img=e.createEl("pswp__img","img"),c=function(){a.loading=!1,a.loaded=!0,a.loadComplete?a.loadComplete(a):a.img=null,b.onload=b.onerror=null,b=null};return b.onload=c,b.onerror=function(){a.loadError=!0,c()},b.src=a.src,b},lc=function(a,b){if(a.src&&a.loadError&&a.container)return b&&(a.container.innerHTML=""),a.container.innerHTML=i.errorMsg.replace("%url%",a.src),!0},mc=function(a,b,c){if(a.src){b||(b=a.container.lastChild);var d=c?a.w:Math.round(a.w*a.fitRatio),e=c?a.h:Math.round(a.h*a.fitRatio);a.placeholder&&!a.loaded&&(a.placeholder.style.width=d+"px",a.placeholder.style.height=e+"px"),b.style.width=d+"px",b.style.height=e+"px"}},nc=function(){if(ec.length){for(var a,b=0;b=0,e=Math.min(c[0],ac()),g=Math.min(c[1],ac());for(b=1;b<=(d?g:e);b++)f.lazyLoadItem(m+b);for(b=1;b<=(d?e:g);b++)f.lazyLoadItem(m-b)}),Ca("initialLayout",function(){f.currItem.initialLayout=i.getThumbBoundsFn&&i.getThumbBoundsFn(m)}),Ca("mainScrollAnimComplete",nc),Ca("initialZoomInEnd",nc),Ca("destroy",function(){for(var a,b=0;b=0&&(void 0!==Yb[a]&&Yb[a])},allowProgressiveImg:function(){return i.forceProgressiveLoading||!G||i.mouseUsed||screen.width>1200},setContent:function(a,b){i.loop&&(b=Aa(b));var c=f.getItemAt(a.index);c&&(c.container=null);var d,g=f.getItemAt(b);if(!g)return void(a.el.innerHTML="");Da("gettingData",b,g),a.index=b,a.item=g;var h=g.container=e.createEl("pswp__zoom-wrap");if(!g.src&&g.html&&(g.html.tagName?h.appendChild(g.html):h.innerHTML=g.html),lc(g),ic(g,qa),!g.src||g.loadError||g.loaded)g.src&&!g.loadError&&(d=e.createEl("pswp__img","img"),d.style.opacity=1,d.src=g.src,mc(g,d),jc(b,g,h,d,!0));else{if(g.loadComplete=function(c){if(j){if(a&&a.index===b){if(lc(c,!0))return c.loadComplete=c.img=null,ic(c,qa),Ia(c),void(a.index===m&&f.updateCurrZoomItem());c.imageAppended?!$b&&c.placeholder&&(c.placeholder.style.display="none",c.placeholder=null):N.transform&&(fa||$b)?ec.push({item:c,baseDiv:h,img:c.img,index:b,holder:a,clearPlaceholder:!0}):jc(b,c,h,c.img,fa||$b,!0)}c.loadComplete=null,c.img=null,Da("imageLoadComplete",b,c)}},e.features.transform){var k="pswp__img pswp__img--placeholder";k+=g.msrc?"":" pswp__img--placeholder--blank";var l=e.createEl(k,g.msrc?"img":"");g.msrc&&(l.src=g.msrc),mc(g,l),h.appendChild(l),g.placeholder=l}g.loading||kc(g),f.allowProgressiveImg()&&(!Zb&&N.transform?ec.push({item:g,baseDiv:h,img:g.img,index:b,holder:a}):jc(b,g,h,g.img,!0,!0))}Zb||b!==m?Ia(g):(ea=h.style,cc(g,d||g.img)),a.el.innerHTML="",a.el.appendChild(h)},cleanSlide:function(a){a.img&&(a.img.onload=a.img.onerror=null),a.loaded=a.loading=a.img=a.imageAppended=!1}}});var oc,pc={},qc=function(a,b,c){var d=document.createEvent("CustomEvent"),e={origEvent:a,target:a.target,releasePoint:b,pointerType:c||"touch"};d.initCustomEvent("pswpTap",!0,!0,e),a.target.dispatchEvent(d)};za("Tap",{publicMethods:{initTap:function(){Ca("firstTouchStart",f.onTapStart),Ca("touchRelease",f.onTapRelease),Ca("destroy",function(){pc={},oc=null})},onTapStart:function(a){a.length>1&&(clearTimeout(oc),oc=null)},onTapRelease:function(a,b){if(b&&!Y&&!W&&!_a){var c=b;if(oc&&(clearTimeout(oc),oc=null,xb(c,pc)))return void Da("doubleTap",c);if("mouse"===b.type)return void qc(a,b,"mouse");var d=a.target.tagName.toUpperCase();if("BUTTON"===d||e.hasClass(a.target,"pswp__single-tap"))return void qc(a,b);Ma(pc,c),oc=setTimeout(function(){qc(a,b),oc=null},300)}}}});var rc;za("DesktopZoom",{publicMethods:{initDesktopZoom:function(){L||(G?Ca("mouseUsed",function(){f.setupDesktopZoom()}):f.setupDesktopZoom(!0))},setupDesktopZoom:function(b){rc={};var c="wheel mousewheel DOMMouseScroll";Ca("bindEvents",function(){e.bind(a,c,f.handleMouseWheel)}),Ca("unbindEvents",function(){rc&&e.unbind(a,c,f.handleMouseWheel)}),f.mouseZoomedIn=!1;var d,g=function(){f.mouseZoomedIn&&(e.removeClass(a,"pswp--zoomed-in"),f.mouseZoomedIn=!1),s<1?e.addClass(a,"pswp--zoom-allowed"):e.removeClass(a,"pswp--zoom-allowed"),h()},h=function(){d&&(e.removeClass(a,"pswp--dragging"),d=!1)};Ca("resize",g),Ca("afterChange",g),Ca("pointerDown",function(){f.mouseZoomedIn&&(d=!0,e.addClass(a,"pswp--dragging"))}),Ca("pointerUp",h),b||g()},handleMouseWheel:function(a){if(s<=f.currItem.fitRatio)return i.modal&&(!i.closeOnScroll||_a||V?a.preventDefault():E&&Math.abs(a.deltaY)>2&&(l=!0,f.close())),!0;if(a.stopPropagation(),rc.x=0,"deltaX"in a)1===a.deltaMode?(rc.x=18*a.deltaX,rc.y=18*a.deltaY):(rc.x=a.deltaX,rc.y=a.deltaY);else if("wheelDelta"in a)a.wheelDeltaX&&(rc.x=-.16*a.wheelDeltaX),a.wheelDeltaY?rc.y=-.16*a.wheelDeltaY:rc.y=-.16*a.wheelDelta;else{if(!("detail"in a))return;rc.y=a.detail}Sa(s,!0);var b=pa.x-rc.x,c=pa.y-rc.y;(i.modal||b<=da.min.x&&b>=da.max.x&&c<=da.min.y&&c>=da.max.y)&&a.preventDefault(),f.panTo(b,c)},toggleDesktopZoom:function(b){b=b||{x:qa.x/2+sa.x,y:qa.y/2+sa.y};var c=i.getDoubleTapZoom(!0,f.currItem),d=s===c;f.mouseZoomedIn=!d,f.zoomTo(d?f.currItem.initialZoomLevel:c,b,333),e[(d?"remove":"add")+"Class"](a,"pswp--zoomed-in")}}});var sc,tc,uc,vc,wc,xc,yc,zc,Ac,Bc,Cc,Dc,Ec={history:!0,galleryUID:1},Fc=function(){return Cc.hash.substring(1)},Gc=function(){sc&&clearTimeout(sc),uc&&clearTimeout(uc)},Hc=function(){var a=Fc(),b={};if(a.length<5)return b;var c,d=a.split("&");for(c=0;c-1&&(yc=yc.split("&gid=")[0],yc=yc.split("?gid=")[0]),Ca("afterChange",f.updateURL),Ca("unbindEvents",function(){e.unbind(window,"hashchange",f.onHashChange)});var a=function(){xc=!0,Ac||(Bc?history.back():yc?Cc.hash=yc:Dc?history.pushState("",document.title,Cc.pathname+Cc.search):Cc.hash=""),Gc()};Ca("unbindEvents",function(){l&&a()}),Ca("destroy",function(){xc||a()}),Ca("firstUpdate",function(){m=Hc().pid});var b=yc.indexOf("pid=");b>-1&&(yc=yc.substring(0,b),"&"===yc.slice(-1)&&(yc=yc.slice(0,-1))),setTimeout(function(){j&&e.bind(window,"hashchange",f.onHashChange)},40)}},onHashChange:function(){return Fc()===yc?(Ac=!0,void f.close()):void(vc||(wc=!0,f.goTo(Hc().pid),wc=!1))},updateURL:function(){Gc(),wc||(zc?sc=setTimeout(Ic,800):Ic())}}}),e.extend(f,eb)};return a});
--------------------------------------------------------------------------------