Device | Width | Height | fg object-fit | bg object-fit |
---|---|---|---|---|
Desktop | 1440 | 810 | cover | cover |
Tablet | 1024 | 1024 | cover | cover |
Mobile | 768 | 1024 | contain/cover | cover |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* eslint no-restricted-globals: 0, react/no-did-mount-set-state: 0 */ | |
import PropTypes from 'prop-types' | |
import React from 'react' | |
import styled, { css } from 'styled-components' | |
import Swipeable from 'react-swipeable' | |
// lodash | |
import get from 'lodash.get' | |
import throttle from 'lodash.throttle' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import map from 'lodash.map' | |
import React from 'react' | |
import Viewport from './fullpage-slides-viewport' | |
const slidesData = [{/* slide 0 */}, {/* slide 1 */}, {/* slide 2 */}] | |
const _ = { | |
map, | |
} | |
class App extends React.Component { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import map from 'lodash.map' | |
import React from 'react' | |
import Viewport from './fullpage-slides-viewport' | |
const backgroundData = [{/* slide 0 bg */}, {/* slide 2 bg */}, {/* slide 4 bg */}] | |
const textData = [{/* slide 0 text */}, {/* slide 3 text */}, {/* slide 4 text */}] | |
const _ = { | |
map, | |
} |
Set 1 | Set 2 | Set 3 | |||
---|---|---|---|---|---|
1 | Enter | from previous page | animeEnter | animeEnter | animeEnterFromPrev |
2 | Enter | from next page | reversed animeExit | animeEnter | animeEnterFromNext |
3 | Exit | to next page | animeExit | animeExit | animeExitToNext |
4 | Exit | to previous page | reversed animeEnter | animeExit | animeExitToPrev |
裝置解析度 | 實際可用高度 | |
---|---|---|
iPhone 6,7,8 | 375 x 667 | 559 |
iPhone 6,7,8 Plus | 414 x 736 | 628 |
iPad | 768 x 1024 | 928 |
iPad Pro | 1024 x 1366 | 1270 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import $ from 'jquery' | |
import Util from './util' | |
/** | |
* -------------------------------------------------------------------------- | |
* Bootstrap (v4.0.0): collapse.js | |
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) | |
* -------------------------------------------------------------------------- | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* A pure version of Array.prototype.splice | |
* It will return a new array rather than mutate the array | |
* See: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/splice | |
* @param {Array} array The target array | |
* @param {number} start Index at which to start changing the array | |
* @param {number} deleteCount An integer indicating the number of old array elements to remove | |
* @param {any} items The elements to add to the array, beginning at the start index | |
* @returns {Array} | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function getList() { | |
const list = [1, 2, 0, 3, 4] | |
return Promise.resolve(list) | |
} | |
function task() { | |
return new Promise((resolve, reject) => { | |
getList() | |
.then((list) => { | |
let hasFailure = false |
Ref:
https://developers.google.com/speed/docs/insights/OptimizeImages (Will be deprecated at May 2019) https://developers.google.com/web/fundamentals/performance/optimizing-content-efficiency/image-optimization
Use:
OlderNewer