diff --git a/static/css/style.css b/static/css/style.css index 7c66a77..54bc180 100644 --- a/static/css/style.css +++ b/static/css/style.css @@ -329,3 +329,50 @@ pre, code, kbd, samp .panel { padding-bottom: 12px; } + +.popup{ + width: 900px; + margin: auto; + text-align: center +} +.popup img{ + width: 200px; + height: 200px; + cursor: pointer +} +.show{ + z-index: 999; + display: none; +} +.show .overlay{ + width: 100%; + height: 100%; + background: rgba(0,0,0,.66); + position: absolute; + top: 0; + left: 0; +} +.show .img-show{ + width: 600px; + height: 400px; + background: #FFF; + position: absolute; + top: 50%; + left: 50%; + transform: translate(-50%,-50%); + overflow: hidden +} +.img-show span{ + position: absolute; + top: 10px; + right: 10px; + z-index: 99; + cursor: pointer; +} +.img-show img{ + width: 100%; + height: 100%; + position: absolute; + top: 0; + left: 0; +} diff --git a/static/js/image-popup.js b/static/js/image-popup.js new file mode 100644 index 0000000..b8482d4 --- /dev/null +++ b/static/js/image-popup.js @@ -0,0 +1,14 @@ +$(function () { + "use strict"; + + $(".popup img").click(function () { + var $src = $(this).attr("src"); + $(".show").fadeIn(); + $(".img-show img").attr("src", $src); + }); + + $("span, .overlay").click(function () { + $(".show").fadeOut(); + }); + +}); diff --git a/templates/article.html b/templates/article.html index 6abc958..767d097 100644 --- a/templates/article.html +++ b/templates/article.html @@ -87,6 +87,13 @@ {{ article.content }} +
+
+
+ X + +
+
{% include 'includes/related-posts.html' %} {% include 'includes/series.html' %} diff --git a/templates/base.html b/templates/base.html index f62e3ec..58f956e 100644 --- a/templates/base.html +++ b/templates/base.html @@ -265,6 +265,7 @@ {% if BANNER %} {% endif %} + {% include 'includes/sidebar/github-js.html' %} {% include 'includes/disqus_script.html' %} {% include 'includes/ga.html' %}