commit a92f834e7d3a90752bf92590f63405007423de11 Author: CaiCai Date: Fri Oct 9 18:43:40 2015 +0800 first commit diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 0000000..487b53a Binary files /dev/null and b/.DS_Store differ diff --git a/404.jade b/404.jade new file mode 100755 index 0000000..4a891f0 --- /dev/null +++ b/404.jade @@ -0,0 +1,6 @@ +html + head + title Not Found + +load('/template/style/css/style.scss') + .page_404 + p 404 Not Foundvar assert = require("assert") diff --git a/about.jade b/about.jade new file mode 100644 index 0000000..ace9684 --- /dev/null +++ b/about.jade @@ -0,0 +1,37 @@ +extends base.jade +block content + .autopagerize_page_element:.content + .about.animated.fadeInDown + h3 是我 + p 生活的花匠,互联网的裁缝,理想的士兵 + h3 自嘲 + p + | 经常嬉笑自嘲,假装不靠谱. + | 早就已经不是少年,但却是满腔少年心气. + + h3 热爱 + p + | 热爱我的职业是这辈子最幸福的事情,虽挖过的坑比填的坑还多,但乐此不疲. + h3 玩儿 + p + | 玩,什么都玩,拼命的玩!喜欢接触新鲜玩意 + h3 直白 + p + | 不会拐弯抹角,不会阿谀奉承! + h3 硬广 + p + | 如果需要老博客主题,请访问:http://old.cai-cai.me + p + | 主题Cais,如需要请访问farbox模版页面,预览地址: + a(href="http://cais.cai-cai.me") 点我点我~ + p + | 博客目前主题取名Anatole,预览地址: + a(href="http://anatole.cai-cai.me") 点我点我~ + h3 联系 + p + | 任何问题,欢迎给我发邮件(hi#cai-cai.me #=@),或者twitter上@我~~ + br + p + | 也可以用 + a(href="https://telegram.me/hicaicai") Telegram + | 联系我 diff --git a/archive.jade b/archive.jade new file mode 100755 index 0000000..14987e7 --- /dev/null +++ b/archive.jade @@ -0,0 +1,16 @@ +from mixins import make_pager +extends base.jade +block content + .autopagerize_page_element:.content + .archive.animated.fadeInDown + ul.list-with-title + entries = get_data(type='post',limit=300, sort='desc').group('-date:year') + for year, posts in entries + div.listing-title= year + ul.listing + for post in posts + .listing-item + .listing-post + a(href=post.url, title=post.title)= post.title + div.post-time + span.date= post.date.format("%m-%d") diff --git a/base.jade b/base.jade new file mode 100755 index 0000000..17bda56 --- /dev/null +++ b/base.jade @@ -0,0 +1,86 @@ +html + +i18n('Home', '首页', 'zh_cn') + +i18n('Albums', '相册', 'zh_cn') + +i18n('Categories', '分类', 'zh_cn') + +i18n('Archive', '归档', 'zh_cn') + +i18n('Tags', '标签', 'zh_cn') + +i18n('About', '关于', 'zh_cn') + +i18n('Links', '友链', 'zh_cn') + head + meta(http-equiv="Content-Type", content="text/html; charset=UTF-8") + block title + title= post.title or site.title + +mobile_meta() + meta(name="author", content="CaiCai,hi@cai-cai.me") + meta(name="keywords", content=site.configs.keywords.escaped) + meta(name="description", content=site.raw_content.escaped) + link(rel="stylesheet", type="text/css", href="http://fonts.googleapis.com/css?family=Open+Sans:300,400,600,700&subset=latin,latin-ext") + link(rel="shortcut icon", href="/template/style/images/favicon.png",type="image/x-icon") + +load('font') + +get_resource("blog_basic.css") + +load('/template/style/css/style.scss') + body + .sidebar + .logo-title + .title.animated.fadeInDown + img(src="/template/style/images/logo@2x.png",style="width:127px;") + h3(title="") + a(href="https://www.caicai.me") {{ site.title }} + if site.raw_content + .description.animated.fadeInDown + p= '%s' % site.raw_content[:100] + + ul.social-links.animated.fadeInDown + if site.configs.twitter + li + a(href="https://twitter.com/{{site.configs.twitter}}") + i.fa.fa-twitter + if site.configs.instagram + li + a(href="http://instagram.com/{{site.configs.instagram}}") + i.fa.fa-instagram + if site.configs.dribbble + li + a(href="https://dribbble.com/{{site.configs.dribbble}}") + i.fa.fa-dribbble + if site.configs.weibo + li + a(href="http://weibo.com/{{site.configs.weibo}}") + i.fa.fa-weibo + .footer + a(target="_blank", href="http://{{request.domain}}") + span Designed by + a(href="https://www.caicai.me") CaiCai + .by_farbox + a(href="http://www.farbox.com", target="_blank") Proudly published with Farbox! + .main + .page-top.animated.fadeInDown + .nav + li + if request.url_without_host=='/' + a.current(href="/") Home + else + a(href="/") Home + li + if request.url_without_host=='/about' + a.current(href="/about") About + else + a(href="/about") About + li + if request.url_without_host=='/archive' + a.current(href="/archive") Archive + else + a(href="/archive") Archive + .information + .back_btn + li + if post + a.fa.fa-chevron-left(onclick="window.history.go(-1)") + else + a.fa.fa-chevron-left(onclick="window.history.go(-1)",style="display:none;") + .avatar + img(src=site.avatar) + block content + +load('jquery') + +load("/template/style/js/jquery-migrate-1.2.1.min.js") + +load("/template/style/js/jquery.appear.js") diff --git a/index.jade b/index.jade new file mode 100755 index 0000000..b8161ce --- /dev/null +++ b/index.jade @@ -0,0 +1,7 @@ +from mixins import make_post, make_pager +extends base.jade +block content + .autopagerize_page_element:.content + for post in posts + +make_post(post, is_detail=False) + +make_pager('Newer Posts', 'Older Posts') diff --git a/interface.json b/interface.json new file mode 100755 index 0000000..b0a5ee6 --- /dev/null +++ b/interface.json @@ -0,0 +1,54 @@ +[ + {}, + {}, + {}, + {}, + { + "title": "Extra", + "title_zh_cn": "更多", + "icon": "align-justify", + "groups":[ + { + "title": "My Social", + "title_zh_cn": "我的社交", + "cells":[ + { + "parts_per_line": 4, + "parts":[ + { + "key": "weibo", + "title": "Weibo", + "title_zh_cn": "微博", + "placeholder": "WeiBo ID", + "model": "text" + }, + { + "key": "twitter", + "title": "Twitter", + "placeholder": "Twitter ID", + "model": "text" + } + , + { + "key": "instagram", + "title": "Instagram", + "placeholder": "Instagram ID", + "model": "text" + } + , + { + "key": "dribbble", + "title": "Dribbble", + "placeholder": "Dribbble ID", + "model": "text" + } + ] + } + ] + + + + } + ] + } +] \ No newline at end of file diff --git a/mixins.jade b/mixins.jade new file mode 100755 index 0000000..ad11d71 --- /dev/null +++ b/mixins.jade @@ -0,0 +1,29 @@ +mixin make_post(post, is_detail=False) + .post.animated.fadeInDown + .post-title + h3 + if is_detail + a= post.title + else + a(href="{{post.url}}")= post.title + if is_detail + .post-content= post.content + else + .post-content= post.content.limit(200).no_pic + .post-footer:.meta + .info + i.fa.fa-calendar + span.date= post.date.format("%Y-%m-%d") + if site.configs.disqus + i.fa.fa-comment-o + a(href="{{post.url}}#disqus_thread") Comments +mixin make_pager(pre_text, next_text) + .pagination + ul.clearfix + if paginator.has_next + li.next.pagbuttons + a.btn(role="navigation",href="{{ paginator.next_page_url}}")= next_text + + if paginator.has_previous + li.pre.pagbuttons + a.btn(role="navigation",href="{{ paginator.previous_page_url }}")= pre_text \ No newline at end of file diff --git a/post+markdown+pages.jade b/post+markdown+pages.jade new file mode 100755 index 0000000..cef6353 --- /dev/null +++ b/post+markdown+pages.jade @@ -0,0 +1,14 @@ +from mixins import make_post + +extends base.jade +block content + .autopagerize_page_element:.content:.post-page + +make_post(post, is_detail=True) + .share + .evernote + a.fa.fa-bookmark(href="javascript:(function(){EN_CLIP_HOST='http://www.evernote.com';try{var%20x=document.createElement('SCRIPT');x.type='text/javascript';x.src=EN_CLIP_HOST+'/public/bookmarkClipper.js?'+(new%20Date().getTime()/100000);document.getElementsByTagName('head')[0].appendChild(x);}catch(e){location.href=EN_CLIP_HOST+'/clip.action?url='+encodeURIComponent(location.href)+'&title='+encodeURIComponent(document.title);}})();", ref="nofollow", target="_blank") + .weibo + a.fa.fa-weibo(href="javascript:void((function(s,d,e){try{}catch(e){}var f='http://service.weibo.com/share/share.php?',u=d.location.href,p=['url=',e(u),'&title=',e(d.title),'&appkey=2924220432'].join('');function a(){if(!window.open([f,p].join(''),'mb',['toolbar=0,status=0,resizable=1,width=620,height=450,left=',(s.width-620)/2,',top=',(s.height-450)/2].join('')))u.href=[f,p].join('');};if(/Firefox/.test(navigator.userAgent)){setTimeout(a,0)}else{a()}})(screen,document,encodeURIComponent));") + .twitter + a.fa.fa-twitter(href="http://twitter.com/home?status={{request.url}} ,{{site.title}},{{post.title}},;") + include include/comments diff --git a/style/.DS_Store b/style/.DS_Store new file mode 100644 index 0000000..4c205de Binary files /dev/null and b/style/.DS_Store differ diff --git a/style/css/.DS_Store b/style/css/.DS_Store new file mode 100644 index 0000000..83cbc58 Binary files /dev/null and b/style/css/.DS_Store differ diff --git a/style/css/style.scss b/style/css/style.scss new file mode 100755 index 0000000..f8ba173 --- /dev/null +++ b/style/css/style.scss @@ -0,0 +1,762 @@ +/*basic styles starts*/ +html { + background-color: #fff; + -webkit-font-smoothing: antialiased; +} + +body { + color: rgba(0, 0, 0, 0.5); + font-family: "Helvetica Neue",Helvetica,"Hiragino Sans GB","STHeitiSC-Light","Microsoft YaHei","微软雅黑",Arial,sans-serif; + font-size: 15px; + width: 100%; + margin: 0 auto 30px auto; + background-color: #fff; + +} +p { + line-height: 1.9em; + font-weight: 400; + font-size: 14px; +} + +a { + text-decoration: none; +} + +a:link, a:visited { + opacity: 1; + -webkit-transition: all .15s linear; + -moz-transition: all .15s linear; + -o-transition: all .15s linear; + -ms-transition: all .15s linear; + transition: all .15s linear; + color: #424242; + +} + +a:hover, a:active { + color: #555; + +} + +/*basic styles ends*/ + + + +/*animation starts*/ + +.animated { + -webkit-animation-fill-mode: both; + -moz-animation-fill-mode: both; + -ms-animation-fill-mode: both; + -o-animation-fill-mode: both; + animation-fill-mode: both; + -webkit-animation-duration: 1s; + -moz-animation-duration: 1s; + -ms-animation-duration: 1s; + -o-animation-duration: 1s; + animation-duration: 1s; +} + +.animated.hinge { + -webkit-animation-duration: 1s; + -moz-animation-duration: 1s; + -ms-animation-duration: 1s; + -o-animation-duration: 1s; + animation-duration: 1s; +} + +@-webkit-keyframes fadeInDown { + 0% { + opacity: 0; + -webkit-transform: translateY(-20px); + } + + 100% { + opacity: 1; + -webkit-transform: translateY(0); + } +} + +@-moz-keyframes fadeInDown { + 0% { + opacity: 0; + -moz-transform: translateY(-20px); + } + + 100% { + opacity: 1; + -moz-transform: translateY(0); + } +} + +@-o-keyframes fadeInDown { + 0% { + opacity: 0; + -o-transform: translateY(-20px); + } + + 100% { + opacity: 1; + -o-transform: translateY(0); + } +} + +@keyframes fadeInDown { + 0% { + opacity: 0; + transform: translateY(-20px); + } + + 100% { + opacity: 1; + transform: translateY(0); + } +} + +.fadeInDown { + -webkit-animation-name: fadeInDown; + -moz-animation-name: fadeInDown; + -o-animation-name: fadeInDown; + animation-name: fadeInDown; +} + +/*animation ends*/ + + + + +.content { + height: auto; + float: right; + width: 60%; + margin-top:60px; +} + +.page-top{ + width: 59.9%; + position: fixed; + right: 0; + z-index: 9999; + background-color: #fff; + height: 60px; + border-bottom: 1px solid #f2f2f2; + + .nav{ + list-style:none; + padding:18px 30px; + float: left; + font-size:12px; + + li{ + position: relative; + display: initial; + padding-right:20px; + } + a { + color:#5A5A5A; + } + a:hover{ + color:#464545; + } + a.current{ + color:#5A5A5A; + padding-bottom: 22px; + border-bottom: 1px solid #5A5A5A; + } + } + + .information{ + float: right; + padding-top: 12px; + padding-right: 20px; + + .avatar{ + float: right; + + img{ + width: 32px; + height: 32px; + border-radius: 300px; + } + } + .back_btn{ + float: left; + padding-top: 5px; + margin-right:-10px; + + li{ + display: initial; + padding-right:40px; + } + } + } + +} +.sidebar { + width: 40%; + -webkit-background-size: cover; + background-size: cover; + background-color: #fff; + height: 100%; + transition:0.8s; + top: 0; + left:0; + position: fixed; + border-right: 1px solid #f2f2f2; + + .logo-title{ + text-align: center; + padding-top:240px; + + + .description { + font-size: 14px; + color: #565654; + } + + + .logo { + margin: 0 auto; + } + + .title{ + h3 { + text-transform: uppercase; + font-size: 2rem; + font-weight: bold; + letter-spacing: 2px; + line-height: 1; + margin:0; + } + + a { + text-decoration: none; + color: #464646; + font-size: 2rem; + font-weight: bold; + } + } + + } + + .social-links { + list-style: none; + padding: 0; + font-size: 14px; + text-align: center; + + i{ + margin-right: 3px; + } + + li { + display: inline; + padding: 0 4px; + line-height: 0; + } + + a { + color: #565654; + } + } +} + + +.post { + background-color: #FFF; + margin: 30px; + + .post-title{ + h1 { + text-transform: uppercase; + font-size: 30px; + letter-spacing: 5px; + line-height: 1; + } + + h2 { + text-transform: uppercase; + letter-spacing: 1px; + font-size: 28px; + line-height: 1; + font-weight: 600; + color: #5f5f5f; + + } + + h3 { + text-transform: uppercase; + letter-spacing: 1px; + line-height: 1; + font-weight: 600; + color: #464646; + font-size: 22px; + margin:0; + + } + a { + text-decoration: none; + letter-spacing: 1px; + color: #5f5f5f; + font-family: Open Sans; + + } + } + + .post-content{ + a { + text-decoration: none; + letter-spacing: 1px; + color: #4786D6; + } + h3{ + color: #5F5F5F; + font-size:22px; + font-weight:600; + font-family: Open Sans; + + } + h4 { + color: #5F5F5F; + font-size:16px; + font-family: Open Sans; + + + } + img { + min-width: 100%; + } + } + + .post-footer { + padding: 0 0 30px 0; + border-bottom: 1px solid #f2f2f2; + + + .meta { + max-width: 100%; + height: 25px; + color: #bbbbbb; + + .info { + float: left; + font-size: 12px; + .date{ + margin-right: 5px; + } + } + + a { + text-decoration: none; + color: #bbbbbb; + } + i{ + margin-right: 3px; + } + } + + + + .tags{ + padding-bottom: 15px; + font-size: 13px; + + ul { + list-style-type: none; + display: inline; + margin: 0; + padding: 0; + + li { + list-style-type: none; + margin: 0; + padding-right: 5px; + display: inline; + } + } + + a{ + text-decoration: none; + color: rgba(0, 0, 0, 0.44); + font-weight: 400; + + &:hover{ + text-decoration: none; + } + } + } + } + + +} + + + + +.pagination { + margin: 30px; + padding: 0px 0 56px 0; + border-bottom: 1px solid #f2f2f2; + + ul { + list-style: none; + margin: 0; + padding: 0; + height: 13px; + + li { + margin: 0 2px 0 2px; + display: inline; + line-height: 1; + + a { + text-decoration: none; + } + } + } + + .pre { + float: left; + } + + .next { + float: right; + } +} + + + + + + + + +.like-reblog-buttons { + float: right; +} + +.like-button { + float: right; + padding: 0 0 0 10px; +} + +.reblog-button { + float: right; + padding: 0; +} + +#install-btn { + position: fixed; + bottom: 0px; + right: 6px +} + +#disqus_thread { + margin: 30px; + border-bottom: 1px solid #f2f2f2; +} + +.footer { + clear: both; + text-align: center; + font-size: 10px; + margin: 0 auto; + bottom: 0; + position: absolute; + width: 100%; + padding-bottom: 20px; + a { + color: #A6A6A6; + } + span{ + } + .by_farbox{ + } +} + + + + +/*for archive*/ +.archive{ + width: 100%; +} +.list-with-title{ + font-size: 14px; + margin: 30px; + padding: 0; + li { + list-style-type: none; + padding: 0; + } + + .listing-title { + font-size: 24px; + color: #666666; + font-weight: 600; + line-height: 2.2em; + } + .listing{ + padding: 0; + .listing-post { + padding-bottom: 5px; + + .post-time { + float: right; + color: #C5C5C5; + } + + a { + color: #8F8F8F; + + &:hover{ + color: #464545; + } + } + + } + } +} +/* share */ +.share{ + padding-left: 30px; + display: flex; + width: 100%; + height: 60px; + display: -webkit-box; +} +.evernote{ + width: 32px; + height: 32px; + border-radius: 300px; + background-color: #3E3E3E; + margin-right:5px; + a{ + color: #fff; + padding: 11px; + font-size: 12px; + } + a:hover{ + color: #ED6243; + padding: 11px; + } +} +.weibo{ + width: 32px; + height: 32px; + border-radius: 300px; + background-color: #ED6243; + margin-right:5px; + + a{ + color: #fff; + padding: 9px; + } + a:hover{ + color: #BD4226; + } +} +.twitter{ + width: 32px; + height: 32px; + border-radius: 300px; + background-color: #59C0FD; + margin-right:5px; + + a{ + color: #fff; + padding: 9px; + } + a:hover{ + color:#4B9ECE; + } +} +/* about */ +.about{ + margin: 30px; + h3{ + font-size: 22px; + } +} +/* 评论样式 */ + +.comment-count { + color: #666; +} + +.tab-community { + color: #666; +} + +.read_more { + font-size: 14px; +} + +.back-button { + padding-top: 30px; + max-width: 100px; + padding-left: 40px; + float: left; +} + +/* 按钮样式 */ +a.btn { + color: #868686; + font-weight: 400; + +} + +.btn { + display: inline-block; + position: relative; + outline: 0; + color: rgba(0, 0, 0, 0.44); + background: rgba(0, 0, 0, 0); + font-size: 14px; + text-align: center; + text-decoration: none; + cursor: pointer; + border: 1px solid rgba(0, 0, 0, 0.15); + white-space: nowrap; + font-weight: 400; + font-style: normal; + border-radius: 999em; +} + +.btn:hover { + display: inline-block; + position: relative; + outline: 0px; + color: #464545; + background: rgba(0, 0, 0, 0); + font-size: 14px; + text-align: center; + text-decoration: none; + cursor: pointer; + border: 1px solid #464545; + white-space: nowrap; + font-weight: 400; + font-style: normal; + border-radius: 999em; +} + +[role="back"] { + padding: 0.5em 1.25em; + line-height: 1.666em; +} + +[role="home"] { + padding: 0.5em 1.25em; + line-height: 1.666em; +} + +[role="navigation"] { + padding: 0.5em 1.25em; + line-height: 1.666em; +} + +[role="tags"] { + padding: 6px 12px; +} + +/* Menu样式 */ +.menu { + float: right; + padding-top: 30px; + + .btn-down{ + margin: 0px; + li { + list-style: none; + width: 100px; + + a { + display: inline-block; + position: relative; + padding: 0.5em 1.25em; + outline: 0; + color: rgba(0, 0, 0, 0.44); + background: rgba(0, 0, 0, 0); + font-size: 14px; + text-align: center; + text-decoration: none; + cursor: pointer; + border: 1px solid rgba(0, 0, 0, 0.15); + white-space: nowrap; + font-weight: 400; + font-style: normal; + border-radius: 999em; + margin-top: 5px; + + &:hover{ + position: relative; + padding: 0.5em 1.25em; + outline: 0; + color: #fff; + background: #3CBD10; + font-size: 14px; + text-align: center; + text-decoration: none; + cursor: pointer; + border: 1px solid rgba(0, 0, 0, 0.15); + white-space: nowrap; + font-weight: 400; + font-style: normal; + border-radius: 999em; + margin-top: 5px; + } + } + + } + } + + .btn-down div { + position: absolute; + visibility: hidden; + width: 100px; + float: right; + + } + +} + + +@media screen and (max-width: 414px) { + .sidebar { + width: 100%; + position:absolute; + border-right:none; + .logo-title{ + padding-top: 100px; + + .title{ + + img{ + width: 100px; + } + h3{ + font-size: 20px; + } + } + } + } + .page-top{ + display: none; + } + .content{ + margin-top: 360px; + width: 100%; + overflow: hidden; + } + .footer{ + display: none; + } + .share{ + display: flex; + display: -webkit-box; + } + +} + + diff --git a/style/images/favicon.png b/style/images/favicon.png new file mode 100644 index 0000000..b0f5080 Binary files /dev/null and b/style/images/favicon.png differ diff --git a/style/images/logo.png b/style/images/logo.png new file mode 100644 index 0000000..b171c8a Binary files /dev/null and b/style/images/logo.png differ diff --git a/style/images/logo@2x.png b/style/images/logo@2x.png new file mode 100644 index 0000000..4844ced Binary files /dev/null and b/style/images/logo@2x.png differ diff --git a/style/js/jquery-migrate-1.2.1.min.js b/style/js/jquery-migrate-1.2.1.min.js new file mode 100755 index 0000000..62149c2 --- /dev/null +++ b/style/js/jquery-migrate-1.2.1.min.js @@ -0,0 +1,2 @@ +/*! jQuery Migrate v1.2.1 | (c) 2005, 2013 jQuery Foundation, Inc. and other contributors | jquery.org/license */ +jQuery.migrateMute===void 0&&(jQuery.migrateMute=!0),function(e,t,n){function r(n){var r=t.console;i[n]||(i[n]=!0,e.migrateWarnings.push(n),r&&r.warn&&!e.migrateMute&&(r.warn("JQMIGRATE: "+n),e.migrateTrace&&r.trace&&r.trace()))}function a(t,a,i,o){if(Object.defineProperty)try{return Object.defineProperty(t,a,{configurable:!0,enumerable:!0,get:function(){return r(o),i},set:function(e){r(o),i=e}}),n}catch(s){}e._definePropertyBroken=!0,t[a]=i}var i={};e.migrateWarnings=[],!e.migrateMute&&t.console&&t.console.log&&t.console.log("JQMIGRATE: Logging is active"),e.migrateTrace===n&&(e.migrateTrace=!0),e.migrateReset=function(){i={},e.migrateWarnings.length=0},"BackCompat"===document.compatMode&&r("jQuery is not compatible with Quirks Mode");var o=e("",{size:1}).attr("size")&&e.attrFn,s=e.attr,u=e.attrHooks.value&&e.attrHooks.value.get||function(){return null},c=e.attrHooks.value&&e.attrHooks.value.set||function(){return n},l=/^(?:input|button)$/i,d=/^[238]$/,p=/^(?:autofocus|autoplay|async|checked|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped|selected)$/i,f=/^(?:checked|selected)$/i;a(e,"attrFn",o||{},"jQuery.attrFn is deprecated"),e.attr=function(t,a,i,u){var c=a.toLowerCase(),g=t&&t.nodeType;return u&&(4>s.length&&r("jQuery.fn.attr( props, pass ) is deprecated"),t&&!d.test(g)&&(o?a in o:e.isFunction(e.fn[a])))?e(t)[a](i):("type"===a&&i!==n&&l.test(t.nodeName)&&t.parentNode&&r("Can't change the 'type' of an input or button in IE 6/7/8"),!e.attrHooks[c]&&p.test(c)&&(e.attrHooks[c]={get:function(t,r){var a,i=e.prop(t,r);return i===!0||"boolean"!=typeof i&&(a=t.getAttributeNode(r))&&a.nodeValue!==!1?r.toLowerCase():n},set:function(t,n,r){var a;return n===!1?e.removeAttr(t,r):(a=e.propFix[r]||r,a in t&&(t[a]=!0),t.setAttribute(r,r.toLowerCase())),r}},f.test(c)&&r("jQuery.fn.attr('"+c+"') may use property instead of attribute")),s.call(e,t,a,i))},e.attrHooks.value={get:function(e,t){var n=(e.nodeName||"").toLowerCase();return"button"===n?u.apply(this,arguments):("input"!==n&&"option"!==n&&r("jQuery.fn.attr('value') no longer gets properties"),t in e?e.value:null)},set:function(e,t){var a=(e.nodeName||"").toLowerCase();return"button"===a?c.apply(this,arguments):("input"!==a&&"option"!==a&&r("jQuery.fn.attr('value', val) no longer sets properties"),e.value=t,n)}};var g,h,v=e.fn.init,m=e.parseJSON,y=/^([^<]*)(<[\w\W]+>)([^>]*)$/;e.fn.init=function(t,n,a){var i;return t&&"string"==typeof t&&!e.isPlainObject(n)&&(i=y.exec(e.trim(t)))&&i[0]&&("<"!==t.charAt(0)&&r("$(html) HTML strings must start with '<' character"),i[3]&&r("$(html) HTML text after last tag is ignored"),"#"===i[0].charAt(0)&&(r("HTML string cannot start with a '#' character"),e.error("JQMIGRATE: Invalid selector string (XSS)")),n&&n.context&&(n=n.context),e.parseHTML)?v.call(this,e.parseHTML(i[2],n,!0),n,a):v.apply(this,arguments)},e.fn.init.prototype=e.fn,e.parseJSON=function(e){return e||null===e?m.apply(this,arguments):(r("jQuery.parseJSON requires a valid JSON string"),null)},e.uaMatch=function(e){e=e.toLowerCase();var t=/(chrome)[ \/]([\w.]+)/.exec(e)||/(webkit)[ \/]([\w.]+)/.exec(e)||/(opera)(?:.*version|)[ \/]([\w.]+)/.exec(e)||/(msie) ([\w.]+)/.exec(e)||0>e.indexOf("compatible")&&/(mozilla)(?:.*? rv:([\w.]+)|)/.exec(e)||[];return{browser:t[1]||"",version:t[2]||"0"}},e.browser||(g=e.uaMatch(navigator.userAgent),h={},g.browser&&(h[g.browser]=!0,h.version=g.version),h.chrome?h.webkit=!0:h.webkit&&(h.safari=!0),e.browser=h),a(e,"browser",e.browser,"jQuery.browser is deprecated"),e.sub=function(){function t(e,n){return new t.fn.init(e,n)}e.extend(!0,t,this),t.superclass=this,t.fn=t.prototype=this(),t.fn.constructor=t,t.sub=this.sub,t.fn.init=function(r,a){return a&&a instanceof e&&!(a instanceof t)&&(a=t(a)),e.fn.init.call(this,r,a,n)},t.fn.init.prototype=t.fn;var n=t(document);return r("jQuery.sub() is deprecated"),t},e.ajaxSetup({converters:{"text json":e.parseJSON}});var b=e.fn.data;e.fn.data=function(t){var a,i,o=this[0];return!o||"events"!==t||1!==arguments.length||(a=e.data(o,t),i=e._data(o,t),a!==n&&a!==i||i===n)?b.apply(this,arguments):(r("Use of jQuery.fn.data('events') is deprecated"),i)};var j=/\/(java|ecma)script/i,w=e.fn.andSelf||e.fn.addBack;e.fn.andSelf=function(){return r("jQuery.fn.andSelf() replaced by jQuery.fn.addBack()"),w.apply(this,arguments)},e.clean||(e.clean=function(t,a,i,o){a=a||document,a=!a.nodeType&&a[0]||a,a=a.ownerDocument||a,r("jQuery.clean() is deprecated");var s,u,c,l,d=[];if(e.merge(d,e.buildFragment(t,a).childNodes),i)for(c=function(e){return!e.type||j.test(e.type)?o?o.push(e.parentNode?e.parentNode.removeChild(e):e):i.appendChild(e):n},s=0;null!=(u=d[s]);s++)e.nodeName(u,"script")&&c(u)||(i.appendChild(u),u.getElementsByTagName!==n&&(l=e.grep(e.merge([],u.getElementsByTagName("script")),c),d.splice.apply(d,[s+1,0].concat(l)),s+=l.length));return d});var Q=e.event.add,x=e.event.remove,k=e.event.trigger,N=e.fn.toggle,T=e.fn.live,M=e.fn.die,S="ajaxStart|ajaxStop|ajaxSend|ajaxComplete|ajaxError|ajaxSuccess",C=RegExp("\\b(?:"+S+")\\b"),H=/(?:^|\s)hover(\.\S+|)\b/,A=function(t){return"string"!=typeof t||e.event.special.hover?t:(H.test(t)&&r("'hover' pseudo-event is deprecated, use 'mouseenter mouseleave'"),t&&t.replace(H,"mouseenter$1 mouseleave$1"))};e.event.props&&"attrChange"!==e.event.props[0]&&e.event.props.unshift("attrChange","attrName","relatedNode","srcElement"),e.event.dispatch&&a(e.event,"handle",e.event.dispatch,"jQuery.event.handle is undocumented and deprecated"),e.event.add=function(e,t,n,a,i){e!==document&&C.test(t)&&r("AJAX events should be attached to document: "+t),Q.call(this,e,A(t||""),n,a,i)},e.event.remove=function(e,t,n,r,a){x.call(this,e,A(t)||"",n,r,a)},e.fn.error=function(){var e=Array.prototype.slice.call(arguments,0);return r("jQuery.fn.error() is deprecated"),e.splice(0,0,"error"),arguments.length?this.bind.apply(this,e):(this.triggerHandler.apply(this,e),this)},e.fn.toggle=function(t,n){if(!e.isFunction(t)||!e.isFunction(n))return N.apply(this,arguments);r("jQuery.fn.toggle(handler, handler...) is deprecated");var a=arguments,i=t.guid||e.guid++,o=0,s=function(n){var r=(e._data(this,"lastToggle"+t.guid)||0)%o;return e._data(this,"lastToggle"+t.guid,r+1),n.preventDefault(),a[r].apply(this,arguments)||!1};for(s.guid=i;a.length>o;)a[o++].guid=i;return this.click(s)},e.fn.live=function(t,n,a){return r("jQuery.fn.live() is deprecated"),T?T.apply(this,arguments):(e(this.context).on(t,this.selector,n,a),this)},e.fn.die=function(t,n){return r("jQuery.fn.die() is deprecated"),M?M.apply(this,arguments):(e(this.context).off(t,this.selector||"**",n),this)},e.event.trigger=function(e,t,n,a){return n||C.test(e)||r("Global events are undocumented and deprecated"),k.call(this,e,t,n||document,a)},e.each(S.split("|"),function(t,n){e.event.special[n]={setup:function(){var t=this;return t!==document&&(e.event.add(document,n+"."+e.guid,function(){e.event.trigger(n,null,t,!0)}),e._data(this,n,e.guid++)),!1},teardown:function(){return this!==document&&e.event.remove(document,n+"."+e._data(this,n)),!1}}})}(jQuery,window); \ No newline at end of file diff --git a/style/js/jquery.appear.js b/style/js/jquery.appear.js new file mode 100755 index 0000000..f1a3334 --- /dev/null +++ b/style/js/jquery.appear.js @@ -0,0 +1,101 @@ +/* + * jQuery appear plugin + * + * Copyright (c) 2012 Andrey Sidorov + * licensed under MIT license. + * + * https://github.com/morr/jquery.appear/ + * + * Version: 0.3.3 + */ +(function($) { + var selectors = []; + + var check_binded = false; + var check_lock = false; + var defaults = { + interval: 250, + force_process: false + } + var $window = $(window); + + var $prior_appeared; + + function process() { + check_lock = false; + for (var index = 0; index < selectors.length; index++) { + var $appeared = $(selectors[index]).filter(function() { + return $(this).is(':appeared'); + }); + + $appeared.trigger('appear', [$appeared]); + + if ($prior_appeared) { + var $disappeared = $prior_appeared.not($appeared); + $disappeared.trigger('disappear', [$disappeared]); + } + $prior_appeared = $appeared; + } + } + + // "appeared" custom filter + $.expr[':']['appeared'] = function(element) { + var $element = $(element); + if (!$element.is(':visible')) { + return false; + } + + var window_left = $window.scrollLeft(); + var window_top = $window.scrollTop(); + var offset = $element.offset(); + var left = offset.left; + var top = offset.top; + + if (top + $element.height() >= window_top && + top - ($element.data('appear-top-offset') || 0) <= window_top + $window.height() && + left + $element.width() >= window_left && + left - ($element.data('appear-left-offset') || 0) <= window_left + $window.width()) { + return true; + } else { + return false; + } + } + + $.fn.extend({ + // watching for element's appearance in browser viewport + appear: function(options) { + var opts = $.extend({}, defaults, options || {}); + var selector = this.selector || this; + if (!check_binded) { + var on_check = function() { + if (check_lock) { + return; + } + check_lock = true; + + setTimeout(process, opts.interval); + }; + + $(window).scroll(on_check).resize(on_check); + check_binded = true; + } + + if (opts.force_process) { + setTimeout(process, opts.interval); + } + selectors.push(selector); + return $(selector); + } + }); + + $.extend({ + // force elements's appearance check + force_appear: function() { + if (check_binded) { + process(); + return true; + }; + return false; + } + }); +})(jQuery); \ No newline at end of file