aboutsummaryrefslogtreecommitdiffstats
path: root/view/tpl/cover_photo_widget.tpl
diff options
context:
space:
mode:
authorzotlabs <mike@macgirvin.com>2017-05-02 12:46:50 -0700
committerzotlabs <mike@macgirvin.com>2017-05-02 12:46:50 -0700
commit80ec92ce8d9f615eeb06d92b67ad1ff840cad0cc (patch)
tree484f2101b78ae16f397310470b7e30f2c03d7b57 /view/tpl/cover_photo_widget.tpl
parent83c4dd6bda1677a3441d06247ea076094394703e (diff)
downloadvolse-hubzilla-80ec92ce8d9f615eeb06d92b67ad1ff840cad0cc.tar.gz
volse-hubzilla-80ec92ce8d9f615eeb06d92b67ad1ff840cad0cc.tar.bz2
volse-hubzilla-80ec92ce8d9f615eeb06d92b67ad1ff840cad0cc.zip
Revert "move theme specific files to theme dir"
This reverts commit e332d1074f1b663ec66d37b0f575df2e41d5535c.
Diffstat (limited to 'view/tpl/cover_photo_widget.tpl')
-rwxr-xr-xview/tpl/cover_photo_widget.tpl76
1 files changed, 76 insertions, 0 deletions
diff --git a/view/tpl/cover_photo_widget.tpl b/view/tpl/cover_photo_widget.tpl
new file mode 100755
index 000000000..a9c384d2f
--- /dev/null
+++ b/view/tpl/cover_photo_widget.tpl
@@ -0,0 +1,76 @@
+<script>
+ var aside_padding_top;
+ var section_padding_top;
+ var coverSlid = false;
+
+ $(document).ready(function() {
+
+ aside_padding_top = parseInt($('aside').css('padding-top'));
+ section_padding_top = parseInt($('section').css('padding-top'));
+
+ $(document).on('click', slideUpCover);
+
+ if($('#cover-photo').length && $(window).width() > 755) {
+ if($(window).scrollTop() < $('#cover-photo').height()) {
+ $('.navbar').removeClass('fixed-top');
+ $('main').css('margin-top', - $('nav').outerHeight(true) + 'px');
+ $('main').css('opacity', 0);
+ }
+ }
+ else {
+ $('#cover-photo').remove();
+ coverSlid = true;
+ }
+ });
+
+ $(window).scroll(function () {
+ if($('#cover-photo').length && $(window).width() > 755 && $(window).scrollTop() >= $('#cover-photo').height()) {
+ $('.navbar').addClass('fixed-top');
+ $('main').css('margin-top', '');
+ $('main').css('opacity', 1);
+ coverSlid = true;
+ }
+ else if ($('#cover-photo').length && $(window).width() > 755 && $(window).scrollTop() < $('#cover-photo').height()){
+ if(coverSlid) {
+ $(window).scrollTop(Math.ceil($('#cover-photo').height()));
+ setTimeout(function(){ coverSlid = false; }, 1000);
+ }
+ else {
+ if($(window).scrollTop() < $('#cover-photo').height()) {
+ $('.navbar').removeClass('fixed-top');
+ $('main').css('margin-top', - $('nav').outerHeight(true) + 'px');
+ $('main').css('opacity', 0);
+ }
+ }
+ }
+ if($('#cover-photo').length && $('main').css('opacity') < 1) {
+ $('main').css('opacity', ($(window).scrollTop()/$('#cover-photo').height()).toFixed(1));
+ }
+ });
+
+ $(window).resize(function () {
+ if($('#cover-photo').length && $(window).width() < 755) {
+ $('#cover-photo').remove();
+ $('.navbar').addClass('fixed-top');
+ $('main').css('opacity', 1);
+ coverSlid = true;
+ }
+
+ });
+
+ function slideUpCover() {
+ if(coverSlid) {
+ return;
+ }
+ $('html, body').animate({scrollTop: Math.ceil($('#cover-photo').height()) + 'px' });
+ return;
+ }
+</script>
+
+<div id="cover-photo" title="{{$hovertitle}}">
+ {{$photo_html}}
+ <div id="cover-photo-caption">
+ <h1>{{$title}}</h1>
+ <h3>{{$subtitle}}</h3>
+ </div>
+</div>