alexlcdee 7 éve
szülő
commit
1d5f65a962

+ 10 - 0
src/files/css/main.css

@@ -10842,4 +10842,14 @@ body {
     margin-top: -15px;
     z-index: 3; }
 
+.go-top-link {
+  width: 33px;
+  height: 33px;
+  position: fixed;
+  bottom: 30px;
+  left: 30px;
+  display: none;
+  background: url("../img/go-top-icon.png");
+  cursor: pointer; }
+
 /*# sourceMappingURL=main.css.map */

A különbségek nem kerülnek megjelenítésre, a fájl túl nagy
+ 0 - 0
src/files/css/main.css.map


BIN
src/files/img/go-top-icon.png


+ 33 - 0
src/files/js/script.js

@@ -39,5 +39,38 @@ $(document).ready(function () {
         e.preventDefault();
         $("#searchForm").toggleClass('header-search--active')
     });
+
+    (function($){
+        var body = $('html, body');
+        var getScroll = function() {
+            return $('body').scrollTop() || $('html').scrollTop();
+        };
+        if(body.height() > window.outerHeight && body.width() > 1023) {
+            var button = $('<div class="go-top-link"></div>')
+                .css({
+                    'position': 'fixed',
+                    'bottom': '30px',
+                    'left': '30px'
+                }).click(function(){
+                    body.animate({'scrollTop': 0});
+                }).hide();
+            body.append(button);
+            var isShown = false;
+            var scrollToShow = 400;
+            if(getScroll() >= scrollToShow) {
+                button.fadeIn();
+                isShown = true;
+            }
+            $(window).on('scroll', function(){
+                if(getScroll() >= scrollToShow && !isShown) {
+                    button.stop().fadeIn();
+                    isShown = true;
+                } else if(getScroll() < scrollToShow && isShown) {
+                    button.stop().fadeOut();
+                    isShown = false;
+                }
+            });
+        }
+    })($)
 });
 	

+ 12 - 1
src/files/scss/main.scss

@@ -69,7 +69,7 @@ body {
         display: block;
         content: '';
         position: absolute;
-        background: rgba(50,4,4, 0.8);
+        background: rgba(50, 4, 4, 0.8);
         height: 50px;
         width: 80px;
         top: 50%;
@@ -97,4 +97,15 @@ body {
         margin-top: -15px;
         z-index: 3;
     }
+}
+
+.go-top-link {
+    width: 33px;
+    height: 33px;
+    position: fixed;
+    bottom: 30px;
+    left: 30px;
+    display: none;
+    background: url('../img/go-top-icon.png');
+    cursor: pointer;
 }

Nem az összes módosított fájl került megjelenítésre, mert túl sok fájl változott