futuro 1.1.1 → 1.1.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -23,78 +23,3 @@ Util.share = function(ting) {
23
23
 
24
24
  Util.copy(getUrl);
25
25
  }
26
-
27
- // const UtilCopy = str => {
28
- // const el = document.createElement('textarea');
29
- // el.value = str;
30
- // document.body.appendChild(el);
31
- // el.select();
32
- // document.execCommand('copy');
33
- // document.body.removeChild(el);
34
- // }
35
-
36
- // // const UtilShare = e => {
37
- // // let ting = $(e.target).parents(Site.page.share),
38
- // // type = $(ting)[0].classList[2],
39
- // // url = $(ting).children(Site.page.url).text().replace('index',''),
40
- // // title = $(ting)[0].children[1],
41
- // // tl = gsap.timeline(),
42
- // // reset = '';
43
-
44
- // // console.log(e);
45
-
46
-
47
- // // if (type == 'page') {
48
- // // reset = 'Copy page';
49
- // // }
50
-
51
- // // UtilCopy(url);
52
-
53
- // // tl
54
- // // .set(title,{
55
- // // text : 'Copied!'
56
- // // })
57
- // // .to(title,{
58
- // // duration : 0.3,
59
- // // opacity : 0
60
- // // },'+=0.6')
61
- // // .set(title,{
62
- // // text : reset,
63
- // // clearProps : 'all'
64
- // // },'+=0.3');
65
- // // }
66
-
67
- // function UtilShare() {
68
- // let target = $(this).parents(Site.page.share),
69
- // getUrl = $(target.context).find(Site.page.url).text(),
70
- // tl = gsap.timeline(),
71
- // type = "";
72
- // getUrl = getUrl.replace("index","");
73
-
74
- // console.log("Util runs!");
75
-
76
-
77
- // $(target.context.classList).map((index,value)=>{
78
- // if (value.includes("type-")) {
79
- // type = value;
80
- // }
81
- // });
82
-
83
- // UtilCopy(getUrl);
84
-
85
- // // tl
86
- // // .set(title,{
87
- // // text : 'Copied!'
88
- // // })
89
- // // .to(title,{
90
- // // duration : 0.3,
91
- // // opacity : 0
92
- // // },'+=0.6')
93
- // // .set(title,{
94
- // // text : reset,
95
- // // clearProps : 'all'
96
- // // },'+=0.3');
97
-
98
- // }
99
-
100
- // // if (!Site.isTheme) { if (Site.isShareable) { $(Site.page.share).click(UtilShare); }}
@@ -2,17 +2,17 @@
2
2
  const WhatsOn = {
3
3
 
4
4
  speed : input => {
5
- return input * 0.03;
5
+ return input * 0.05;
6
6
  },
7
7
 
8
8
  slide : value => {
9
9
 
10
- let alert = $(".block.alert-content",value),
11
- feed = $(".alert-feed",value),
10
+ let alert = $(".screen-alert__wrap",value),
11
+ feed = $(".screen-alert__feed",value),
12
12
  width = $(feed).width() + 100,
13
- clone = $(".alert-clone",value);
13
+ clone = $(".screen-alert__clone",value);
14
14
 
15
- $(alert).addClass("modify-grid");
15
+ $(alert).addClass("modify-grid");
16
16
 
17
17
  const prep = gsap.timeline({ defaults : { ease : "none" }});
18
18
 
@@ -33,9 +33,9 @@ const WhatsOn = {
33
33
 
34
34
  scroll : value => {
35
35
 
36
- let feed = $(".feed",value),
36
+ let feed = $(".screen-event__feed",value),
37
37
  height = $(feed).height(),
38
- clone = $(".clone",value);
38
+ clone = $(".screen-event__clone",value);
39
39
 
40
40
  let tl = gsap.timeline({ repeat : -1, defaults : { ease : "none" }});
41
41
 
@@ -0,0 +1,269 @@
1
+ (function (global, $) {
2
+ var Browsr = function (target) {
3
+ return new Browsr.init(target);
4
+ };
5
+
6
+ let library = true,
7
+ found = false,
8
+ book = {
9
+ found: false,
10
+ },
11
+ chapter = {
12
+ found: false,
13
+ },
14
+ page = {
15
+ found: false,
16
+ };
17
+
18
+ Browsr.prototype = {
19
+ match(value, type = "book") {
20
+ $(value.classList).map((_, value) => {
21
+ if (type == "book") {
22
+ if (value.startsWith(type + "-")) {
23
+ book.class = value;
24
+ }
25
+ } else if (type == "chapter") {
26
+ if (value.startsWith(type + "-")) {
27
+ chapter.class = value;
28
+ }
29
+ }
30
+ });
31
+ },
32
+ checkPage(value) {
33
+ found = false;
34
+ $(value.classList).map((_, value) => {
35
+ if (value.startsWith("page-")) {
36
+ if (page.class == value) {
37
+ found = true;
38
+ page.found = true;
39
+ }
40
+ }
41
+ });
42
+ },
43
+ checkChapter(value) {
44
+ found = false;
45
+ $(value.classList).map((_, value) => {
46
+ if (value.startsWith("chapter-")) {
47
+ if (chapter.class == value) {
48
+ found = true;
49
+ chapter.found = true;
50
+ }
51
+ }
52
+ });
53
+ },
54
+ checkBook(value) {
55
+ found = false;
56
+ $(value.classList).map((_, value) => {
57
+ if (value.startsWith("book-")) {
58
+ if (book.class == value) {
59
+ found = true;
60
+ book.found = true;
61
+ }
62
+ }
63
+ });
64
+ },
65
+ setPageUrl(index) {
66
+ if (!this.pathify()[index]) {
67
+ $(page.links[0].classList).map((_, value) => {
68
+ if (value.startsWith("page-")) {
69
+ page.url = value.slice(5);
70
+ }
71
+ });
72
+ } else {
73
+ page.url = this.pathify()[index];
74
+ }
75
+ },
76
+ setChapterUrl(index) {
77
+ if (!this.pathify()[index]) {
78
+ $(chapter.links[0].classList).map((_, value) => {
79
+ if (value.startsWith("chapter-")) {
80
+ chapter.url = value.slice(8);
81
+ }
82
+ });
83
+ } else {
84
+ chapter.url = this.pathify()[index];
85
+ }
86
+ },
87
+ nunify(value) {
88
+ gsap.set(value, { display: "none" });
89
+ },
90
+ shadify(value) {
91
+ gsap.set(value, { background: "rgba(0,0,0,0.05)" });
92
+ },
93
+ clearify(value, attr = "background") {
94
+ gsap.set(value, { clearProps: attr });
95
+ },
96
+ bookify(value) {
97
+ return $(".block.browse-book", ".wrap.browse-" + value);
98
+ },
99
+ linkify(value) {
100
+ return $(".link.browse-" + value, ".wrap.browse-" + value);
101
+ },
102
+ classify(value, type) {
103
+ return type + "-" + value;
104
+ },
105
+ pathify() {
106
+ return window.location.pathname.split("/").map((value) => {
107
+ if (value != "") {
108
+ return value;
109
+ }
110
+ });
111
+ },
112
+ setup() {
113
+ chapter.links = this.linkify("chapter");
114
+ page.links = this.linkify("page");
115
+ if (library) {
116
+ book.url = this.pathify()[1];
117
+ this.setChapterUrl(2);
118
+ this.setPageUrl(3);
119
+ book.links = this.linkify("book");
120
+ book.class = this.classify(book.url, "book");
121
+ } else {
122
+ this.setChapterUrl(1);
123
+ this.setPageUrl(2);
124
+ }
125
+ chapter.books = this.bookify("chapter");
126
+ chapter.class = this.classify(chapter.url, "chapter");
127
+ page.books = this.bookify("page");
128
+ page.class = this.classify(page.url, "page");
129
+ },
130
+ start() {
131
+ this.setup();
132
+ // console.log(book,chapter,page);
133
+
134
+ if (book.url) {
135
+ book.links.map((_, value) => {
136
+ this.checkBook(value);
137
+ if (found) {
138
+ this.shadify(value);
139
+ }
140
+ });
141
+ }
142
+
143
+ chapter.books.map((_, value) => {
144
+ this.checkBook(value);
145
+
146
+ if (found) {
147
+ chapter.books.map((_, value) => {
148
+ $(value.children).map((_, value) => {
149
+ this.checkChapter(value);
150
+
151
+ if (found) {
152
+ this.shadify(value);
153
+ }
154
+ });
155
+ });
156
+ } else {
157
+ this.nunify(value);
158
+ }
159
+ });
160
+
161
+ page.books.map((_, value) => {
162
+ this.checkBook(value);
163
+
164
+ if (found) {
165
+ page.books.map((_, value) => {
166
+ $(value.children).map((_, value) => {
167
+ this.checkChapter(value);
168
+
169
+ if (found) {
170
+ $(value.children).map((_, value) => {
171
+ this.checkPage(value);
172
+
173
+ if (found) {
174
+ this.shadify(value);
175
+ }
176
+ });
177
+ } else {
178
+ this.nunify(value);
179
+ }
180
+ });
181
+ });
182
+ } else {
183
+ this.nunify(value);
184
+ }
185
+ });
186
+
187
+ return this;
188
+ },
189
+ respond() {
190
+ book.links.hover((e) => {
191
+ this.match(e.target);
192
+ this.clearify(book.links);
193
+ this.shadify(e.target);
194
+
195
+ chapter.books.map((_, value) => {
196
+ this.nunify(value);
197
+ this.clearify(value.children);
198
+ this.checkBook(value);
199
+
200
+ if (found) {
201
+ this.clearify(value, "display");
202
+ this.shadify(value.children[0]);
203
+ }
204
+ });
205
+
206
+ page.books.map((_, value) => {
207
+ this.nunify(value);
208
+ this.checkBook(value);
209
+
210
+ if (found) {
211
+ this.clearify(value, "display");
212
+
213
+ $(value.children).map((_, value) => {
214
+ this.nunify(value);
215
+ this.clearify(value.children);
216
+
217
+ if (_ == 0) {
218
+ this.clearify(value, "display");
219
+ this.shadify(value.children[0]);
220
+ }
221
+ });
222
+ }
223
+ });
224
+ });
225
+
226
+ chapter.links.hover((e) => {
227
+ this.match(e.target, "chapter");
228
+ this.clearify(chapter.links);
229
+ this.shadify(e.target);
230
+
231
+ page.books.map((_, value) => {
232
+ this.nunify(value);
233
+ this.checkBook(value);
234
+
235
+ if (found) {
236
+ this.clearify(value, "display");
237
+
238
+ $(value.children).map((_, value) => {
239
+ this.nunify(value);
240
+ this.clearify(value.children);
241
+ this.checkChapter(value);
242
+
243
+ if (found) {
244
+ this.clearify(value, "display");
245
+ this.shadify(value.children[0]);
246
+ }
247
+ });
248
+ }
249
+ });
250
+ });
251
+ page.links.hover((e) => {
252
+ this.clearify(page.links);
253
+ this.shadify(e.target);
254
+ });
255
+
256
+ return this;
257
+ },
258
+ };
259
+
260
+ Browsr.init = function (target) {
261
+ var self = this;
262
+ self.target = target || document;
263
+ this.start().respond();
264
+ };
265
+
266
+ Browsr.init.prototype = Browsr.prototype;
267
+
268
+ global.Browsr = Browsr;
269
+ })(window, $);
@@ -1,16 +1,15 @@
1
1
  (function (global, $) {
2
- var Checkr = function (target) {
3
- return new Checkr.init(target);
2
+ var Checkr = function (desktop) {
3
+ return new Checkr.init(desktop);
4
4
  };
5
5
 
6
6
  Checkr.prototype = {
7
7
  width(
8
- desktop,
9
8
  site = ".site",
10
9
  overlay = ".area.overlay-mobile",
11
10
  display = "grid"
12
11
  ) {
13
- if (!desktop) {
12
+ if (!this.desktop) {
14
13
  gsap.set(site, { clearProps: "display" });
15
14
  gsap.set(overlay, { display: display });
16
15
  this.print();
@@ -19,19 +18,21 @@
19
18
  gsap.set(site, { display: display });
20
19
  }
21
20
  },
22
-
23
21
  print(self = ".width", width = 1200, bar = ".bar.mobile") {
24
- var size = this.target.documentElement.clientWidth,
22
+ if (!this.desktop) {
23
+ var size = document.documentElement.clientWidth,
25
24
  more = width - size + "px",
26
25
  percent = (100 / width) * size + "%";
27
- $(self).html(more);
28
- gsap.set(bar, { width: percent });
26
+ $(self).html(more);
27
+ gsap.set(bar, { width: percent });
28
+ }
29
29
  },
30
30
  };
31
31
 
32
- Checkr.init = function (target) {
32
+ Checkr.init = function (desktop) {
33
33
  var self = this;
34
- self.target = target || document;
34
+ self.desktop = desktop;
35
+ this.width();
35
36
  };
36
37
 
37
38
  Checkr.init.prototype = Checkr.prototype;
@@ -0,0 +1,102 @@
1
+
2
+ ((global,$)=>{
3
+
4
+ let Orvly = (target) => {
5
+ return new Orvly.init(target);
6
+ }
7
+
8
+ let input = $(".input.text-search"),
9
+ results = $(".wrap.results");
10
+
11
+ Orvly.prototype = {
12
+
13
+ changeScreen(index) {
14
+ let { open,name } = Overlay.custom[index],
15
+ target = `.area.overlay-${name}`;
16
+
17
+ if (!open) {
18
+
19
+ gsap.set("body", {
20
+ overflow : "hidden"
21
+ });
22
+
23
+ gsap.set(target, {
24
+ display : Config.display
25
+ });
26
+
27
+ if (name == "search") {
28
+ input.focus();
29
+ }
30
+
31
+ open = true;
32
+
33
+ } else {
34
+
35
+ gsap.set("body",{
36
+ clearProps : "overflow"
37
+ });
38
+
39
+ gsap.set(target, {
40
+ clearProps : "display"
41
+ });
42
+
43
+ if (name == "search") {
44
+ input.val("");
45
+ results.empty();
46
+ }
47
+
48
+ open = false;
49
+
50
+ }
51
+
52
+ },
53
+
54
+ keyUp(e) {
55
+ let code = e.keyCode,
56
+ focus = Site.inFocus;
57
+
58
+ $(Overlay.custom).map((index,{ open,name }) => {
59
+
60
+ if (open && code == 27) {
61
+
62
+ if (name == "about") {
63
+ this.changeScreen(index);
64
+ } else if (name == "browse") {
65
+ this.changeScreen(index);
66
+ } else if (name == "search") {
67
+ this.changeScreen(index);
68
+ }
69
+
70
+ } else if (!open && !focus) {
71
+
72
+ if (code == 65 && name == "about") {
73
+ this.changeScreen(index);
74
+ } else if (code == 66 && name == "browse") {
75
+ this.changeScreen(index);
76
+ } else if (code == 83 && name == "search") {
77
+ this.changeScreen(index);
78
+ }
79
+
80
+ }
81
+
82
+ });
83
+
84
+ }
85
+
86
+ };
87
+
88
+ Orvly.init = function (target) {
89
+ let self = this;
90
+ self.target = target;
91
+ self.keyUp(target);
92
+ };
93
+
94
+ Orvly.init.prototype = Orvly.prototype;
95
+
96
+ global.Orvly = Orvly;
97
+
98
+ })(window,$)
99
+
100
+ $(document).keyup((e) => {
101
+ Orvly(e);
102
+ });