Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/naro143/hugo-coder-portfolio.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornaro143 <y.ishimi@itdharman.com>2018-08-03 19:23:24 +0300
committernaro143 <y.ishimi@itdharman.com>2018-08-03 19:23:24 +0300
commit678d7fc148ffa2ab7a6667bb4b1f77a6673a00f0 (patch)
treee60628b50f9199b46b3927a161ea5aa51dd9cca4
parent179a677172172531f887ef1d427b450f744f77c4 (diff)
fix: divid footer fixed-bar
-rw-r--r--exampleSite/config.toml4
-rw-r--r--layouts/_default/baseof.html6
-rw-r--r--layouts/partials/footer.html16
-rw-r--r--static/css/app.css5
-rw-r--r--static/js/app.js4
5 files changed, 23 insertions, 12 deletions
diff --git a/exampleSite/config.toml b/exampleSite/config.toml
index ae9bd2a..d67bb2a 100644
--- a/exampleSite/config.toml
+++ b/exampleSite/config.toml
@@ -1,7 +1,7 @@
baseurl = "http://www.example.com"
title = "johndoe"
-theme = "coder"
+theme = "coder-portfolio"
languagecode = "en"
@@ -21,6 +21,8 @@ disqusShortname = "yourdiscussshortname"
info = "Full Stack DevOps and Magician"
avatarurl = "images/avatar.jpg"
footercontent = "Enter a text here."
+ fixedbarContent = "Do you want to know me more private?→"
+ fixedbarContentAfter = "Thank You! Please share it if you like it→"
hideCredits = false
hideCopyright = false
diff --git a/layouts/_default/baseof.html b/layouts/_default/baseof.html
index f3efb52..928f346 100644
--- a/layouts/_default/baseof.html
+++ b/layouts/_default/baseof.html
@@ -54,13 +54,13 @@
{{ template "_internal/google_analytics.html" . }}
<script src="{{ "js/app.js" | absURL }}"></script>
- {{ with .Site.Params.footerContentAfter }}
+ {{ with .Site.Params.fixedbarContentAfter }}
<script>
(function($) {
- return $(function() {
+ $(function() {
$('#privateTrigger').on('click', function() {
$('.private').slideToggle();
- return $('#privateTriggerText').text("{{ . }}");
+ $('#privateTriggerText').text("{{ . }}");
});
});
})(jQuery);
diff --git a/layouts/partials/footer.html b/layouts/partials/footer.html
index aee87a7..06d6c60 100644
--- a/layouts/partials/footer.html
+++ b/layouts/partials/footer.html
@@ -1,16 +1,24 @@
<footer class="footer">
<section class="container">
{{ with .Site.Params.footercontent }}
- <p id="privateTriggerText">{{.}}<a id="privateTrigger">Click!</a></p>
+ <p>{{.}}</p>
{{ end }}
{{ if not .Site.Params.hideCopyright }} © {{ .Site.LastChange.Format "2006" }} {{ end }} {{ if not .Site.Params.hideCredits}} {{ if not .Site.Params.hideCopyright }} · {{ end }} Powered by <a href="https://gohugo.io/">Hugo</a> & <a href="https://github.com/luizdepra/hugo-coder/">Coder</a>. {{ end }}
+
+ </section>
+</footer>
+<div class="fixed-bar">
+ <section class="container">
+ {{ with .Site.Params.fixedbarContent }}
+ <p id="privateTriggerText">{{.}}<a id="privateTrigger">Click!</a></p>
+ {{ end }}
{{ if .Site.Params.snsShare }}
- <div class="sns-shares">
+ <div class="sns-shares">
<a class="sns-share twitter-share" href="https://twitter.com/intent/tweet?original_referer={{ .Permalink }}&ref_src=twsrc%5Etfw&text={{ .Title }} {{ .Site.Title }}&tw_p=tweetbutton&url={{ .Permalink }}"><i class="fab fa-twitter"></i></a>
<a class="fb btn sns-share fb-share" href="http://www.facebook.com/share.php?u={{ .Permalink }}" onclick="window.open(this.href, 'FBwindow', 'width=650, height=450, menubar=no, toolbar=no, scrollbars=yes'); return false;"><i class="fab fa-facebook-f"></i></a>
<a class="sns-share hatena-share" href="http://b.hatena.ne.jp/entry/{{ .Permalink }}" data-hatena-bookmark-layout="touch" data-hatena-bookmark-width="40" data-hatena-bookmark-height="40" title="このエントリーをはてなブックマークに追加"><img src="images/hatena_icon.png"></a>
<a class="sns-share line-share" href="https://social-plugins.line.me/lineit/share?url={{ .Permalink }}"><img src="images/line.png"></a>
- </div>
+ </div>
{{ end }}
</section>
-</footer>
+</div>
diff --git a/static/css/app.css b/static/css/app.css
index 5cd8042..0478c98 100644
--- a/static/css/app.css
+++ b/static/css/app.css
@@ -46,15 +46,16 @@ a:hover:before, a:hover:after {
border-bottom: 1px solid rgba(0, 0, 0, 0.15);
}
-.footer {
+.fixed-bar {
position: fixed;
bottom: 0;
margin: 0;
height: 65px;
+ width: 100%;
border-top: 1px solid rgba(0, 0, 0, 0.05);
background: #fefefe;
}
-.footer .container {
+.fixed-bar .container {
display: flex;
justify-content: center;
align-items: center;
diff --git a/static/js/app.js b/static/js/app.js
index 5694ce1..946d966 100644
--- a/static/js/app.js
+++ b/static/js/app.js
@@ -10,10 +10,10 @@
winScrollTop = $(this).scrollTop();
scrollDistance = startPos - winScrollTop;
if (scrollDistance >= 20) {
- $('.footer').slideDown("slow");
+ $('.fixed-bar').slideDown("slow");
return startPos = winScrollTop;
} else if (scrollDistance <= -20) {
- $('.footer').slideUp("slow");
+ $('.fixed-bar').slideUp("slow");
return startPos = winScrollTop;
}
});