futuro 0.7.1 → 0.7.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/_sass/_button.scss +4 -0
- data/assets/js/footer/custom/Settings.js +2 -0
- data/assets/js/footer/custom/SwitchButton.js +49 -36
- data/assets/js/futuro.footer.custom.js +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fc3eeed4ba8c4ad6bb1faa0fc7c7559981b8ef132184caf708a8cd09759acda1
|
4
|
+
data.tar.gz: 513a00228505aeeed9b4821da6f3233f6ea3e02475488cbcd98f9fb5b80723ec
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 540439f9f26b9c9e1bb772c631b656e22f6f481f372ce83e3757833509ac38f42d99f8fb2b738722f78fca134d13d2c790deb65f26c7b2e60f2e894727a68e76
|
7
|
+
data.tar.gz: f3956ac9992cc5e9a2dff45deeda13c069bdc22c8a02b3c4849b2c404cdac0a462eb9213a4ff4c6d0d350792c98fee8592bfa9abd724b8f17e7ca35b2d5853bc
|
data/_sass/_button.scss
CHANGED
@@ -1,10 +1,9 @@
|
|
1
1
|
|
2
|
-
let
|
3
|
-
target : ".button-wrap.switch-button"
|
4
|
-
lock : false
|
2
|
+
let Button = {
|
3
|
+
target : ".button-wrap.switch-button"
|
5
4
|
};
|
6
5
|
|
7
|
-
const
|
6
|
+
const ButtonSwitch = (e,type) => {
|
8
7
|
let text = $(e.target),
|
9
8
|
bg = text.siblings(".button-bg"),
|
10
9
|
btn = text.parent(),
|
@@ -21,64 +20,78 @@ const ButtonConfirm = (e,type) => {
|
|
21
20
|
}
|
22
21
|
};
|
23
22
|
|
24
|
-
|
23
|
+
let before = [Text.dis.before,Text.dat.before],
|
24
|
+
after = [Text.dis.after,Text.dat.after];
|
25
25
|
|
26
|
-
|
26
|
+
if (btn.hasClass("undo")) {
|
27
|
+
|
28
|
+
if (type === "down") {
|
29
|
+
|
30
|
+
gsap.set([btn,bg],{
|
31
|
+
clearProps : "all"
|
32
|
+
});
|
33
|
+
|
34
|
+
} else if (type === "up") {
|
35
|
+
|
36
|
+
$(btn).removeClass("undo");
|
37
|
+
|
38
|
+
gsap.set([before,after],{
|
39
|
+
clearProps : "all"
|
40
|
+
});
|
41
|
+
|
42
|
+
gsap.set(text,{
|
43
|
+
text : "Switch"
|
44
|
+
});
|
45
|
+
}
|
46
|
+
|
47
|
+
|
48
|
+
} else {
|
49
|
+
|
50
|
+
if (type === "down") {
|
27
51
|
gsap.set([btn,bg],{
|
28
52
|
scale : 0.95
|
29
53
|
});
|
30
54
|
}
|
31
55
|
|
32
|
-
else if (type
|
33
|
-
|
34
|
-
let tl
|
35
|
-
swap = gsap.timeline();
|
36
|
-
|
37
|
-
swap
|
38
|
-
.to([Text.dis.before,Text.dat.before],{
|
39
|
-
duration : 0.2,
|
40
|
-
opacity : 0
|
41
|
-
})
|
42
|
-
.set([Text.dis.before,Text.dat.before],{
|
43
|
-
display : "none",
|
44
|
-
delay : 0.2
|
45
|
-
})
|
46
|
-
.set([Text.dis.after,Text.dat.after],{
|
47
|
-
display : "block"
|
48
|
-
});
|
56
|
+
else if (type === "up") {
|
57
|
+
|
58
|
+
let tl = gsap.timeline();
|
49
59
|
|
50
60
|
tl
|
51
|
-
.
|
52
|
-
|
53
|
-
|
54
|
-
.set(all,{
|
55
|
-
clearProps : "all"
|
61
|
+
.to(before,{
|
62
|
+
duration : 0.2,
|
63
|
+
opacity : 0
|
56
64
|
})
|
57
65
|
.set([btn,bg],{
|
58
66
|
backgroundColor : Color.green
|
59
67
|
})
|
68
|
+
.set(text,{
|
69
|
+
text : "Undo"
|
70
|
+
})
|
71
|
+
.set(before,{
|
72
|
+
display : "none",
|
73
|
+
})
|
74
|
+
.set(after,{
|
75
|
+
display : "block"
|
76
|
+
})
|
60
77
|
.to(bg,{
|
61
78
|
duration : 0.5,
|
62
79
|
scaleX : 1.2,
|
63
80
|
scaleY : 1.3,
|
64
81
|
opacity : 0
|
65
82
|
})
|
66
|
-
.set(all,{
|
67
|
-
clearProps : "all",
|
68
|
-
delay : 1
|
69
|
-
})
|
70
83
|
.call(()=>{
|
71
|
-
|
84
|
+
$(btn).addClass("undo");
|
72
85
|
})
|
73
86
|
;
|
74
87
|
}
|
75
88
|
}
|
76
89
|
}
|
77
90
|
|
78
|
-
$(
|
91
|
+
$(Button.target)
|
79
92
|
.mousedown(function(e) {
|
80
|
-
|
93
|
+
ButtonSwitch(e,'down');
|
81
94
|
})
|
82
95
|
.mouseup(function(e) {
|
83
|
-
|
96
|
+
ButtonSwitch(e,'up');
|
84
97
|
});
|
@@ -1 +1 @@
|
|
1
|
-
"use strict";var BrowseScreen,body="body",site=".site",shade="rgba(0,0,0,0.05)",controller=new ScrollMagic.Controller;"theme"!=Config.install&&((BrowseScreen=Overlay.custom[1]).data=$(BrowseScreen.chapter.col).children(BrowseScreen.chunk).children().length);var PrintWidth=function(){var e=$(document)[0].documentElement.clientWidth,o=Site.desktop.width-e+"px",t=100/Site.desktop.width*e+"%";$(".width").html(o),gsap.set(Overlay.mobile.bar,{width:t})},CheckWidth=function(){Site.desktop.active?(gsap.set(Overlay.mobile.screen,{clearProps:"display"}),gsap.set(site,{display:Config.display})):(gsap.set(site,{clearProps:"display"}),gsap.set(Overlay.mobile.screen,{display:Config.display}),PrintWidth())};Config.respond||($(CheckWidth),$(window).resize(CheckWidth));var ActiveBook=function(){if(!$(body).hasClass("type-home")){var e=$(body)[0].classList,t="";$(e).each(function(e,o){o.startsWith("book-")&&(t=o.slice(5),gsap.set(Site.topbar.lnk+"."+t,{borderBottom:"3px solid"}))})}};$(function(){"theme"!=Config.install&&$(ActiveBook)});var ExpandBlock=function(e){var o=$(e.target),t=o.parent().siblings(Site.page.artwork).children(Site.code.wrap);"none"==t.css("display")?(gsap.set(t,{display:Config.display}),gsap.set(o,{text:"Hide"})):(gsap.set(t,{clearProps:"display"}),gsap.set(o,{text:"Show"}))};"docs"==Config.style&&$(Site.code.expand).click(function(e){ExpandBlock(e)});var ChangeScreen=function(e,o,t){"close"==t?(gsap.set(body,{clearProps:"overflow"}),gsap.set(".overlay."+Overlay.custom[e].name,{clearProps:"display"}),Overlay.custom[e].open=!1):(gsap.set(body,{overflow:"hidden"}),gsap.set(".overlay."+Overlay.custom[e].name,{display:Config.display}),Overlay.custom[e].open=!0)},BuildScreens=function(e,o){var t=Overlay.button+"."+o.name,n=Overlay.exit+"."+o.name;$(t).click(function(){ChangeScreen(e,o,"open")}),$(n).click(function(){ChangeScreen(e,o,"close")})},KeyUp=function(t){27==t.keyCode&&$(Overlay.custom).each(function(e,o){Overlay.custom[e].open&&ChangeScreen(e,o,"close")}),65==t.keyCode&&$(Overlay.custom).each(function(e,o){Overlay.custom[0].open||(ChangeScreen(0,o,"open"),console.log(t.keyCode))}),66==t.keyCode&&$(Overlay.custom).each(function(e,o){Overlay.custom[1].open||ChangeScreen(1,o,"open")}),83==t.keyCode&&$(Overlay.custom).each(function(e,o){Overlay.custom[2].open||ChangeScreen(2,o,"open")})};$(function(){$(Overlay.custom).each(function(e,o){BuildScreens(e,o)})}),$(document).keyup(function(e){Site.focus||KeyUp(e)});var ScrollerUpdate=function(){var e=$(Site.scroll.lnk);1<e.length&&e.each(function(){var e=$(this)[0].classList[2],o=gsap.to(Site.scroll.lnk+"."+e,{duration:.1,opacity:1});new ScrollMagic.Scene({triggerElement:"#"+e}).setTween(o).addTo(controller)})},ScrollFunc=function(){var n="<div class='block scroller'><div class='wrap scroller'>";$(Site.chapter.target).each(function(e,o){var t=$(o)[0].children[0].id;0==e?n+='<a class="lnk scroller '.concat(t,'" href="#').concat(t,'" style=""><svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0" y="0" width="26" height="26" viewBox="0 0 26 26" xml:space="preserve" enable-background="new 0 0 26 26"><path d="M13,5l9,14H4L13,5z"/></svg></a>'):e==$(Site.chapter.target).length-1?n+='<a class="lnk scroller '.concat(t,'" href="#').concat(t,'"><svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0" y="0" width="26" height="26" viewBox="0 0 26 26" xml:space="preserve" enable-background="new 0 0 26 26"><path d="M13,21L4,7h18L13,21z"/></svg></a>'):n+='<a class="lnk scroller '.concat(t,'" href="#').concat(t,'"><svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0" y="0" width="26" height="26" viewBox="0 0 26 26" xml:space="preserve" enable-background="new 0 0 26 26"><circle cx="13" cy="13" r="9"/></svg></a>')}),n+="</div></div>",$(site).append(n),ScrollerUpdate(),SmoothScroll()};$(function(){"theme"!=Config.install&&1<$(Site.chapter.target).length&&ScrollFunc()});var SetupHome=function(){$(body).hasClass("type-home")&&(gsap.timeline({repeat:-1,yoyo:!0,defaults:{ease:"sine.inOut"}}).fromTo(".area.book",{y:-5},{duration:1,y:5}),$(".wrap.home").slick(Config.slick),$(".wrap.book").hover(function(){gsap.to(this,{duration:.1,y:-20})},function(){gsap.to(this,{duration:.1,y:0})}))};"library"==Config.install&&$(SetupHome);var isLibraryHome="library"==Config.install&&$(body).hasClass("type-home"),SiteFunc=function(){Config.respond?isLibraryHome?gsap.set(site,{display:"block"}):gsap.set(site,{display:Config.display}):Site.mobile.active||(isLibraryHome?gsap.set(site,{display:"block"}):gsap.set(site,{display:Config.display})),setTimeout(function(){gsap.set(Overlay.load.screen,{clearProps:"display"}),SiteTl.pause()},1e3)};$(SiteFunc),$(window).resize(SiteFunc);var SmoothScroll=function(){$('a[href*="#"]').not('[href="#"]').not('[href="#0"]').click(function(e){if(location.pathname.replace(/^\//,"")==this.pathname.replace(/^\//,"")&&location.hostname==this.hostname){var o=$(this.hash);(o=o.length?o:$("[name="+this.hash.slice(1)+"]")).length&&(e.preventDefault(),$("html, body").animate({scrollTop:o.offset().top},500,function(){var e=$(o);if(e.focus(),e.is(":focus"))return!1;e.attr("tabindex","-1"),e.focus()}))}})};$(SmoothScroll);var SplitCode=function(){$(Site.code.page).each(function(e,o){$(Site.code.scss,this);var t=$(Site.code.html,this),n=t.html();t.text(n)})};"docs"==Config.style&&$(SplitCode);var StartBrowse=function(){var e=$(".block.browse-lnk",BrowseScreen.book.col)[0],o=$(".block.browse-chunk",BrowseScreen.chapter.col)[0],t=$(".block.browse-chunk",BrowseScreen.page.col)[0],n=$(t)[0].children[0],r=$(e)[0].children[0],
|
1
|
+
"use strict";var BrowseScreen,body="body",site=".site",shade="rgba(0,0,0,0.05)",controller=new ScrollMagic.Controller;"theme"!=Config.install&&((BrowseScreen=Overlay.custom[1]).data=$(BrowseScreen.chapter.col).children(BrowseScreen.chunk).children().length),console.log("ready?");var PrintWidth=function(){var e=$(document)[0].documentElement.clientWidth,o=Site.desktop.width-e+"px",t=100/Site.desktop.width*e+"%";$(".width").html(o),gsap.set(Overlay.mobile.bar,{width:t})},CheckWidth=function(){Site.desktop.active?(gsap.set(Overlay.mobile.screen,{clearProps:"display"}),gsap.set(site,{display:Config.display})):(gsap.set(site,{clearProps:"display"}),gsap.set(Overlay.mobile.screen,{display:Config.display}),PrintWidth())};Config.respond||($(CheckWidth),$(window).resize(CheckWidth));var ActiveBook=function(){if(!$(body).hasClass("type-home")){var e=$(body)[0].classList,t="";$(e).each(function(e,o){o.startsWith("book-")&&(t=o.slice(5),gsap.set(Site.topbar.lnk+"."+t,{borderBottom:"3px solid"}))})}};$(function(){"theme"!=Config.install&&$(ActiveBook)});var ExpandBlock=function(e){var o=$(e.target),t=o.parent().siblings(Site.page.artwork).children(Site.code.wrap);"none"==t.css("display")?(gsap.set(t,{display:Config.display}),gsap.set(o,{text:"Hide"})):(gsap.set(t,{clearProps:"display"}),gsap.set(o,{text:"Show"}))};"docs"==Config.style&&$(Site.code.expand).click(function(e){ExpandBlock(e)});var ChangeScreen=function(e,o,t){"close"==t?(gsap.set(body,{clearProps:"overflow"}),gsap.set(".overlay."+Overlay.custom[e].name,{clearProps:"display"}),Overlay.custom[e].open=!1):(gsap.set(body,{overflow:"hidden"}),gsap.set(".overlay."+Overlay.custom[e].name,{display:Config.display}),Overlay.custom[e].open=!0)},BuildScreens=function(e,o){var t=Overlay.button+"."+o.name,n=Overlay.exit+"."+o.name;$(t).click(function(){ChangeScreen(e,o,"open")}),$(n).click(function(){ChangeScreen(e,o,"close")})},KeyUp=function(t){27==t.keyCode&&$(Overlay.custom).each(function(e,o){Overlay.custom[e].open&&ChangeScreen(e,o,"close")}),65==t.keyCode&&$(Overlay.custom).each(function(e,o){Overlay.custom[0].open||(ChangeScreen(0,o,"open"),console.log(t.keyCode))}),66==t.keyCode&&$(Overlay.custom).each(function(e,o){Overlay.custom[1].open||ChangeScreen(1,o,"open")}),83==t.keyCode&&$(Overlay.custom).each(function(e,o){Overlay.custom[2].open||ChangeScreen(2,o,"open")})};$(function(){$(Overlay.custom).each(function(e,o){BuildScreens(e,o)})}),$(document).keyup(function(e){Site.focus||KeyUp(e)});var ScrollerUpdate=function(){var e=$(Site.scroll.lnk);1<e.length&&e.each(function(){var e=$(this)[0].classList[2],o=gsap.to(Site.scroll.lnk+"."+e,{duration:.1,opacity:1});new ScrollMagic.Scene({triggerElement:"#"+e}).setTween(o).addTo(controller)})},ScrollFunc=function(){var n="<div class='block scroller'><div class='wrap scroller'>";$(Site.chapter.target).each(function(e,o){var t=$(o)[0].children[0].id;0==e?n+='<a class="lnk scroller '.concat(t,'" href="#').concat(t,'" style=""><svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0" y="0" width="26" height="26" viewBox="0 0 26 26" xml:space="preserve" enable-background="new 0 0 26 26"><path d="M13,5l9,14H4L13,5z"/></svg></a>'):e==$(Site.chapter.target).length-1?n+='<a class="lnk scroller '.concat(t,'" href="#').concat(t,'"><svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0" y="0" width="26" height="26" viewBox="0 0 26 26" xml:space="preserve" enable-background="new 0 0 26 26"><path d="M13,21L4,7h18L13,21z"/></svg></a>'):n+='<a class="lnk scroller '.concat(t,'" href="#').concat(t,'"><svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0" y="0" width="26" height="26" viewBox="0 0 26 26" xml:space="preserve" enable-background="new 0 0 26 26"><circle cx="13" cy="13" r="9"/></svg></a>')}),n+="</div></div>",$(site).append(n),ScrollerUpdate(),SmoothScroll()};$(function(){"theme"!=Config.install&&1<$(Site.chapter.target).length&&ScrollFunc()});var SetupHome=function(){$(body).hasClass("type-home")&&(gsap.timeline({repeat:-1,yoyo:!0,defaults:{ease:"sine.inOut"}}).fromTo(".area.book",{y:-5},{duration:1,y:5}),$(".wrap.home").slick(Config.slick),$(".wrap.book").hover(function(){gsap.to(this,{duration:.1,y:-20})},function(){gsap.to(this,{duration:.1,y:0})}))};"library"==Config.install&&$(SetupHome);var isLibraryHome="library"==Config.install&&$(body).hasClass("type-home"),SiteFunc=function(){Config.respond?isLibraryHome?gsap.set(site,{display:"block"}):gsap.set(site,{display:Config.display}):Site.mobile.active||(isLibraryHome?gsap.set(site,{display:"block"}):gsap.set(site,{display:Config.display})),setTimeout(function(){gsap.set(Overlay.load.screen,{clearProps:"display"}),SiteTl.pause()},1e3)};$(SiteFunc),$(window).resize(SiteFunc);var SmoothScroll=function(){$('a[href*="#"]').not('[href="#"]').not('[href="#0"]').click(function(e){if(location.pathname.replace(/^\//,"")==this.pathname.replace(/^\//,"")&&location.hostname==this.hostname){var o=$(this.hash);(o=o.length?o:$("[name="+this.hash.slice(1)+"]")).length&&(e.preventDefault(),$("html, body").animate({scrollTop:o.offset().top},500,function(){var e=$(o);if(e.focus(),e.is(":focus"))return!1;e.attr("tabindex","-1"),e.focus()}))}})};$(SmoothScroll);var SplitCode=function(){$(Site.code.page).each(function(e,o){$(Site.code.scss,this);var t=$(Site.code.html,this),n=t.html();t.text(n)})};"docs"==Config.style&&$(SplitCode);var StartBrowse=function(){var e=$(".block.browse-lnk",BrowseScreen.book.col)[0],o=$(".block.browse-chunk",BrowseScreen.chapter.col)[0],t=$(".block.browse-chunk",BrowseScreen.page.col)[0],n=$(t)[0].children[0],r=$(e)[0].children[0],s=$(o)[0].children[0].children[0],a=$(n)[0].children[0].children[0];gsap.timeline().set(BrowseScreen.chunk,{display:"none"}).set([o,t,n],{display:"block"}).set([r,s,a],{backgroundColor:shade})},HoverBook=function(e){var o=$(e.target)[0].classList[2].slice(5),t=$(BrowseScreen.chunk+"."+o,BrowseScreen.chapter.col),n=$(BrowseScreen.chunk+"."+o,BrowseScreen.page.col),r=$(n)[0].children[0],s=$(t)[0].children[0].children[0],a=$(r)[0].children[0].children[0];gsap.timeline().set(BrowseScreen.chunk,{display:"none"}).set([t,n,r],{display:"block"}).set([BrowseScreen.book.lnk,BrowseScreen.chapter.lnk,BrowseScreen.page.lnk],{clearProps:"backgroundColor"}).set([$(e.target),s,a],{backgroundColor:shade})},HoverChap=function(e){var o=$(e.target)[0].classList[2].slice(5),t=$(e.target)[0].classList[3].slice(8),n=$(BrowseScreen.chunk+"."+o,BrowseScreen.chapter.col),r=$(BrowseScreen.chunk+"."+o,BrowseScreen.page.col),s=$(BrowseScreen.chunk+"."+t,r),a=$(s)[0].children[0].children[0];gsap.timeline().set(BrowseScreen.chunk,{display:"none"}).set([n,r,s],{display:"block"}).set([BrowseScreen.chapter.lnk,BrowseScreen.page.lnk],{clearProps:"backgroundColor"}).set([$(e.target),a],{backgroundColor:shade})},HoverPage=function(e){gsap.timeline().set(BrowseScreen.page.lnk,{clearProps:"backgroundColor"}).set($(e.target),{backgroundColor:shade})};"theme"!=Config.install&&$(function(){$(body).hasClass("type-home")||0<BrowseScreen.data&&(StartBrowse(),$(BrowseScreen.book.lnk).hover(function(e){HoverBook(e)}),$(BrowseScreen.chapter.lnk).hover(function(e){HoverChap(e)}),$(BrowseScreen.page.lnk).hover(function(e){HoverPage(e)}))});var Button={target:".button-wrap.switch-button"},ButtonSwitch=function(e,o){var t=$(e.target),n=t.siblings(".button-bg"),r=t.parent(),s={dis:{before:$(r).siblings(".before"),after:$(r).siblings(".after")},dat:{before:$(r).parent().siblings().children(".before"),after:$(r).parent().siblings().children(".after")}},a=[s.dis.before,s.dat.before],c=[s.dis.after,s.dat.after];if(r.hasClass("undo"))"down"===o?gsap.set([r,n],{clearProps:"all"}):"up"===o&&($(r).removeClass("undo"),gsap.set([a,c],{clearProps:"all"}),gsap.set(t,{text:"Switch"}));else if("down"===o)gsap.set([r,n],{scale:.95});else if("up"===o){gsap.timeline().to(a,{duration:.2,opacity:0}).set([r,n],{backgroundColor:Color.green}).set(t,{text:"Undo"}).set(a,{display:"none"}).set(c,{display:"block"}).to(n,{duration:.5,scaleX:1.2,scaleY:1.3,opacity:0}).call(function(){$(r).addClass("undo")})}};$(Button.target).mousedown(function(e){ButtonSwitch(e,"down")}).mouseup(function(e){ButtonSwitch(e,"up")});var SwitchFocus=function(){$("input,textarea").focusin(function(){Site.focus=!0}),$("input,textarea").focusout(function(){Site.focus=!1})};$(SwitchFocus);var UtilCopy=function(e){var o=document.createElement("textarea");o.value=e,document.body.appendChild(o),o.select(),document.execCommand("copy"),document.body.removeChild(o)},UtilShare=function(e){var o=$(e.target).parents(Site.page.share),t=$(o)[0].classList[2],n=$(o).children(Site.page.url).text().replace("index",""),r=$(o)[0].children[1],s=gsap.timeline(),a="";"page"==t&&(a="Copy page"),UtilCopy(n),s.set(r,{text:"Copied!"}).to(r,{duration:.3,opacity:0},"+=0.6").set(r,{text:a,clearProps:"all"},"+=0.3")};"theme"!=Config.install&&Config.share&&$(function(){$(Site.page.share).click(UtilShare)});
|