diff --git a/metro-hot/css/metro-hot.css b/metro-hot/css/metro-hot.css index def09c0..064e124 100644 --- a/metro-hot/css/metro-hot.css +++ b/metro-hot/css/metro-hot.css @@ -18,7 +18,7 @@ * skin metro-hot style * * @author Liyuan Li -* @version 1.0.0.9, Jul 24, 2013 +* @version 1.0.1.0, Jul 31, 2013 */ /* start base */ @font-face { @@ -407,9 +407,10 @@ textarea { } .article-list > div > img { - min-width: 100%; max-width: 100%; transition: all 1.2s; + display: block; + margin: 0 auto; } .article-list > div:hover > img { @@ -500,6 +501,11 @@ textarea { word-wrap: break-word; padding: 0; } + +.article-image .article-body { + padding: 10px; + height: 95px; +} /* end article list*/ /* start side */ @@ -920,7 +926,7 @@ textarea { float: left; font-size: 12px; line-height: 20px; - margin: 6px 10px; + margin: 6px; padding: 5px 10px; transition: all 0.8s ease 0s; white-space: nowrap; diff --git a/metro-hot/css/metro-hot.min.css b/metro-hot/css/metro-hot.min.css index efa34a8..25b56a0 100644 --- a/metro-hot/css/metro-hot.min.css +++ b/metro-hot/css/metro-hot.min.css @@ -65,7 +65,7 @@ textarea{overflow:auto;vertical-align:top} .navigation a.lats{border-bottom-width:0} .main .pagination{float:none;padding:20px 0 25px;text-align:right;margin-right:10px;line-height:34px} .article-list>div{background-color:#323232;float:left;height:220px;margin:5px 10px 5px 0;overflow:hidden;position:relative;width:450px} -.article-list>div>img{min-width:100%;max-width:100%;transition:all 1.2s} +.article-list>div>img{max-width:100%;transition:all 1.2s;display:block;margin:0 auto} .article-list>div:hover>img{transform:scale(1.2)} .article-list>div:hover .article-image{top:0} .article-list>div:hover .fn-right{display:block} @@ -82,6 +82,7 @@ textarea{overflow:auto;vertical-align:top} .article-info>a:hover{background-color:#ea4040;color:#fff} .article-abstract>.article-tags{margin:10px 0 0 10px} .article-abstract>.article-body{height:115px;margin:10px 10px 0;overflow:hidden;white-space:inherit;word-wrap:break-word;padding:0} +.article-image .article-body{padding:10px;height:95px} .side{float:right;width:240px} #search{background-color:#fff;border:0 none;color:#3a3a3a;height:50px;margin-top:5px;padding:0 10px;width:177px;transition:all .3s ease-out 0} .side form>span{background-color:#fff;color:#3a3a3a;float:right;font-size:25px;height:32px;margin-top:5px;padding:9px} @@ -143,7 +144,7 @@ textarea{overflow:auto;vertical-align:top} .links-tile{margin-left:20px;background-color:#7b4f9d} .tags-tile span,.links-tile span,.archives-tile span,.most-comment span,.most-view span{font-size:60px} .tags-tile .text,.links-tile .text,.archives-tile .text,.most-comment .text,.most-view .text{position:static;width:253px} -.tags-tile a,.links-tile a,.archives-tile a{background-color:#ea4040;color:#d1d2d1;float:left;font-size:12px;line-height:20px;margin:6px 10px;padding:5px 10px;transition:all .8s ease 0;white-space:nowrap} +.tags-tile a,.links-tile a,.archives-tile a{background-color:#ea4040;color:#d1d2d1;float:left;font-size:12px;line-height:20px;margin:6px;padding:5px 10px;transition:all .8s ease 0;white-space:nowrap} .tags-tile a:hover,.links-tile a:hover,.archives-tile a:hover{background-color:#fff;color:#ea4040} .most-comment,.most-view{background-color:#f09609;width:535px;margin:100px 0} .most-comment .text,.most-view .text{margin-right:20px;line-height:24px;width:430px} diff --git a/metro-hot/dynamic.ftl b/metro-hot/dynamic.ftl index 66e7038..6624e0e 100644 --- a/metro-hot/dynamic.ftl +++ b/metro-hot/dynamic.ftl @@ -163,7 +163,7 @@ <#else> - ${archiveDate.archiveDateYear} ${yearLabel} ${archiveDate.archiveDateMonth} ${monthLabel}(${archiveDate.archiveDatePublishedArticleCount}) + ${archiveDate.archiveDateYear?substring(2,4)}${yearLabel}${archiveDate.archiveDateMonth}${monthLabel}(${archiveDate.archiveDatePublishedArticleCount}) diff --git a/metro-hot/js/metro-hot.js b/metro-hot/js/metro-hot.js index b289ab1..69001ff 100644 --- a/metro-hot/js/metro-hot.js +++ b/metro-hot/js/metro-hot.js @@ -17,7 +17,7 @@ * @fileoverview metro-hot js. * * @author Liyuan Li - * @version 1.0.0.8, Jul 24, 2013 + * @version 1.0.0.9, Jul 31, 2013 */ var MetroHot = { @@ -153,10 +153,17 @@ var MetroHot = { $it.addClass("article-image"); $images.hide(); - $it.before(""); + $it.before(""); } }); }, + /** + * @description 计算图片 margin-top + * @param {BOM} it 图片元素 + */ + loadImg: function(it) { + it.style.marginTop = ("margin-top", (220 - it.height) / 2 + "px"); + }, /** * @description 分享按钮 */ diff --git a/metro-hot/js/metro-hot.min.js b/metro-hot/js/metro-hot.min.js index 2c26915..b7246f6 100644 --- a/metro-hot/js/metro-hot.min.js +++ b/metro-hot/js/metro-hot.min.js @@ -1 +1 @@ -var MetroHot={headerH:$("#header").height()+30+($("#header > div").get(1)?30:0),responsiveType:"large",goTranslate:function(){window.open("http://translate.google.com/translate?sl=auto&tl=auto&u="+location.href)},init:function(){var logoutHref="";$("#admin a").each(function(){if($(this).attr("href").indexOf("/logout?goto=")>-1){logoutHref=$(this).attr("href")}});$("#logout, .logout").attr("href",logoutHref);$(".header .title").click(function(){$(".navigation").slideToggle()}).dblclick(function(){window.location.href=latkeConfig.servePath});var onlineVisitorCnt=$("#top > span").first().text();$(".online-count .text").append(onlineVisitorCnt.substr(1,onlineVisitorCnt.length));var isLogin=$("#admin").data("login");if(isLogin){$(".user .text").html($("#admin > span").text());$(".login, .register, #login, #register, .logout, .settings").hide()}else{$(".login, .register, .user, .clear, .logout, .settings, #logout, #settings").hide()}if($("#dynamic").length===1){$(window).scroll(function(){var y=$(window).scrollTop();if(y>MetroHot.headerH){$("#goTop").fadeIn("slow")}else{$("#goTop").hide()}}).click(function(event){if(event.target.className==="title"||event.target.parentElement.className==="title"){return}$(".navigation").slideUp()});$("body").css("min-height","inherit");return}$("#login, .login").attr("href",$("#admin > a").first().attr("href"));$(window).scroll(function(){var y=$(window).scrollTop();if(y>MetroHot.headerH){if(isLogin){$(".logout, .settings").show()}else{$(".login, .register").show()}}else{if(isLogin){$(".logout, .settings").hide()}else{$(".login, .register").hide()}}if(y>MetroHot.headerH){$("#goTop").fadeIn("slow")}else{$("#goTop").hide()}if($(".side > div").height()<620){if(y>MetroHot.headerH){$(".side > div").css({position:"fixed",top:"0px",width:"240px"})}else{$(".side > div").css("position","static")}}else{if(y+Util.getWinHeight()>$(".side > div").height()+MetroHot.headerH){$(".side > div").css({position:"fixed",top:"auto",bottom:"10px",width:"240px"})}else{$(".side > div").css("position","static")}}}).click(function(event){if(event.target.className==="title"||event.target.parentElement.className==="title"){return}$(".navigation").slideUp()}).resize(function(){var windowW=window.innerWidth,type="large";if(windowW>460&&windowW<=860){type="mid"}else if(window<460){type="small"}if(MetroHot.responsiveType!==type){$(window).scroll();MetroHot.responsiveType===type}});$(window).scroll()},initArticleList:function(){$(".article-list .article-abstract").each(function(){var $it=$(this);var $images=$it.find("img");if($images.length>0){$it.addClass("article-image");$images.hide();$it.before("")}})},share:function(){var title=encodeURIComponent($("title").text()),url=window.location.href,pic=$(".article-body img").attr("src");var urls={};urls.tencent="http://share.v.t.qq.com/index.php?c=share&a=index&title="+title+"&url="+url+"&pic="+pic;urls.sina="http://v.t.sina.com.cn/share/share.php?title="+title+"&url="+url+"&pic="+pic;urls.google="https://plus.google.com/share?url="+url;urls.twitter="https://twitter.com/intent/tweet?status="+title+" "+url;$(".share span").click(function(){var key=$(this).attr("title").toLowerCase();window.open(urls[key],"_blank","top=100,left=200,width=648,height=618")})},loadRandomArticles:function(){$.ajax({url:latkeConfig.servePath+"/get-random-articles.do",type:"POST",success:function(result,textStatus){var randomArticles=result.randomArticles;if(!randomArticles||0===randomArticles.length){$("#randomArticles").remove();return}var listHtml="";for(var i=0;i"+title+"";listHtml+=randomArticleLiHtml}var randomArticleListHtml="";$("#randomArticles .text").append(randomArticleListHtml)}})},loadRelevantArticles:function(id){$.ajax({url:latkeConfig.servePath+"/article/id/"+id+"/relevant/articles",type:"GET",success:function(data,textStatus){var articles=data.relevantArticles;if(!articles||0===articles.length){$("#relevantArticles").remove();return}var listHtml="";for(var i=0;i"+title+"";listHtml+=articleLiHtml}var relevantArticleListHtml="";$("#relevantArticles .text").append(relevantArticleListHtml)},error:function(){$("#relevantArticles").remove()}})},loadExternalRelevantArticles:function(tags){var tips=this.tips;try{$.ajax({url:"http://rhythm.b3log.org:80/get-articles-by-tags.do?tags="+tags+"&blogHost="+tips.blogHost+"&paginationPageSize="+tips.externalRelevantArticlesDisplayCount,type:"GET",cache:true,dataType:"jsonp",error:function(){$("#externalRelevantArticles").remove()},success:function(data,textStatus){var articles=data.articles;if(!articles||0===articles.length){$("#externalRelevantArticles").remove();return}var listHtml="";for(var i=0;i"+title+"";listHtml+=articleLiHtml}var randomArticleListHtml="
    "+listHtml+"
";$("#externalRelevantArticles .text").append(randomArticleListHtml)}})}catch(e){$("#externalRelevantArticles").remove()}},goCmt:function(){$("html, body").animate({scrollTop:$(".comment-disabled").get(0).offsetTop})}};!function(){MetroHot.init();if($(".article-header").length>0){MetroHot.share()}else{MetroHot.initArticleList()}}(); \ No newline at end of file +var MetroHot={headerH:$("#header").height()+30+($("#header > div").get(1)?30:0),responsiveType:"large",goTranslate:function(){window.open("http://translate.google.com/translate?sl=auto&tl=auto&u="+location.href)},init:function(){var logoutHref="";$("#admin a").each(function(){if($(this).attr("href").indexOf("/logout?goto=")>-1){logoutHref=$(this).attr("href")}});$("#logout, .logout").attr("href",logoutHref);$(".header .title").click(function(){$(".navigation").slideToggle()}).dblclick(function(){window.location.href=latkeConfig.servePath});var onlineVisitorCnt=$("#top > span").first().text();$(".online-count .text").append(onlineVisitorCnt.substr(1,onlineVisitorCnt.length));var isLogin=$("#admin").data("login");if(isLogin){$(".user .text").html($("#admin > span").text());$(".login, .register, #login, #register, .logout, .settings").hide()}else{$(".login, .register, .user, .clear, .logout, .settings, #logout, #settings").hide()}if($("#dynamic").length===1){$(window).scroll(function(){var y=$(window).scrollTop();if(y>MetroHot.headerH){$("#goTop").fadeIn("slow")}else{$("#goTop").hide()}}).click(function(event){if(event.target.className==="title"||event.target.parentElement.className==="title"){return}$(".navigation").slideUp()});$("body").css("min-height","inherit");return}$("#login, .login").attr("href",$("#admin > a").first().attr("href"));$(window).scroll(function(){var y=$(window).scrollTop();if(y>MetroHot.headerH){if(isLogin){$(".logout, .settings").show()}else{$(".login, .register").show()}}else{if(isLogin){$(".logout, .settings").hide()}else{$(".login, .register").hide()}}if(y>MetroHot.headerH){$("#goTop").fadeIn("slow")}else{$("#goTop").hide()}if($(".side > div").height()<620){if(y>MetroHot.headerH){$(".side > div").css({position:"fixed",top:"0px",width:"240px"})}else{$(".side > div").css("position","static")}}else{if(y+Util.getWinHeight()>$(".side > div").height()+MetroHot.headerH){$(".side > div").css({position:"fixed",top:"auto",bottom:"10px",width:"240px"})}else{$(".side > div").css("position","static")}}}).click(function(event){if(event.target.className==="title"||event.target.parentElement.className==="title"){return}$(".navigation").slideUp()}).resize(function(){var windowW=window.innerWidth,type="large";if(windowW>460&&windowW<=860){type="mid"}else if(window<460){type="small"}if(MetroHot.responsiveType!==type){$(window).scroll();MetroHot.responsiveType===type}});$(window).scroll()},initArticleList:function(){$(".article-list .article-abstract").each(function(){var $it=$(this);var $images=$it.find("img");if($images.length>0){$it.addClass("article-image");$images.hide();$it.before("")}})},loadImg:function(it){it.style.marginTop=("margin-top",(220-it.height)/2+"px")},share:function(){var title=encodeURIComponent($("title").text()),url=window.location.href,pic=$(".article-body img").attr("src");var urls={};urls.tencent="http://share.v.t.qq.com/index.php?c=share&a=index&title="+title+"&url="+url+"&pic="+pic;urls.sina="http://v.t.sina.com.cn/share/share.php?title="+title+"&url="+url+"&pic="+pic;urls.google="https://plus.google.com/share?url="+url;urls.twitter="https://twitter.com/intent/tweet?status="+title+" "+url;$(".share span").click(function(){var key=$(this).attr("title").toLowerCase();window.open(urls[key],"_blank","top=100,left=200,width=648,height=618")})},loadRandomArticles:function(){$.ajax({url:latkeConfig.servePath+"/get-random-articles.do",type:"POST",success:function(result,textStatus){var randomArticles=result.randomArticles;if(!randomArticles||0===randomArticles.length){$("#randomArticles").remove();return}var listHtml="";for(var i=0;i"+title+"";listHtml+=randomArticleLiHtml}var randomArticleListHtml="
    "+listHtml+"
";$("#randomArticles .text").append(randomArticleListHtml)}})},loadRelevantArticles:function(id){$.ajax({url:latkeConfig.servePath+"/article/id/"+id+"/relevant/articles",type:"GET",success:function(data,textStatus){var articles=data.relevantArticles;if(!articles||0===articles.length){$("#relevantArticles").remove();return}var listHtml="";for(var i=0;i"+title+"";listHtml+=articleLiHtml}var relevantArticleListHtml="
    "+listHtml+"
";$("#relevantArticles .text").append(relevantArticleListHtml)},error:function(){$("#relevantArticles").remove()}})},loadExternalRelevantArticles:function(tags){var tips=this.tips;try{$.ajax({url:"http://rhythm.b3log.org:80/get-articles-by-tags.do?tags="+tags+"&blogHost="+tips.blogHost+"&paginationPageSize="+tips.externalRelevantArticlesDisplayCount,type:"GET",cache:true,dataType:"jsonp",error:function(){$("#externalRelevantArticles").remove()},success:function(data,textStatus){var articles=data.articles;if(!articles||0===articles.length){$("#externalRelevantArticles").remove();return}var listHtml="";for(var i=0;i"+title+"";listHtml+=articleLiHtml}var randomArticleListHtml="
    "+listHtml+"
";$("#externalRelevantArticles .text").append(randomArticleListHtml)}})}catch(e){$("#externalRelevantArticles").remove()}},goCmt:function(){$("html, body").animate({scrollTop:$(".comment-disabled").get(0).offsetTop})}};!function(){MetroHot.init();if($(".article-header").length>0){MetroHot.share()}else{MetroHot.initArticleList()}}(); \ No newline at end of file diff --git a/metro-hot/macro-head.ftl b/metro-hot/macro-head.ftl index ef0b748..944ecf3 100644 --- a/metro-hot/macro-head.ftl +++ b/metro-hot/macro-head.ftl @@ -10,7 +10,6 @@ - ${htmlHead} diff --git a/metro-hot/preview.png b/metro-hot/preview.png index 53cd318..c6f47e5 100644 Binary files a/metro-hot/preview.png and b/metro-hot/preview.png differ diff --git a/skin-preview/metro-hot.png b/skin-preview/metro-hot.png new file mode 100644 index 0000000..7aaf6c8 Binary files /dev/null and b/skin-preview/metro-hot.png differ