├── images ├── img-1.png ├── img-2.jpg ├── img-3.png └── screen_shots │ ├── 1.png │ ├── 2.png │ └── 3.png ├── index.html ├── Readme.md ├── style.css └── turn.js /images/img-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iamawmrit/book-flip-3DEffect/HEAD/images/img-1.png -------------------------------------------------------------------------------- /images/img-2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iamawmrit/book-flip-3DEffect/HEAD/images/img-2.jpg -------------------------------------------------------------------------------- /images/img-3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iamawmrit/book-flip-3DEffect/HEAD/images/img-3.png -------------------------------------------------------------------------------- /images/screen_shots/1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iamawmrit/book-flip-3DEffect/HEAD/images/screen_shots/1.png -------------------------------------------------------------------------------- /images/screen_shots/2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iamawmrit/book-flip-3DEffect/HEAD/images/screen_shots/2.png -------------------------------------------------------------------------------- /images/screen_shots/3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iamawmrit/book-flip-3DEffect/HEAD/images/screen_shots/3.png -------------------------------------------------------------------------------- /index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | Pubg Gun Skins 9 | 10 | 11 | 12 |
13 |
My Pubg Gun Skins ~ Awmrit
14 |
15 |
16 | Let's Look At Some Amazing PUBG Mobile Gun Skins 🎮
17 | Show Off Your Unique Skins in Matches!
18 | Unlock Exclusive Skins Through Events!
19 | Join the Community and Share Your Collection! 20 |
21 | 22 |
23 | 24 | Glacier M4 16 25 |
26 |
27 | 28 | Glacier ump 29 |
30 |
31 | 32 | Awm 33 |
34 |
35 |
Thank You ~ Awmrit
36 |
37 | 38 | 39 | 40 | 43 | 44 | 45 | -------------------------------------------------------------------------------- /Readme.md: -------------------------------------------------------------------------------- 1 | # PUBG Gun Skins Flipbook 2 | 3 | This project showcases a flipbook of PUBG gun skins, designed to be responsive for various screen sizes. The flipbook allows users to view different gun skins in a visually appealing format. 4 | 5 | ## Table of Contents 6 | 7 | - [PUBG Gun Skins Flipbook](#pubg-gun-skins-flipbook) 8 | - [Table of Contents](#table-of-contents) 9 | - [Features](#features) 10 | - [Technologies Used](#technologies-used) 11 | - [Installation](#installation) 12 | - [Usage](#usage) 13 | - [Note](#note) 14 | 15 | ## Features 16 | 17 | - **Responsive Design**: The flipbook adjusts its layout based on the screen size, ensuring a great user experience on both desktop and mobile devices. 18 | - **Modern UI**: Clean and visually appealing design using the Poppins font. 19 | - **Interactive Elements**: Users can navigate through different gun skins. 20 | 21 | ## Technologies Used 22 | 23 | - **HTML5**: For the structure of the flipbook. 24 | - **CSS3**: For styling and responsive design. 25 | - **JavaScript**: For interactive elements (using jQuery). 26 | - **Flipbook Plugin**: Utilizes the jQuery Turn.js plugin for the flipbook effect. 27 | 28 | ## Installation 29 | 30 | 1. Clone the repository: 31 | ```bash 32 | git clone https://github.com/iamawmrit/book-flip-3DEffect.git 33 | ``` 34 | 35 | 2. Navigate into the project directory: 36 | ```bash 37 | cd book-flip-3DEffect 38 | ``` 39 | 40 | 3. Open `index.html` in your web browser to view the flipbook. 41 | 42 | ## Usage 43 | 44 | - The flipbook displays various PUBG gun skins with images and descriptions. 45 | - Users can interact with the flipbook by flipping through the pages. 46 | 47 | ## This is what it looks like 48 | ![Flipbook Screenshot](images/screen_shots/1.png) 49 | ![Flipbook Screenshot](images/screen_shots/2.png) 50 | ![Flipbook Screenshot](images/screen_shots/3.png) 51 | 52 | ## Note 53 | 54 | This project is free to use! 55 | -------------------------------------------------------------------------------- /style.css: -------------------------------------------------------------------------------- 1 | @import url('https://fonts.googleapis.com/css2?family=Poppins:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&display=swap'); 2 | 3 | * { 4 | margin: 0; 5 | padding: 0; 6 | box-sizing: border-box; 7 | font-family: "Poppins", sans-serif; 8 | } 9 | 10 | body { 11 | display: grid; 12 | place-content: center; 13 | height: 100vh; 14 | width: 100vw; 15 | overflow: hidden; 16 | background: #d3e6ff; 17 | } 18 | 19 | .flipbook { 20 | width: 80vw; /* Use viewport width for responsiveness */ 21 | height: 70vh; /* Adjusted height for better aspect ratio */ 22 | max-width: 1000px; /* Maximum width to prevent excessive scaling */ 23 | max-height: 600px; /* Maximum height to prevent excessive scaling */ 24 | } 25 | 26 | .flipbook .hard { 27 | background: #2b78c0 !important; 28 | color: #fff; 29 | font-weight: bold; 30 | border: none; 31 | } 32 | 33 | .flipbook .hard small { 34 | font-style: italic; 35 | font-weight: lighter; 36 | opacity: 0.7; 37 | font-size: 14px; 38 | } 39 | 40 | .flipbook .page { 41 | background: white; 42 | display: flex; 43 | flex-direction: column; 44 | justify-content: center; 45 | align-items: center; 46 | gap: 10px; 47 | border: 1px solid rgba(0, 0, 0, 0.11); 48 | } 49 | 50 | .page img { 51 | width: 70%; 52 | object-fit: cover; 53 | margin: auto; 54 | } 55 | 56 | .flipbook .page small { 57 | font-size: 14px; 58 | margin-bottom: 10px; 59 | } 60 | 61 | /* Media queries for extra small devices (phones, 600px and down) */ 62 | @media only screen and (max-width: 600px) { 63 | .flipbook { 64 | width: 90vw; 65 | height: 30vh; /* Reduced height for better aspect ratio */ 66 | } 67 | 68 | .page img { 69 | width: 80%; 70 | } 71 | } 72 | 73 | /* Media queries for small devices (portrait tablets and large phones, 600px and up) */ 74 | @media only screen and (min-width: 600px) and (max-width: 768px) { 75 | .flipbook { 76 | width: 85vw; 77 | height: 55vh; /* Reduced height for better aspect ratio */ 78 | } 79 | 80 | .page img { 81 | width: 75%; 82 | } 83 | } 84 | 85 | /* Media queries for medium devices (landscape tablets, 768px and up) */ 86 | @media only screen and (min-width: 768px) and (max-width: 992px) { 87 | .flipbook { 88 | width: 90vw; 89 | height: 60vh; /* Adjusted height for better aspect ratio */ 90 | } 91 | 92 | .page img { 93 | width: 70%; 94 | } 95 | } 96 | -------------------------------------------------------------------------------- /turn.js: -------------------------------------------------------------------------------- 1 | /* turn.js 4.1.0 | Copyright (c) 2012 Emmanuel Garcia | turnjs.com | turnjs.com/license.txt */ 2 | 3 | (function (f) { 4 | function I(a, b, c) { 5 | if (!c[0] || "object" == typeof c[0]) return b.init.apply(a, c); 6 | if (b[c[0]]) return b[c[0]].apply(a, Array.prototype.slice.call(c, 1)); 7 | throw p(c[0] + " is not a method or property"); 8 | } 9 | function l(a, b, c, d) { 10 | return { 11 | css: { 12 | position: "absolute", 13 | top: a, 14 | left: b, 15 | overflow: d || "hidden", 16 | zIndex: c || "auto", 17 | }, 18 | }; 19 | } 20 | function R(a, b, c, d, e) { 21 | var h = 1 - e, 22 | f = h * h * h, 23 | g = e * e * e; 24 | return j( 25 | Math.round(f * a.x + 3 * e * h * h * b.x + 3 * e * e * h * c.x + g * d.x), 26 | Math.round(f * a.y + 3 * e * h * h * b.y + 3 * e * e * h * c.y + g * d.y) 27 | ); 28 | } 29 | function j(a, b) { 30 | return { x: a, y: b }; 31 | } 32 | function E(a, b, c) { 33 | return y && c 34 | ? " translate3d(" + a + "px," + b + "px, 0px) " 35 | : " translate(" + a + "px, " + b + "px) "; 36 | } 37 | function F(a) { 38 | return " rotate(" + a + "deg) "; 39 | } 40 | function n(a, b) { 41 | return Object.prototype.hasOwnProperty.call(b, a); 42 | } 43 | function S() { 44 | for ( 45 | var a = ["Moz", "Webkit", "Khtml", "O", "ms"], b = a.length, c = ""; 46 | b--; 47 | 48 | ) 49 | a[b] + "Transform" in document.body.style && 50 | (c = "-" + a[b].toLowerCase() + "-"); 51 | return c; 52 | } 53 | function O(a, b, c, d, e) { 54 | var h, 55 | f = []; 56 | if ("-webkit-" == v) { 57 | for (h = 0; h < e; h++) 58 | f.push("color-stop(" + d[h][0] + ", " + d[h][1] + ")"); 59 | a.css({ 60 | "background-image": 61 | "-webkit-gradient(linear, " + 62 | b.x + 63 | "% " + 64 | b.y + 65 | "%," + 66 | c.x + 67 | "% " + 68 | c.y + 69 | "%, " + 70 | f.join(",") + 71 | " )", 72 | }); 73 | } else { 74 | var b = { x: (b.x / 100) * a.width(), y: (b.y / 100) * a.height() }, 75 | c = { x: (c.x / 100) * a.width(), y: (c.y / 100) * a.height() }, 76 | g = c.x - b.x; 77 | h = c.y - b.y; 78 | var i = Math.atan2(h, g), 79 | w = i - Math.PI / 2, 80 | w = 81 | Math.abs(a.width() * Math.sin(w)) + 82 | Math.abs(a.height() * Math.cos(w)), 83 | g = Math.sqrt(h * h + g * g), 84 | c = j(c.x < b.x ? a.width() : 0, c.y < b.y ? a.height() : 0), 85 | k = Math.tan(i); 86 | h = -1 / k; 87 | k = (h * c.x - c.y - k * b.x + b.y) / (h - k); 88 | c = h * k - h * c.x + c.y; 89 | b = Math.sqrt(Math.pow(k - b.x, 2) + Math.pow(c - b.y, 2)); 90 | for (h = 0; h < e; h++) 91 | f.push(" " + d[h][1] + " " + (100 * (b + g * d[h][0])) / w + "%"); 92 | a.css({ 93 | "background-image": 94 | v + "linear-gradient(" + -i + "rad," + f.join(",") + ")", 95 | }); 96 | } 97 | } 98 | function s(a, b, c) { 99 | a = f.Event(a); 100 | b.trigger(a, c); 101 | return a.isDefaultPrevented() 102 | ? "prevented" 103 | : a.isPropagationStopped() 104 | ? "stopped" 105 | : ""; 106 | } 107 | function p(a) { 108 | function b(a) { 109 | this.name = "TurnJsError"; 110 | this.message = a; 111 | } 112 | b.prototype = Error(); 113 | b.prototype.constructor = b; 114 | return new b(a); 115 | } 116 | function C(a) { 117 | var b = { top: 0, left: 0 }; 118 | do (b.left += a.offsetLeft), (b.top += a.offsetTop); 119 | while ((a = a.offsetParent)); 120 | return b; 121 | } 122 | var y, 123 | T, 124 | v = "", 125 | J = Math.PI, 126 | K = J / 2, 127 | t = "ontouchstart" in window, 128 | q = t 129 | ? { 130 | down: "touchstart", 131 | move: "touchmove", 132 | up: "touchend", 133 | over: "touchstart", 134 | out: "touchend", 135 | } 136 | : { 137 | down: "mousedown", 138 | move: "mousemove", 139 | up: "mouseup", 140 | over: "mouseover", 141 | out: "mouseout", 142 | }, 143 | o = { 144 | backward: ["bl", "tl"], 145 | forward: ["br", "tr"], 146 | all: "tl bl tr br l r".split(" "), 147 | }, 148 | U = ["single", "double"], 149 | V = ["ltr", "rtl"], 150 | W = { 151 | acceleration: !0, 152 | display: "double", 153 | duration: 600, 154 | page: 1, 155 | gradients: !0, 156 | turnCorners: "bl,br", 157 | when: null, 158 | }, 159 | X = { cornerSize: 100 }, 160 | g = { 161 | init: function (a) { 162 | y = 163 | "WebKitCSSMatrix" in window || 164 | "MozPerspective" in document.body.style; 165 | var b; 166 | T = (b = /AppleWebkit\/([0-9\.]+)/i.exec(navigator.userAgent)) 167 | ? 534.3 < parseFloat(b[1]) 168 | : !0; 169 | v = S(); 170 | var c; 171 | b = 0; 172 | var d = this.data(), 173 | e = this.children(), 174 | a = f.extend( 175 | { 176 | width: this.width(), 177 | height: this.height(), 178 | direction: this.attr("dir") || this.css("direction") || "ltr", 179 | }, 180 | W, 181 | a 182 | ); 183 | d.opts = a; 184 | d.pageObjs = {}; 185 | d.pages = {}; 186 | d.pageWrap = {}; 187 | d.pageZoom = {}; 188 | d.pagePlace = {}; 189 | d.pageMv = []; 190 | d.zoom = 1; 191 | d.totalPages = a.pages || 0; 192 | d.eventHandlers = { 193 | touchStart: f.proxy(g._touchStart, this), 194 | touchMove: f.proxy(g._touchMove, this), 195 | touchEnd: f.proxy(g._touchEnd, this), 196 | start: f.proxy(g._eventStart, this), 197 | }; 198 | if (a.when) for (c in a.when) n(c, a.when) && this.bind(c, a.when[c]); 199 | this.css({ position: "relative", width: a.width, height: a.height }); 200 | this.turn("display", a.display); 201 | "" !== a.direction && this.turn("direction", a.direction); 202 | y && !t && a.acceleration && this.transform(E(0, 0, !0)); 203 | for (c = 0; c < e.length; c++) 204 | "1" != f(e[c]).attr("ignore") && this.turn("addPage", e[c], ++b); 205 | f(this) 206 | .bind(q.down, d.eventHandlers.touchStart) 207 | .bind("end", g._eventEnd) 208 | .bind("pressed", g._eventPressed) 209 | .bind("released", g._eventReleased) 210 | .bind("flip", g._flip); 211 | f(this).parent().bind("start", d.eventHandlers.start); 212 | f(document) 213 | .bind(q.move, d.eventHandlers.touchMove) 214 | .bind(q.up, d.eventHandlers.touchEnd); 215 | this.turn("page", a.page); 216 | d.done = !0; 217 | return this; 218 | }, 219 | addPage: function (a, b) { 220 | var c, 221 | d = !1, 222 | e = this.data(), 223 | h = e.totalPages + 1; 224 | if (e.destroying) return !1; 225 | if ((c = /\bp([0-9]+)\b/.exec(f(a).attr("class")))) 226 | b = parseInt(c[1], 10); 227 | if (b) 228 | if (b == h) d = !0; 229 | else { 230 | if (b > h) throw p('Page "' + b + '" cannot be inserted'); 231 | } 232 | else (b = h), (d = !0); 233 | 1 <= b && 234 | b <= h && 235 | ((c = "double" == e.display ? (b % 2 ? " odd" : " even") : ""), 236 | e.done && this.turn("stop"), 237 | b in e.pageObjs && g._movePages.call(this, b, 1), 238 | d && (e.totalPages = h), 239 | (e.pageObjs[b] = f(a) 240 | .css({ float: "left" }) 241 | .addClass("page p" + b + c)), 242 | -1 != navigator.userAgent.indexOf("MSIE 9.0") && 243 | e.pageObjs[b].hasClass("hard") && 244 | e.pageObjs[b].removeClass("hard"), 245 | g._addPage.call(this, b), 246 | g._removeFromDOM.call(this)); 247 | return this; 248 | }, 249 | _addPage: function (a) { 250 | var b = this.data(), 251 | c = b.pageObjs[a]; 252 | if (c) 253 | if (g._necessPage.call(this, a)) { 254 | if (!b.pageWrap[a]) { 255 | b.pageWrap[a] = f("
", { 256 | class: "page-wrapper", 257 | page: a, 258 | css: { position: "absolute", overflow: "hidden" }, 259 | }); 260 | this.append(b.pageWrap[a]); 261 | b.pagePlace[a] || 262 | ((b.pagePlace[a] = a), b.pageObjs[a].appendTo(b.pageWrap[a])); 263 | var d = g._pageSize.call(this, a, !0); 264 | c.css({ width: d.width, height: d.height }); 265 | b.pageWrap[a].css(d); 266 | } 267 | b.pagePlace[a] == a && g._makeFlip.call(this, a); 268 | } else (b.pagePlace[a] = 0), b.pageObjs[a] && b.pageObjs[a].remove(); 269 | }, 270 | hasPage: function (a) { 271 | return n(a, this.data().pageObjs); 272 | }, 273 | center: function (a) { 274 | var b = this.data(), 275 | c = f(this).turn("size"), 276 | d = 0; 277 | b.noCenter || 278 | ("double" == b.display && 279 | ((a = this.turn("view", a || b.tpage || b.page)), 280 | "ltr" == b.direction 281 | ? a[0] 282 | ? a[1] || (d += c.width / 4) 283 | : (d -= c.width / 4) 284 | : a[0] 285 | ? a[1] || (d -= c.width / 4) 286 | : (d += c.width / 4)), 287 | f(this).css({ marginLeft: d })); 288 | return this; 289 | }, 290 | destroy: function () { 291 | var a = this, 292 | b = this.data(), 293 | c = 294 | "end first flip last pressed released start turning turned zooming missing".split( 295 | " " 296 | ); 297 | if ("prevented" != s("destroying", this)) { 298 | b.destroying = !0; 299 | f.each(c, function (b, c) { 300 | a.unbind(c); 301 | }); 302 | this.parent().unbind("start", b.eventHandlers.start); 303 | for ( 304 | f(document) 305 | .unbind(q.move, b.eventHandlers.touchMove) 306 | .unbind(q.up, b.eventHandlers.touchEnd); 307 | 0 !== b.totalPages; 308 | 309 | ) 310 | this.turn("removePage", b.totalPages); 311 | b.fparent && b.fparent.remove(); 312 | b.shadow && b.shadow.remove(); 313 | this.removeData(); 314 | b = null; 315 | return this; 316 | } 317 | }, 318 | is: function () { 319 | return "object" == typeof this.data().pages; 320 | }, 321 | zoom: function (a) { 322 | var b = this.data(); 323 | if ("number" == typeof a) { 324 | if (0.001 > a || 100 < a) throw p(a + " is not a value for zoom"); 325 | if ("prevented" == s("zooming", this, [a, b.zoom])) return this; 326 | var c = this.turn("size"), 327 | d = this.turn("view"), 328 | e = 1 / b.zoom, 329 | h = Math.round(c.width * e * a), 330 | c = Math.round(c.height * e * a); 331 | b.zoom = a; 332 | f(this).turn("stop").turn("size", h, c); 333 | b.opts.autoCenter && this.turn("center"); 334 | g._updateShadow.call(this); 335 | for (a = 0; a < d.length; a++) 336 | d[a] && 337 | b.pageZoom[d[a]] != b.zoom && 338 | (this.trigger("zoomed", [d[a], d, b.pageZoom[d[a]], b.zoom]), 339 | (b.pageZoom[d[a]] = b.zoom)); 340 | return this; 341 | } 342 | return b.zoom; 343 | }, 344 | _pageSize: function (a, b) { 345 | var c = this.data(), 346 | d = {}; 347 | if ("single" == c.display) 348 | (d.width = this.width()), 349 | (d.height = this.height()), 350 | b && ((d.top = 0), (d.left = 0), (d.right = "auto")); 351 | else { 352 | var e = this.width() / 2, 353 | h = this.height(); 354 | c.pageObjs[a].hasClass("own-size") 355 | ? ((d.width = c.pageObjs[a].width()), 356 | (d.height = c.pageObjs[a].height())) 357 | : ((d.width = e), (d.height = h)); 358 | if (b) { 359 | var f = a % 2; 360 | d.top = (h - d.height) / 2; 361 | "ltr" == c.direction 362 | ? ((d[f ? "right" : "left"] = e - d.width), 363 | (d[f ? "left" : "right"] = "auto")) 364 | : ((d[f ? "left" : "right"] = e - d.width), 365 | (d[f ? "right" : "left"] = "auto")); 366 | } 367 | } 368 | return d; 369 | }, 370 | _makeFlip: function (a) { 371 | var b = this.data(); 372 | if (!b.pages[a] && b.pagePlace[a] == a) { 373 | var c = "single" == b.display, 374 | d = a % 2; 375 | b.pages[a] = b.pageObjs[a] 376 | .css(g._pageSize.call(this, a)) 377 | .flip({ page: a, next: d || c ? a + 1 : a - 1, turn: this }) 378 | .flip("disable", b.disabled); 379 | g._setPageLoc.call(this, a); 380 | b.pageZoom[a] = b.zoom; 381 | } 382 | return b.pages[a]; 383 | }, 384 | _makeRange: function () { 385 | var a, b; 386 | if (!(1 > this.data().totalPages)) { 387 | b = this.turn("range"); 388 | for (a = b[0]; a <= b[1]; a++) g._addPage.call(this, a); 389 | } 390 | }, 391 | range: function (a) { 392 | var b, 393 | c, 394 | d, 395 | e = this.data(), 396 | a = a || e.tpage || e.page || 1; 397 | d = g._view.call(this, a); 398 | if (1 > a || a > e.totalPages) 399 | throw p('"' + a + '" is not a valid page'); 400 | d[1] = d[1] || d[0]; 401 | 1 <= d[0] && d[1] <= e.totalPages 402 | ? ((a = Math.floor(2)), 403 | e.totalPages - d[1] > d[0] 404 | ? ((b = Math.min(d[0] - 1, a)), (c = 2 * a - b)) 405 | : ((c = Math.min(e.totalPages - d[1], a)), (b = 2 * a - c))) 406 | : (c = b = 5); 407 | return [Math.max(1, d[0] - b), Math.min(e.totalPages, d[1] + c)]; 408 | }, 409 | _necessPage: function (a) { 410 | if (0 === a) return !0; 411 | var b = this.turn("range"); 412 | return ( 413 | this.data().pageObjs[a].hasClass("fixed") || (a >= b[0] && a <= b[1]) 414 | ); 415 | }, 416 | _removeFromDOM: function () { 417 | var a, 418 | b = this.data(); 419 | for (a in b.pageWrap) 420 | n(a, b.pageWrap) && 421 | !g._necessPage.call(this, a) && 422 | g._removePageFromDOM.call(this, a); 423 | }, 424 | _removePageFromDOM: function (a) { 425 | var b = this.data(); 426 | if (b.pages[a]) { 427 | var c = b.pages[a].data(); 428 | i._moveFoldingPage.call(b.pages[a], !1); 429 | c.f && c.f.fwrapper && c.f.fwrapper.remove(); 430 | b.pages[a].removeData(); 431 | b.pages[a].remove(); 432 | delete b.pages[a]; 433 | } 434 | b.pageObjs[a] && b.pageObjs[a].remove(); 435 | b.pageWrap[a] && (b.pageWrap[a].remove(), delete b.pageWrap[a]); 436 | g._removeMv.call(this, a); 437 | delete b.pagePlace[a]; 438 | delete b.pageZoom[a]; 439 | }, 440 | removePage: function (a) { 441 | var b = this.data(); 442 | if ("*" == a) 443 | for (; 0 !== b.totalPages; ) this.turn("removePage", b.totalPages); 444 | else { 445 | if (1 > a || a > b.totalPages) 446 | throw p("The page " + a + " doesn't exist"); 447 | b.pageObjs[a] && 448 | (this.turn("stop"), 449 | g._removePageFromDOM.call(this, a), 450 | delete b.pageObjs[a]); 451 | g._movePages.call(this, a, -1); 452 | b.totalPages -= 1; 453 | b.page > b.totalPages 454 | ? ((b.page = null), g._fitPage.call(this, b.totalPages)) 455 | : (g._makeRange.call(this), this.turn("update")); 456 | } 457 | return this; 458 | }, 459 | _movePages: function (a, b) { 460 | var c, 461 | d = this, 462 | e = this.data(), 463 | h = "single" == e.display, 464 | f = function (a) { 465 | var c = a + b, 466 | f = c % 2, 467 | i = f ? " odd " : " even "; 468 | e.pageObjs[a] && 469 | (e.pageObjs[c] = e.pageObjs[a] 470 | .removeClass("p" + a + " odd even") 471 | .addClass("p" + c + i)); 472 | e.pagePlace[a] && 473 | e.pageWrap[a] && 474 | ((e.pagePlace[c] = c), 475 | (e.pageWrap[c] = e.pageObjs[c].hasClass("fixed") 476 | ? e.pageWrap[a].attr("page", c) 477 | : e.pageWrap[a] 478 | .css(g._pageSize.call(d, c, !0)) 479 | .attr("page", c)), 480 | e.pages[a] && 481 | (e.pages[c] = e.pages[a].flip("options", { 482 | page: c, 483 | next: h || f ? c + 1 : c - 1, 484 | })), 485 | b && 486 | (delete e.pages[a], 487 | delete e.pagePlace[a], 488 | delete e.pageZoom[a], 489 | delete e.pageObjs[a], 490 | delete e.pageWrap[a])); 491 | }; 492 | if (0 < b) for (c = e.totalPages; c >= a; c--) f(c); 493 | else for (c = a; c <= e.totalPages; c++) f(c); 494 | }, 495 | display: function (a) { 496 | var b = this.data(), 497 | c = b.display; 498 | if (void 0 === a) return c; 499 | if (-1 == f.inArray(a, U)) 500 | throw p('"' + a + '" is not a value for display'); 501 | switch (a) { 502 | case "single": 503 | b.pageObjs[0] || 504 | (this.turn("stop").css({ overflow: "hidden" }), 505 | (b.pageObjs[0] = f("
", { class: "page p-temporal" }) 506 | .css({ width: this.width(), height: this.height() }) 507 | .appendTo(this))); 508 | this.addClass("shadow"); 509 | break; 510 | case "double": 511 | b.pageObjs[0] && 512 | (this.turn("stop").css({ overflow: "" }), 513 | b.pageObjs[0].remove(), 514 | delete b.pageObjs[0]), 515 | this.removeClass("shadow"); 516 | } 517 | b.display = a; 518 | c && 519 | ((a = this.turn("size")), 520 | g._movePages.call(this, 1, 0), 521 | this.turn("size", a.width, a.height).turn("update")); 522 | return this; 523 | }, 524 | direction: function (a) { 525 | var b = this.data(); 526 | if (void 0 === a) return b.direction; 527 | a = a.toLowerCase(); 528 | if (-1 == f.inArray(a, V)) 529 | throw p('"' + a + '" is not a value for direction'); 530 | "rtl" == a && f(this).attr("dir", "ltr").css({ direction: "ltr" }); 531 | b.direction = a; 532 | b.done && this.turn("size", f(this).width(), f(this).height()); 533 | return this; 534 | }, 535 | animating: function () { 536 | return 0 < this.data().pageMv.length; 537 | }, 538 | corner: function () { 539 | var a, 540 | b, 541 | c = this.data(); 542 | for (b in c.pages) 543 | if (n(b, c.pages) && (a = c.pages[b].flip("corner"))) return a; 544 | return !1; 545 | }, 546 | data: function () { 547 | return this.data(); 548 | }, 549 | disable: function (a) { 550 | var b, 551 | c = this.data(), 552 | d = this.turn("view"); 553 | c.disabled = void 0 === a || !0 === a; 554 | for (b in c.pages) 555 | n(b, c.pages) && 556 | c.pages[b].flip( 557 | "disable", 558 | c.disabled ? !0 : -1 == f.inArray(parseInt(b, 10), d) 559 | ); 560 | return this; 561 | }, 562 | disabled: function (a) { 563 | return void 0 === a 564 | ? !0 === this.data().disabled 565 | : this.turn("disable", a); 566 | }, 567 | size: function (a, b) { 568 | if (void 0 === a || void 0 === b) 569 | return { width: this.width(), height: this.height() }; 570 | this.turn("stop"); 571 | var c, 572 | d, 573 | e = this.data(); 574 | d = "double" == e.display ? a / 2 : a; 575 | this.css({ width: a, height: b }); 576 | e.pageObjs[0] && e.pageObjs[0].css({ width: d, height: b }); 577 | for (c in e.pageWrap) 578 | n(c, e.pageWrap) && 579 | ((d = g._pageSize.call(this, c, !0)), 580 | e.pageObjs[c].css({ width: d.width, height: d.height }), 581 | e.pageWrap[c].css(d), 582 | e.pages[c] && e.pages[c].css({ width: d.width, height: d.height })); 583 | this.turn("resize"); 584 | return this; 585 | }, 586 | resize: function () { 587 | var a, 588 | b = this.data(); 589 | b.pages[0] && 590 | (b.pageWrap[0].css({ left: -this.width() }), 591 | b.pages[0].flip("resize", !0)); 592 | for (a = 1; a <= b.totalPages; a++) 593 | b.pages[a] && b.pages[a].flip("resize", !0); 594 | g._updateShadow.call(this); 595 | b.opts.autoCenter && this.turn("center"); 596 | }, 597 | _removeMv: function (a) { 598 | var b, 599 | c = this.data(); 600 | for (b = 0; b < c.pageMv.length; b++) 601 | if (c.pageMv[b] == a) return c.pageMv.splice(b, 1), !0; 602 | return !1; 603 | }, 604 | _addMv: function (a) { 605 | var b = this.data(); 606 | g._removeMv.call(this, a); 607 | b.pageMv.push(a); 608 | }, 609 | _view: function (a) { 610 | var b = this.data(), 611 | a = a || b.page; 612 | return "double" == b.display ? (a % 2 ? [a - 1, a] : [a, a + 1]) : [a]; 613 | }, 614 | view: function (a) { 615 | var b = this.data(), 616 | a = g._view.call(this, a); 617 | return "double" == b.display 618 | ? [0 < a[0] ? a[0] : 0, a[1] <= b.totalPages ? a[1] : 0] 619 | : [0 < a[0] && a[0] <= b.totalPages ? a[0] : 0]; 620 | }, 621 | stop: function (a, b) { 622 | if (this.turn("animating")) { 623 | var c, 624 | d, 625 | e, 626 | h = this.data(); 627 | h.tpage && ((h.page = h.tpage), delete h.tpage); 628 | for (c = 0; c < h.pageMv.length; c++) 629 | h.pageMv[c] && 630 | h.pageMv[c] !== a && 631 | ((e = h.pages[h.pageMv[c]]), 632 | (d = e.data().f.opts), 633 | e.flip("hideFoldedPage", b), 634 | b || i._moveFoldingPage.call(e, !1), 635 | d.force && 636 | ((d.next = 0 === d.page % 2 ? d.page - 1 : d.page + 1), 637 | delete d.force)); 638 | } 639 | this.turn("update"); 640 | return this; 641 | }, 642 | pages: function (a) { 643 | var b = this.data(); 644 | if (a) { 645 | if (a < b.totalPages) 646 | for (var c = b.totalPages; c > a; c--) this.turn("removePage", c); 647 | b.totalPages = a; 648 | g._fitPage.call(this, b.page); 649 | return this; 650 | } 651 | return b.totalPages; 652 | }, 653 | _missing: function (a) { 654 | var b = this.data(); 655 | if (!(1 > b.totalPages)) { 656 | for (var c = this.turn("range", a), d = [], a = c[0]; a <= c[1]; a++) 657 | b.pageObjs[a] || d.push(a); 658 | 0 < d.length && this.trigger("missing", [d]); 659 | } 660 | }, 661 | _fitPage: function (a) { 662 | var b = this.data(), 663 | c = this.turn("view", a); 664 | g._missing.call(this, a); 665 | if (b.pageObjs[a]) { 666 | b.page = a; 667 | this.turn("stop"); 668 | for (var d = 0; d < c.length; d++) 669 | c[d] && 670 | b.pageZoom[c[d]] != b.zoom && 671 | (this.trigger("zoomed", [c[d], c, b.pageZoom[c[d]], b.zoom]), 672 | (b.pageZoom[c[d]] = b.zoom)); 673 | g._removeFromDOM.call(this); 674 | g._makeRange.call(this); 675 | g._updateShadow.call(this); 676 | this.trigger("turned", [a, c]); 677 | this.turn("update"); 678 | b.opts.autoCenter && this.turn("center"); 679 | } 680 | }, 681 | _turnPage: function (a) { 682 | var b, 683 | c, 684 | d = this.data(), 685 | e = d.pagePlace[a], 686 | h = this.turn("view"), 687 | i = this.turn("view", a); 688 | if (d.page != a) { 689 | var j = d.page; 690 | if ("prevented" == s("turning", this, [a, i])) { 691 | j == d.page && 692 | -1 != f.inArray(e, d.pageMv) && 693 | d.pages[e].flip("hideFoldedPage", !0); 694 | return; 695 | } 696 | -1 != f.inArray(1, i) && this.trigger("first"); 697 | -1 != f.inArray(d.totalPages, i) && this.trigger("last"); 698 | } 699 | "single" == d.display 700 | ? ((b = h[0]), (c = i[0])) 701 | : h[1] && a > h[1] 702 | ? ((b = h[1]), (c = i[0])) 703 | : h[0] && a < h[0] && ((b = h[0]), (c = i[1])); 704 | e = d.opts.turnCorners.split(","); 705 | h = d.pages[b].data().f; 706 | i = h.opts; 707 | j = h.point; 708 | g._missing.call(this, a); 709 | d.pageObjs[a] && 710 | (this.turn("stop"), 711 | (d.page = a), 712 | g._makeRange.call(this), 713 | (d.tpage = c), 714 | i.next != c && ((i.next = c), (i.force = !0)), 715 | this.turn("update"), 716 | (h.point = j), 717 | "hard" == h.effect 718 | ? "ltr" == d.direction 719 | ? d.pages[b].flip("turnPage", a > b ? "r" : "l") 720 | : d.pages[b].flip("turnPage", a > b ? "l" : "r") 721 | : "ltr" == d.direction 722 | ? d.pages[b].flip("turnPage", e[a > b ? 1 : 0]) 723 | : d.pages[b].flip("turnPage", e[a > b ? 0 : 1])); 724 | }, 725 | page: function (a) { 726 | var b = this.data(); 727 | if (void 0 === a) return b.page; 728 | if (!b.disabled && !b.destroying) { 729 | a = parseInt(a, 10); 730 | if (0 < a && a <= b.totalPages) 731 | return ( 732 | a != b.page && 733 | (!b.done || -1 != f.inArray(a, this.turn("view")) 734 | ? g._fitPage.call(this, a) 735 | : g._turnPage.call(this, a)), 736 | this 737 | ); 738 | throw p("The page " + a + " does not exist"); 739 | } 740 | }, 741 | next: function () { 742 | return this.turn( 743 | "page", 744 | Math.min( 745 | this.data().totalPages, 746 | g._view.call(this, this.data().page).pop() + 1 747 | ) 748 | ); 749 | }, 750 | previous: function () { 751 | return this.turn( 752 | "page", 753 | Math.max(1, g._view.call(this, this.data().page).shift() - 1) 754 | ); 755 | }, 756 | peel: function (a, b) { 757 | var c = this.data(), 758 | d = this.turn("view"), 759 | b = void 0 === b ? !0 : !0 === b; 760 | !1 === a 761 | ? this.turn("stop", null, b) 762 | : "single" == c.display 763 | ? c.pages[c.page].flip("peel", a, b) 764 | : ((d = 765 | "ltr" == c.direction 766 | ? -1 != a.indexOf("l") 767 | ? d[0] 768 | : d[1] 769 | : -1 != a.indexOf("l") 770 | ? d[1] 771 | : d[0]), 772 | c.pages[d] && c.pages[d].flip("peel", a, b)); 773 | return this; 774 | }, 775 | _addMotionPage: function () { 776 | var a = f(this).data().f.opts, 777 | b = a.turn; 778 | b.data(); 779 | g._addMv.call(b, a.page); 780 | }, 781 | _eventStart: function (a, b, c) { 782 | var d = b.turn.data(), 783 | e = d.pageZoom[b.page]; 784 | a.isDefaultPrevented() || 785 | (e && 786 | e != d.zoom && 787 | (b.turn.trigger("zoomed", [ 788 | b.page, 789 | b.turn.turn("view", b.page), 790 | e, 791 | d.zoom, 792 | ]), 793 | (d.pageZoom[b.page] = d.zoom)), 794 | "single" == d.display && 795 | c && 796 | (("l" == c.charAt(1) && "ltr" == d.direction) || 797 | ("r" == c.charAt(1) && "rtl" == d.direction) 798 | ? ((b.next = b.next < b.page ? b.next : b.page - 1), 799 | (b.force = !0)) 800 | : (b.next = b.next > b.page ? b.next : b.page + 1)), 801 | g._addMotionPage.call(a.target)); 802 | g._updateShadow.call(b.turn); 803 | }, 804 | _eventEnd: function (a, b, c) { 805 | f(a.target).data(); 806 | var a = b.turn, 807 | d = a.data(); 808 | if (c) { 809 | if (((c = d.tpage || d.page), c == b.next || c == b.page)) 810 | delete d.tpage, g._fitPage.call(a, c || b.next, !0); 811 | } else 812 | g._removeMv.call(a, b.page), 813 | g._updateShadow.call(a), 814 | a.turn("update"); 815 | }, 816 | _eventPressed: function (a) { 817 | var a = f(a.target).data().f, 818 | b = a.opts.turn; 819 | b.data().mouseAction = !0; 820 | b.turn("update"); 821 | return (a.time = new Date().getTime()); 822 | }, 823 | _eventReleased: function (a, b) { 824 | var c; 825 | c = f(a.target); 826 | var d = c.data().f, 827 | e = d.opts.turn, 828 | h = e.data(); 829 | c = 830 | "single" == h.display 831 | ? "br" == b.corner || "tr" == b.corner 832 | ? b.x < c.width() / 2 833 | : b.x > c.width() / 2 834 | : 0 > b.x || b.x > c.width(); 835 | if (200 > new Date().getTime() - d.time || c) 836 | a.preventDefault(), g._turnPage.call(e, d.opts.next); 837 | h.mouseAction = !1; 838 | }, 839 | _flip: function (a) { 840 | a.stopPropagation(); 841 | a = f(a.target).data().f.opts; 842 | a.turn.trigger("turn", [a.next]); 843 | a.turn.data().opts.autoCenter && a.turn.turn("center", a.next); 844 | }, 845 | _touchStart: function () { 846 | var a = this.data(), 847 | b; 848 | for (b in a.pages) 849 | if ( 850 | n(b, a.pages) && 851 | !1 === i._eventStart.apply(a.pages[b], arguments) 852 | ) 853 | return !1; 854 | }, 855 | _touchMove: function () { 856 | var a = this.data(), 857 | b; 858 | for (b in a.pages) 859 | n(b, a.pages) && i._eventMove.apply(a.pages[b], arguments); 860 | }, 861 | _touchEnd: function () { 862 | var a = this.data(), 863 | b; 864 | for (b in a.pages) 865 | n(b, a.pages) && i._eventEnd.apply(a.pages[b], arguments); 866 | }, 867 | calculateZ: function (a) { 868 | var b, 869 | c, 870 | d, 871 | e, 872 | h = this, 873 | f = this.data(); 874 | b = this.turn("view"); 875 | var i = b[0] || b[1], 876 | g = a.length - 1, 877 | j = { pageZ: {}, partZ: {}, pageV: {} }, 878 | k = function (a) { 879 | a = h.turn("view", a); 880 | a[0] && (j.pageV[a[0]] = !0); 881 | a[1] && (j.pageV[a[1]] = !0); 882 | }; 883 | for (b = 0; b <= g; b++) 884 | (c = a[b]), 885 | (d = f.pages[c].data().f.opts.next), 886 | (e = f.pagePlace[c]), 887 | k(c), 888 | k(d), 889 | (c = f.pagePlace[d] == d ? d : c), 890 | (j.pageZ[c] = f.totalPages - Math.abs(i - c)), 891 | (j.partZ[e] = 2 * f.totalPages - g + b); 892 | return j; 893 | }, 894 | update: function () { 895 | var a, 896 | b = this.data(); 897 | if (this.turn("animating") && 0 !== b.pageMv[0]) { 898 | var c, 899 | d = this.turn("calculateZ", b.pageMv), 900 | e = this.turn("corner"), 901 | h = this.turn("view"), 902 | i = this.turn("view", b.tpage); 903 | for (a in b.pageWrap) 904 | if ( 905 | n(a, b.pageWrap) && 906 | ((c = b.pageObjs[a].hasClass("fixed")), 907 | b.pageWrap[a].css({ 908 | display: d.pageV[a] || c ? "" : "none", 909 | zIndex: 910 | (b.pageObjs[a].hasClass("hard") ? d.partZ[a] : d.pageZ[a]) || 911 | (c ? -1 : 0), 912 | }), 913 | (c = b.pages[a])) 914 | ) 915 | c.flip("z", d.partZ[a] || null), 916 | d.pageV[a] && c.flip("resize"), 917 | b.tpage 918 | ? c 919 | .flip("hover", !1) 920 | .flip( 921 | "disable", 922 | -1 == f.inArray(parseInt(a, 10), b.pageMv) && 923 | a != i[0] && 924 | a != i[1] 925 | ) 926 | : c 927 | .flip("hover", !1 === e) 928 | .flip("disable", a != h[0] && a != h[1]); 929 | } else 930 | for (a in b.pageWrap) 931 | n(a, b.pageWrap) && 932 | ((d = g._setPageLoc.call(this, a)), 933 | b.pages[a] && 934 | b.pages[a] 935 | .flip("disable", b.disabled || 1 != d) 936 | .flip("hover", !0) 937 | .flip("z", null)); 938 | return this; 939 | }, 940 | _updateShadow: function () { 941 | var a, 942 | b, 943 | c = this.data(), 944 | d = this.width(), 945 | e = this.height(), 946 | h = "single" == c.display ? d : d / 2; 947 | a = this.turn("view"); 948 | c.shadow || 949 | (c.shadow = f("
", { 950 | class: "shadow", 951 | css: l(0, 0, 0).css, 952 | }).appendTo(this)); 953 | for (var i = 0; i < c.pageMv.length && a[0] && a[1]; i++) 954 | (a = this.turn("view", c.pages[c.pageMv[i]].data().f.opts.next)), 955 | (b = this.turn("view", c.pageMv[i])), 956 | (a[0] = a[0] && b[0]), 957 | (a[1] = a[1] && b[1]); 958 | switch ( 959 | a[0] 960 | ? a[1] 961 | ? 3 962 | : "ltr" == c.direction 963 | ? 2 964 | : 1 965 | : "ltr" == c.direction 966 | ? 1 967 | : 2 968 | ) { 969 | case 1: 970 | c.shadow.css({ width: h, height: e, top: 0, left: h }); 971 | break; 972 | case 2: 973 | c.shadow.css({ width: h, height: e, top: 0, left: 0 }); 974 | break; 975 | case 3: 976 | c.shadow.css({ width: d, height: e, top: 0, left: 0 }); 977 | } 978 | }, 979 | _setPageLoc: function (a) { 980 | var b = this.data(), 981 | c = this.turn("view"), 982 | d = 0; 983 | if (a == c[0] || a == c[1]) d = 1; 984 | else if ( 985 | ("single" == b.display && a == c[0] + 1) || 986 | ("double" == b.display && a == c[0] - 2) || 987 | a == c[1] + 2 988 | ) 989 | d = 2; 990 | if (!this.turn("animating")) 991 | switch (d) { 992 | case 1: 993 | b.pageWrap[a].css({ zIndex: b.totalPages, display: "" }); 994 | break; 995 | case 2: 996 | b.pageWrap[a].css({ zIndex: b.totalPages - 1, display: "" }); 997 | break; 998 | case 0: 999 | b.pageWrap[a].css({ 1000 | zIndex: 0, 1001 | display: b.pageObjs[a].hasClass("fixed") ? "" : "none", 1002 | }); 1003 | } 1004 | return d; 1005 | }, 1006 | options: function (a) { 1007 | if (void 0 === a) return this.data().opts; 1008 | var b = this.data(); 1009 | f.extend(b.opts, a); 1010 | a.pages && this.turn("pages", a.pages); 1011 | a.page && this.turn("page", a.page); 1012 | a.display && this.turn("display", a.display); 1013 | a.direction && this.turn("direction", a.direction); 1014 | a.width && a.height && this.turn("size", a.width, a.height); 1015 | if (a.when) 1016 | for (var c in a.when) 1017 | n(c, a.when) && this.unbind(c).bind(c, a.when[c]); 1018 | return this; 1019 | }, 1020 | version: function () { 1021 | return "4.1.0"; 1022 | }, 1023 | }, 1024 | i = { 1025 | init: function (a) { 1026 | this.data({ 1027 | f: { 1028 | disabled: !1, 1029 | hover: !1, 1030 | effect: this.hasClass("hard") ? "hard" : "sheet", 1031 | }, 1032 | }); 1033 | this.flip("options", a); 1034 | i._addPageWrapper.call(this); 1035 | return this; 1036 | }, 1037 | setData: function (a) { 1038 | var b = this.data(); 1039 | b.f = f.extend(b.f, a); 1040 | return this; 1041 | }, 1042 | options: function (a) { 1043 | var b = this.data().f; 1044 | return a 1045 | ? (i.setData.call(this, { opts: f.extend({}, b.opts || X, a) }), this) 1046 | : b.opts; 1047 | }, 1048 | z: function (a) { 1049 | var b = this.data().f; 1050 | b.opts["z-index"] = a; 1051 | b.fwrapper && 1052 | b.fwrapper.css({ 1053 | zIndex: a || parseInt(b.parent.css("z-index"), 10) || 0, 1054 | }); 1055 | return this; 1056 | }, 1057 | _cAllowed: function () { 1058 | var a = this.data().f, 1059 | b = a.opts.page, 1060 | c = a.opts.turn.data(), 1061 | d = b % 2; 1062 | return "hard" == a.effect 1063 | ? "ltr" == c.direction 1064 | ? [d ? "r" : "l"] 1065 | : [d ? "l" : "r"] 1066 | : "single" == c.display 1067 | ? 1 == b 1068 | ? "ltr" == c.direction 1069 | ? o.forward 1070 | : o.backward 1071 | : b == c.totalPages 1072 | ? "ltr" == c.direction 1073 | ? o.backward 1074 | : o.forward 1075 | : o.all 1076 | : "ltr" == c.direction 1077 | ? o[d ? "forward" : "backward"] 1078 | : o[d ? "backward" : "forward"]; 1079 | }, 1080 | _cornerActivated: function (a) { 1081 | var b = this.data().f, 1082 | c = this.width(), 1083 | d = this.height(), 1084 | a = { x: a.x, y: a.y, corner: "" }, 1085 | e = b.opts.cornerSize; 1086 | if (0 >= a.x || 0 >= a.y || a.x >= c || a.y >= d) return !1; 1087 | var h = i._cAllowed.call(this); 1088 | switch (b.effect) { 1089 | case "hard": 1090 | if (a.x > c - e) a.corner = "r"; 1091 | else if (a.x < e) a.corner = "l"; 1092 | else return !1; 1093 | break; 1094 | case "sheet": 1095 | if (a.y < e) a.corner += "t"; 1096 | else if (a.y >= d - e) a.corner += "b"; 1097 | else return !1; 1098 | if (a.x <= e) a.corner += "l"; 1099 | else if (a.x >= c - e) a.corner += "r"; 1100 | else return !1; 1101 | } 1102 | return !a.corner || -1 == f.inArray(a.corner, h) ? !1 : a; 1103 | }, 1104 | _isIArea: function (a) { 1105 | var b = this.data().f.parent.offset(), 1106 | a = t && a.originalEvent ? a.originalEvent.touches[0] : a; 1107 | return i._cornerActivated.call(this, { 1108 | x: a.pageX - b.left, 1109 | y: a.pageY - b.top, 1110 | }); 1111 | }, 1112 | _c: function (a, b) { 1113 | b = b || 0; 1114 | switch (a) { 1115 | case "tl": 1116 | return j(b, b); 1117 | case "tr": 1118 | return j(this.width() - b, b); 1119 | case "bl": 1120 | return j(b, this.height() - b); 1121 | case "br": 1122 | return j(this.width() - b, this.height() - b); 1123 | case "l": 1124 | return j(b, 0); 1125 | case "r": 1126 | return j(this.width() - b, 0); 1127 | } 1128 | }, 1129 | _c2: function (a) { 1130 | switch (a) { 1131 | case "tl": 1132 | return j(2 * this.width(), 0); 1133 | case "tr": 1134 | return j(-this.width(), 0); 1135 | case "bl": 1136 | return j(2 * this.width(), this.height()); 1137 | case "br": 1138 | return j(-this.width(), this.height()); 1139 | case "l": 1140 | return j(2 * this.width(), 0); 1141 | case "r": 1142 | return j(-this.width(), 0); 1143 | } 1144 | }, 1145 | _foldingPage: function () { 1146 | var a = this.data().f; 1147 | if (a) { 1148 | var b = a.opts; 1149 | if (b.turn) 1150 | return ( 1151 | (a = b.turn.data()), 1152 | "single" == a.display 1153 | ? 1 < b.next || 1 < b.page 1154 | ? a.pageObjs[0] 1155 | : null 1156 | : a.pageObjs[b.next] 1157 | ); 1158 | } 1159 | }, 1160 | _backGradient: function () { 1161 | var a = this.data().f, 1162 | b = a.opts.turn.data(); 1163 | if ( 1164 | (b = 1165 | b.opts.gradients && 1166 | ("single" == b.display || 1167 | (2 != a.opts.page && a.opts.page != b.totalPages - 1))) && 1168 | !a.bshadow 1169 | ) 1170 | a.bshadow = f("
", l(0, 0, 1)) 1171 | .css({ position: "", width: this.width(), height: this.height() }) 1172 | .appendTo(a.parent); 1173 | return b; 1174 | }, 1175 | type: function () { 1176 | return this.data().f.effect; 1177 | }, 1178 | resize: function (a) { 1179 | var b = this.data().f, 1180 | c = b.opts.turn.data(), 1181 | d = this.width(), 1182 | e = this.height(); 1183 | switch (b.effect) { 1184 | case "hard": 1185 | a && 1186 | (b.wrapper.css({ width: d, height: e }), 1187 | b.fpage.css({ width: d, height: e }), 1188 | c.opts.gradients && 1189 | (b.ashadow.css({ width: d, height: e }), 1190 | b.bshadow.css({ width: d, height: e }))); 1191 | break; 1192 | case "sheet": 1193 | a && 1194 | ((a = Math.round(Math.sqrt(Math.pow(d, 2) + Math.pow(e, 2)))), 1195 | b.wrapper.css({ width: a, height: a }), 1196 | b.fwrapper 1197 | .css({ width: a, height: a }) 1198 | .children(":first-child") 1199 | .css({ width: d, height: e }), 1200 | b.fpage.css({ width: d, height: e }), 1201 | c.opts.gradients && b.ashadow.css({ width: d, height: e }), 1202 | i._backGradient.call(this) && 1203 | b.bshadow.css({ width: d, height: e })), 1204 | b.parent.is(":visible") && 1205 | ((c = C(b.parent[0])), 1206 | b.fwrapper.css({ top: c.top, left: c.left }), 1207 | (c = C(b.opts.turn[0])), 1208 | b.fparent.css({ top: -c.top, left: -c.left })), 1209 | this.flip("z", b.opts["z-index"]); 1210 | } 1211 | }, 1212 | _addPageWrapper: function () { 1213 | var a = this.data().f, 1214 | b = a.opts.turn.data(), 1215 | c = this.parent(); 1216 | a.parent = c; 1217 | if (!a.wrapper) 1218 | switch (a.effect) { 1219 | case "hard": 1220 | var d = {}; 1221 | d[v + "transform-style"] = "preserve-3d"; 1222 | d[v + "backface-visibility"] = "hidden"; 1223 | a.wrapper = f("
", l(0, 0, 2)) 1224 | .css(d) 1225 | .appendTo(c) 1226 | .prepend(this); 1227 | a.fpage = f("
", l(0, 0, 1)).css(d).appendTo(c); 1228 | b.opts.gradients && 1229 | ((a.ashadow = f("
", l(0, 0, 0)).hide().appendTo(c)), 1230 | (a.bshadow = f("
", l(0, 0, 0)))); 1231 | break; 1232 | case "sheet": 1233 | var d = this.width(), 1234 | e = this.height(); 1235 | Math.round(Math.sqrt(Math.pow(d, 2) + Math.pow(e, 2))); 1236 | a.fparent = a.opts.turn.data().fparent; 1237 | a.fparent || 1238 | ((d = f("
", { 1239 | css: { "pointer-events": "none" }, 1240 | }).hide()), 1241 | (d.data().flips = 0), 1242 | d.css(l(0, 0, "auto", "visible").css).appendTo(a.opts.turn), 1243 | (a.opts.turn.data().fparent = d), 1244 | (a.fparent = d)); 1245 | this.css({ 1246 | position: "absolute", 1247 | top: 0, 1248 | left: 0, 1249 | bottom: "auto", 1250 | right: "auto", 1251 | }); 1252 | a.wrapper = f("
", l(0, 0, this.css("z-index"))) 1253 | .appendTo(c) 1254 | .prepend(this); 1255 | a.fwrapper = f("
", l(c.offset().top, c.offset().left)) 1256 | .hide() 1257 | .appendTo(a.fparent); 1258 | a.fpage = f("
", l(0, 0, 0, "visible")) 1259 | .css({ cursor: "default" }) 1260 | .appendTo(a.fwrapper); 1261 | b.opts.gradients && 1262 | (a.ashadow = f("
", l(0, 0, 1)).appendTo(a.fpage)); 1263 | i.setData.call(this, a); 1264 | } 1265 | i.resize.call(this, !0); 1266 | }, 1267 | _fold: function (a) { 1268 | var b = this.data().f, 1269 | c = b.opts.turn.data(), 1270 | d = i._c.call(this, a.corner), 1271 | e = this.width(), 1272 | h = this.height(); 1273 | switch (b.effect) { 1274 | case "hard": 1275 | a.x = 1276 | "l" == a.corner 1277 | ? Math.min(Math.max(a.x, 0), 2 * e) 1278 | : Math.max(Math.min(a.x, e), -e); 1279 | var f, 1280 | g, 1281 | r, 1282 | w, 1283 | k, 1284 | n = c.totalPages, 1285 | l = b.opts["z-index"] || n, 1286 | p = { overflow: "visible" }, 1287 | o = d.x ? (d.x - a.x) / e : a.x / e, 1288 | q = 90 * o, 1289 | s = 90 > q; 1290 | switch (a.corner) { 1291 | case "l": 1292 | w = "0% 50%"; 1293 | k = "100% 50%"; 1294 | s 1295 | ? ((f = 0), (g = 0 < b.opts.next - 1), (r = 1)) 1296 | : ((f = "100%"), (g = b.opts.page + 1 < n), (r = 0)); 1297 | break; 1298 | case "r": 1299 | (w = "100% 50%"), 1300 | (k = "0% 50%"), 1301 | (q = -q), 1302 | (e = -e), 1303 | s 1304 | ? ((f = 0), (g = b.opts.next + 1 < n), (r = 0)) 1305 | : ((f = "-100%"), (g = 1 != b.opts.page), (r = 1)); 1306 | } 1307 | p[v + "perspective-origin"] = k; 1308 | b.wrapper.transform( 1309 | "rotateY(" + 1310 | q + 1311 | "deg)translate3d(0px, 0px, " + 1312 | (this.attr("depth") || 0) + 1313 | "px)", 1314 | k 1315 | ); 1316 | b.fpage.transform( 1317 | "translateX(" + e + "px) rotateY(" + (180 + q) + "deg)", 1318 | w 1319 | ); 1320 | b.parent.css(p); 1321 | s 1322 | ? ((o = -o + 1), 1323 | b.wrapper.css({ zIndex: l + 1 }), 1324 | b.fpage.css({ zIndex: l })) 1325 | : ((o -= 1), 1326 | b.wrapper.css({ zIndex: l }), 1327 | b.fpage.css({ zIndex: l + 1 })); 1328 | c.opts.gradients && 1329 | (g 1330 | ? b.ashadow 1331 | .css({ 1332 | display: "", 1333 | left: f, 1334 | backgroundColor: "rgba(0,0,0," + 0.5 * o + ")", 1335 | }) 1336 | .transform("rotateY(0deg)") 1337 | : b.ashadow.hide(), 1338 | b.bshadow.css({ opacity: -o + 1 }), 1339 | s 1340 | ? b.bshadow.parent()[0] != b.wrapper[0] && 1341 | b.bshadow.appendTo(b.wrapper) 1342 | : b.bshadow.parent()[0] != b.fpage[0] && 1343 | b.bshadow.appendTo(b.fpage), 1344 | O( 1345 | b.bshadow, 1346 | j(100 * r, 0), 1347 | j(100 * (-r + 1), 0), 1348 | [ 1349 | [0, "rgba(0,0,0,0.3)"], 1350 | [1, "rgba(0,0,0,0)"], 1351 | ], 1352 | 2 1353 | )); 1354 | break; 1355 | case "sheet": 1356 | var t = this, 1357 | G = 0, 1358 | y, 1359 | z, 1360 | A, 1361 | L, 1362 | x, 1363 | M, 1364 | C, 1365 | u = j(0, 0), 1366 | P = j(0, 0), 1367 | m = j(0, 0), 1368 | I = i._foldingPage.call(this); 1369 | Math.tan(0); 1370 | var N = c.opts.acceleration, 1371 | Q = b.wrapper.height(), 1372 | D = "t" == a.corner.substr(0, 1), 1373 | B = "l" == a.corner.substr(1, 1), 1374 | H = function () { 1375 | var b = j(0, 0), 1376 | f = j(0, 0); 1377 | b.x = d.x ? d.x - a.x : a.x; 1378 | b.y = T ? (d.y ? d.y - a.y : a.y) : 0; 1379 | f.x = B ? e - b.x / 2 : a.x + b.x / 2; 1380 | f.y = b.y / 2; 1381 | var g = K - Math.atan2(b.y, b.x), 1382 | k = g - Math.atan2(f.y, f.x), 1383 | k = Math.max( 1384 | 0, 1385 | Math.sin(k) * Math.sqrt(Math.pow(f.x, 2) + Math.pow(f.y, 2)) 1386 | ); 1387 | G = 180 * (g / J); 1388 | m = j(k * Math.sin(g), k * Math.cos(g)); 1389 | if ( 1390 | g > K && 1391 | ((m.x += Math.abs((m.y * b.y) / b.x)), 1392 | (m.y = 0), 1393 | Math.round(m.x * Math.tan(J - g)) < h) 1394 | ) 1395 | return ( 1396 | (a.y = Math.sqrt(Math.pow(h, 2) + 2 * f.x * b.x)), 1397 | D && (a.y = h - a.y), 1398 | H() 1399 | ); 1400 | if ( 1401 | g > K && 1402 | ((b = J - g), 1403 | (f = Q - h / Math.sin(b)), 1404 | (u = j( 1405 | Math.round(f * Math.cos(b)), 1406 | Math.round(f * Math.sin(b)) 1407 | )), 1408 | B && (u.x = -u.x), 1409 | D) 1410 | ) 1411 | u.y = -u.y; 1412 | y = Math.round(m.y / Math.tan(g) + m.x); 1413 | b = e - y; 1414 | f = b * Math.cos(2 * g); 1415 | k = b * Math.sin(2 * g); 1416 | P = j(Math.round(B ? b - f : y + f), Math.round(D ? k : h - k)); 1417 | if ( 1418 | c.opts.gradients && 1419 | ((x = b * Math.sin(g)), 1420 | (b = i._c2.call(t, a.corner)), 1421 | (b = 1422 | Math.sqrt(Math.pow(b.x - a.x, 2) + Math.pow(b.y - a.y, 2)) / 1423 | e), 1424 | (C = Math.sin(K * (1 < b ? 2 - b : b))), 1425 | (M = Math.min(b, 1)), 1426 | (L = 100 < x ? (x - 100) / x : 0), 1427 | (z = j( 1428 | 100 * ((x * Math.sin(g)) / e), 1429 | 100 * ((x * Math.cos(g)) / h) 1430 | )), 1431 | i._backGradient.call(t) && 1432 | ((A = j( 1433 | 100 * ((1.2 * x * Math.sin(g)) / e), 1434 | 100 * ((1.2 * x * Math.cos(g)) / h) 1435 | )), 1436 | B || (A.x = 100 - A.x), 1437 | !D)) 1438 | ) 1439 | A.y = 100 - A.y; 1440 | m.x = Math.round(m.x); 1441 | m.y = Math.round(m.y); 1442 | return !0; 1443 | }; 1444 | f = function (a, d, f, g) { 1445 | var k = ["0", "auto"], 1446 | m = ((e - Q) * f[0]) / 100, 1447 | l = ((h - Q) * f[1]) / 100, 1448 | d = { 1449 | left: k[d[0]], 1450 | top: k[d[1]], 1451 | right: k[d[2]], 1452 | bottom: k[d[3]], 1453 | }, 1454 | k = {}, 1455 | n = 90 != g && -90 != g ? (B ? -1 : 1) : 0, 1456 | r = f[0] + "% " + f[1] + "%"; 1457 | t.css(d).transform(F(g) + E(a.x + n, a.y, N), r); 1458 | b.fpage 1459 | .css(d) 1460 | .transform( 1461 | F(g) + 1462 | E( 1463 | a.x + P.x - u.x - (e * f[0]) / 100, 1464 | a.y + P.y - u.y - (h * f[1]) / 100, 1465 | N 1466 | ) + 1467 | F((180 / g - 2) * g), 1468 | r 1469 | ); 1470 | b.wrapper.transform(E(-a.x + m - n, -a.y + l, N) + F(-g), r); 1471 | b.fwrapper.transform( 1472 | E(-a.x + u.x + m, -a.y + u.y + l, N) + F(-g), 1473 | r 1474 | ); 1475 | c.opts.gradients && 1476 | (f[0] && (z.x = 100 - z.x), 1477 | f[1] && (z.y = 100 - z.y), 1478 | (k["box-shadow"] = "0 0 20px rgba(0,0,0," + 0.5 * C + ")"), 1479 | I.css(k), 1480 | O( 1481 | b.ashadow, 1482 | j(B ? 100 : 0, D ? 0 : 100), 1483 | j(z.x, z.y), 1484 | [ 1485 | [L, "rgba(0,0,0,0)"], 1486 | [0.8 * (1 - L) + L, "rgba(0,0,0," + 0.2 * M + ")"], 1487 | [1, "rgba(255,255,255," + 0.2 * M + ")"], 1488 | ], 1489 | 3, 1490 | 0 1491 | ), 1492 | i._backGradient.call(t) && 1493 | O( 1494 | b.bshadow, 1495 | j(B ? 0 : 100, D ? 0 : 100), 1496 | j(A.x, A.y), 1497 | [ 1498 | [0.6, "rgba(0,0,0,0)"], 1499 | [0.8, "rgba(0,0,0," + 0.3 * M + ")"], 1500 | [1, "rgba(0,0,0,0)"], 1501 | ], 1502 | 3 1503 | )); 1504 | }; 1505 | switch (a.corner) { 1506 | case "tl": 1507 | a.x = Math.max(a.x, 1); 1508 | H(); 1509 | f(m, [1, 0, 0, 1], [100, 0], G); 1510 | break; 1511 | case "tr": 1512 | a.x = Math.min(a.x, e - 1); 1513 | H(); 1514 | f(j(-m.x, m.y), [0, 0, 0, 1], [0, 0], -G); 1515 | break; 1516 | case "bl": 1517 | a.x = Math.max(a.x, 1); 1518 | H(); 1519 | f(j(m.x, -m.y), [1, 1, 0, 0], [100, 100], -G); 1520 | break; 1521 | case "br": 1522 | (a.x = Math.min(a.x, e - 1)), 1523 | H(), 1524 | f(j(-m.x, -m.y), [0, 1, 1, 0], [0, 100], G); 1525 | } 1526 | } 1527 | b.point = a; 1528 | }, 1529 | _moveFoldingPage: function (a) { 1530 | var b = this.data().f; 1531 | if (b) { 1532 | var c = b.opts.turn, 1533 | d = c.data(), 1534 | e = d.pagePlace; 1535 | a 1536 | ? ((d = b.opts.next), 1537 | e[d] != b.opts.page && 1538 | (b.folding && i._moveFoldingPage.call(this, !1), 1539 | i._foldingPage.call(this).appendTo(b.fpage), 1540 | (e[d] = b.opts.page), 1541 | (b.folding = d)), 1542 | c.turn("update")) 1543 | : b.folding && 1544 | (d.pages[b.folding] 1545 | ? ((c = d.pages[b.folding].data().f), 1546 | d.pageObjs[b.folding].appendTo(c.wrapper)) 1547 | : d.pageWrap[b.folding] && 1548 | d.pageObjs[b.folding].appendTo(d.pageWrap[b.folding]), 1549 | b.folding in e && (e[b.folding] = b.folding), 1550 | delete b.folding); 1551 | } 1552 | }, 1553 | _showFoldedPage: function (a, b) { 1554 | var c = i._foldingPage.call(this), 1555 | d = this.data(), 1556 | e = d.f, 1557 | f = e.visible; 1558 | if (c) { 1559 | if (!f || !e.point || e.point.corner != a.corner) 1560 | if ( 1561 | ((c = 1562 | "hover" == e.status || 1563 | "peel" == e.status || 1564 | e.opts.turn.data().mouseAction 1565 | ? a.corner 1566 | : null), 1567 | (f = !1), 1568 | "prevented" == s("start", this, [e.opts, c])) 1569 | ) 1570 | return !1; 1571 | if (b) { 1572 | var g = this, 1573 | d = 1574 | e.point && e.point.corner == a.corner 1575 | ? e.point 1576 | : i._c.call(this, a.corner, 1); 1577 | this.animatef({ 1578 | from: [d.x, d.y], 1579 | to: [a.x, a.y], 1580 | duration: 500, 1581 | frame: function (b) { 1582 | a.x = Math.round(b[0]); 1583 | a.y = Math.round(b[1]); 1584 | i._fold.call(g, a); 1585 | }, 1586 | }); 1587 | } else 1588 | i._fold.call(this, a), 1589 | d.effect && !d.effect.turning && this.animatef(!1); 1590 | if (!f) 1591 | switch (e.effect) { 1592 | case "hard": 1593 | e.visible = !0; 1594 | i._moveFoldingPage.call(this, !0); 1595 | e.fpage.show(); 1596 | e.opts.shadows && e.bshadow.show(); 1597 | break; 1598 | case "sheet": 1599 | (e.visible = !0), 1600 | e.fparent.show().data().flips++, 1601 | i._moveFoldingPage.call(this, !0), 1602 | e.fwrapper.show(), 1603 | e.bshadow && e.bshadow.show(); 1604 | } 1605 | return !0; 1606 | } 1607 | return !1; 1608 | }, 1609 | hide: function () { 1610 | var a = this.data().f, 1611 | b = a.opts.turn.data(), 1612 | c = i._foldingPage.call(this); 1613 | switch (a.effect) { 1614 | case "hard": 1615 | b.opts.gradients && 1616 | ((a.bshadowLoc = 0), a.bshadow.remove(), a.ashadow.hide()); 1617 | a.wrapper.transform(""); 1618 | a.fpage.hide(); 1619 | break; 1620 | case "sheet": 1621 | 0 === --a.fparent.data().flips && a.fparent.hide(), 1622 | this.css({ 1623 | left: 0, 1624 | top: 0, 1625 | right: "auto", 1626 | bottom: "auto", 1627 | }).transform(""), 1628 | a.wrapper.transform(""), 1629 | a.fwrapper.hide(), 1630 | a.bshadow && a.bshadow.hide(), 1631 | c.transform(""); 1632 | } 1633 | a.visible = !1; 1634 | return this; 1635 | }, 1636 | hideFoldedPage: function (a) { 1637 | var b = this.data().f; 1638 | if (b.point) { 1639 | var c = this, 1640 | d = b.point, 1641 | e = function () { 1642 | b.point = null; 1643 | b.status = ""; 1644 | c.flip("hide"); 1645 | c.trigger("end", [b.opts, !1]); 1646 | }; 1647 | if (a) { 1648 | var f = i._c.call(this, d.corner), 1649 | a = 1650 | "t" == d.corner.substr(0, 1) 1651 | ? Math.min(0, d.y - f.y) / 2 1652 | : Math.max(0, d.y - f.y) / 2, 1653 | g = j(d.x, d.y + a), 1654 | l = j(f.x, f.y - a); 1655 | this.animatef({ 1656 | from: 0, 1657 | to: 1, 1658 | frame: function (a) { 1659 | a = R(d, g, l, f, a); 1660 | d.x = a.x; 1661 | d.y = a.y; 1662 | i._fold.call(c, d); 1663 | }, 1664 | complete: e, 1665 | duration: 800, 1666 | hiding: !0, 1667 | }); 1668 | } else this.animatef(!1), e(); 1669 | } 1670 | }, 1671 | turnPage: function (a) { 1672 | var b = this, 1673 | c = this.data().f, 1674 | d = c.opts.turn.data(), 1675 | a = { 1676 | corner: c.corner ? c.corner.corner : a || i._cAllowed.call(this)[0], 1677 | }, 1678 | e = 1679 | c.point || 1680 | i._c.call(this, a.corner, c.opts.turn ? d.opts.elevation : 0), 1681 | f = i._c2.call(this, a.corner); 1682 | this.trigger("flip").animatef({ 1683 | from: 0, 1684 | to: 1, 1685 | frame: function (c) { 1686 | c = R(e, e, f, f, c); 1687 | a.x = c.x; 1688 | a.y = c.y; 1689 | i._showFoldedPage.call(b, a); 1690 | }, 1691 | complete: function () { 1692 | b.trigger("end", [c.opts, !0]); 1693 | }, 1694 | duration: d.opts.duration, 1695 | turning: !0, 1696 | }); 1697 | c.corner = null; 1698 | }, 1699 | moving: function () { 1700 | return "effect" in this.data(); 1701 | }, 1702 | isTurning: function () { 1703 | return this.flip("moving") && this.data().effect.turning; 1704 | }, 1705 | corner: function () { 1706 | return this.data().f.corner; 1707 | }, 1708 | _eventStart: function (a) { 1709 | var b = this.data().f, 1710 | c = b.opts.turn; 1711 | if ( 1712 | !b.corner && 1713 | !b.disabled && 1714 | !this.flip("isTurning") && 1715 | b.opts.page == c.data().pagePlace[b.opts.page] 1716 | ) { 1717 | b.corner = i._isIArea.call(this, a); 1718 | if (b.corner && i._foldingPage.call(this)) 1719 | return ( 1720 | this.trigger("pressed", [b.point]), 1721 | i._showFoldedPage.call(this, b.corner), 1722 | !1 1723 | ); 1724 | b.corner = null; 1725 | } 1726 | }, 1727 | _eventMove: function (a) { 1728 | var b = this.data().f; 1729 | if (!b.disabled) 1730 | if (((a = t ? a.originalEvent.touches : [a]), b.corner)) { 1731 | var c = b.parent.offset(); 1732 | b.corner.x = a[0].pageX - c.left; 1733 | b.corner.y = a[0].pageY - c.top; 1734 | i._showFoldedPage.call(this, b.corner); 1735 | } else if (b.hover && !this.data().effect && this.is(":visible")) 1736 | if ((a = i._isIArea.call(this, a[0]))) { 1737 | if ( 1738 | ("sheet" == b.effect && 2 == a.corner.length) || 1739 | "hard" == b.effect 1740 | ) 1741 | (b.status = "hover"), 1742 | (b = i._c.call(this, a.corner, b.opts.cornerSize / 2)), 1743 | (a.x = b.x), 1744 | (a.y = b.y), 1745 | i._showFoldedPage.call(this, a, !0); 1746 | } else 1747 | "hover" == b.status && 1748 | ((b.status = ""), i.hideFoldedPage.call(this, !0)); 1749 | }, 1750 | _eventEnd: function () { 1751 | var a = this.data().f, 1752 | b = a.corner; 1753 | !a.disabled && 1754 | b && 1755 | "prevented" != s("released", this, [a.point || b]) && 1756 | i.hideFoldedPage.call(this, !0); 1757 | a.corner = null; 1758 | }, 1759 | disable: function (a) { 1760 | i.setData.call(this, { disabled: a }); 1761 | return this; 1762 | }, 1763 | hover: function (a) { 1764 | i.setData.call(this, { hover: a }); 1765 | return this; 1766 | }, 1767 | peel: function (a, b) { 1768 | var c = this.data().f; 1769 | if (a) { 1770 | if (-1 == f.inArray(a, o.all)) 1771 | throw p("Corner " + a + " is not permitted"); 1772 | if (-1 != f.inArray(a, i._cAllowed.call(this))) { 1773 | var d = i._c.call(this, a, c.opts.cornerSize / 2); 1774 | c.status = "peel"; 1775 | i._showFoldedPage.call(this, { corner: a, x: d.x, y: d.y }, b); 1776 | } 1777 | } else (c.status = ""), i.hideFoldedPage.call(this, b); 1778 | return this; 1779 | }, 1780 | }; 1781 | window.requestAnim = 1782 | window.requestAnimationFrame || 1783 | window.webkitRequestAnimationFrame || 1784 | window.mozRequestAnimationFrame || 1785 | window.oRequestAnimationFrame || 1786 | window.msRequestAnimationFrame || 1787 | function (a) { 1788 | window.setTimeout(a, 1e3 / 60); 1789 | }; 1790 | f.extend(f.fn, { 1791 | flip: function () { 1792 | return I(f(this[0]), i, arguments); 1793 | }, 1794 | turn: function () { 1795 | return I(f(this[0]), g, arguments); 1796 | }, 1797 | transform: function (a, b) { 1798 | var c = {}; 1799 | b && (c[v + "transform-origin"] = b); 1800 | c[v + "transform"] = a; 1801 | return this.css(c); 1802 | }, 1803 | animatef: function (a) { 1804 | var b = this.data(); 1805 | b.effect && b.effect.stop(); 1806 | if (a) { 1807 | a.to.length || (a.to = [a.to]); 1808 | a.from.length || (a.from = [a.from]); 1809 | for ( 1810 | var c = [], 1811 | d = a.to.length, 1812 | e = !0, 1813 | g = this, 1814 | i = new Date().getTime(), 1815 | j = function () { 1816 | if (b.effect && e) { 1817 | for ( 1818 | var f = [], 1819 | k = Math.min(a.duration, new Date().getTime() - i), 1820 | l = 0; 1821 | l < d; 1822 | l++ 1823 | ) 1824 | f.push(b.effect.easing(1, k, a.from[l], c[l], a.duration)); 1825 | a.frame(d == 1 ? f[0] : f); 1826 | if (k == a.duration) { 1827 | delete b.effect; 1828 | g.data(b); 1829 | a.complete && a.complete(); 1830 | } else window.requestAnim(j); 1831 | } 1832 | }, 1833 | l = 0; 1834 | l < d; 1835 | l++ 1836 | ) 1837 | c.push(a.to[l] - a.from[l]); 1838 | b.effect = f.extend( 1839 | { 1840 | stop: function () { 1841 | e = false; 1842 | }, 1843 | easing: function (a, b, c, d, e) { 1844 | return d * Math.sqrt(1 - (b = b / e - 1) * b) + c; 1845 | }, 1846 | }, 1847 | a 1848 | ); 1849 | this.data(b); 1850 | j(); 1851 | } else delete b.effect; 1852 | }, 1853 | }); 1854 | f.isTouch = t; 1855 | f.mouseEvents = q; 1856 | f.cssPrefix = S; 1857 | f.cssTransitionEnd = function () { 1858 | var a, 1859 | b = document.createElement("fakeelement"), 1860 | c = { 1861 | transition: "transitionend", 1862 | OTransition: "oTransitionEnd", 1863 | MSTransition: "transitionend", 1864 | MozTransition: "transitionend", 1865 | WebkitTransition: "webkitTransitionEnd", 1866 | }; 1867 | for (a in c) if (void 0 !== b.style[a]) return c[a]; 1868 | }; 1869 | f.findPos = C; 1870 | })(jQuery); 1871 | --------------------------------------------------------------------------------