├── .DS_Store ├── .gitignore ├── Procfile ├── README.md ├── TLD.png ├── api_key.png ├── catalog-info.yaml ├── contentful-exports └── exports.json ├── craco.config.js ├── package-lock.json ├── package.json ├── public ├── favicon.ico ├── index.html ├── logo192.png ├── logo512.png ├── manifest.json └── robots.txt ├── setup.js ├── src ├── .DS_Store ├── App.css ├── App.js ├── App.test.js ├── actions │ └── index.js ├── assets │ ├── css │ │ ├── font-awesome.min.css │ │ ├── main.css │ │ └── theme.css │ ├── dam │ │ ├── .DS_Store │ │ ├── _DSC0009.jpg │ │ ├── _DSC0011-Edit.jpg │ │ ├── _DSC0024-Edit.jpg │ │ ├── _DSC0028-Edit.jpg │ │ ├── _DSC0047-Edit.jpg │ │ ├── _DSC0050.jpg │ │ ├── _DSC0056.jpg │ │ ├── _DSC0060.jpg │ │ ├── cancun-1-2.jpg │ │ ├── cancun-1.jpg │ │ └── kevin parker.jpeg │ ├── fonts │ │ ├── FontAwesome.otf │ │ ├── fontawesome-webfont.eot │ │ ├── fontawesome-webfont.svg │ │ ├── fontawesome-webfont.ttf │ │ ├── fontawesome-webfont.woff │ │ └── fontawesome-webfont.woff2 │ ├── images │ │ ├── banner.jpg │ │ └── contentful-logo.png │ └── js │ │ ├── bootstrap.min.js │ │ ├── demo.js │ │ ├── jquery.min.js │ │ ├── jquery.scrollex.min.js │ │ ├── jquery.scrolly.min.js │ │ ├── main.js │ │ ├── skel.min.js │ │ └── util.js ├── commonSlices │ └── testSlice.js ├── components │ ├── app.js │ ├── asset.js │ ├── call_to_action.js │ ├── footer.js │ ├── header.js │ ├── headline.js │ ├── hero_image.js │ ├── image_carousel.js │ ├── image_with_caption.js │ ├── locale_select.js │ ├── paragraph_with_headline.js │ ├── product_show.js │ ├── product_show2.js │ ├── section.js │ ├── set_of_three.js │ ├── set_of_two.js │ └── text_with_image.js ├── index.css ├── index.js ├── logo.svg ├── reducers │ ├── assets_reducer.js │ ├── index.js │ └── products_reducer.js ├── reportWebVitals.js ├── routes.js └── setupTests.js ├── tailwind.config.js ├── winning-demo-content-model-simple.png └── winning-demo-content-model.png /.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/contentful/The-Learning-Demo/5f990cfc6e8b9a1ec67d2777564174056dfb24e8/.DS_Store -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Logs 2 | logs 3 | *.log 4 | npm-debug.log* 5 | 6 | # Compiled binary addons (http://nodejs.org/api/addons.html) 7 | build/Release 8 | 9 | # Dependency directories 10 | node_modules/ 11 | 12 | # Optional npm cache directory 13 | .npm 14 | 15 | # Optional eslint cache 16 | .eslintcache 17 | 18 | # Optional REPL history 19 | .node_repl_history 20 | 21 | # Output of 'npm pack' 22 | *.tgz 23 | 24 | # build folder 25 | #public 26 | 27 | # secrets 28 | .contentful.json 29 | .env* 30 | !.env.example 31 | .env 32 | *config.js 33 | 34 | # contentful cli 35 | contentful-import* 36 | country-codes.json 37 | -------------------------------------------------------------------------------- /Procfile: -------------------------------------------------------------------------------- 1 | web: node ./node_modules/webpack-dev-server/bin/webpack-dev-server.js 2 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Contentful Learning Demo(CRA-Version) 2 | 3 | ### Installation prerequisites 4 | 5 | We recommend installing this demo app in an empty space - it will create 15 content types during installation. Node.js 12.18.1 or greater is recommended. 6 | 7 | ![TLD](./TLD.png) 8 | 9 | ### Get the source code and install dependencies. 10 | 11 | ``` 12 | $ git clone https://github.com/contentful/The-Learning-Demo.git . 13 | $ npm install 14 | ``` 15 | 16 | ### Run the installation script 17 | 18 | ``` 19 | $ npm run setup 20 | ``` 21 | 22 | ### Important! Give your API key access to the new demo environment 23 | 24 | ![API key](./api_key.png) 25 | 26 | ### Run in the project locally 27 | 28 | ``` 29 | $ npm run start 30 | ``` 31 | 32 | ### View the app in a browser 33 | 34 | ``` 35 | http://localhost:3000/ 36 | ``` 37 | 38 | ## Content model 39 | 40 | ![Content model simple](./winning-demo-content-model-simple.png) 41 | 42 | ![Content model full](./winning-demo-content-model.png) 43 | -------------------------------------------------------------------------------- /TLD.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/contentful/The-Learning-Demo/5f990cfc6e8b9a1ec67d2777564174056dfb24e8/TLD.png -------------------------------------------------------------------------------- /api_key.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/contentful/The-Learning-Demo/5f990cfc6e8b9a1ec67d2777564174056dfb24e8/api_key.png -------------------------------------------------------------------------------- /catalog-info.yaml: -------------------------------------------------------------------------------- 1 | # Backstage documentation 2 | # https://backstage.io/docs/features/software-catalog/descriptor-format/ 3 | 4 | # !!! WARNING !!! 5 | # This is a template file with a number of fields that need to be filled before merging this to the default branch 6 | apiVersion: backstage.io/v1alpha1 7 | # Component, API, Template, Group, User, Resource, System, Domain, Location 8 | kind: unknown 9 | metadata: 10 | name: The-Learning-Demo 11 | description: unknown 12 | annotations: 13 | github.com/project-slug: contentful/The-Learning-Demo 14 | contentful.com/service-tier: "unknown" #1, 2, 3, 4 15 | 16 | tags: 17 | - update-me 18 | #need to add sast.yaml to .github/workflows and enable it in polaris dashboard 19 | #once that is done this can be changed to sast-enabled 20 | - sast-disabled 21 | #make this match the value from service-tier above 22 | - tier-unknown 23 | spec: 24 | #cli, component, contentful.com/template, documentation, function, library, service, template, website 25 | type: unknown 26 | #deprecated, experimental, production, unknown 27 | lifecycle: unknown 28 | system: unknown #optional 29 | # your team name as it appears in github when tagging them for reviews 30 | owner: group:team-unknown -------------------------------------------------------------------------------- /craco.config.js: -------------------------------------------------------------------------------- 1 | // craco.config.js 2 | module.exports = { 3 | style: { 4 | postcss: { 5 | plugins: [ 6 | require('tailwindcss'), 7 | require('autoprefixer'), 8 | ], 9 | }, 10 | }, 11 | } -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "learning-demo2", 3 | "version": "0.1.0", 4 | "private": true, 5 | "dependencies": { 6 | "@craco/craco": "^6.1.2", 7 | "@reduxjs/toolkit": "^1.6.0", 8 | "@testing-library/jest-dom": "^5.14.1", 9 | "@testing-library/react": "^11.2.7", 10 | "@testing-library/user-event": "^12.8.3", 11 | "axios": "^0.28.0", 12 | "bulma": "^0.9.3", 13 | "compression": "^1.7.4", 14 | "contentful": "^8.4.2", 15 | "contentful-management": "^7.25.1", 16 | "dotenv": "^10.0.0", 17 | "inquirer": "^8.1.1", 18 | "marked": "^2.1.1", 19 | "react": "^17.0.2", 20 | "react-app-polyfill": "^2.0.0", 21 | "react-dom": "^17.0.2", 22 | "react-json-view": "^1.21.3", 23 | "react-redux": "^7.2.4", 24 | "react-remarkable": "^1.1.3", 25 | "react-router": "^5.2.0", 26 | "react-router-dom": "^5.2.0", 27 | "react-scripts": "5.0.1", 28 | "react-slick": "^0.28.1", 29 | "react-spinkit": "^3.0.0", 30 | "react-text-truncate": "^0.16.0", 31 | "redux": "^4.1.0", 32 | "redux-persist": "^6.0.0", 33 | "redux-persist-transform-encrypt": "^5.1.1", 34 | "redux-promise": "^0.6.0", 35 | "web-vitals": "^1.1.2" 36 | }, 37 | "scripts": { 38 | "setup": "node setup.js", 39 | "start": "craco start", 40 | "build": "craco build", 41 | "test": "craco test", 42 | "eject": "react-scripts eject" 43 | }, 44 | "eslintConfig": { 45 | "extends": [ 46 | "react-app", 47 | "react-app/jest" 48 | ] 49 | }, 50 | "browserslist": { 51 | "production": [ 52 | ">0.2%", 53 | "not dead", 54 | "not op_mini all" 55 | ], 56 | "development": [ 57 | "last 1 chrome version", 58 | "last 1 firefox version", 59 | "last 1 safari version" 60 | ] 61 | }, 62 | "devDependencies": { 63 | "autoprefixer": "^9.8.6", 64 | "contentful-import": "^8.1.16", 65 | "postcss": "^8.4.31", 66 | "tailwindcss": "npm:@tailwindcss/postcss7-compat@^2.2.2" 67 | } 68 | } 69 | -------------------------------------------------------------------------------- /public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/contentful/The-Learning-Demo/5f990cfc6e8b9a1ec67d2777564174056dfb24e8/public/favicon.ico -------------------------------------------------------------------------------- /public/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 12 | 13 | 14 | 15 | 16 | 17 | 21 | 22 | 31 | The Learning Demo 3.0 with CRA 32 | 33 | 34 | 35 |
36 | 46 | 47 | 48 | -------------------------------------------------------------------------------- /public/logo192.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/contentful/The-Learning-Demo/5f990cfc6e8b9a1ec67d2777564174056dfb24e8/public/logo192.png -------------------------------------------------------------------------------- /public/logo512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/contentful/The-Learning-Demo/5f990cfc6e8b9a1ec67d2777564174056dfb24e8/public/logo512.png -------------------------------------------------------------------------------- /public/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "short_name": "React App", 3 | "name": "Create React App Sample", 4 | "icons": [ 5 | { 6 | "src": "favicon.ico", 7 | "sizes": "64x64 32x32 24x24 16x16", 8 | "type": "image/x-icon" 9 | }, 10 | { 11 | "src": "logo192.png", 12 | "type": "image/png", 13 | "sizes": "192x192" 14 | }, 15 | { 16 | "src": "logo512.png", 17 | "type": "image/png", 18 | "sizes": "512x512" 19 | } 20 | ], 21 | "start_url": ".", 22 | "display": "standalone", 23 | "theme_color": "#000000", 24 | "background_color": "#ffffff" 25 | } 26 | -------------------------------------------------------------------------------- /public/robots.txt: -------------------------------------------------------------------------------- 1 | # https://www.robotstxt.org/robotstxt.html 2 | User-agent: * 3 | Disallow: 4 | -------------------------------------------------------------------------------- /setup.js: -------------------------------------------------------------------------------- 1 | require("dotenv").config(); 2 | const contentful = require("contentful-management"); 3 | const spaceImport = require("contentful-import"); 4 | const exportFile = require("./contentful-exports/exports.json"); 5 | const inquirer = require("inquirer"); 6 | const chalk = require("chalk"); 7 | const path = require("path"); 8 | const { writeFileSync } = require("fs"); 9 | 10 | const argv = require("yargs-parser")(process.argv.slice(2)); 11 | 12 | console.log(` 13 | To set up this project you need to provide your Space ID 14 | and the belonging API access tokens. 15 | 16 | You can find all the needed information in your Contentful space under: 17 | 18 | ${chalk.yellow( 19 | `app.contentful.com ${chalk.red("->")} Space Settings ${chalk.red( 20 | "->" 21 | )} API keys` 22 | )} 23 | 24 | The ${chalk.green("Content Delivery API Token")} 25 | will be used to ship published production-ready content in your Gatsby app. 26 | 27 | Ready? Let's do it! 🎉 28 | 29 | The ${chalk.green("Content Management API Token")} 30 | will be used to import and write data to your space. 31 | 32 | 33 | `); 34 | 35 | const questions = [ 36 | { 37 | name: "spaceId", 38 | message: "Your Space ID", 39 | when: !argv.spaceId && !process.env.CF_TLD_SPACE_ID, 40 | validate: (input) => 41 | /^[a-z0-9]{12}$/.test(input) || 42 | "Space ID must be 12 lowercase characters", 43 | }, 44 | { 45 | name: "accessToken", 46 | when: !argv.accessToken && !process.env.CF_TLD_ACCESS_TOKEN, 47 | message: "Your Content Delivery API access token", 48 | }, 49 | { 50 | name: "managementToken", 51 | when: !argv.managementToken, 52 | message: "Your Content Management API access token", 53 | }, 54 | ]; 55 | 56 | inquirer 57 | .prompt(questions) 58 | .then(({ spaceId, managementToken, accessToken }) => { 59 | const { CF_TLD_SPACE_ID, CF_TLD_ACCESS_TOKEN } = process.env; 60 | 61 | // env vars are given precedence followed by args provided to the setup 62 | // followed by input given to prompts displayed by the setup script 63 | spaceId = CF_TLD_SPACE_ID || argv.spaceId || spaceId; 64 | managementToken = argv.managementToken || managementToken; 65 | accessToken = CF_TLD_ACCESS_TOKEN || argv.accessToken || accessToken; 66 | 67 | console.log("Writing config file..."); 68 | const configFiles = [`config.js`].map((file) => 69 | path.join(__dirname, "src", "components", file) 70 | ); 71 | 72 | const fileContents = 73 | [ 74 | `// All environment variables will be sourced`, 75 | `// Do NOT commit this file to source control`, 76 | `module.exports = {`, 77 | `space_id: '${spaceId}',`, 78 | `delivery_token: '${accessToken}',`, 79 | `environment: 'demo'`, 80 | `}`, 81 | ].join("\n") + "\n"; 82 | 83 | configFiles.forEach((file) => { 84 | writeFileSync(file, fileContents, "utf8"); 85 | console.log(`Config file ${chalk.yellow(file)} written`); 86 | }); 87 | return { spaceId, managementToken }; 88 | }) 89 | .then(({ spaceId, managementToken }) => { 90 | spaceImport({ 91 | spaceId: spaceId, 92 | managementToken: managementToken, 93 | content: exportFile, 94 | }).then(() => { 95 | const client = contentful.createClient({ 96 | accessToken: managementToken, 97 | }); 98 | client 99 | .getSpace(spaceId) 100 | .then((space) => 101 | space.createEnvironmentWithId("demo", { name: "Demo" }) 102 | ) 103 | .then((environment) => console.log("Demo environment created")) 104 | .then((_, error) => { 105 | console.log( 106 | `All set! Make sure to give your API key access to your new demo environment. You can now run ${chalk.yellow( 107 | "npm run dev" 108 | )} and bring up the app in a browser ${chalk.yellow( 109 | "http://localhost:8080" 110 | )} .` 111 | ); 112 | }) 113 | .catch(console.error); 114 | }); 115 | }) 116 | .catch((error) => console.error(error)); 117 | -------------------------------------------------------------------------------- /src/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/contentful/The-Learning-Demo/5f990cfc6e8b9a1ec67d2777564174056dfb24e8/src/.DS_Store -------------------------------------------------------------------------------- /src/App.css: -------------------------------------------------------------------------------- 1 | .App { 2 | text-align: center; 3 | } 4 | 5 | .App-logo { 6 | height: 40vmin; 7 | pointer-events: none; 8 | } 9 | 10 | @media (prefers-reduced-motion: no-preference) { 11 | .App-logo { 12 | animation: App-logo-spin infinite 20s linear; 13 | } 14 | } 15 | 16 | .App-header { 17 | background-color: #282c34; 18 | min-height: 100vh; 19 | display: flex; 20 | flex-direction: column; 21 | align-items: center; 22 | justify-content: center; 23 | font-size: calc(10px + 2vmin); 24 | color: white; 25 | } 26 | 27 | .App-link { 28 | color: #61dafb; 29 | } 30 | 31 | @keyframes App-logo-spin { 32 | from { 33 | transform: rotate(0deg); 34 | } 35 | to { 36 | transform: rotate(360deg); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /src/App.js: -------------------------------------------------------------------------------- 1 | import React, { Fragment, Suspense } from "react"; 2 | 3 | import { BrowserRouter, Route, Switch } from "react-router-dom"; 4 | 5 | import Routes from "./routes"; 6 | 7 | function App() { 8 | return ( 9 | 10 | }> 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | ); 20 | } 21 | 22 | // serviceWorker.register(); 23 | 24 | export default App; 25 | -------------------------------------------------------------------------------- /src/App.test.js: -------------------------------------------------------------------------------- 1 | import { render, screen } from '@testing-library/react'; 2 | import App from './App'; 3 | 4 | test('renders learn react link', () => { 5 | render(); 6 | const linkElement = screen.getByText(/learn react/i); 7 | expect(linkElement).toBeInTheDocument(); 8 | }); 9 | -------------------------------------------------------------------------------- /src/actions/index.js: -------------------------------------------------------------------------------- 1 | import axios from 'axios'; 2 | 3 | export const FETCH_PRODUCTS = 'FETCH_PRODUCTS'; 4 | export const FETCH_PRODUCT = 'FETCH_PRODUCT'; 5 | export const FETCH_ASSET = 'FETCH_ASSET'; 6 | 7 | const API_BASE_URL = "" 8 | const API_SPACE_ID = "" 9 | const API_TOKEN = "" 10 | 11 | 12 | 13 | export function fetchProducts() { 14 | const request = axios.get(`${API_BASE_URL}/spaces/${API_SPACE_ID}/entries?access_token=${API_TOKEN}&content_type=product&order=-sys.updatedAt`); 15 | // const request = contentfulClient.getEntries({content_type: 'product'}) 16 | return { 17 | type: FETCH_PRODUCTS, 18 | payload: request 19 | }; 20 | } 21 | export function fetchProduct(id) { 22 | const request = axios.get(`${API_BASE_URL}/spaces/${API_SPACE_ID}/entries/${id}?access_token=${API_TOKEN}&content_type=product`); 23 | return { 24 | type: FETCH_PRODUCT, 25 | payload: request 26 | }; 27 | } 28 | export function fetchAsset(id) { 29 | const request = axios.get(`${API_BASE_URL}/spaces/${API_SPACE_ID}/assets/${id}?access_token=${API_TOKEN}`); 30 | 31 | return { 32 | type: FETCH_ASSET, 33 | payload: request 34 | }; 35 | } 36 | -------------------------------------------------------------------------------- /src/assets/css/font-awesome.min.css: -------------------------------------------------------------------------------- 1 | /*! 2 | * Font Awesome 4.6.3 by @davegandy - http://fontawesome.io - @fontawesome 3 | * License - http://fontawesome.io/license (Font: SIL OFL 1.1, CSS: MIT License) 4 | */@font-face{font-family:'FontAwesome';src:url('../fonts/fontawesome-webfont.eot?v=4.6.3');src:url('../fonts/fontawesome-webfont.eot?#iefix&v=4.6.3') format('embedded-opentype'),url('../fonts/fontawesome-webfont.woff2?v=4.6.3') format('woff2'),url('../fonts/fontawesome-webfont.woff?v=4.6.3') format('woff'),url('../fonts/fontawesome-webfont.ttf?v=4.6.3') format('truetype'),url('../fonts/fontawesome-webfont.svg?v=4.6.3#fontawesomeregular') format('svg');font-weight:normal;font-style:normal}.fa{display:inline-block;font:normal normal normal 14px/1 FontAwesome;font-size:inherit;text-rendering:auto;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.fa-lg{font-size:1.33333333em;line-height:.75em;vertical-align:-15%}.fa-2x{font-size:2em}.fa-3x{font-size:3em}.fa-4x{font-size:4em}.fa-5x{font-size:5em}.fa-fw{width:1.28571429em;text-align:center}.fa-ul{padding-left:0;margin-left:2.14285714em;list-style-type:none}.fa-ul>li{position:relative}.fa-li{position:absolute;left:-2.14285714em;width:2.14285714em;top:.14285714em;text-align:center}.fa-li.fa-lg{left:-1.85714286em}.fa-border{padding:.2em .25em .15em;border:solid .08em #eee;border-radius:.1em}.fa-pull-left{float:left}.fa-pull-right{float:right}.fa.fa-pull-left{margin-right:.3em}.fa.fa-pull-right{margin-left:.3em}.pull-right{float:right}.pull-left{float:left}.fa.pull-left{margin-right:.3em}.fa.pull-right{margin-left:.3em}.fa-spin{-webkit-animation:fa-spin 2s infinite linear;animation:fa-spin 2s infinite linear}.fa-pulse{-webkit-animation:fa-spin 1s infinite steps(8);animation:fa-spin 1s infinite steps(8)}@-webkit-keyframes fa-spin{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}100%{-webkit-transform:rotate(359deg);transform:rotate(359deg)}}@keyframes fa-spin{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}100%{-webkit-transform:rotate(359deg);transform:rotate(359deg)}}.fa-rotate-90{-ms-filter:"progid:DXImageTransform.Microsoft.BasicImage(rotation=1)";-webkit-transform:rotate(90deg);-ms-transform:rotate(90deg);transform:rotate(90deg)}.fa-rotate-180{-ms-filter:"progid:DXImageTransform.Microsoft.BasicImage(rotation=2)";-webkit-transform:rotate(180deg);-ms-transform:rotate(180deg);transform:rotate(180deg)}.fa-rotate-270{-ms-filter:"progid:DXImageTransform.Microsoft.BasicImage(rotation=3)";-webkit-transform:rotate(270deg);-ms-transform:rotate(270deg);transform:rotate(270deg)}.fa-flip-horizontal{-ms-filter:"progid:DXImageTransform.Microsoft.BasicImage(rotation=0, mirror=1)";-webkit-transform:scale(-1, 1);-ms-transform:scale(-1, 1);transform:scale(-1, 1)}.fa-flip-vertical{-ms-filter:"progid:DXImageTransform.Microsoft.BasicImage(rotation=2, mirror=1)";-webkit-transform:scale(1, -1);-ms-transform:scale(1, -1);transform:scale(1, -1)}:root .fa-rotate-90,:root .fa-rotate-180,:root .fa-rotate-270,:root .fa-flip-horizontal,:root .fa-flip-vertical{filter:none}.fa-stack{position:relative;display:inline-block;width:2em;height:2em;line-height:2em;vertical-align:middle}.fa-stack-1x,.fa-stack-2x{position:absolute;left:0;width:100%;text-align:center}.fa-stack-1x{line-height:inherit}.fa-stack-2x{font-size:2em}.fa-inverse{color:#fff}.fa-glass:before{content:"\f000"}.fa-music:before{content:"\f001"}.fa-search:before{content:"\f002"}.fa-envelope-o:before{content:"\f003"}.fa-heart:before{content:"\f004"}.fa-star:before{content:"\f005"}.fa-star-o:before{content:"\f006"}.fa-user:before{content:"\f007"}.fa-film:before{content:"\f008"}.fa-th-large:before{content:"\f009"}.fa-th:before{content:"\f00a"}.fa-th-list:before{content:"\f00b"}.fa-check:before{content:"\f00c"}.fa-remove:before,.fa-close:before,.fa-times:before{content:"\f00d"}.fa-search-plus:before{content:"\f00e"}.fa-search-minus:before{content:"\f010"}.fa-power-off:before{content:"\f011"}.fa-signal:before{content:"\f012"}.fa-gear:before,.fa-cog:before{content:"\f013"}.fa-trash-o:before{content:"\f014"}.fa-home:before{content:"\f015"}.fa-file-o:before{content:"\f016"}.fa-clock-o:before{content:"\f017"}.fa-road:before{content:"\f018"}.fa-download:before{content:"\f019"}.fa-arrow-circle-o-down:before{content:"\f01a"}.fa-arrow-circle-o-up:before{content:"\f01b"}.fa-inbox:before{content:"\f01c"}.fa-play-circle-o:before{content:"\f01d"}.fa-rotate-right:before,.fa-repeat:before{content:"\f01e"}.fa-refresh:before{content:"\f021"}.fa-list-alt:before{content:"\f022"}.fa-lock:before{content:"\f023"}.fa-flag:before{content:"\f024"}.fa-headphones:before{content:"\f025"}.fa-volume-off:before{content:"\f026"}.fa-volume-down:before{content:"\f027"}.fa-volume-up:before{content:"\f028"}.fa-qrcode:before{content:"\f029"}.fa-barcode:before{content:"\f02a"}.fa-tag:before{content:"\f02b"}.fa-tags:before{content:"\f02c"}.fa-book:before{content:"\f02d"}.fa-bookmark:before{content:"\f02e"}.fa-print:before{content:"\f02f"}.fa-camera:before{content:"\f030"}.fa-font:before{content:"\f031"}.fa-bold:before{content:"\f032"}.fa-italic:before{content:"\f033"}.fa-text-height:before{content:"\f034"}.fa-text-width:before{content:"\f035"}.fa-align-left:before{content:"\f036"}.fa-align-center:before{content:"\f037"}.fa-align-right:before{content:"\f038"}.fa-align-justify:before{content:"\f039"}.fa-list:before{content:"\f03a"}.fa-dedent:before,.fa-outdent:before{content:"\f03b"}.fa-indent:before{content:"\f03c"}.fa-video-camera:before{content:"\f03d"}.fa-photo:before,.fa-image:before,.fa-picture-o:before{content:"\f03e"}.fa-pencil:before{content:"\f040"}.fa-map-marker:before{content:"\f041"}.fa-adjust:before{content:"\f042"}.fa-tint:before{content:"\f043"}.fa-edit:before,.fa-pencil-square-o:before{content:"\f044"}.fa-share-square-o:before{content:"\f045"}.fa-check-square-o:before{content:"\f046"}.fa-arrows:before{content:"\f047"}.fa-step-backward:before{content:"\f048"}.fa-fast-backward:before{content:"\f049"}.fa-backward:before{content:"\f04a"}.fa-play:before{content:"\f04b"}.fa-pause:before{content:"\f04c"}.fa-stop:before{content:"\f04d"}.fa-forward:before{content:"\f04e"}.fa-fast-forward:before{content:"\f050"}.fa-step-forward:before{content:"\f051"}.fa-eject:before{content:"\f052"}.fa-chevron-left:before{content:"\f053"}.fa-chevron-right:before{content:"\f054"}.fa-plus-circle:before{content:"\f055"}.fa-minus-circle:before{content:"\f056"}.fa-times-circle:before{content:"\f057"}.fa-check-circle:before{content:"\f058"}.fa-question-circle:before{content:"\f059"}.fa-info-circle:before{content:"\f05a"}.fa-crosshairs:before{content:"\f05b"}.fa-times-circle-o:before{content:"\f05c"}.fa-check-circle-o:before{content:"\f05d"}.fa-ban:before{content:"\f05e"}.fa-arrow-left:before{content:"\f060"}.fa-arrow-right:before{content:"\f061"}.fa-arrow-up:before{content:"\f062"}.fa-arrow-down:before{content:"\f063"}.fa-mail-forward:before,.fa-share:before{content:"\f064"}.fa-expand:before{content:"\f065"}.fa-compress:before{content:"\f066"}.fa-plus:before{content:"\f067"}.fa-minus:before{content:"\f068"}.fa-asterisk:before{content:"\f069"}.fa-exclamation-circle:before{content:"\f06a"}.fa-gift:before{content:"\f06b"}.fa-leaf:before{content:"\f06c"}.fa-fire:before{content:"\f06d"}.fa-eye:before{content:"\f06e"}.fa-eye-slash:before{content:"\f070"}.fa-warning:before,.fa-exclamation-triangle:before{content:"\f071"}.fa-plane:before{content:"\f072"}.fa-calendar:before{content:"\f073"}.fa-random:before{content:"\f074"}.fa-comment:before{content:"\f075"}.fa-magnet:before{content:"\f076"}.fa-chevron-up:before{content:"\f077"}.fa-chevron-down:before{content:"\f078"}.fa-retweet:before{content:"\f079"}.fa-shopping-cart:before{content:"\f07a"}.fa-folder:before{content:"\f07b"}.fa-folder-open:before{content:"\f07c"}.fa-arrows-v:before{content:"\f07d"}.fa-arrows-h:before{content:"\f07e"}.fa-bar-chart-o:before,.fa-bar-chart:before{content:"\f080"}.fa-twitter-square:before{content:"\f081"}.fa-facebook-square:before{content:"\f082"}.fa-camera-retro:before{content:"\f083"}.fa-key:before{content:"\f084"}.fa-gears:before,.fa-cogs:before{content:"\f085"}.fa-comments:before{content:"\f086"}.fa-thumbs-o-up:before{content:"\f087"}.fa-thumbs-o-down:before{content:"\f088"}.fa-star-half:before{content:"\f089"}.fa-heart-o:before{content:"\f08a"}.fa-sign-out:before{content:"\f08b"}.fa-linkedin-square:before{content:"\f08c"}.fa-thumb-tack:before{content:"\f08d"}.fa-external-link:before{content:"\f08e"}.fa-sign-in:before{content:"\f090"}.fa-trophy:before{content:"\f091"}.fa-github-square:before{content:"\f092"}.fa-upload:before{content:"\f093"}.fa-lemon-o:before{content:"\f094"}.fa-phone:before{content:"\f095"}.fa-square-o:before{content:"\f096"}.fa-bookmark-o:before{content:"\f097"}.fa-phone-square:before{content:"\f098"}.fa-twitter:before{content:"\f099"}.fa-facebook-f:before,.fa-facebook:before{content:"\f09a"}.fa-github:before{content:"\f09b"}.fa-unlock:before{content:"\f09c"}.fa-credit-card:before{content:"\f09d"}.fa-feed:before,.fa-rss:before{content:"\f09e"}.fa-hdd-o:before{content:"\f0a0"}.fa-bullhorn:before{content:"\f0a1"}.fa-bell:before{content:"\f0f3"}.fa-certificate:before{content:"\f0a3"}.fa-hand-o-right:before{content:"\f0a4"}.fa-hand-o-left:before{content:"\f0a5"}.fa-hand-o-up:before{content:"\f0a6"}.fa-hand-o-down:before{content:"\f0a7"}.fa-arrow-circle-left:before{content:"\f0a8"}.fa-arrow-circle-right:before{content:"\f0a9"}.fa-arrow-circle-up:before{content:"\f0aa"}.fa-arrow-circle-down:before{content:"\f0ab"}.fa-globe:before{content:"\f0ac"}.fa-wrench:before{content:"\f0ad"}.fa-tasks:before{content:"\f0ae"}.fa-filter:before{content:"\f0b0"}.fa-briefcase:before{content:"\f0b1"}.fa-arrows-alt:before{content:"\f0b2"}.fa-group:before,.fa-users:before{content:"\f0c0"}.fa-chain:before,.fa-link:before{content:"\f0c1"}.fa-cloud:before{content:"\f0c2"}.fa-flask:before{content:"\f0c3"}.fa-cut:before,.fa-scissors:before{content:"\f0c4"}.fa-copy:before,.fa-files-o:before{content:"\f0c5"}.fa-paperclip:before{content:"\f0c6"}.fa-save:before,.fa-floppy-o:before{content:"\f0c7"}.fa-square:before{content:"\f0c8"}.fa-navicon:before,.fa-reorder:before,.fa-bars:before{content:"\f0c9"}.fa-list-ul:before{content:"\f0ca"}.fa-list-ol:before{content:"\f0cb"}.fa-strikethrough:before{content:"\f0cc"}.fa-underline:before{content:"\f0cd"}.fa-table:before{content:"\f0ce"}.fa-magic:before{content:"\f0d0"}.fa-truck:before{content:"\f0d1"}.fa-pinterest:before{content:"\f0d2"}.fa-pinterest-square:before{content:"\f0d3"}.fa-google-plus-square:before{content:"\f0d4"}.fa-google-plus:before{content:"\f0d5"}.fa-money:before{content:"\f0d6"}.fa-caret-down:before{content:"\f0d7"}.fa-caret-up:before{content:"\f0d8"}.fa-caret-left:before{content:"\f0d9"}.fa-caret-right:before{content:"\f0da"}.fa-columns:before{content:"\f0db"}.fa-unsorted:before,.fa-sort:before{content:"\f0dc"}.fa-sort-down:before,.fa-sort-desc:before{content:"\f0dd"}.fa-sort-up:before,.fa-sort-asc:before{content:"\f0de"}.fa-envelope:before{content:"\f0e0"}.fa-linkedin:before{content:"\f0e1"}.fa-rotate-left:before,.fa-undo:before{content:"\f0e2"}.fa-legal:before,.fa-gavel:before{content:"\f0e3"}.fa-dashboard:before,.fa-tachometer:before{content:"\f0e4"}.fa-comment-o:before{content:"\f0e5"}.fa-comments-o:before{content:"\f0e6"}.fa-flash:before,.fa-bolt:before{content:"\f0e7"}.fa-sitemap:before{content:"\f0e8"}.fa-umbrella:before{content:"\f0e9"}.fa-paste:before,.fa-clipboard:before{content:"\f0ea"}.fa-lightbulb-o:before{content:"\f0eb"}.fa-exchange:before{content:"\f0ec"}.fa-cloud-download:before{content:"\f0ed"}.fa-cloud-upload:before{content:"\f0ee"}.fa-user-md:before{content:"\f0f0"}.fa-stethoscope:before{content:"\f0f1"}.fa-suitcase:before{content:"\f0f2"}.fa-bell-o:before{content:"\f0a2"}.fa-coffee:before{content:"\f0f4"}.fa-cutlery:before{content:"\f0f5"}.fa-file-text-o:before{content:"\f0f6"}.fa-building-o:before{content:"\f0f7"}.fa-hospital-o:before{content:"\f0f8"}.fa-ambulance:before{content:"\f0f9"}.fa-medkit:before{content:"\f0fa"}.fa-fighter-jet:before{content:"\f0fb"}.fa-beer:before{content:"\f0fc"}.fa-h-square:before{content:"\f0fd"}.fa-plus-square:before{content:"\f0fe"}.fa-angle-double-left:before{content:"\f100"}.fa-angle-double-right:before{content:"\f101"}.fa-angle-double-up:before{content:"\f102"}.fa-angle-double-down:before{content:"\f103"}.fa-angle-left:before{content:"\f104"}.fa-angle-right:before{content:"\f105"}.fa-angle-up:before{content:"\f106"}.fa-angle-down:before{content:"\f107"}.fa-desktop:before{content:"\f108"}.fa-laptop:before{content:"\f109"}.fa-tablet:before{content:"\f10a"}.fa-mobile-phone:before,.fa-mobile:before{content:"\f10b"}.fa-circle-o:before{content:"\f10c"}.fa-quote-left:before{content:"\f10d"}.fa-quote-right:before{content:"\f10e"}.fa-spinner:before{content:"\f110"}.fa-circle:before{content:"\f111"}.fa-mail-reply:before,.fa-reply:before{content:"\f112"}.fa-github-alt:before{content:"\f113"}.fa-folder-o:before{content:"\f114"}.fa-folder-open-o:before{content:"\f115"}.fa-smile-o:before{content:"\f118"}.fa-frown-o:before{content:"\f119"}.fa-meh-o:before{content:"\f11a"}.fa-gamepad:before{content:"\f11b"}.fa-keyboard-o:before{content:"\f11c"}.fa-flag-o:before{content:"\f11d"}.fa-flag-checkered:before{content:"\f11e"}.fa-terminal:before{content:"\f120"}.fa-code:before{content:"\f121"}.fa-mail-reply-all:before,.fa-reply-all:before{content:"\f122"}.fa-star-half-empty:before,.fa-star-half-full:before,.fa-star-half-o:before{content:"\f123"}.fa-location-arrow:before{content:"\f124"}.fa-crop:before{content:"\f125"}.fa-code-fork:before{content:"\f126"}.fa-unlink:before,.fa-chain-broken:before{content:"\f127"}.fa-question:before{content:"\f128"}.fa-info:before{content:"\f129"}.fa-exclamation:before{content:"\f12a"}.fa-superscript:before{content:"\f12b"}.fa-subscript:before{content:"\f12c"}.fa-eraser:before{content:"\f12d"}.fa-puzzle-piece:before{content:"\f12e"}.fa-microphone:before{content:"\f130"}.fa-microphone-slash:before{content:"\f131"}.fa-shield:before{content:"\f132"}.fa-calendar-o:before{content:"\f133"}.fa-fire-extinguisher:before{content:"\f134"}.fa-rocket:before{content:"\f135"}.fa-maxcdn:before{content:"\f136"}.fa-chevron-circle-left:before{content:"\f137"}.fa-chevron-circle-right:before{content:"\f138"}.fa-chevron-circle-up:before{content:"\f139"}.fa-chevron-circle-down:before{content:"\f13a"}.fa-html5:before{content:"\f13b"}.fa-css3:before{content:"\f13c"}.fa-anchor:before{content:"\f13d"}.fa-unlock-alt:before{content:"\f13e"}.fa-bullseye:before{content:"\f140"}.fa-ellipsis-h:before{content:"\f141"}.fa-ellipsis-v:before{content:"\f142"}.fa-rss-square:before{content:"\f143"}.fa-play-circle:before{content:"\f144"}.fa-ticket:before{content:"\f145"}.fa-minus-square:before{content:"\f146"}.fa-minus-square-o:before{content:"\f147"}.fa-level-up:before{content:"\f148"}.fa-level-down:before{content:"\f149"}.fa-check-square:before{content:"\f14a"}.fa-pencil-square:before{content:"\f14b"}.fa-external-link-square:before{content:"\f14c"}.fa-share-square:before{content:"\f14d"}.fa-compass:before{content:"\f14e"}.fa-toggle-down:before,.fa-caret-square-o-down:before{content:"\f150"}.fa-toggle-up:before,.fa-caret-square-o-up:before{content:"\f151"}.fa-toggle-right:before,.fa-caret-square-o-right:before{content:"\f152"}.fa-euro:before,.fa-eur:before{content:"\f153"}.fa-gbp:before{content:"\f154"}.fa-dollar:before,.fa-usd:before{content:"\f155"}.fa-rupee:before,.fa-inr:before{content:"\f156"}.fa-cny:before,.fa-rmb:before,.fa-yen:before,.fa-jpy:before{content:"\f157"}.fa-ruble:before,.fa-rouble:before,.fa-rub:before{content:"\f158"}.fa-won:before,.fa-krw:before{content:"\f159"}.fa-bitcoin:before,.fa-btc:before{content:"\f15a"}.fa-file:before{content:"\f15b"}.fa-file-text:before{content:"\f15c"}.fa-sort-alpha-asc:before{content:"\f15d"}.fa-sort-alpha-desc:before{content:"\f15e"}.fa-sort-amount-asc:before{content:"\f160"}.fa-sort-amount-desc:before{content:"\f161"}.fa-sort-numeric-asc:before{content:"\f162"}.fa-sort-numeric-desc:before{content:"\f163"}.fa-thumbs-up:before{content:"\f164"}.fa-thumbs-down:before{content:"\f165"}.fa-youtube-square:before{content:"\f166"}.fa-youtube:before{content:"\f167"}.fa-xing:before{content:"\f168"}.fa-xing-square:before{content:"\f169"}.fa-youtube-play:before{content:"\f16a"}.fa-dropbox:before{content:"\f16b"}.fa-stack-overflow:before{content:"\f16c"}.fa-instagram:before{content:"\f16d"}.fa-flickr:before{content:"\f16e"}.fa-adn:before{content:"\f170"}.fa-bitbucket:before{content:"\f171"}.fa-bitbucket-square:before{content:"\f172"}.fa-tumblr:before{content:"\f173"}.fa-tumblr-square:before{content:"\f174"}.fa-long-arrow-down:before{content:"\f175"}.fa-long-arrow-up:before{content:"\f176"}.fa-long-arrow-left:before{content:"\f177"}.fa-long-arrow-right:before{content:"\f178"}.fa-apple:before{content:"\f179"}.fa-windows:before{content:"\f17a"}.fa-android:before{content:"\f17b"}.fa-linux:before{content:"\f17c"}.fa-dribbble:before{content:"\f17d"}.fa-skype:before{content:"\f17e"}.fa-foursquare:before{content:"\f180"}.fa-trello:before{content:"\f181"}.fa-female:before{content:"\f182"}.fa-male:before{content:"\f183"}.fa-gittip:before,.fa-gratipay:before{content:"\f184"}.fa-sun-o:before{content:"\f185"}.fa-moon-o:before{content:"\f186"}.fa-archive:before{content:"\f187"}.fa-bug:before{content:"\f188"}.fa-vk:before{content:"\f189"}.fa-weibo:before{content:"\f18a"}.fa-renren:before{content:"\f18b"}.fa-pagelines:before{content:"\f18c"}.fa-stack-exchange:before{content:"\f18d"}.fa-arrow-circle-o-right:before{content:"\f18e"}.fa-arrow-circle-o-left:before{content:"\f190"}.fa-toggle-left:before,.fa-caret-square-o-left:before{content:"\f191"}.fa-dot-circle-o:before{content:"\f192"}.fa-wheelchair:before{content:"\f193"}.fa-vimeo-square:before{content:"\f194"}.fa-turkish-lira:before,.fa-try:before{content:"\f195"}.fa-plus-square-o:before{content:"\f196"}.fa-space-shuttle:before{content:"\f197"}.fa-slack:before{content:"\f198"}.fa-envelope-square:before{content:"\f199"}.fa-wordpress:before{content:"\f19a"}.fa-openid:before{content:"\f19b"}.fa-institution:before,.fa-bank:before,.fa-university:before{content:"\f19c"}.fa-mortar-board:before,.fa-graduation-cap:before{content:"\f19d"}.fa-yahoo:before{content:"\f19e"}.fa-google:before{content:"\f1a0"}.fa-reddit:before{content:"\f1a1"}.fa-reddit-square:before{content:"\f1a2"}.fa-stumbleupon-circle:before{content:"\f1a3"}.fa-stumbleupon:before{content:"\f1a4"}.fa-delicious:before{content:"\f1a5"}.fa-digg:before{content:"\f1a6"}.fa-pied-piper-pp:before{content:"\f1a7"}.fa-pied-piper-alt:before{content:"\f1a8"}.fa-drupal:before{content:"\f1a9"}.fa-joomla:before{content:"\f1aa"}.fa-language:before{content:"\f1ab"}.fa-fax:before{content:"\f1ac"}.fa-building:before{content:"\f1ad"}.fa-child:before{content:"\f1ae"}.fa-paw:before{content:"\f1b0"}.fa-spoon:before{content:"\f1b1"}.fa-cube:before{content:"\f1b2"}.fa-cubes:before{content:"\f1b3"}.fa-behance:before{content:"\f1b4"}.fa-behance-square:before{content:"\f1b5"}.fa-steam:before{content:"\f1b6"}.fa-steam-square:before{content:"\f1b7"}.fa-recycle:before{content:"\f1b8"}.fa-automobile:before,.fa-car:before{content:"\f1b9"}.fa-cab:before,.fa-taxi:before{content:"\f1ba"}.fa-tree:before{content:"\f1bb"}.fa-spotify:before{content:"\f1bc"}.fa-deviantart:before{content:"\f1bd"}.fa-soundcloud:before{content:"\f1be"}.fa-database:before{content:"\f1c0"}.fa-file-pdf-o:before{content:"\f1c1"}.fa-file-word-o:before{content:"\f1c2"}.fa-file-excel-o:before{content:"\f1c3"}.fa-file-powerpoint-o:before{content:"\f1c4"}.fa-file-photo-o:before,.fa-file-picture-o:before,.fa-file-image-o:before{content:"\f1c5"}.fa-file-zip-o:before,.fa-file-archive-o:before{content:"\f1c6"}.fa-file-sound-o:before,.fa-file-audio-o:before{content:"\f1c7"}.fa-file-movie-o:before,.fa-file-video-o:before{content:"\f1c8"}.fa-file-code-o:before{content:"\f1c9"}.fa-vine:before{content:"\f1ca"}.fa-codepen:before{content:"\f1cb"}.fa-jsfiddle:before{content:"\f1cc"}.fa-life-bouy:before,.fa-life-buoy:before,.fa-life-saver:before,.fa-support:before,.fa-life-ring:before{content:"\f1cd"}.fa-circle-o-notch:before{content:"\f1ce"}.fa-ra:before,.fa-resistance:before,.fa-rebel:before{content:"\f1d0"}.fa-ge:before,.fa-empire:before{content:"\f1d1"}.fa-git-square:before{content:"\f1d2"}.fa-git:before{content:"\f1d3"}.fa-y-combinator-square:before,.fa-yc-square:before,.fa-hacker-news:before{content:"\f1d4"}.fa-tencent-weibo:before{content:"\f1d5"}.fa-qq:before{content:"\f1d6"}.fa-wechat:before,.fa-weixin:before{content:"\f1d7"}.fa-send:before,.fa-paper-plane:before{content:"\f1d8"}.fa-send-o:before,.fa-paper-plane-o:before{content:"\f1d9"}.fa-history:before{content:"\f1da"}.fa-circle-thin:before{content:"\f1db"}.fa-header:before{content:"\f1dc"}.fa-paragraph:before{content:"\f1dd"}.fa-sliders:before{content:"\f1de"}.fa-share-alt:before{content:"\f1e0"}.fa-share-alt-square:before{content:"\f1e1"}.fa-bomb:before{content:"\f1e2"}.fa-soccer-ball-o:before,.fa-futbol-o:before{content:"\f1e3"}.fa-tty:before{content:"\f1e4"}.fa-binoculars:before{content:"\f1e5"}.fa-plug:before{content:"\f1e6"}.fa-slideshare:before{content:"\f1e7"}.fa-twitch:before{content:"\f1e8"}.fa-yelp:before{content:"\f1e9"}.fa-newspaper-o:before{content:"\f1ea"}.fa-wifi:before{content:"\f1eb"}.fa-calculator:before{content:"\f1ec"}.fa-paypal:before{content:"\f1ed"}.fa-google-wallet:before{content:"\f1ee"}.fa-cc-visa:before{content:"\f1f0"}.fa-cc-mastercard:before{content:"\f1f1"}.fa-cc-discover:before{content:"\f1f2"}.fa-cc-amex:before{content:"\f1f3"}.fa-cc-paypal:before{content:"\f1f4"}.fa-cc-stripe:before{content:"\f1f5"}.fa-bell-slash:before{content:"\f1f6"}.fa-bell-slash-o:before{content:"\f1f7"}.fa-trash:before{content:"\f1f8"}.fa-copyright:before{content:"\f1f9"}.fa-at:before{content:"\f1fa"}.fa-eyedropper:before{content:"\f1fb"}.fa-paint-brush:before{content:"\f1fc"}.fa-birthday-cake:before{content:"\f1fd"}.fa-area-chart:before{content:"\f1fe"}.fa-pie-chart:before{content:"\f200"}.fa-line-chart:before{content:"\f201"}.fa-lastfm:before{content:"\f202"}.fa-lastfm-square:before{content:"\f203"}.fa-toggle-off:before{content:"\f204"}.fa-toggle-on:before{content:"\f205"}.fa-bicycle:before{content:"\f206"}.fa-bus:before{content:"\f207"}.fa-ioxhost:before{content:"\f208"}.fa-angellist:before{content:"\f209"}.fa-cc:before{content:"\f20a"}.fa-shekel:before,.fa-sheqel:before,.fa-ils:before{content:"\f20b"}.fa-meanpath:before{content:"\f20c"}.fa-buysellads:before{content:"\f20d"}.fa-connectdevelop:before{content:"\f20e"}.fa-dashcube:before{content:"\f210"}.fa-forumbee:before{content:"\f211"}.fa-leanpub:before{content:"\f212"}.fa-sellsy:before{content:"\f213"}.fa-shirtsinbulk:before{content:"\f214"}.fa-simplybuilt:before{content:"\f215"}.fa-skyatlas:before{content:"\f216"}.fa-cart-plus:before{content:"\f217"}.fa-cart-arrow-down:before{content:"\f218"}.fa-diamond:before{content:"\f219"}.fa-ship:before{content:"\f21a"}.fa-user-secret:before{content:"\f21b"}.fa-motorcycle:before{content:"\f21c"}.fa-street-view:before{content:"\f21d"}.fa-heartbeat:before{content:"\f21e"}.fa-venus:before{content:"\f221"}.fa-mars:before{content:"\f222"}.fa-mercury:before{content:"\f223"}.fa-intersex:before,.fa-transgender:before{content:"\f224"}.fa-transgender-alt:before{content:"\f225"}.fa-venus-double:before{content:"\f226"}.fa-mars-double:before{content:"\f227"}.fa-venus-mars:before{content:"\f228"}.fa-mars-stroke:before{content:"\f229"}.fa-mars-stroke-v:before{content:"\f22a"}.fa-mars-stroke-h:before{content:"\f22b"}.fa-neuter:before{content:"\f22c"}.fa-genderless:before{content:"\f22d"}.fa-facebook-official:before{content:"\f230"}.fa-pinterest-p:before{content:"\f231"}.fa-whatsapp:before{content:"\f232"}.fa-server:before{content:"\f233"}.fa-user-plus:before{content:"\f234"}.fa-user-times:before{content:"\f235"}.fa-hotel:before,.fa-bed:before{content:"\f236"}.fa-viacoin:before{content:"\f237"}.fa-train:before{content:"\f238"}.fa-subway:before{content:"\f239"}.fa-medium:before{content:"\f23a"}.fa-yc:before,.fa-y-combinator:before{content:"\f23b"}.fa-optin-monster:before{content:"\f23c"}.fa-opencart:before{content:"\f23d"}.fa-expeditedssl:before{content:"\f23e"}.fa-battery-4:before,.fa-battery-full:before{content:"\f240"}.fa-battery-3:before,.fa-battery-three-quarters:before{content:"\f241"}.fa-battery-2:before,.fa-battery-half:before{content:"\f242"}.fa-battery-1:before,.fa-battery-quarter:before{content:"\f243"}.fa-battery-0:before,.fa-battery-empty:before{content:"\f244"}.fa-mouse-pointer:before{content:"\f245"}.fa-i-cursor:before{content:"\f246"}.fa-object-group:before{content:"\f247"}.fa-object-ungroup:before{content:"\f248"}.fa-sticky-note:before{content:"\f249"}.fa-sticky-note-o:before{content:"\f24a"}.fa-cc-jcb:before{content:"\f24b"}.fa-cc-diners-club:before{content:"\f24c"}.fa-clone:before{content:"\f24d"}.fa-balance-scale:before{content:"\f24e"}.fa-hourglass-o:before{content:"\f250"}.fa-hourglass-1:before,.fa-hourglass-start:before{content:"\f251"}.fa-hourglass-2:before,.fa-hourglass-half:before{content:"\f252"}.fa-hourglass-3:before,.fa-hourglass-end:before{content:"\f253"}.fa-hourglass:before{content:"\f254"}.fa-hand-grab-o:before,.fa-hand-rock-o:before{content:"\f255"}.fa-hand-stop-o:before,.fa-hand-paper-o:before{content:"\f256"}.fa-hand-scissors-o:before{content:"\f257"}.fa-hand-lizard-o:before{content:"\f258"}.fa-hand-spock-o:before{content:"\f259"}.fa-hand-pointer-o:before{content:"\f25a"}.fa-hand-peace-o:before{content:"\f25b"}.fa-trademark:before{content:"\f25c"}.fa-registered:before{content:"\f25d"}.fa-creative-commons:before{content:"\f25e"}.fa-gg:before{content:"\f260"}.fa-gg-circle:before{content:"\f261"}.fa-tripadvisor:before{content:"\f262"}.fa-odnoklassniki:before{content:"\f263"}.fa-odnoklassniki-square:before{content:"\f264"}.fa-get-pocket:before{content:"\f265"}.fa-wikipedia-w:before{content:"\f266"}.fa-safari:before{content:"\f267"}.fa-chrome:before{content:"\f268"}.fa-firefox:before{content:"\f269"}.fa-opera:before{content:"\f26a"}.fa-internet-explorer:before{content:"\f26b"}.fa-tv:before,.fa-television:before{content:"\f26c"}.fa-contao:before{content:"\f26d"}.fa-500px:before{content:"\f26e"}.fa-amazon:before{content:"\f270"}.fa-calendar-plus-o:before{content:"\f271"}.fa-calendar-minus-o:before{content:"\f272"}.fa-calendar-times-o:before{content:"\f273"}.fa-calendar-check-o:before{content:"\f274"}.fa-industry:before{content:"\f275"}.fa-map-pin:before{content:"\f276"}.fa-map-signs:before{content:"\f277"}.fa-map-o:before{content:"\f278"}.fa-map:before{content:"\f279"}.fa-commenting:before{content:"\f27a"}.fa-commenting-o:before{content:"\f27b"}.fa-houzz:before{content:"\f27c"}.fa-vimeo:before{content:"\f27d"}.fa-black-tie:before{content:"\f27e"}.fa-fonticons:before{content:"\f280"}.fa-reddit-alien:before{content:"\f281"}.fa-edge:before{content:"\f282"}.fa-credit-card-alt:before{content:"\f283"}.fa-codiepie:before{content:"\f284"}.fa-modx:before{content:"\f285"}.fa-fort-awesome:before{content:"\f286"}.fa-usb:before{content:"\f287"}.fa-product-hunt:before{content:"\f288"}.fa-mixcloud:before{content:"\f289"}.fa-scribd:before{content:"\f28a"}.fa-pause-circle:before{content:"\f28b"}.fa-pause-circle-o:before{content:"\f28c"}.fa-stop-circle:before{content:"\f28d"}.fa-stop-circle-o:before{content:"\f28e"}.fa-shopping-bag:before{content:"\f290"}.fa-shopping-basket:before{content:"\f291"}.fa-hashtag:before{content:"\f292"}.fa-bluetooth:before{content:"\f293"}.fa-bluetooth-b:before{content:"\f294"}.fa-percent:before{content:"\f295"}.fa-gitlab:before{content:"\f296"}.fa-wpbeginner:before{content:"\f297"}.fa-wpforms:before{content:"\f298"}.fa-envira:before{content:"\f299"}.fa-universal-access:before{content:"\f29a"}.fa-wheelchair-alt:before{content:"\f29b"}.fa-question-circle-o:before{content:"\f29c"}.fa-blind:before{content:"\f29d"}.fa-audio-description:before{content:"\f29e"}.fa-volume-control-phone:before{content:"\f2a0"}.fa-braille:before{content:"\f2a1"}.fa-assistive-listening-systems:before{content:"\f2a2"}.fa-asl-interpreting:before,.fa-american-sign-language-interpreting:before{content:"\f2a3"}.fa-deafness:before,.fa-hard-of-hearing:before,.fa-deaf:before{content:"\f2a4"}.fa-glide:before{content:"\f2a5"}.fa-glide-g:before{content:"\f2a6"}.fa-signing:before,.fa-sign-language:before{content:"\f2a7"}.fa-low-vision:before{content:"\f2a8"}.fa-viadeo:before{content:"\f2a9"}.fa-viadeo-square:before{content:"\f2aa"}.fa-snapchat:before{content:"\f2ab"}.fa-snapchat-ghost:before{content:"\f2ac"}.fa-snapchat-square:before{content:"\f2ad"}.fa-pied-piper:before{content:"\f2ae"}.fa-first-order:before{content:"\f2b0"}.fa-yoast:before{content:"\f2b1"}.fa-themeisle:before{content:"\f2b2"}.fa-google-plus-circle:before,.fa-google-plus-official:before{content:"\f2b3"}.fa-fa:before,.fa-font-awesome:before{content:"\f2b4"}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0, 0, 0, 0);border:0}.sr-only-focusable:active,.sr-only-focusable:focus{position:static;width:auto;height:auto;margin:0;overflow:visible;clip:auto} 5 | -------------------------------------------------------------------------------- /src/assets/css/main.css: -------------------------------------------------------------------------------- 1 | @import url('https://fonts.googleapis.com/css?family=Montserrat:300'); 2 | 3 | body { 4 | overflow-x: hidden; 5 | font-family: 'Montserrat', sans-serif !important; 6 | } 7 | 8 | .product-index { 9 | margin: 5%; 10 | } 11 | 12 | .locale-control{ 13 | width: 100px; 14 | margin: 0 auto 2%; 15 | padding: 2%; 16 | border: none; 17 | background-color: #FFF; 18 | } 19 | 20 | .locale-control:focus{ 21 | outline:0; 22 | border:none; 23 | box-shadow:0; 24 | } 25 | 26 | .hero-image { 27 | height: 60vh; 28 | min-height: 10em; 29 | width: 100vw; 30 | position: relative; 31 | left: 50%; 32 | right: 50%; 33 | margin-left: -50vw; 34 | margin-right: -50vw; 35 | background-size: cover; 36 | background-position: center; 37 | margin-bottom: 25px; 38 | } 39 | 40 | .slider-carousel { 41 | margin: 0 auto; 42 | width: 40%; 43 | } 44 | 45 | .individual-carousel-container { 46 | margin: 0 auto; 47 | } 48 | 49 | .individual-carousel { 50 | margin: 0 auto; 51 | } 52 | 53 | .section > .header { 54 | padding: 2%; 55 | } 56 | 57 | .header { 58 | display: flex; 59 | flex-direction: row; 60 | justify-content: space-between; 61 | width: 100vw; 62 | position: absolute; 63 | left: 50%; 64 | right: 50%; 65 | margin-left: -50vw; 66 | margin-right: -50vw; 67 | z-index: 10; 68 | background: linear-gradient(to bottom, rgba(255,255,255,1), rgba(255,255,255,0.0)); 69 | } 70 | 71 | .section > :not(.header) { 72 | padding: 10px 0; 73 | } 74 | 75 | .section > :not(.hero-image):not(.header) { 76 | padding-left: 5%; 77 | padding-right: 5%; 78 | } 79 | 80 | a { 81 | color: black; 82 | text-decoration: none; 83 | } 84 | 85 | ul { 86 | padding: 0; 87 | } 88 | -------------------------------------------------------------------------------- /src/assets/dam/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/contentful/The-Learning-Demo/5f990cfc6e8b9a1ec67d2777564174056dfb24e8/src/assets/dam/.DS_Store -------------------------------------------------------------------------------- /src/assets/dam/_DSC0009.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/contentful/The-Learning-Demo/5f990cfc6e8b9a1ec67d2777564174056dfb24e8/src/assets/dam/_DSC0009.jpg -------------------------------------------------------------------------------- /src/assets/dam/_DSC0011-Edit.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/contentful/The-Learning-Demo/5f990cfc6e8b9a1ec67d2777564174056dfb24e8/src/assets/dam/_DSC0011-Edit.jpg -------------------------------------------------------------------------------- /src/assets/dam/_DSC0024-Edit.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/contentful/The-Learning-Demo/5f990cfc6e8b9a1ec67d2777564174056dfb24e8/src/assets/dam/_DSC0024-Edit.jpg -------------------------------------------------------------------------------- /src/assets/dam/_DSC0028-Edit.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/contentful/The-Learning-Demo/5f990cfc6e8b9a1ec67d2777564174056dfb24e8/src/assets/dam/_DSC0028-Edit.jpg -------------------------------------------------------------------------------- /src/assets/dam/_DSC0047-Edit.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/contentful/The-Learning-Demo/5f990cfc6e8b9a1ec67d2777564174056dfb24e8/src/assets/dam/_DSC0047-Edit.jpg -------------------------------------------------------------------------------- /src/assets/dam/_DSC0050.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/contentful/The-Learning-Demo/5f990cfc6e8b9a1ec67d2777564174056dfb24e8/src/assets/dam/_DSC0050.jpg -------------------------------------------------------------------------------- /src/assets/dam/_DSC0056.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/contentful/The-Learning-Demo/5f990cfc6e8b9a1ec67d2777564174056dfb24e8/src/assets/dam/_DSC0056.jpg -------------------------------------------------------------------------------- /src/assets/dam/_DSC0060.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/contentful/The-Learning-Demo/5f990cfc6e8b9a1ec67d2777564174056dfb24e8/src/assets/dam/_DSC0060.jpg -------------------------------------------------------------------------------- /src/assets/dam/cancun-1-2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/contentful/The-Learning-Demo/5f990cfc6e8b9a1ec67d2777564174056dfb24e8/src/assets/dam/cancun-1-2.jpg -------------------------------------------------------------------------------- /src/assets/dam/cancun-1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/contentful/The-Learning-Demo/5f990cfc6e8b9a1ec67d2777564174056dfb24e8/src/assets/dam/cancun-1.jpg -------------------------------------------------------------------------------- /src/assets/dam/kevin parker.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/contentful/The-Learning-Demo/5f990cfc6e8b9a1ec67d2777564174056dfb24e8/src/assets/dam/kevin parker.jpeg -------------------------------------------------------------------------------- /src/assets/fonts/FontAwesome.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/contentful/The-Learning-Demo/5f990cfc6e8b9a1ec67d2777564174056dfb24e8/src/assets/fonts/FontAwesome.otf -------------------------------------------------------------------------------- /src/assets/fonts/fontawesome-webfont.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/contentful/The-Learning-Demo/5f990cfc6e8b9a1ec67d2777564174056dfb24e8/src/assets/fonts/fontawesome-webfont.eot -------------------------------------------------------------------------------- /src/assets/fonts/fontawesome-webfont.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/contentful/The-Learning-Demo/5f990cfc6e8b9a1ec67d2777564174056dfb24e8/src/assets/fonts/fontawesome-webfont.ttf -------------------------------------------------------------------------------- /src/assets/fonts/fontawesome-webfont.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/contentful/The-Learning-Demo/5f990cfc6e8b9a1ec67d2777564174056dfb24e8/src/assets/fonts/fontawesome-webfont.woff -------------------------------------------------------------------------------- /src/assets/fonts/fontawesome-webfont.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/contentful/The-Learning-Demo/5f990cfc6e8b9a1ec67d2777564174056dfb24e8/src/assets/fonts/fontawesome-webfont.woff2 -------------------------------------------------------------------------------- /src/assets/images/banner.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/contentful/The-Learning-Demo/5f990cfc6e8b9a1ec67d2777564174056dfb24e8/src/assets/images/banner.jpg -------------------------------------------------------------------------------- /src/assets/images/contentful-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/contentful/The-Learning-Demo/5f990cfc6e8b9a1ec67d2777564174056dfb24e8/src/assets/images/contentful-logo.png -------------------------------------------------------------------------------- /src/assets/js/bootstrap.min.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * Bootstrap v3.3.7 (http://getbootstrap.com) 3 | * Copyright 2011-2016 Twitter, Inc. 4 | * Licensed under the MIT license 5 | */ 6 | if("undefined"==typeof jQuery)throw new Error("Bootstrap's JavaScript requires jQuery");+function(a){"use strict";var b=a.fn.jquery.split(" ")[0].split(".");if(b[0]<2&&b[1]<9||1==b[0]&&9==b[1]&&b[2]<1||b[0]>3)throw new Error("Bootstrap's JavaScript requires jQuery version 1.9.1 or higher, but lower than version 4")}(jQuery),+function(a){"use strict";function b(){var a=document.createElement("bootstrap"),b={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend",transition:"transitionend"};for(var c in b)if(void 0!==a.style[c])return{end:b[c]};return!1}a.fn.emulateTransitionEnd=function(b){var c=!1,d=this;a(this).one("bsTransitionEnd",function(){c=!0});var e=function(){c||a(d).trigger(a.support.transition.end)};return setTimeout(e,b),this},a(function(){a.support.transition=b(),a.support.transition&&(a.event.special.bsTransitionEnd={bindType:a.support.transition.end,delegateType:a.support.transition.end,handle:function(b){if(a(b.target).is(this))return b.handleObj.handler.apply(this,arguments)}})})}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var c=a(this),e=c.data("bs.alert");e||c.data("bs.alert",e=new d(this)),"string"==typeof b&&e[b].call(c)})}var c='[data-dismiss="alert"]',d=function(b){a(b).on("click",c,this.close)};d.VERSION="3.3.7",d.TRANSITION_DURATION=150,d.prototype.close=function(b){function c(){g.detach().trigger("closed.bs.alert").remove()}var e=a(this),f=e.attr("data-target");f||(f=e.attr("href"),f=f&&f.replace(/.*(?=#[^\s]*$)/,""));var g=a("#"===f?[]:f);b&&b.preventDefault(),g.length||(g=e.closest(".alert")),g.trigger(b=a.Event("close.bs.alert")),b.isDefaultPrevented()||(g.removeClass("in"),a.support.transition&&g.hasClass("fade")?g.one("bsTransitionEnd",c).emulateTransitionEnd(d.TRANSITION_DURATION):c())};var e=a.fn.alert;a.fn.alert=b,a.fn.alert.Constructor=d,a.fn.alert.noConflict=function(){return a.fn.alert=e,this},a(document).on("click.bs.alert.data-api",c,d.prototype.close)}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.button"),f="object"==typeof b&&b;e||d.data("bs.button",e=new c(this,f)),"toggle"==b?e.toggle():b&&e.setState(b)})}var c=function(b,d){this.$element=a(b),this.options=a.extend({},c.DEFAULTS,d),this.isLoading=!1};c.VERSION="3.3.7",c.DEFAULTS={loadingText:"loading..."},c.prototype.setState=function(b){var c="disabled",d=this.$element,e=d.is("input")?"val":"html",f=d.data();b+="Text",null==f.resetText&&d.data("resetText",d[e]()),setTimeout(a.proxy(function(){d[e](null==f[b]?this.options[b]:f[b]),"loadingText"==b?(this.isLoading=!0,d.addClass(c).attr(c,c).prop(c,!0)):this.isLoading&&(this.isLoading=!1,d.removeClass(c).removeAttr(c).prop(c,!1))},this),0)},c.prototype.toggle=function(){var a=!0,b=this.$element.closest('[data-toggle="buttons"]');if(b.length){var c=this.$element.find("input");"radio"==c.prop("type")?(c.prop("checked")&&(a=!1),b.find(".active").removeClass("active"),this.$element.addClass("active")):"checkbox"==c.prop("type")&&(c.prop("checked")!==this.$element.hasClass("active")&&(a=!1),this.$element.toggleClass("active")),c.prop("checked",this.$element.hasClass("active")),a&&c.trigger("change")}else this.$element.attr("aria-pressed",!this.$element.hasClass("active")),this.$element.toggleClass("active")};var d=a.fn.button;a.fn.button=b,a.fn.button.Constructor=c,a.fn.button.noConflict=function(){return a.fn.button=d,this},a(document).on("click.bs.button.data-api",'[data-toggle^="button"]',function(c){var d=a(c.target).closest(".btn");b.call(d,"toggle"),a(c.target).is('input[type="radio"], input[type="checkbox"]')||(c.preventDefault(),d.is("input,button")?d.trigger("focus"):d.find("input:visible,button:visible").first().trigger("focus"))}).on("focus.bs.button.data-api blur.bs.button.data-api",'[data-toggle^="button"]',function(b){a(b.target).closest(".btn").toggleClass("focus",/^focus(in)?$/.test(b.type))})}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.carousel"),f=a.extend({},c.DEFAULTS,d.data(),"object"==typeof b&&b),g="string"==typeof b?b:f.slide;e||d.data("bs.carousel",e=new c(this,f)),"number"==typeof b?e.to(b):g?e[g]():f.interval&&e.pause().cycle()})}var c=function(b,c){this.$element=a(b),this.$indicators=this.$element.find(".carousel-indicators"),this.options=c,this.paused=null,this.sliding=null,this.interval=null,this.$active=null,this.$items=null,this.options.keyboard&&this.$element.on("keydown.bs.carousel",a.proxy(this.keydown,this)),"hover"==this.options.pause&&!("ontouchstart"in document.documentElement)&&this.$element.on("mouseenter.bs.carousel",a.proxy(this.pause,this)).on("mouseleave.bs.carousel",a.proxy(this.cycle,this))};c.VERSION="3.3.7",c.TRANSITION_DURATION=600,c.DEFAULTS={interval:5e3,pause:"hover",wrap:!0,keyboard:!0},c.prototype.keydown=function(a){if(!/input|textarea/i.test(a.target.tagName)){switch(a.which){case 37:this.prev();break;case 39:this.next();break;default:return}a.preventDefault()}},c.prototype.cycle=function(b){return b||(this.paused=!1),this.interval&&clearInterval(this.interval),this.options.interval&&!this.paused&&(this.interval=setInterval(a.proxy(this.next,this),this.options.interval)),this},c.prototype.getItemIndex=function(a){return this.$items=a.parent().children(".item"),this.$items.index(a||this.$active)},c.prototype.getItemForDirection=function(a,b){var c=this.getItemIndex(b),d="prev"==a&&0===c||"next"==a&&c==this.$items.length-1;if(d&&!this.options.wrap)return b;var e="prev"==a?-1:1,f=(c+e)%this.$items.length;return this.$items.eq(f)},c.prototype.to=function(a){var b=this,c=this.getItemIndex(this.$active=this.$element.find(".item.active"));if(!(a>this.$items.length-1||a<0))return this.sliding?this.$element.one("slid.bs.carousel",function(){b.to(a)}):c==a?this.pause().cycle():this.slide(a>c?"next":"prev",this.$items.eq(a))},c.prototype.pause=function(b){return b||(this.paused=!0),this.$element.find(".next, .prev").length&&a.support.transition&&(this.$element.trigger(a.support.transition.end),this.cycle(!0)),this.interval=clearInterval(this.interval),this},c.prototype.next=function(){if(!this.sliding)return this.slide("next")},c.prototype.prev=function(){if(!this.sliding)return this.slide("prev")},c.prototype.slide=function(b,d){var e=this.$element.find(".item.active"),f=d||this.getItemForDirection(b,e),g=this.interval,h="next"==b?"left":"right",i=this;if(f.hasClass("active"))return this.sliding=!1;var j=f[0],k=a.Event("slide.bs.carousel",{relatedTarget:j,direction:h});if(this.$element.trigger(k),!k.isDefaultPrevented()){if(this.sliding=!0,g&&this.pause(),this.$indicators.length){this.$indicators.find(".active").removeClass("active");var l=a(this.$indicators.children()[this.getItemIndex(f)]);l&&l.addClass("active")}var m=a.Event("slid.bs.carousel",{relatedTarget:j,direction:h});return a.support.transition&&this.$element.hasClass("slide")?(f.addClass(b),f[0].offsetWidth,e.addClass(h),f.addClass(h),e.one("bsTransitionEnd",function(){f.removeClass([b,h].join(" ")).addClass("active"),e.removeClass(["active",h].join(" ")),i.sliding=!1,setTimeout(function(){i.$element.trigger(m)},0)}).emulateTransitionEnd(c.TRANSITION_DURATION)):(e.removeClass("active"),f.addClass("active"),this.sliding=!1,this.$element.trigger(m)),g&&this.cycle(),this}};var d=a.fn.carousel;a.fn.carousel=b,a.fn.carousel.Constructor=c,a.fn.carousel.noConflict=function(){return a.fn.carousel=d,this};var e=function(c){var d,e=a(this),f=a(e.attr("data-target")||(d=e.attr("href"))&&d.replace(/.*(?=#[^\s]+$)/,""));if(f.hasClass("carousel")){var g=a.extend({},f.data(),e.data()),h=e.attr("data-slide-to");h&&(g.interval=!1),b.call(f,g),h&&f.data("bs.carousel").to(h),c.preventDefault()}};a(document).on("click.bs.carousel.data-api","[data-slide]",e).on("click.bs.carousel.data-api","[data-slide-to]",e),a(window).on("load",function(){a('[data-ride="carousel"]').each(function(){var c=a(this);b.call(c,c.data())})})}(jQuery),+function(a){"use strict";function b(b){var c,d=b.attr("data-target")||(c=b.attr("href"))&&c.replace(/.*(?=#[^\s]+$)/,"");return a(d)}function c(b){return this.each(function(){var c=a(this),e=c.data("bs.collapse"),f=a.extend({},d.DEFAULTS,c.data(),"object"==typeof b&&b);!e&&f.toggle&&/show|hide/.test(b)&&(f.toggle=!1),e||c.data("bs.collapse",e=new d(this,f)),"string"==typeof b&&e[b]()})}var d=function(b,c){this.$element=a(b),this.options=a.extend({},d.DEFAULTS,c),this.$trigger=a('[data-toggle="collapse"][href="#'+b.id+'"],[data-toggle="collapse"][data-target="#'+b.id+'"]'),this.transitioning=null,this.options.parent?this.$parent=this.getParent():this.addAriaAndCollapsedClass(this.$element,this.$trigger),this.options.toggle&&this.toggle()};d.VERSION="3.3.7",d.TRANSITION_DURATION=350,d.DEFAULTS={toggle:!0},d.prototype.dimension=function(){var a=this.$element.hasClass("width");return a?"width":"height"},d.prototype.show=function(){if(!this.transitioning&&!this.$element.hasClass("in")){var b,e=this.$parent&&this.$parent.children(".panel").children(".in, .collapsing");if(!(e&&e.length&&(b=e.data("bs.collapse"),b&&b.transitioning))){var f=a.Event("show.bs.collapse");if(this.$element.trigger(f),!f.isDefaultPrevented()){e&&e.length&&(c.call(e,"hide"),b||e.data("bs.collapse",null));var g=this.dimension();this.$element.removeClass("collapse").addClass("collapsing")[g](0).attr("aria-expanded",!0),this.$trigger.removeClass("collapsed").attr("aria-expanded",!0),this.transitioning=1;var h=function(){this.$element.removeClass("collapsing").addClass("collapse in")[g](""),this.transitioning=0,this.$element.trigger("shown.bs.collapse")};if(!a.support.transition)return h.call(this);var i=a.camelCase(["scroll",g].join("-"));this.$element.one("bsTransitionEnd",a.proxy(h,this)).emulateTransitionEnd(d.TRANSITION_DURATION)[g](this.$element[0][i])}}}},d.prototype.hide=function(){if(!this.transitioning&&this.$element.hasClass("in")){var b=a.Event("hide.bs.collapse");if(this.$element.trigger(b),!b.isDefaultPrevented()){var c=this.dimension();this.$element[c](this.$element[c]())[0].offsetHeight,this.$element.addClass("collapsing").removeClass("collapse in").attr("aria-expanded",!1),this.$trigger.addClass("collapsed").attr("aria-expanded",!1),this.transitioning=1;var e=function(){this.transitioning=0,this.$element.removeClass("collapsing").addClass("collapse").trigger("hidden.bs.collapse")};return a.support.transition?void this.$element[c](0).one("bsTransitionEnd",a.proxy(e,this)).emulateTransitionEnd(d.TRANSITION_DURATION):e.call(this)}}},d.prototype.toggle=function(){this[this.$element.hasClass("in")?"hide":"show"]()},d.prototype.getParent=function(){return a(this.options.parent).find('[data-toggle="collapse"][data-parent="'+this.options.parent+'"]').each(a.proxy(function(c,d){var e=a(d);this.addAriaAndCollapsedClass(b(e),e)},this)).end()},d.prototype.addAriaAndCollapsedClass=function(a,b){var c=a.hasClass("in");a.attr("aria-expanded",c),b.toggleClass("collapsed",!c).attr("aria-expanded",c)};var e=a.fn.collapse;a.fn.collapse=c,a.fn.collapse.Constructor=d,a.fn.collapse.noConflict=function(){return a.fn.collapse=e,this},a(document).on("click.bs.collapse.data-api",'[data-toggle="collapse"]',function(d){var e=a(this);e.attr("data-target")||d.preventDefault();var f=b(e),g=f.data("bs.collapse"),h=g?"toggle":e.data();c.call(f,h)})}(jQuery),+function(a){"use strict";function b(b){var c=b.attr("data-target");c||(c=b.attr("href"),c=c&&/#[A-Za-z]/.test(c)&&c.replace(/.*(?=#[^\s]*$)/,""));var d=c&&a(c);return d&&d.length?d:b.parent()}function c(c){c&&3===c.which||(a(e).remove(),a(f).each(function(){var d=a(this),e=b(d),f={relatedTarget:this};e.hasClass("open")&&(c&&"click"==c.type&&/input|textarea/i.test(c.target.tagName)&&a.contains(e[0],c.target)||(e.trigger(c=a.Event("hide.bs.dropdown",f)),c.isDefaultPrevented()||(d.attr("aria-expanded","false"),e.removeClass("open").trigger(a.Event("hidden.bs.dropdown",f)))))}))}function d(b){return this.each(function(){var c=a(this),d=c.data("bs.dropdown");d||c.data("bs.dropdown",d=new g(this)),"string"==typeof b&&d[b].call(c)})}var e=".dropdown-backdrop",f='[data-toggle="dropdown"]',g=function(b){a(b).on("click.bs.dropdown",this.toggle)};g.VERSION="3.3.7",g.prototype.toggle=function(d){var e=a(this);if(!e.is(".disabled, :disabled")){var f=b(e),g=f.hasClass("open");if(c(),!g){"ontouchstart"in document.documentElement&&!f.closest(".navbar-nav").length&&a(document.createElement("div")).addClass("dropdown-backdrop").insertAfter(a(this)).on("click",c);var h={relatedTarget:this};if(f.trigger(d=a.Event("show.bs.dropdown",h)),d.isDefaultPrevented())return;e.trigger("focus").attr("aria-expanded","true"),f.toggleClass("open").trigger(a.Event("shown.bs.dropdown",h))}return!1}},g.prototype.keydown=function(c){if(/(38|40|27|32)/.test(c.which)&&!/input|textarea/i.test(c.target.tagName)){var d=a(this);if(c.preventDefault(),c.stopPropagation(),!d.is(".disabled, :disabled")){var e=b(d),g=e.hasClass("open");if(!g&&27!=c.which||g&&27==c.which)return 27==c.which&&e.find(f).trigger("focus"),d.trigger("click");var h=" li:not(.disabled):visible a",i=e.find(".dropdown-menu"+h);if(i.length){var j=i.index(c.target);38==c.which&&j>0&&j--,40==c.which&&jdocument.documentElement.clientHeight;this.$element.css({paddingLeft:!this.bodyIsOverflowing&&a?this.scrollbarWidth:"",paddingRight:this.bodyIsOverflowing&&!a?this.scrollbarWidth:""})},c.prototype.resetAdjustments=function(){this.$element.css({paddingLeft:"",paddingRight:""})},c.prototype.checkScrollbar=function(){var a=window.innerWidth;if(!a){var b=document.documentElement.getBoundingClientRect();a=b.right-Math.abs(b.left)}this.bodyIsOverflowing=document.body.clientWidth
',trigger:"hover focus",title:"",delay:0,html:!1,container:!1,viewport:{selector:"body",padding:0}},c.prototype.init=function(b,c,d){if(this.enabled=!0,this.type=b,this.$element=a(c),this.options=this.getOptions(d),this.$viewport=this.options.viewport&&a(a.isFunction(this.options.viewport)?this.options.viewport.call(this,this.$element):this.options.viewport.selector||this.options.viewport),this.inState={click:!1,hover:!1,focus:!1},this.$element[0]instanceof document.constructor&&!this.options.selector)throw new Error("`selector` option must be specified when initializing "+this.type+" on the window.document object!");for(var e=this.options.trigger.split(" "),f=e.length;f--;){var g=e[f];if("click"==g)this.$element.on("click."+this.type,this.options.selector,a.proxy(this.toggle,this));else if("manual"!=g){var h="hover"==g?"mouseenter":"focusin",i="hover"==g?"mouseleave":"focusout";this.$element.on(h+"."+this.type,this.options.selector,a.proxy(this.enter,this)),this.$element.on(i+"."+this.type,this.options.selector,a.proxy(this.leave,this))}}this.options.selector?this._options=a.extend({},this.options,{trigger:"manual",selector:""}):this.fixTitle()},c.prototype.getDefaults=function(){return c.DEFAULTS},c.prototype.getOptions=function(b){return b=a.extend({},this.getDefaults(),this.$element.data(),b),b.delay&&"number"==typeof b.delay&&(b.delay={show:b.delay,hide:b.delay}),b},c.prototype.getDelegateOptions=function(){var b={},c=this.getDefaults();return this._options&&a.each(this._options,function(a,d){c[a]!=d&&(b[a]=d)}),b},c.prototype.enter=function(b){var c=b instanceof this.constructor?b:a(b.currentTarget).data("bs."+this.type);return c||(c=new this.constructor(b.currentTarget,this.getDelegateOptions()),a(b.currentTarget).data("bs."+this.type,c)),b instanceof a.Event&&(c.inState["focusin"==b.type?"focus":"hover"]=!0),c.tip().hasClass("in")||"in"==c.hoverState?void(c.hoverState="in"):(clearTimeout(c.timeout),c.hoverState="in",c.options.delay&&c.options.delay.show?void(c.timeout=setTimeout(function(){"in"==c.hoverState&&c.show()},c.options.delay.show)):c.show())},c.prototype.isInStateTrue=function(){for(var a in this.inState)if(this.inState[a])return!0;return!1},c.prototype.leave=function(b){var c=b instanceof this.constructor?b:a(b.currentTarget).data("bs."+this.type);if(c||(c=new this.constructor(b.currentTarget,this.getDelegateOptions()),a(b.currentTarget).data("bs."+this.type,c)),b instanceof a.Event&&(c.inState["focusout"==b.type?"focus":"hover"]=!1),!c.isInStateTrue())return clearTimeout(c.timeout),c.hoverState="out",c.options.delay&&c.options.delay.hide?void(c.timeout=setTimeout(function(){"out"==c.hoverState&&c.hide()},c.options.delay.hide)):c.hide()},c.prototype.show=function(){var b=a.Event("show.bs."+this.type);if(this.hasContent()&&this.enabled){this.$element.trigger(b);var d=a.contains(this.$element[0].ownerDocument.documentElement,this.$element[0]);if(b.isDefaultPrevented()||!d)return;var e=this,f=this.tip(),g=this.getUID(this.type);this.setContent(),f.attr("id",g),this.$element.attr("aria-describedby",g),this.options.animation&&f.addClass("fade");var h="function"==typeof this.options.placement?this.options.placement.call(this,f[0],this.$element[0]):this.options.placement,i=/\s?auto?\s?/i,j=i.test(h);j&&(h=h.replace(i,"")||"top"),f.detach().css({top:0,left:0,display:"block"}).addClass(h).data("bs."+this.type,this),this.options.container?f.appendTo(this.options.container):f.insertAfter(this.$element),this.$element.trigger("inserted.bs."+this.type);var k=this.getPosition(),l=f[0].offsetWidth,m=f[0].offsetHeight;if(j){var n=h,o=this.getPosition(this.$viewport);h="bottom"==h&&k.bottom+m>o.bottom?"top":"top"==h&&k.top-mo.width?"left":"left"==h&&k.left-lg.top+g.height&&(e.top=g.top+g.height-i)}else{var j=b.left-f,k=b.left+f+c;jg.right&&(e.left=g.left+g.width-k)}return e},c.prototype.getTitle=function(){var a,b=this.$element,c=this.options;return a=b.attr("data-original-title")||("function"==typeof c.title?c.title.call(b[0]):c.title)},c.prototype.getUID=function(a){do a+=~~(1e6*Math.random());while(document.getElementById(a));return a},c.prototype.tip=function(){if(!this.$tip&&(this.$tip=a(this.options.template),1!=this.$tip.length))throw new Error(this.type+" `template` option must consist of exactly 1 top-level element!");return this.$tip},c.prototype.arrow=function(){return this.$arrow=this.$arrow||this.tip().find(".tooltip-arrow")},c.prototype.enable=function(){this.enabled=!0},c.prototype.disable=function(){this.enabled=!1},c.prototype.toggleEnabled=function(){this.enabled=!this.enabled},c.prototype.toggle=function(b){var c=this;b&&(c=a(b.currentTarget).data("bs."+this.type),c||(c=new this.constructor(b.currentTarget,this.getDelegateOptions()),a(b.currentTarget).data("bs."+this.type,c))),b?(c.inState.click=!c.inState.click,c.isInStateTrue()?c.enter(c):c.leave(c)):c.tip().hasClass("in")?c.leave(c):c.enter(c)},c.prototype.destroy=function(){var a=this;clearTimeout(this.timeout),this.hide(function(){a.$element.off("."+a.type).removeData("bs."+a.type),a.$tip&&a.$tip.detach(),a.$tip=null,a.$arrow=null,a.$viewport=null,a.$element=null})};var d=a.fn.tooltip;a.fn.tooltip=b,a.fn.tooltip.Constructor=c,a.fn.tooltip.noConflict=function(){return a.fn.tooltip=d,this}}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.popover"),f="object"==typeof b&&b;!e&&/destroy|hide/.test(b)||(e||d.data("bs.popover",e=new c(this,f)),"string"==typeof b&&e[b]())})}var c=function(a,b){this.init("popover",a,b)};if(!a.fn.tooltip)throw new Error("Popover requires tooltip.js");c.VERSION="3.3.7",c.DEFAULTS=a.extend({},a.fn.tooltip.Constructor.DEFAULTS,{placement:"right",trigger:"click",content:"",template:''}),c.prototype=a.extend({},a.fn.tooltip.Constructor.prototype),c.prototype.constructor=c,c.prototype.getDefaults=function(){return c.DEFAULTS},c.prototype.setContent=function(){var a=this.tip(),b=this.getTitle(),c=this.getContent();a.find(".popover-title")[this.options.html?"html":"text"](b),a.find(".popover-content").children().detach().end()[this.options.html?"string"==typeof c?"html":"append":"text"](c),a.removeClass("fade top bottom left right in"),a.find(".popover-title").html()||a.find(".popover-title").hide()},c.prototype.hasContent=function(){return this.getTitle()||this.getContent()},c.prototype.getContent=function(){var a=this.$element,b=this.options;return a.attr("data-content")||("function"==typeof b.content?b.content.call(a[0]):b.content)},c.prototype.arrow=function(){return this.$arrow=this.$arrow||this.tip().find(".arrow")};var d=a.fn.popover;a.fn.popover=b,a.fn.popover.Constructor=c,a.fn.popover.noConflict=function(){return a.fn.popover=d,this}}(jQuery),+function(a){"use strict";function b(c,d){this.$body=a(document.body),this.$scrollElement=a(a(c).is(document.body)?window:c),this.options=a.extend({},b.DEFAULTS,d),this.selector=(this.options.target||"")+" .nav li > a",this.offsets=[],this.targets=[],this.activeTarget=null,this.scrollHeight=0,this.$scrollElement.on("scroll.bs.scrollspy",a.proxy(this.process,this)),this.refresh(),this.process()}function c(c){return this.each(function(){var d=a(this),e=d.data("bs.scrollspy"),f="object"==typeof c&&c;e||d.data("bs.scrollspy",e=new b(this,f)),"string"==typeof c&&e[c]()})}b.VERSION="3.3.7",b.DEFAULTS={offset:10},b.prototype.getScrollHeight=function(){return this.$scrollElement[0].scrollHeight||Math.max(this.$body[0].scrollHeight,document.documentElement.scrollHeight)},b.prototype.refresh=function(){var b=this,c="offset",d=0;this.offsets=[],this.targets=[],this.scrollHeight=this.getScrollHeight(),a.isWindow(this.$scrollElement[0])||(c="position",d=this.$scrollElement.scrollTop()),this.$body.find(this.selector).map(function(){var b=a(this),e=b.data("target")||b.attr("href"),f=/^#./.test(e)&&a(e);return f&&f.length&&f.is(":visible")&&[[f[c]().top+d,e]]||null}).sort(function(a,b){return a[0]-b[0]}).each(function(){b.offsets.push(this[0]),b.targets.push(this[1])})},b.prototype.process=function(){var a,b=this.$scrollElement.scrollTop()+this.options.offset,c=this.getScrollHeight(),d=this.options.offset+c-this.$scrollElement.height(),e=this.offsets,f=this.targets,g=this.activeTarget;if(this.scrollHeight!=c&&this.refresh(),b>=d)return g!=(a=f[f.length-1])&&this.activate(a);if(g&&b=e[a]&&(void 0===e[a+1]||b .dropdown-menu > .active").removeClass("active").end().find('[data-toggle="tab"]').attr("aria-expanded",!1),b.addClass("active").find('[data-toggle="tab"]').attr("aria-expanded",!0),h?(b[0].offsetWidth,b.addClass("in")):b.removeClass("fade"),b.parent(".dropdown-menu").length&&b.closest("li.dropdown").addClass("active").end().find('[data-toggle="tab"]').attr("aria-expanded",!0),e&&e()}var g=d.find("> .active"),h=e&&a.support.transition&&(g.length&&g.hasClass("fade")||!!d.find("> .fade").length);g.length&&h?g.one("bsTransitionEnd",f).emulateTransitionEnd(c.TRANSITION_DURATION):f(),g.removeClass("in")};var d=a.fn.tab;a.fn.tab=b,a.fn.tab.Constructor=c,a.fn.tab.noConflict=function(){return a.fn.tab=d,this};var e=function(c){c.preventDefault(),b.call(a(this),"show")};a(document).on("click.bs.tab.data-api",'[data-toggle="tab"]',e).on("click.bs.tab.data-api",'[data-toggle="pill"]',e)}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.affix"),f="object"==typeof b&&b;e||d.data("bs.affix",e=new c(this,f)),"string"==typeof b&&e[b]()})}var c=function(b,d){this.options=a.extend({},c.DEFAULTS,d),this.$target=a(this.options.target).on("scroll.bs.affix.data-api",a.proxy(this.checkPosition,this)).on("click.bs.affix.data-api",a.proxy(this.checkPositionWithEventLoop,this)),this.$element=a(b),this.affixed=null,this.unpin=null,this.pinnedOffset=null,this.checkPosition()};c.VERSION="3.3.7",c.RESET="affix affix-top affix-bottom",c.DEFAULTS={offset:0,target:window},c.prototype.getState=function(a,b,c,d){var e=this.$target.scrollTop(),f=this.$element.offset(),g=this.$target.height();if(null!=c&&"top"==this.affixed)return e=a-d&&"bottom"},c.prototype.getPinnedOffset=function(){if(this.pinnedOffset)return this.pinnedOffset;this.$element.removeClass(c.RESET).addClass("affix");var a=this.$target.scrollTop(),b=this.$element.offset();return this.pinnedOffset=b.top-a},c.prototype.checkPositionWithEventLoop=function(){setTimeout(a.proxy(this.checkPosition,this),1)},c.prototype.checkPosition=function(){if(this.$element.is(":visible")){var b=this.$element.height(),d=this.options.offset,e=d.top,f=d.bottom,g=Math.max(a(document).height(),a(document.body).height());"object"!=typeof d&&(f=e=d),"function"==typeof e&&(e=d.top(this.$element)),"function"==typeof f&&(f=d.bottom(this.$element));var h=this.getState(g,b,e,f);if(this.affixed!=h){null!=this.unpin&&this.$element.css("top","");var i="affix"+(h?"-"+h:""),j=a.Event(i+".bs.affix");if(this.$element.trigger(j),j.isDefaultPrevented())return;this.affixed=h,this.unpin="bottom"==h?this.getPinnedOffset():null,this.$element.removeClass(c.RESET).addClass(i).trigger(i.replace("affix","affixed")+".bs.affix")}"bottom"==h&&this.$element.offset({top:g-b-f})}};var d=a.fn.affix;a.fn.affix=b,a.fn.affix.Constructor=c,a.fn.affix.noConflict=function(){return a.fn.affix=d,this},a(window).on("load",function(){a('[data-spy="affix"]').each(function(){var c=a(this),d=c.data();d.offset=d.offset||{},null!=d.offsetBottom&&(d.offset.bottom=d.offsetBottom),null!=d.offsetTop&&(d.offset.top=d.offsetTop),b.call(c,d)})})}(jQuery); -------------------------------------------------------------------------------- /src/assets/js/demo.js: -------------------------------------------------------------------------------- 1 | /* 2 | Story by HTML5 UP 3 | html5up.net | @ajlkn 4 | Free for personal and commercial use under the CCA 3.0 license (html5up.net/license) 5 | 6 | Note: Only needed for demo purposes. Delete for production sites. 7 | */ 8 | 9 | (function($) { 10 | 11 | var $window = $(window); 12 | 13 | // Styles. 14 | $( 15 | '' 35 | ).appendTo($('head')); 36 | 37 | // Functions. 38 | $.fn.demo_controls = function(styles, userOptions) { 39 | 40 | var $this = $(this), 41 | $styleProperty, $stylePropertyClasses, 42 | $controls, $x, $y, $z, 43 | options, 44 | current, i, j, k, s, n, count; 45 | 46 | // No elements? 47 | if (this.length == 0) 48 | return $this; 49 | 50 | // Multiple elements? 51 | if (this.length > 1) { 52 | 53 | for (var i=0; i < this.length; i++) 54 | $(this[i]).demo_controls(styles, userOptions); 55 | 56 | return $this; 57 | 58 | } 59 | 60 | // Options. 61 | options = $.extend({ 62 | target: null, 63 | palette: true 64 | }, userOptions); 65 | 66 | // Controls. 67 | if (styles) { 68 | 69 | $controls = $( 70 | '' + 71 | '' + 72 | 'style' + 73 | '' + (options.palette ? ', ' : ' ') + 74 | '' + 75 | (options.palette ? 76 | '' + 77 | 'scheme' + 78 | '' + 79 | 'default' + 80 | 'invert' + 81 | ', ' + 82 | '' + 83 | '' + 84 | 'color' + 85 | '' + 86 | 'default' + 87 | 'color1' + 88 | 'color2' + 89 | 'color3' + 90 | 'color4' + 91 | 'color5' + 92 | 'color6' + 93 | 'color7' + 94 | ', ' + 95 | '' 96 | : '') + 97 | '' 98 | ); 99 | 100 | } 101 | else { 102 | 103 | $controls = $( 104 | '' + 105 | (options.palette ? 106 | '' + 107 | 'scheme' + 108 | '' + 109 | 'default' + 110 | 'invert' + 111 | ' and ' + 112 | '' + 113 | '' + 114 | 'color' + 115 | '' + 116 | 'default' + 117 | 'color1' + 118 | 'color2' + 119 | 'color3' + 120 | 'color4' + 121 | 'color5' + 122 | 'color6' + 123 | 'color7' + 124 | '' + 125 | '' 126 | : '') + 127 | '' 128 | ); 129 | 130 | } 131 | 132 | // Target. 133 | switch (options.target) { 134 | 135 | case 'previous': 136 | $this.prev().find('.demo-controls').replaceWith($controls); 137 | break; 138 | 139 | default: 140 | $this.find('.demo-controls').replaceWith($controls); 141 | break; 142 | 143 | } 144 | 145 | // Styles. 146 | if (styles) { 147 | 148 | $styleProperty = $controls.find('.property[data-name="style"]'); 149 | $stylePropertyClasses = $styleProperty.children('.classes'); 150 | 151 | for (i in styles) { 152 | 153 | current = false; 154 | count = Object.keys(styles[i]).length; 155 | n = 1; 156 | 157 | // Add to style property. 158 | $x = $(', ' + i + '') 159 | .appendTo($stylePropertyClasses); 160 | 161 | if ($this.hasClass(i)) { 162 | 163 | $x.addClass('active'); 164 | current = true; 165 | 166 | } 167 | 168 | // Step through properties. 169 | for (j in styles[i]) { 170 | 171 | $x = $( 172 | '' + 173 | (n == count ? 'and ' : '') + 174 | '' + j + '' + 175 | '' + 176 | '' + (n < count ? ', ' : '') + 177 | '' 178 | ).appendTo($controls); 179 | 180 | $y = $x.children('.classes'); 181 | 182 | if (current) 183 | $x.addClass('active'); 184 | 185 | for (k in styles[i][j]) { 186 | 187 | $z = $(', ' + styles[i][j][k].replace('*', '') + '') 188 | .appendTo($y); 189 | 190 | if (styles[i][j][k].substr(-1, 1) == '*') 191 | $z.addClass('default'); 192 | 193 | if (current 194 | && $this.hasClass(k)) 195 | $z.addClass('active'); 196 | 197 | } 198 | 199 | n++; 200 | 201 | } 202 | 203 | } 204 | 205 | } 206 | 207 | // Events. 208 | $controls.on('click', 'a', function(event) { 209 | event.preventDefault(); 210 | }); 211 | 212 | $controls.on('click', '.property.active', function(event) { 213 | 214 | var $property = $(this); 215 | var $classes = $property.find('.classes > *'); 216 | var $current = $classes.filter('.active'); 217 | var $next; 218 | 219 | // Determine next. 220 | if ($current.length == 0 221 | || $current.index() == $classes.length - 1) 222 | $next = $classes.first(); 223 | else 224 | $next = $current.next(); 225 | 226 | // Turn on animate all. 227 | $this.addClass('demo-animate-all'); 228 | 229 | // Deactivate current. 230 | $current.removeClass('active'); 231 | $this.removeClass($current.data('class')); 232 | 233 | // Activate next. 234 | $next.addClass('active'); 235 | $this.addClass($next.data('class')); 236 | 237 | // Turn off animate all. 238 | setTimeout(function() { 239 | $this.removeClass('demo-animate-all'); 240 | }, 500); 241 | 242 | }); 243 | 244 | $controls.on('click', '.property[data-name="style"]', function(event) { 245 | 246 | var $property = $(this); 247 | var $classes = $property.find('.classes > *'); 248 | var $current = $classes.filter('.active'); 249 | var $next; 250 | 251 | // Determine next. 252 | if ($current.length == 0 253 | || $current.index() == $classes.length - 1) 254 | $next = $classes.first(); 255 | else 256 | $next = $current.next(); 257 | 258 | // Turn on animate all. 259 | $this.addClass('demo-animate-all'); 260 | 261 | // Deactivate current. 262 | $current.removeClass('active'); 263 | $this.removeClass($current.data('class')); 264 | 265 | $controls.find('.property[data-requires="' + $current.data('class') + '"]') 266 | .removeClass('active'); 267 | 268 | $controls.find('.property[data-requires="' + $current.data('class') + '"] > .classes > .active').each(function() { 269 | 270 | $(this).removeClass('active'); 271 | 272 | if ($(this).data('class') != '-') 273 | $this.removeClass($(this).data('class')); 274 | 275 | }); 276 | 277 | // Activate next. 278 | $next.addClass('active'); 279 | $this.addClass($next.data('class')); 280 | 281 | $controls.find('.property[data-requires="' + $next.data('class') + '"]') 282 | .addClass('active'); 283 | 284 | $controls.find('.property[data-requires="' + $next.data('class') + '"] > .classes > .default').each(function() { 285 | 286 | $(this).addClass('active'); 287 | 288 | if ($(this).data('class') != '-') 289 | $this.addClass($(this).data('class')); 290 | 291 | }); 292 | 293 | // Turn off animate all. 294 | setTimeout(function() { 295 | $this.removeClass('demo-animate-all'); 296 | }, 500); 297 | 298 | }); 299 | 300 | }; 301 | 302 | // Elements. 303 | 304 | // Wrappers. 305 | $('.wrapper').demo_controls(null, { 306 | palette: true 307 | }); 308 | 309 | // Banner. 310 | $('.banner').demo_controls({ 311 | style1: { 312 | 'size': { 313 | '-': 'normal', 314 | 'fullscreen': 'fullscreen*' 315 | }, 316 | 'orientation': { 317 | 'orient-left': 'left*', 318 | 'orient-right': 'right' 319 | }, 320 | 'content alignment': { 321 | 'content-align-left': 'left*', 322 | 'content-align-center': 'center', 323 | 'content-align-right': 'right' 324 | }, 325 | 'image position': { 326 | 'image-position-left': 'left', 327 | 'image-position-center': 'center*', 328 | 'image-position-right': 'right' 329 | } 330 | }, 331 | style2: { 332 | 'size': { 333 | '-': 'normal', 334 | 'fullscreen': 'fullscreen*' 335 | }, 336 | 'orientation': { 337 | 'orient-left': 'left', 338 | 'orient-center': 'center*', 339 | 'orient-right': 'right' 340 | }, 341 | 'content alignment': { 342 | 'content-align-left': 'left', 343 | 'content-align-center': 'center*', 344 | 'content-align-right': 'right' 345 | }, 346 | 'image position': { 347 | 'image-position-left': 'left', 348 | 'image-position-center': 'center*', 349 | 'image-position-right': 'right' 350 | } 351 | }, 352 | style3: { 353 | 'size': { 354 | '-': 'normal', 355 | 'fullscreen': 'fullscreen*' 356 | }, 357 | 'orientation': { 358 | 'orient-left': 'left', 359 | 'orient-right': 'right*' 360 | }, 361 | 'content alignment': { 362 | 'content-align-left': 'left*', 363 | 'content-align-center': 'center', 364 | 'content-align-right': 'right' 365 | }, 366 | 'image position': { 367 | 'image-position-left': 'left', 368 | 'image-position-center': 'center*', 369 | 'image-position-right': 'right' 370 | } 371 | }, 372 | style4: { 373 | 'size': { 374 | '-': 'normal', 375 | 'fullscreen': 'fullscreen*' 376 | }, 377 | 'phone type': { 378 | 'iphone': 'iphone*', 379 | 'android': 'android' 380 | }, 381 | 'orientation': { 382 | 'orient-left': 'left', 383 | 'orient-right': 'right*' 384 | }, 385 | 'content alignment': { 386 | 'content-align-left': 'left*', 387 | 'content-align-center': 'center', 388 | 'content-align-right': 'right' 389 | }, 390 | 'image position': { 391 | 'image-position-left': 'left', 392 | 'image-position-center': 'center*', 393 | 'image-position-right': 'right' 394 | } 395 | }, 396 | style5: { 397 | 'size': { 398 | '-': 'normal', 399 | 'fullscreen': 'fullscreen*' 400 | }, 401 | 'content alignment': { 402 | 'content-align-left': 'left', 403 | 'content-align-center': 'center*', 404 | 'content-align-right': 'right' 405 | }, 406 | 'image position': { 407 | 'image-position-left': 'left', 408 | 'image-position-center': 'center*', 409 | 'image-position-right': 'right' 410 | } 411 | } 412 | }); 413 | 414 | // Spotlight. 415 | $('.spotlight').demo_controls({ 416 | style1: { 417 | 'orientation': { 418 | 'orient-left': 'left', 419 | 'orient-right': 'right*' 420 | }, 421 | 'content alignment': { 422 | 'content-align-left': 'left*', 423 | 'content-align-center': 'center', 424 | 'content-align-right': 'right' 425 | }, 426 | 'image position': { 427 | 'image-position-left': 'left*', 428 | 'image-position-center': 'center', 429 | 'image-position-right': 'right' 430 | } 431 | }, 432 | style2: { 433 | 'orientation': { 434 | 'orient-left': 'left', 435 | 'orient-right': 'right*' 436 | }, 437 | 'content alignment': { 438 | 'content-align-left': 'left*', 439 | 'content-align-center': 'center', 440 | 'content-align-right': 'right' 441 | }, 442 | 'image position': { 443 | 'image-position-left': 'left', 444 | 'image-position-center': 'center*', 445 | 'image-position-right': 'right' 446 | } 447 | }, 448 | style3: { 449 | 'phone type': { 450 | 'iphone': 'iphone*', 451 | 'android': 'android' 452 | }, 453 | 'orientation': { 454 | 'orient-left': 'left', 455 | 'orient-right': 'right*' 456 | }, 457 | 'content alignment': { 458 | 'content-align-left': 'left*', 459 | 'content-align-center': 'center', 460 | 'content-align-right': 'right' 461 | }, 462 | 'image position': { 463 | 'image-position-left': 'left', 464 | 'image-position-center': 'center*', 465 | 'image-position-right': 'right' 466 | } 467 | }, 468 | style4: { 469 | 'size': { 470 | '-size': 'normal', 471 | 'fullscreen': 'fullscreen*', 472 | 'halfscreen': 'halfscreen' 473 | }, 474 | 'orientation': { 475 | 'orient-left': 'left*', 476 | 'orient-center': 'center', 477 | 'orient-right': 'right' 478 | }, 479 | 'content alignment': { 480 | 'content-align-left': 'left*', 481 | 'content-align-center': 'center', 482 | 'content-align-right': 'right' 483 | }, 484 | 'image position': { 485 | 'image-position-left': 'left', 486 | 'image-position-center': 'center*', 487 | 'image-position-right': 'right' 488 | } 489 | }, 490 | style5: { 491 | 'size': { 492 | '-size': 'normal', 493 | 'fullscreen': 'fullscreen*', 494 | 'halfscreen': 'halfscreen' 495 | }, 496 | 'orientation': { 497 | 'orient-left': 'left*', 498 | 'orient-center': 'center', 499 | 'orient-right': 'right' 500 | }, 501 | 'content alignment': { 502 | 'content-align-left': 'left*', 503 | 'content-align-center': 'center', 504 | 'content-align-right': 'right' 505 | }, 506 | 'image position': { 507 | 'image-position-left': 'left', 508 | 'image-position-center': 'center*', 509 | 'image-position-right': 'right' 510 | } 511 | }, 512 | }); 513 | 514 | // Gallery. 515 | $('.gallery').demo_controls({ 516 | style1: { 517 | 'size': { 518 | 'small': 'small', 519 | 'medium': 'medium*', 520 | 'big': 'big' 521 | } 522 | }, 523 | style2: { 524 | 'size': { 525 | 'small': 'small', 526 | 'medium': 'medium*', 527 | 'big': 'big' 528 | } 529 | }, 530 | }, { 531 | target: 'previous', 532 | palette: false 533 | }); 534 | 535 | // Items. 536 | $('.items').demo_controls({ 537 | style1: { 538 | 'size': { 539 | 'small': 'small', 540 | 'medium': 'medium*', 541 | 'big': 'big' 542 | } 543 | }, 544 | style2: { 545 | 'size': { 546 | 'small': 'small', 547 | 'medium': 'medium*', 548 | 'big': 'big' 549 | } 550 | }, 551 | style3: { 552 | 'size': { 553 | 'small': 'small', 554 | 'medium': 'medium*', 555 | 'big': 'big' 556 | } 557 | } 558 | }, { 559 | target: 'previous', 560 | palette: false 561 | }); 562 | 563 | })(jQuery); -------------------------------------------------------------------------------- /src/assets/js/jquery.scrollex.min.js: -------------------------------------------------------------------------------- 1 | /* jquery.scrollex v0.2.1 | (c) @ajlkn | github.com/ajlkn/jquery.scrollex | MIT licensed */ 2 | !function(t){function e(t,e,n){return"string"==typeof t&&("%"==t.slice(-1)?t=parseInt(t.substring(0,t.length-1))/100*e:"vh"==t.slice(-2)?t=parseInt(t.substring(0,t.length-2))/100*n:"px"==t.slice(-2)&&(t=parseInt(t.substring(0,t.length-2)))),t}var n=t(window),i=1,o={};n.on("scroll",function(){var e=n.scrollTop();t.map(o,function(t){window.clearTimeout(t.timeoutId),t.timeoutId=window.setTimeout(function(){t.handler(e)},t.options.delay)})}).on("load",function(){n.trigger("scroll")}),jQuery.fn.scrollex=function(l){var s=t(this);if(0==this.length)return s;if(this.length>1){for(var r=0;r=i&&o>=t};break;case"bottom":h=function(t,e,n,i,o){return n>=i&&o>=n};break;case"middle":h=function(t,e,n,i,o){return e>=i&&o>=e};break;case"top-only":h=function(t,e,n,i,o){return i>=t&&n>=i};break;case"bottom-only":h=function(t,e,n,i,o){return n>=o&&o>=t};break;default:case"default":h=function(t,e,n,i,o){return n>=i&&o>=t}}return c=function(t){var i,o,l,s,r,a,u=this.state,h=!1,c=this.$element.offset();i=n.height(),o=t+i/2,l=t+i,s=this.$element.outerHeight(),r=c.top+e(this.options.top,s,i),a=c.top+s-e(this.options.bottom,s,i),h=this.test(t,o,l,r,a),h!=u&&(this.state=h,h?this.options.enter&&this.options.enter.apply(this.element):this.options.leave&&this.options.leave.apply(this.element)),this.options.scroll&&this.options.scroll.apply(this.element,[(o-r)/(a-r)])},p={id:a,options:u,test:h,handler:c,state:null,element:this,$element:s,timeoutId:null},o[a]=p,s.data("_scrollexId",p.id),p.options.initialize&&p.options.initialize.apply(this),s},jQuery.fn.unscrollex=function(){var e=t(this);if(0==this.length)return e;if(this.length>1){for(var n=0;n1){for(o=0;o $window.height()) 61 | $x.css('height', 'auto'); 62 | else 63 | $x.css('height', '100vh'); 64 | 65 | }, 250); 66 | 67 | }).triggerHandler('resize.flexbox-fix'); 68 | 69 | })(); 70 | 71 | // Object fit workaround. 72 | if (!skel.canUse('object-fit')) 73 | (function() { 74 | 75 | $('.banner .image, .spotlight .image').each(function() { 76 | 77 | var $this = $(this), 78 | $img = $this.children('img'), 79 | positionClass = $this.parent().attr('class').match(/image-position-([a-z]+)/); 80 | 81 | // Set image. 82 | $this 83 | .css('background-image', 'url("' + $img.attr('src') + '")') 84 | .css('background-repeat', 'no-repeat') 85 | .css('background-size', 'cover'); 86 | 87 | // Set position. 88 | switch (positionClass.length > 1 ? positionClass[1] : '') { 89 | 90 | case 'left': 91 | $this.css('background-position', 'left'); 92 | break; 93 | 94 | case 'right': 95 | $this.css('background-position', 'right'); 96 | break; 97 | 98 | default: 99 | case 'center': 100 | $this.css('background-position', 'center'); 101 | break; 102 | 103 | } 104 | 105 | // Hide original. 106 | $img.css('opacity', '0'); 107 | 108 | }); 109 | 110 | })(); 111 | 112 | // Smooth scroll. 113 | $('.smooth-scroll').scrolly(); 114 | $('.smooth-scroll-middle').scrolly({ anchor: 'middle' }); 115 | 116 | // Wrapper. 117 | $wrapper.children() 118 | .scrollex({ 119 | top: '30vh', 120 | bottom: '30vh', 121 | initialize: function() { 122 | $(this).addClass('is-inactive'); 123 | }, 124 | terminate: function() { 125 | $(this).removeClass('is-inactive'); 126 | }, 127 | enter: function() { 128 | $(this).removeClass('is-inactive'); 129 | }, 130 | leave: function() { 131 | 132 | var $this = $(this); 133 | 134 | if ($this.hasClass('onscroll-bidirectional')) 135 | $this.addClass('is-inactive'); 136 | 137 | } 138 | }); 139 | 140 | // Items. 141 | $('.items') 142 | .scrollex({ 143 | top: '30vh', 144 | bottom: '30vh', 145 | delay: 50, 146 | initialize: function() { 147 | $(this).addClass('is-inactive'); 148 | }, 149 | terminate: function() { 150 | $(this).removeClass('is-inactive'); 151 | }, 152 | enter: function() { 153 | $(this).removeClass('is-inactive'); 154 | }, 155 | leave: function() { 156 | 157 | var $this = $(this); 158 | 159 | if ($this.hasClass('onscroll-bidirectional')) 160 | $this.addClass('is-inactive'); 161 | 162 | } 163 | }) 164 | .children() 165 | .wrapInner('
'); 166 | 167 | // Gallery. 168 | $('.gallery') 169 | .wrapInner('
') 170 | .prepend(skel.vars.mobile ? '' : '
') 171 | .scrollex({ 172 | top: '30vh', 173 | bottom: '30vh', 174 | delay: 50, 175 | initialize: function() { 176 | $(this).addClass('is-inactive'); 177 | }, 178 | terminate: function() { 179 | $(this).removeClass('is-inactive'); 180 | }, 181 | enter: function() { 182 | $(this).removeClass('is-inactive'); 183 | }, 184 | leave: function() { 185 | 186 | var $this = $(this); 187 | 188 | if ($this.hasClass('onscroll-bidirectional')) 189 | $this.addClass('is-inactive'); 190 | 191 | } 192 | }) 193 | .children('.inner') 194 | //.css('overflow', 'hidden') 195 | .css('overflow-y', skel.vars.mobile ? 'visible' : 'hidden') 196 | .css('overflow-x', skel.vars.mobile ? 'scroll' : 'hidden') 197 | .scrollLeft(0); 198 | 199 | // Style #1. 200 | // ... 201 | 202 | // Style #2. 203 | $('.gallery') 204 | .on('wheel', '.inner', function(event) { 205 | 206 | var $this = $(this), 207 | delta = (event.originalEvent.deltaX * 10); 208 | 209 | // Cap delta. 210 | if (delta > 0) 211 | delta = Math.min(25, delta); 212 | else if (delta < 0) 213 | delta = Math.max(-25, delta); 214 | 215 | // Scroll. 216 | $this.scrollLeft( $this.scrollLeft() + delta ); 217 | 218 | }) 219 | .on('mouseenter', '.forward, .backward', function(event) { 220 | 221 | var $this = $(this), 222 | $inner = $this.siblings('.inner'), 223 | direction = ($this.hasClass('forward') ? 1 : -1); 224 | 225 | // Clear move interval. 226 | clearInterval(this._gallery_moveIntervalId); 227 | 228 | // Start interval. 229 | this._gallery_moveIntervalId = setInterval(function() { 230 | $inner.scrollLeft( $inner.scrollLeft() + (5 * direction) ); 231 | }, 10); 232 | 233 | }) 234 | .on('mouseleave', '.forward, .backward', function(event) { 235 | 236 | // Clear move interval. 237 | clearInterval(this._gallery_moveIntervalId); 238 | 239 | }); 240 | 241 | // Lightbox. 242 | $('.gallery.lightbox') 243 | .on('click', 'a', function(event) { 244 | 245 | var $a = $(this), 246 | $gallery = $a.parents('.gallery'), 247 | $modal = $gallery.children('.modal'), 248 | $modalImg = $modal.find('img'), 249 | href = $a.attr('href'); 250 | 251 | // Not an image? Bail. 252 | if (!href.match(/\.(jpg|gif|png|mp4)$/)) 253 | return; 254 | 255 | // Prevent default. 256 | event.preventDefault(); 257 | event.stopPropagation(); 258 | 259 | // Locked? Bail. 260 | if ($modal[0]._locked) 261 | return; 262 | 263 | // Lock. 264 | $modal[0]._locked = true; 265 | 266 | // Set src. 267 | $modalImg.attr('src', href); 268 | 269 | // Set visible. 270 | $modal.addClass('visible'); 271 | 272 | // Focus. 273 | $modal.focus(); 274 | 275 | // Delay. 276 | setTimeout(function() { 277 | 278 | // Unlock. 279 | $modal[0]._locked = false; 280 | 281 | }, 600); 282 | 283 | }) 284 | .on('click', '.modal', function(event) { 285 | 286 | var $modal = $(this), 287 | $modalImg = $modal.find('img'); 288 | 289 | // Locked? Bail. 290 | if ($modal[0]._locked) 291 | return; 292 | 293 | // Already hidden? Bail. 294 | if (!$modal.hasClass('visible')) 295 | return; 296 | 297 | // Lock. 298 | $modal[0]._locked = true; 299 | 300 | // Clear visible, loaded. 301 | $modal 302 | .removeClass('loaded') 303 | 304 | // Delay. 305 | setTimeout(function() { 306 | 307 | $modal 308 | .removeClass('visible') 309 | 310 | setTimeout(function() { 311 | 312 | // Clear src. 313 | $modalImg.attr('src', ''); 314 | 315 | // Unlock. 316 | $modal[0]._locked = false; 317 | 318 | // Focus. 319 | $body.focus(); 320 | 321 | }, 475); 322 | 323 | }, 125); 324 | 325 | }) 326 | .on('keypress', '.modal', function(event) { 327 | 328 | var $modal = $(this); 329 | 330 | // Escape? Hide modal. 331 | if (event.keyCode == 27) 332 | $modal.trigger('click'); 333 | 334 | }) 335 | .prepend('') 336 | .find('img') 337 | .on('load', function(event) { 338 | 339 | var $modalImg = $(this), 340 | $modal = $modalImg.parents('.modal'); 341 | 342 | setTimeout(function() { 343 | 344 | // No longer visible? Bail. 345 | if (!$modal.hasClass('visible')) 346 | return; 347 | 348 | // Set loaded. 349 | $modal.addClass('loaded'); 350 | 351 | }, 275); 352 | 353 | }); 354 | 355 | }); 356 | 357 | })(jQuery); 358 | -------------------------------------------------------------------------------- /src/assets/js/skel.min.js: -------------------------------------------------------------------------------- 1 | /* skel.js v3.0.1 | (c) skel.io | MIT licensed */ 2 | var skel=function(){"use strict";var t={breakpointIds:null,events:{},isInit:!1,obj:{attachments:{},breakpoints:{},head:null,states:{}},sd:"/",state:null,stateHandlers:{},stateId:"",vars:{},DOMReady:null,indexOf:null,isArray:null,iterate:null,matchesMedia:null,extend:function(e,n){t.iterate(n,function(i){t.isArray(n[i])?(t.isArray(e[i])||(e[i]=[]),t.extend(e[i],n[i])):"object"==typeof n[i]?("object"!=typeof e[i]&&(e[i]={}),t.extend(e[i],n[i])):e[i]=n[i]})},newStyle:function(t){var e=document.createElement("style");return e.type="text/css",e.innerHTML=t,e},_canUse:null,canUse:function(e){t._canUse||(t._canUse=document.createElement("div"));var n=t._canUse.style,i=e.charAt(0).toUpperCase()+e.slice(1);return e in n||"Moz"+i in n||"Webkit"+i in n||"O"+i in n||"ms"+i in n},on:function(e,n){var i=e.split(/[\s]+/);return t.iterate(i,function(e){var a=i[e];if(t.isInit){if("init"==a)return void n();if("change"==a)n();else{var r=a.charAt(0);if("+"==r||"!"==r){var o=a.substring(1);if(o in t.obj.breakpoints)if("+"==r&&t.obj.breakpoints[o].active)n();else if("!"==r&&!t.obj.breakpoints[o].active)return void n()}}}t.events[a]||(t.events[a]=[]),t.events[a].push(n)}),t},trigger:function(e){return t.events[e]&&0!=t.events[e].length?(t.iterate(t.events[e],function(n){t.events[e][n]()}),t):void 0},breakpoint:function(e){return t.obj.breakpoints[e]},breakpoints:function(e){function n(t,e){this.name=this.id=t,this.media=e,this.active=!1,this.wasActive=!1}return n.prototype.matches=function(){return t.matchesMedia(this.media)},n.prototype.sync=function(){this.wasActive=this.active,this.active=this.matches()},t.iterate(e,function(i){t.obj.breakpoints[i]=new n(i,e[i])}),window.setTimeout(function(){t.poll()},0),t},addStateHandler:function(e,n){t.stateHandlers[e]=n},callStateHandler:function(e){var n=t.stateHandlers[e]();t.iterate(n,function(e){t.state.attachments.push(n[e])})},changeState:function(e){t.iterate(t.obj.breakpoints,function(e){t.obj.breakpoints[e].sync()}),t.vars.lastStateId=t.stateId,t.stateId=e,t.breakpointIds=t.stateId===t.sd?[]:t.stateId.substring(1).split(t.sd),t.obj.states[t.stateId]?t.state=t.obj.states[t.stateId]:(t.obj.states[t.stateId]={attachments:[]},t.state=t.obj.states[t.stateId],t.iterate(t.stateHandlers,t.callStateHandler)),t.detachAll(t.state.attachments),t.attachAll(t.state.attachments),t.vars.stateId=t.stateId,t.vars.state=t.state,t.trigger("change"),t.iterate(t.obj.breakpoints,function(e){t.obj.breakpoints[e].active?t.obj.breakpoints[e].wasActive||t.trigger("+"+e):t.obj.breakpoints[e].wasActive&&t.trigger("-"+e)})},generateStateConfig:function(e,n){var i={};return t.extend(i,e),t.iterate(t.breakpointIds,function(e){t.extend(i,n[t.breakpointIds[e]])}),i},getStateId:function(){var e="";return t.iterate(t.obj.breakpoints,function(n){var i=t.obj.breakpoints[n];i.matches()&&(e+=t.sd+i.id)}),e},poll:function(){var e="";e=t.getStateId(),""===e&&(e=t.sd),e!==t.stateId&&t.changeState(e)},_attach:null,attach:function(e){var n=t.obj.head,i=e.element;return i.parentNode&&i.parentNode.tagName?!1:(t._attach||(t._attach=n.firstChild),n.insertBefore(i,t._attach.nextSibling),e.permanent&&(t._attach=i),!0)},attachAll:function(e){var n=[];t.iterate(e,function(t){n[e[t].priority]||(n[e[t].priority]=[]),n[e[t].priority].push(e[t])}),n.reverse(),t.iterate(n,function(e){t.iterate(n[e],function(i){t.attach(n[e][i])})})},detach:function(t){var e=t.element;return t.permanent||!e.parentNode||e.parentNode&&!e.parentNode.tagName?!1:(e.parentNode.removeChild(e),!0)},detachAll:function(e){var n={};t.iterate(e,function(t){n[e[t].id]=!0}),t.iterate(t.obj.attachments,function(e){e in n||t.detach(t.obj.attachments[e])})},attachment:function(e){return e in t.obj.attachments?t.obj.attachments[e]:null},newAttachment:function(e,n,i,a){return t.obj.attachments[e]={id:e,element:n,priority:i,permanent:a}},init:function(){t.initMethods(),t.initVars(),t.initEvents(),t.obj.head=document.getElementsByTagName("head")[0],t.isInit=!0,t.trigger("init")},initEvents:function(){t.on("resize",function(){t.poll()}),t.on("orientationChange",function(){t.poll()}),t.DOMReady(function(){t.trigger("ready")}),window.onload&&t.on("load",window.onload),window.onload=function(){t.trigger("load")},window.onresize&&t.on("resize",window.onresize),window.onresize=function(){t.trigger("resize")},window.onorientationchange&&t.on("orientationChange",window.onorientationchange),window.onorientationchange=function(){t.trigger("orientationChange")}},initMethods:function(){document.addEventListener?!function(e,n){t.DOMReady=n()}("domready",function(){function t(t){for(r=1;t=n.shift();)t()}var e,n=[],i=document,a="DOMContentLoaded",r=/^loaded|^c/.test(i.readyState);return i.addEventListener(a,e=function(){i.removeEventListener(a,e),t()}),function(t){r?t():n.push(t)}}):!function(e,n){t.DOMReady=n()}("domready",function(t){function e(t){for(h=1;t=i.shift();)t()}var n,i=[],a=!1,r=document,o=r.documentElement,s=o.doScroll,c="DOMContentLoaded",d="addEventListener",u="onreadystatechange",l="readyState",f=s?/^loaded|^c/:/^loaded|c/,h=f.test(r[l]);return r[d]&&r[d](c,n=function(){r.removeEventListener(c,n,a),e()},a),s&&r.attachEvent(u,n=function(){/^c/.test(r[l])&&(r.detachEvent(u,n),e())}),t=s?function(e){self!=top?h?e():i.push(e):function(){try{o.doScroll("left")}catch(n){return setTimeout(function(){t(e)},50)}e()}()}:function(t){h?t():i.push(t)}}),Array.prototype.indexOf?t.indexOf=function(t,e){return t.indexOf(e)}:t.indexOf=function(t,e){if("string"==typeof t)return t.indexOf(e);var n,i,a=e?e:0;if(!this)throw new TypeError;if(i=this.length,0===i||a>=i)return-1;for(0>a&&(a=i-Math.abs(a)),n=a;i>n;n++)if(this[n]===t)return n;return-1},Array.isArray?t.isArray=function(t){return Array.isArray(t)}:t.isArray=function(t){return"[object Array]"===Object.prototype.toString.call(t)},Object.keys?t.iterate=function(t,e){if(!t)return[];var n,i=Object.keys(t);for(n=0;i[n]&&e(i[n],t[i[n]])!==!1;n++);}:t.iterate=function(t,e){if(!t)return[];var n;for(n in t)if(Object.prototype.hasOwnProperty.call(t,n)&&e(n,t[n])===!1)break},window.matchMedia?t.matchesMedia=function(t){return""==t?!0:window.matchMedia(t).matches}:window.styleMedia||window.media?t.matchesMedia=function(t){if(""==t)return!0;var e=window.styleMedia||window.media;return e.matchMedium(t||"all")}:window.getComputedStyle?t.matchesMedia=function(t){if(""==t)return!0;var e=document.createElement("style"),n=document.getElementsByTagName("script")[0],i=null;e.type="text/css",e.id="matchmediajs-test",n.parentNode.insertBefore(e,n),i="getComputedStyle"in window&&window.getComputedStyle(e,null)||e.currentStyle;var a="@media "+t+"{ #matchmediajs-test { width: 1px; } }";return e.styleSheet?e.styleSheet.cssText=a:e.textContent=a,"1px"===i.width}:t.matchesMedia=function(t){if(""==t)return!0;var e,n,i,a,r={"min-width":null,"max-width":null},o=!1;for(i=t.split(/\s+and\s+/),e=0;er["max-width"]||null!==r["min-height"]&&cr["max-height"]?!1:!0},navigator.userAgent.match(/MSIE ([0-9]+)/)&&RegExp.$1<9&&(t.newStyle=function(t){var e=document.createElement("span");return e.innerHTML=' ",e})},initVars:function(){var e,n,i,a=navigator.userAgent;e="other",n=0,i=[["firefox",/Firefox\/([0-9\.]+)/],["bb",/BlackBerry.+Version\/([0-9\.]+)/],["bb",/BB[0-9]+.+Version\/([0-9\.]+)/],["opera",/OPR\/([0-9\.]+)/],["opera",/Opera\/([0-9\.]+)/],["edge",/Edge\/([0-9\.]+)/],["safari",/Version\/([0-9\.]+).+Safari/],["chrome",/Chrome\/([0-9\.]+)/],["ie",/MSIE ([0-9]+)/],["ie",/Trident\/.+rv:([0-9]+)/]],t.iterate(i,function(t,i){return a.match(i[1])?(e=i[0],n=parseFloat(RegExp.$1),!1):void 0}),t.vars.browser=e,t.vars.browserVersion=n,e="other",n=0,i=[["ios",/([0-9_]+) like Mac OS X/,function(t){return t.replace("_",".").replace("_","")}],["ios",/CPU like Mac OS X/,function(t){return 0}],["wp",/Windows Phone ([0-9\.]+)/,null],["android",/Android ([0-9\.]+)/,null],["mac",/Macintosh.+Mac OS X ([0-9_]+)/,function(t){return t.replace("_",".").replace("_","")}],["windows",/Windows NT ([0-9\.]+)/,null],["bb",/BlackBerry.+Version\/([0-9\.]+)/,null],["bb",/BB[0-9]+.+Version\/([0-9\.]+)/,null]],t.iterate(i,function(t,i){return a.match(i[1])?(e=i[0],n=parseFloat(i[2]?i[2](RegExp.$1):RegExp.$1),!1):void 0}),t.vars.os=e,t.vars.osVersion=n,t.vars.IEVersion="ie"==t.vars.browser?t.vars.browserVersion:99,t.vars.touch="wp"==t.vars.os?navigator.msMaxTouchPoints>0:!!("ontouchstart"in window),t.vars.mobile="wp"==t.vars.os||"android"==t.vars.os||"ios"==t.vars.os||"bb"==t.vars.os}};return t.init(),t}();!function(t,e){"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?module.exports=e():t.skel=e()}(this,function(){return skel}); 3 | -------------------------------------------------------------------------------- /src/assets/js/util.js: -------------------------------------------------------------------------------- 1 | (function($) { 2 | 3 | /** 4 | * Generate an indented list of links from a nav. Meant for use with panel(). 5 | * @return {jQuery} jQuery object. 6 | */ 7 | $.fn.navList = function() { 8 | 9 | var $this = $(this); 10 | $a = $this.find('a'), 11 | b = []; 12 | 13 | $a.each(function() { 14 | 15 | var $this = $(this), 16 | indent = Math.max(0, $this.parents('li').length - 1), 17 | href = $this.attr('href'), 18 | target = $this.attr('target'); 19 | 20 | b.push( 21 | '' + 26 | '' + 27 | $this.text() + 28 | '' 29 | ); 30 | 31 | }); 32 | 33 | return b.join(''); 34 | 35 | }; 36 | 37 | /** 38 | * Panel-ify an element. 39 | * @param {object} userConfig User config. 40 | * @return {jQuery} jQuery object. 41 | */ 42 | $.fn.panel = function(userConfig) { 43 | 44 | // No elements? 45 | if (this.length == 0) 46 | return $this; 47 | 48 | // Multiple elements? 49 | if (this.length > 1) { 50 | 51 | for (var i=0; i < this.length; i++) 52 | $(this[i]).panel(userConfig); 53 | 54 | return $this; 55 | 56 | } 57 | 58 | // Vars. 59 | var $this = $(this), 60 | $body = $('body'), 61 | $window = $(window), 62 | id = $this.attr('id'), 63 | config; 64 | 65 | // Config. 66 | config = $.extend({ 67 | 68 | // Delay. 69 | delay: 0, 70 | 71 | // Hide panel on link click. 72 | hideOnClick: false, 73 | 74 | // Hide panel on escape keypress. 75 | hideOnEscape: false, 76 | 77 | // Hide panel on swipe. 78 | hideOnSwipe: false, 79 | 80 | // Reset scroll position on hide. 81 | resetScroll: false, 82 | 83 | // Reset forms on hide. 84 | resetForms: false, 85 | 86 | // Side of viewport the panel will appear. 87 | side: null, 88 | 89 | // Target element for "class". 90 | target: $this, 91 | 92 | // Class to toggle. 93 | visibleClass: 'visible' 94 | 95 | }, userConfig); 96 | 97 | // Expand "target" if it's not a jQuery object already. 98 | if (typeof config.target != 'jQuery') 99 | config.target = $(config.target); 100 | 101 | // Panel. 102 | 103 | // Methods. 104 | $this._hide = function(event) { 105 | 106 | // Already hidden? Bail. 107 | if (!config.target.hasClass(config.visibleClass)) 108 | return; 109 | 110 | // If an event was provided, cancel it. 111 | if (event) { 112 | 113 | event.preventDefault(); 114 | event.stopPropagation(); 115 | 116 | } 117 | 118 | // Hide. 119 | config.target.removeClass(config.visibleClass); 120 | 121 | // Post-hide stuff. 122 | window.setTimeout(function() { 123 | 124 | // Reset scroll position. 125 | if (config.resetScroll) 126 | $this.scrollTop(0); 127 | 128 | // Reset forms. 129 | if (config.resetForms) 130 | $this.find('form').each(function() { 131 | this.reset(); 132 | }); 133 | 134 | }, config.delay); 135 | 136 | }; 137 | 138 | // Vendor fixes. 139 | $this 140 | .css('-ms-overflow-style', '-ms-autohiding-scrollbar') 141 | .css('-webkit-overflow-scrolling', 'touch'); 142 | 143 | // Hide on click. 144 | if (config.hideOnClick) { 145 | 146 | $this.find('a') 147 | .css('-webkit-tap-highlight-color', 'rgba(0,0,0,0)'); 148 | 149 | $this 150 | .on('click', 'a', function(event) { 151 | 152 | var $a = $(this), 153 | href = $a.attr('href'), 154 | target = $a.attr('target'); 155 | 156 | if (!href || href == '#' || href == '' || href == '#' + id) 157 | return; 158 | 159 | // Cancel original event. 160 | event.preventDefault(); 161 | event.stopPropagation(); 162 | 163 | // Hide panel. 164 | $this._hide(); 165 | 166 | // Redirect to href. 167 | window.setTimeout(function() { 168 | 169 | if (target == '_blank') 170 | window.open(href); 171 | else 172 | window.location.href = href; 173 | 174 | }, config.delay + 10); 175 | 176 | }); 177 | 178 | } 179 | 180 | // Event: Touch stuff. 181 | $this.on('touchstart', function(event) { 182 | 183 | $this.touchPosX = event.originalEvent.touches[0].pageX; 184 | $this.touchPosY = event.originalEvent.touches[0].pageY; 185 | 186 | }) 187 | 188 | $this.on('touchmove', function(event) { 189 | 190 | if ($this.touchPosX === null 191 | || $this.touchPosY === null) 192 | return; 193 | 194 | var diffX = $this.touchPosX - event.originalEvent.touches[0].pageX, 195 | diffY = $this.touchPosY - event.originalEvent.touches[0].pageY, 196 | th = $this.outerHeight(), 197 | ts = ($this.get(0).scrollHeight - $this.scrollTop()); 198 | 199 | // Hide on swipe? 200 | if (config.hideOnSwipe) { 201 | 202 | var result = false, 203 | boundary = 20, 204 | delta = 50; 205 | 206 | switch (config.side) { 207 | 208 | case 'left': 209 | result = (diffY < boundary && diffY > (-1 * boundary)) && (diffX > delta); 210 | break; 211 | 212 | case 'right': 213 | result = (diffY < boundary && diffY > (-1 * boundary)) && (diffX < (-1 * delta)); 214 | break; 215 | 216 | case 'top': 217 | result = (diffX < boundary && diffX > (-1 * boundary)) && (diffY > delta); 218 | break; 219 | 220 | case 'bottom': 221 | result = (diffX < boundary && diffX > (-1 * boundary)) && (diffY < (-1 * delta)); 222 | break; 223 | 224 | default: 225 | break; 226 | 227 | } 228 | 229 | if (result) { 230 | 231 | $this.touchPosX = null; 232 | $this.touchPosY = null; 233 | $this._hide(); 234 | 235 | return false; 236 | 237 | } 238 | 239 | } 240 | 241 | // Prevent vertical scrolling past the top or bottom. 242 | if (($this.scrollTop() < 0 && diffY < 0) 243 | || (ts > (th - 2) && ts < (th + 2) && diffY > 0)) { 244 | 245 | event.preventDefault(); 246 | event.stopPropagation(); 247 | 248 | } 249 | 250 | }); 251 | 252 | // Event: Prevent certain events inside the panel from bubbling. 253 | $this.on('click touchend touchstart touchmove', function(event) { 254 | event.stopPropagation(); 255 | }); 256 | 257 | // Event: Hide panel if a child anchor tag pointing to its ID is clicked. 258 | $this.on('click', 'a[href="#' + id + '"]', function(event) { 259 | 260 | event.preventDefault(); 261 | event.stopPropagation(); 262 | 263 | config.target.removeClass(config.visibleClass); 264 | 265 | }); 266 | 267 | // Body. 268 | 269 | // Event: Hide panel on body click/tap. 270 | $body.on('click touchend', function(event) { 271 | $this._hide(event); 272 | }); 273 | 274 | // Event: Toggle. 275 | $body.on('click', 'a[href="#' + id + '"]', function(event) { 276 | 277 | event.preventDefault(); 278 | event.stopPropagation(); 279 | 280 | config.target.toggleClass(config.visibleClass); 281 | 282 | }); 283 | 284 | // Window. 285 | 286 | // Event: Hide on ESC. 287 | if (config.hideOnEscape) 288 | $window.on('keydown', function(event) { 289 | 290 | if (event.keyCode == 27) 291 | $this._hide(event); 292 | 293 | }); 294 | 295 | return $this; 296 | 297 | }; 298 | 299 | /** 300 | * Apply "placeholder" attribute polyfill to one or more forms. 301 | * @return {jQuery} jQuery object. 302 | */ 303 | $.fn.placeholder = function() { 304 | 305 | // Browser natively supports placeholders? Bail. 306 | if (typeof (document.createElement('input')).placeholder != 'undefined') 307 | return $(this); 308 | 309 | // No elements? 310 | if (this.length == 0) 311 | return $this; 312 | 313 | // Multiple elements? 314 | if (this.length > 1) { 315 | 316 | for (var i=0; i < this.length; i++) 317 | $(this[i]).placeholder(); 318 | 319 | return $this; 320 | 321 | } 322 | 323 | // Vars. 324 | var $this = $(this); 325 | 326 | // Text, TextArea. 327 | $this.find('input[type=text],textarea') 328 | .each(function() { 329 | 330 | var i = $(this); 331 | 332 | if (i.val() == '' 333 | || i.val() == i.attr('placeholder')) 334 | i 335 | .addClass('polyfill-placeholder') 336 | .val(i.attr('placeholder')); 337 | 338 | }) 339 | .on('blur', function() { 340 | 341 | var i = $(this); 342 | 343 | if (i.attr('name').match(/-polyfill-field$/)) 344 | return; 345 | 346 | if (i.val() == '') 347 | i 348 | .addClass('polyfill-placeholder') 349 | .val(i.attr('placeholder')); 350 | 351 | }) 352 | .on('focus', function() { 353 | 354 | var i = $(this); 355 | 356 | if (i.attr('name').match(/-polyfill-field$/)) 357 | return; 358 | 359 | if (i.val() == i.attr('placeholder')) 360 | i 361 | .removeClass('polyfill-placeholder') 362 | .val(''); 363 | 364 | }); 365 | 366 | // Password. 367 | $this.find('input[type=password]') 368 | .each(function() { 369 | 370 | var i = $(this); 371 | var x = $( 372 | $('
') 373 | .append(i.clone()) 374 | .remove() 375 | .html() 376 | .replace(/type="password"/i, 'type="text"') 377 | .replace(/type=password/i, 'type=text') 378 | ); 379 | 380 | if (i.attr('id') != '') 381 | x.attr('id', i.attr('id') + '-polyfill-field'); 382 | 383 | if (i.attr('name') != '') 384 | x.attr('name', i.attr('name') + '-polyfill-field'); 385 | 386 | x.addClass('polyfill-placeholder') 387 | .val(x.attr('placeholder')).insertAfter(i); 388 | 389 | if (i.val() == '') 390 | i.hide(); 391 | else 392 | x.hide(); 393 | 394 | i 395 | .on('blur', function(event) { 396 | 397 | event.preventDefault(); 398 | 399 | var x = i.parent().find('input[name=' + i.attr('name') + '-polyfill-field]'); 400 | 401 | if (i.val() == '') { 402 | 403 | i.hide(); 404 | x.show(); 405 | 406 | } 407 | 408 | }); 409 | 410 | x 411 | .on('focus', function(event) { 412 | 413 | event.preventDefault(); 414 | 415 | var i = x.parent().find('input[name=' + x.attr('name').replace('-polyfill-field', '') + ']'); 416 | 417 | x.hide(); 418 | 419 | i 420 | .show() 421 | .focus(); 422 | 423 | }) 424 | .on('keypress', function(event) { 425 | 426 | event.preventDefault(); 427 | x.val(''); 428 | 429 | }); 430 | 431 | }); 432 | 433 | // Events. 434 | $this 435 | .on('submit', function() { 436 | 437 | $this.find('input[type=text],input[type=password],textarea') 438 | .each(function(event) { 439 | 440 | var i = $(this); 441 | 442 | if (i.attr('name').match(/-polyfill-field$/)) 443 | i.attr('name', ''); 444 | 445 | if (i.val() == i.attr('placeholder')) { 446 | 447 | i.removeClass('polyfill-placeholder'); 448 | i.val(''); 449 | 450 | } 451 | 452 | }); 453 | 454 | }) 455 | .on('reset', function(event) { 456 | 457 | event.preventDefault(); 458 | 459 | $this.find('select') 460 | .val($('option:first').val()); 461 | 462 | $this.find('input,textarea') 463 | .each(function() { 464 | 465 | var i = $(this), 466 | x; 467 | 468 | i.removeClass('polyfill-placeholder'); 469 | 470 | switch (this.type) { 471 | 472 | case 'submit': 473 | case 'reset': 474 | break; 475 | 476 | case 'password': 477 | i.val(i.attr('defaultValue')); 478 | 479 | x = i.parent().find('input[name=' + i.attr('name') + '-polyfill-field]'); 480 | 481 | if (i.val() == '') { 482 | i.hide(); 483 | x.show(); 484 | } 485 | else { 486 | i.show(); 487 | x.hide(); 488 | } 489 | 490 | break; 491 | 492 | case 'checkbox': 493 | case 'radio': 494 | i.attr('checked', i.attr('defaultValue')); 495 | break; 496 | 497 | case 'text': 498 | case 'textarea': 499 | i.val(i.attr('defaultValue')); 500 | 501 | if (i.val() == '') { 502 | i.addClass('polyfill-placeholder'); 503 | i.val(i.attr('placeholder')); 504 | } 505 | 506 | break; 507 | 508 | default: 509 | i.val(i.attr('defaultValue')); 510 | break; 511 | 512 | } 513 | }); 514 | 515 | }); 516 | 517 | return $this; 518 | 519 | }; 520 | 521 | /** 522 | * Moves elements to/from the first positions of their respective parents. 523 | * @param {jQuery} $elements Elements (or selector) to move. 524 | * @param {bool} condition If true, moves elements to the top. Otherwise, moves elements back to their original locations. 525 | */ 526 | $.prioritize = function($elements, condition) { 527 | 528 | var key = '__prioritize'; 529 | 530 | // Expand $elements if it's not already a jQuery object. 531 | if (typeof $elements != 'jQuery') 532 | $elements = $($elements); 533 | 534 | // Step through elements. 535 | $elements.each(function() { 536 | 537 | var $e = $(this), $p, 538 | $parent = $e.parent(); 539 | 540 | // No parent? Bail. 541 | if ($parent.length == 0) 542 | return; 543 | 544 | // Not moved? Move it. 545 | if (!$e.data(key)) { 546 | 547 | // Condition is false? Bail. 548 | if (!condition) 549 | return; 550 | 551 | // Get placeholder (which will serve as our point of reference for when this element needs to move back). 552 | $p = $e.prev(); 553 | 554 | // Couldn't find anything? Means this element's already at the top, so bail. 555 | if ($p.length == 0) 556 | return; 557 | 558 | // Move element to top of parent. 559 | $e.prependTo($parent); 560 | 561 | // Mark element as moved. 562 | $e.data(key, $p); 563 | 564 | } 565 | 566 | // Moved already? 567 | else { 568 | 569 | // Condition is true? Bail. 570 | if (condition) 571 | return; 572 | 573 | $p = $e.data(key); 574 | 575 | // Move element back to its original location (using our placeholder). 576 | $e.insertAfter($p); 577 | 578 | // Unmark element as moved. 579 | $e.removeData(key); 580 | 581 | } 582 | 583 | }); 584 | 585 | }; 586 | 587 | })(jQuery); -------------------------------------------------------------------------------- /src/commonSlices/testSlice.js: -------------------------------------------------------------------------------- 1 | import { createSlice } from "@reduxjs/toolkit"; 2 | 3 | const initialState = { 4 | tickets: [], 5 | test: "testing", 6 | isLoading: false, 7 | error: "", 8 | replyTicketError: "", 9 | searchTicketList: [], 10 | selectedTicket: {}, 11 | replyMsg: "", 12 | cart: [], 13 | }; 14 | 15 | const testSlice = createSlice({ 16 | name: "testSlice", 17 | initialState, 18 | reducers: { 19 | fetchTicketLoading: (state) => { 20 | state.isLoading = true; 21 | }, 22 | fetchTicketSuccess: (state, action) => { 23 | state.tickets = action.payload; 24 | state.searchTicketList = action.payload; 25 | state.isLoading = false; 26 | }, 27 | fetchTicketFail: (state, { payload }) => { 28 | state.isLoading = false; 29 | state.error = payload; 30 | }, 31 | }, 32 | }); 33 | 34 | const { reducer, actions } = testSlice; 35 | 36 | export const { 37 | fetchTicketLoading, 38 | fetchTicketSuccess, 39 | fetchTicketFail, 40 | fetchSingleTicketLoading, 41 | fetchSingleTicketSuccess, 42 | fetchSingleTicketFail, 43 | 44 | } = actions; 45 | 46 | export default reducer; -------------------------------------------------------------------------------- /src/components/app.js: -------------------------------------------------------------------------------- 1 | import React, { Component } from 'react'; 2 | import Footer from './footer'; 3 | 4 | export default class App extends Component { 5 | render() { 6 | return ( 7 |
8 | {this.props.children} 9 |
10 |
11 | ); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /src/components/asset.js: -------------------------------------------------------------------------------- 1 | import React, { Component } from 'react'; 2 | import { connect } from 'react-redux'; 3 | import { fetchAsset } from '../actions/index'; 4 | 5 | class Asset extends Component { 6 | componentWillMount() { 7 | this.props.fetchAsset(this.props.assetId) 8 | } 9 | renderAsset() { 10 | return this.props.assets.map((asset) => { 11 | if (asset.sys.id == this.props.assetId) { 12 | return ( 13 | {asset.fields.file.fileName} 14 | ); 15 | } 16 | }); 17 | } 18 | render() { 19 | return ( 20 |
21 | {this.renderAsset()} 22 |
23 | ); 24 | } 25 | } 26 | 27 | function mapStateToProps(state) { 28 | return { 29 | assets: state.assets 30 | }; 31 | } 32 | 33 | export default connect(mapStateToProps, { fetchAsset })(Asset) 34 | -------------------------------------------------------------------------------- /src/components/call_to_action.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import Markdown from 'react-remarkable'; 3 | 4 | export default class CallToAction extends React.Component { 5 | constructor(props) { 6 | super(props); 7 | } 8 | 9 | render() { 10 | return ( 11 |
12 |
13 |
14 | 15 | 16 | 17 |
18 |
19 |
20 | ) 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /src/components/footer.js: -------------------------------------------------------------------------------- 1 | import React, { Component } from 'react'; 2 | 3 | class Footer extends Component { 4 | render() { 5 | return( 6 |
7 |
8 |
9 |
Contentful Learning Services
10 |
11 |
12 |
13 | 14 | ); 15 | } 16 | } 17 | 18 | export default Footer; 19 | -------------------------------------------------------------------------------- /src/components/header.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | 3 | export default class Header extends React.Component { 4 | constructor(props) { 5 | super(props); 6 | } 7 | 8 | render() { 9 | //If the component comes through with an image resolved use that, otherwise use the test image 10 | //NOTE: For locales with no fallback or localized images added, this can happen currently 11 | const imageURL = (this.props.fields.logo && this.props.fields.logo.fields.file) ? this.props.fields.logo.fields.file.url : this.props.defaultImageURL; 12 | 13 | return ( 14 |
16 |
18 | 19 | 20 | 21 | 22 |
23 |
24 | {this.props.fields.navigationLinks.map((navLink) => { 25 | return ( 26 | 36 | ) 37 | })} 38 |
39 |
40 | ) 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /src/components/headline.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | 3 | export default class Headline extends React.Component { 4 | constructor(props) { 5 | super(props); 6 | } 7 | 8 | render() { 9 | return ( 10 |
11 |

{this.props.fields.headline}

12 |

{this.props.fields.subHeadline}

13 |
14 | ) 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /src/components/hero_image.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | 3 | export default class HeroImage extends React.Component { 4 | constructor(props) { 5 | super(props); 6 | } 7 | 8 | render() { 9 | //If the component comes through with an image resolved use that, otherwise use the test image 10 | //NOTE: For locales with no fallback or localized images added, this can happen currently 11 | //const imageURL = (this.props.fields.image && this.props.fields.image.fields.file) ? this.props.fields.image.fields.file.url : this.props.defaultImageURL; 12 | 13 | let imageURL = ''; 14 | if (this.props.fields.cloudinaryImage && this.props.fields.cloudinaryImage[0] && this.props.fields.cloudinaryImage[0].secure_url) { 15 | imageURL = this.props.fields.cloudinaryImage[0].secure_url + '?w=1600&q=80&fm=webp'; 16 | } else { 17 | imageURL = (this.props.fields.image && this.props.fields.image.fields.file) ? this.props.fields.image.fields.file.url : this.props.defaultImageURL; 18 | imageURL = imageURL + '?w=1600&q=80&fm=jpg&fl=progressive'; 19 | } 20 | 21 | return ( 22 |
26 | 27 | {/* The following sprite is to help load the background image faster */} 28 | 29 |
30 | ) 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /src/components/image_carousel.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import Slider from 'react-slick'; 3 | 4 | export default class ImageCarousel extends React.Component { 5 | constructor(props) { 6 | super(props); 7 | } 8 | 9 | render() { 10 | let images = [] 11 | for (let i = 0; i < this.props.fields.images.length; i++) { 12 | images.push(`https:${this.props.fields.images[i].fields.image.fields.file.url}`) 13 | } 14 | console.log(images); 15 | var settings = {infinite: true, speed: 400, slidesToShow: 1, slidesToScroll: 1} 16 | return ( 17 | 18 | {images.map((image) => ( 19 |
20 | 21 | 22 |
23 | ) 24 | )} 25 |
26 | ) 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /src/components/image_with_caption.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | 3 | export default class ImageWithCaption extends React.Component { 4 | constructor(props) { 5 | super(props); 6 | } 7 | 8 | render() { 9 | //If the component comes through with an image resolved use that, otherwise use the test image 10 | //NOTE: For locales with no fallback or localized images added, this can happen currently 11 | const imageURL = (this.props.fields.image && this.props.fields.image.fields.file) ? this.props.fields.image.fields.file.url : this.props.defaultImageURL; 12 | 13 | return ( 14 |
15 | 16 |
17 |
18 | 19 | 20 | 22 | 23 |
24 | {/* {JSON.stringify(this.props.fields.name)} */} 25 | 26 |
{this.props.fields.name}
27 |
28 | 29 | ) 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /src/components/locale_select.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | 3 | const LocaleSelect = (props) => { 4 | if (!props.locales){ 5 | return
; 6 | } 7 | 8 | //Make options from the current locale options 9 | let localeOptions = props.locales.map((code) => 10 | 11 | ); 12 | 13 | //Return JSX with select control for choosing locale options 14 | return ( 15 |
16 |
17 |
18 | 25 |
26 |
27 |
28 | 29 |
30 | ) 31 | } 32 | 33 | export default LocaleSelect; 34 | -------------------------------------------------------------------------------- /src/components/paragraph_with_headline.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import Markdown from 'react-remarkable'; 3 | 4 | export default class ParagraphWithHeadline extends React.Component { 5 | constructor(props) { 6 | super(props); 7 | } 8 | 9 | render() { 10 | return ( 11 |
15 | 16 |

{this.props.fields.headline}

17 | 18 |
19 | ) 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /src/components/product_show.js: -------------------------------------------------------------------------------- 1 | // import React, { Component, PropTypes } from 'react'; 2 | import React, { memo, useState, useEffect, useCallback } from "react"; 3 | import { Link } from "react-router"; 4 | import * as contentful from "contentful"; 5 | import Section from "./section"; 6 | import LocaleSelect from "./locale_select"; 7 | import config from "./config"; 8 | import ReactJson from "react-json-view"; 9 | 10 | import marked from "marked"; 11 | 12 | const Spinner = require("react-spinkit"); 13 | 14 | const TEST_IMAGE_URL = 15 | "https://images.ctfassets.net/34zhepmq2vpx/4ClyFr0XGwcOiKUMyyiMKO/c47e029fa790bf3c01b8900bd6cacf87/TWD_Test_Image6.png"; 16 | 17 | export default function ProductShow(props) { 18 | let options = {}; 19 | 20 | let is_preview = ""; 21 | let space_id = ""; 22 | let access_token = ""; 23 | 24 | options.space = space_id ? space_id : config.space_id; 25 | options.host = is_preview ? "preview.contentful.com" : undefined; 26 | options.accessToken = access_token 27 | ? access_token 28 | : is_preview 29 | ? config.preview_token 30 | : config.delivery_token; 31 | // hard code to start 32 | options.environment = config.environment ? config.environment : "master"; 33 | 34 | const [productsByLocale, setProductsByLocale] = useState(""); 35 | const [currentLocale, setCurrentLocale] = useState(""); 36 | const [defaultLocale, setDefaultLocale] = useState(""); 37 | const [locales, setLocales] = useState(""); 38 | 39 | const [defaultImageURL, setDefaultImageURL] = useState(""); 40 | 41 | const handleSelectLocale = (selectedCode) => { 42 | setCurrentLocale(selectedCode); 43 | }; 44 | 45 | // get contentful space data 46 | const getCtflSpace = async () => { 47 | // contentful queries here 48 | const contentfulClient = contentful.createClient(options); 49 | //Get the locales setup for the space and do necessary processing 50 | await contentfulClient 51 | .getLocales() 52 | .then((data) => { 53 | //Store current locale codes in array to be populated in select dropdown on page 54 | const localeCodes = data.items.map((localeData) => localeData.code); 55 | 56 | //Filter to find the default locale to use later 57 | const defaultLocaleHolder = data.items.filter( 58 | (item) => item.default === true 59 | )[0].code; 60 | 61 | let productsByLocaleHolder = {}; //placeholder for productsByLocal 62 | 63 | //Get entries for each locale setup for the space 64 | localeCodes.map((localeCode) => { 65 | contentfulClient 66 | .getEntries({ 67 | content_type: "landingPage", 68 | locale: localeCode, 69 | "fields.slug": props.location.pathname.split("/")[1], 70 | include: 10, 71 | }) 72 | .then((data2) => { 73 | productsByLocaleHolder[localeCode] = data2.items[0]; 74 | //If on the last object of the array, set the state after we get the entry 75 | if (localeCodes.indexOf(localeCode) == localeCodes.length - 1) { 76 | //Fetch a default image that can be used in case of errors retrieving others (e.g. fallbacks not defined and API doesn't return assets) 77 | //TODO: Handling this way for now since there hasn't been resolution whether this should fallback to the default locale or not. Can reassess when this is resolved. 78 | //Also set state 79 | 80 | setProductsByLocale(productsByLocaleHolder); 81 | setCurrentLocale(defaultLocaleHolder); 82 | setDefaultLocale(defaultLocaleHolder); 83 | setDefaultImageURL(TEST_IMAGE_URL); 84 | setLocales(localeCodes); 85 | } 86 | }) 87 | .catch((erx) => { 88 | console.log("An Error Occured", erx); 89 | }); 90 | }); 91 | }) 92 | .catch((ecflx) => { 93 | alert( 94 | "An Error Occured, Make sure you enable API key for 'demo' Enivironment on The Web App" 95 | ); 96 | console.log("An Error Occured", ecflx); 97 | }); 98 | }; 99 | 100 | // this runs on component mount 101 | useEffect(() => { 102 | getCtflSpace(); 103 | 104 | return () => {}; 105 | }, []); 106 | 107 | // this runs if has productsByLocale changed 108 | useEffect(() => { 109 | // if currentLocal not in returned data, run again 110 | //must make sure productsByLocale is not empty first 111 | if (productsByLocale) { 112 | if (!productsByLocale[currentLocale]) { 113 | getCtflSpace(); 114 | } 115 | } 116 | 117 | return () => {}; 118 | }, [productsByLocale]); 119 | 120 | if (!productsByLocale[currentLocale]) { 121 | return ( 122 |
123 |
124 | Loading... 125 |
126 | 127 | {productsByLocale ? ( 128 | <> 129 | {" "} 130 |
131 |
132 |

YOU MAY REVIEW THE JSON DATA HERE

133 |
134 |
135 | {productsByLocale ? ( 136 | 141 | ) : ( 142 | "" 143 | )} 144 |
145 |
146 | 147 | ) : ( 148 | "" 149 | )} 150 |
151 | ); 152 | } 153 | 154 | document.title = productsByLocale[currentLocale].fields.title; 155 | 156 | let sections = productsByLocale[currentLocale].fields.sections.map( 157 | (section, idx) => { 158 | if (section) { 159 | return ( 160 |
169 | ); 170 | } else { 171 | return "---"; 172 | } 173 | } 174 | ); 175 | 176 | return ( 177 |
178 | {sections} 179 | {locales ? ( 180 | 185 | ) : ( 186 | "" 187 | )} 188 | 189 |
190 |
191 |

YOU MAY REVIEW THE JSON DATA HERE

192 |
193 |
194 | {productsByLocale ? ( 195 | 200 | ) : ( 201 | "" 202 | )} 203 |
204 |
205 |
206 | ); 207 | } 208 | -------------------------------------------------------------------------------- /src/components/product_show2.js: -------------------------------------------------------------------------------- 1 | // import React, { Component, PropTypes } from 'react'; 2 | import React, { memo, useState, useEffect, useCallback } from "react"; 3 | import { Link } from "react-router"; 4 | import * as contentful from "contentful"; 5 | import Section from "./section"; 6 | import LocaleSelect from "./locale_select"; 7 | import config from "./config"; 8 | import ReactJson from "react-json-view"; 9 | 10 | import marked from "marked"; 11 | 12 | const Spinner = require("react-spinkit"); 13 | 14 | const TEST_IMAGE_URL = 15 | "https://images.ctfassets.net/34zhepmq2vpx/4ClyFr0XGwcOiKUMyyiMKO/c47e029fa790bf3c01b8900bd6cacf87/TWD_Test_Image6.png"; 16 | 17 | export default function ProductShow(props) { 18 | let options = {}; 19 | 20 | let is_preview = ""; 21 | let space_id = ""; 22 | let access_token = ""; 23 | 24 | options.space = space_id ? space_id : config.space_id; 25 | options.host = is_preview ? "preview.contentful.com" : undefined; 26 | options.accessToken = access_token 27 | ? access_token 28 | : is_preview 29 | ? config.preview_token 30 | : config.delivery_token; 31 | // hard code to start 32 | options.environment = config.environment ? config.environment : "master"; 33 | 34 | const [productsByLocale, setProductsByLocale] = useState(""); 35 | const [currentLocale, setCurrentLocale] = useState(""); 36 | const [defaultLocale, setDefaultLocale] = useState(""); 37 | const [locales, setLocales] = useState(""); 38 | 39 | const [defaultImageURL, setDefaultImageURL] = useState(""); 40 | 41 | const handleSelectLocale = (selectedCode) => { 42 | setCurrentLocale(selectedCode); 43 | }; 44 | 45 | // get contentful space data 46 | const getCtflSpace = async () => { 47 | // contentful queries here 48 | const contentfulClient = contentful.createClient(options); 49 | //Get the locales setup for the space and do necessary processing 50 | await contentfulClient 51 | .getLocales() 52 | .then((data) => { 53 | //Store current locale codes in array to be populated in select dropdown on page 54 | const localeCodes = data.items.map((localeData) => localeData.code); 55 | // console.log("localeCodes", data.items) 56 | 57 | //Filter to find the default locale to use later 58 | const defaultLocaleHolder = data.items.filter( 59 | (item) => item.default === true 60 | )[0].code; 61 | 62 | let productsByLocaleHolder = {}; //placeholder for productsByLocal 63 | 64 | //Get entries for each locale setup for the space 65 | localeCodes.map((localeCode) => { 66 | contentfulClient 67 | .getEntries({ 68 | content_type: "landingPage", 69 | locale: localeCode, 70 | "fields.slug": props.location.pathname.split("/")[1], 71 | include: 10, 72 | }) 73 | .then((data2) => { 74 | productsByLocaleHolder[localeCode] = data2.items[0]; 75 | //If on the last object of the array, set the state after we get the entry 76 | if (localeCodes.indexOf(localeCode) == localeCodes.length - 1) { 77 | //Fetch a default image that can be used in case of errors retrieving others (e.g. fallbacks not defined and API doesn't return assets) 78 | //TODO: Handling this way for now since there hasn't been resolution whether this should fallback to the default locale or not. Can reassess when this is resolved. 79 | //Also set state 80 | 81 | setProductsByLocale(productsByLocaleHolder); 82 | setCurrentLocale(defaultLocaleHolder); 83 | setDefaultLocale(defaultLocaleHolder); 84 | setDefaultImageURL(TEST_IMAGE_URL); 85 | setLocales(localeCodes); 86 | } 87 | }) 88 | .catch((erx) => { 89 | alert("error1"); 90 | console.log("An Error Occured", erx); 91 | }); 92 | }); 93 | }) 94 | .catch((ecflx) => { 95 | alert( 96 | "An Error Occured, Make sure you enable API key for 'demo' Enivironment on The Web App" 97 | ); 98 | console.log("An Error Occured", ecflx); 99 | }); 100 | }; 101 | 102 | // this runs on component mount 103 | useEffect(() => { 104 | getCtflSpace(); 105 | 106 | return () => {}; 107 | }, []); 108 | 109 | // this runs if has productsByLocale changed 110 | useEffect(() => { 111 | // if currentLocal not in returned data, run again 112 | //must make sure productsByLocale is not empty first 113 | if (productsByLocale) { 114 | if (!productsByLocale[currentLocale]) { 115 | getCtflSpace(); 116 | } 117 | } 118 | 119 | return () => {}; 120 | }, [productsByLocale]); 121 | 122 | if (!productsByLocale[currentLocale]) { 123 | return ( 124 |
125 |
126 | Loading... 127 |
128 | 129 | {productsByLocale ? ( 130 | <> 131 | {" "} 132 |
133 |
134 |

YOU MAY REVIEW THE JSON DATA HERE

135 |
136 |
137 | {productsByLocale ? ( 138 | 143 | ) : ( 144 | "" 145 | )} 146 |
147 |
148 | 149 | ) : ( 150 | "" 151 | )} 152 |
153 | ); 154 | } 155 | 156 | document.title = productsByLocale[currentLocale].fields.title; 157 | 158 | let sections = productsByLocale[currentLocale].fields.sections.map( 159 | (section, idx) => ( 160 |
161 |
170 |
171 | ) 172 | ); 173 | return ( 174 |
175 | {sections} 176 | 181 | 182 |
183 |
184 |

YOU MAY REVIEW THE JSON DATA HERE

185 |
186 |
187 | {productsByLocale ? ( 188 | 193 | ) : ( 194 | "" 195 | )} 196 |
197 |
198 |
199 | ); 200 | } 201 | -------------------------------------------------------------------------------- /src/components/section.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import Markdown from 'react-remarkable'; 3 | 4 | import CallToAction from './call_to_action'; 5 | import Header from './header'; 6 | import Headline from './headline' 7 | import HeroImage from './hero_image'; 8 | import ImageCarousel from './image_carousel' 9 | import ImageWithCaption from './image_with_caption'; 10 | import ParagraphWithHeadline from './paragraph_with_headline' 11 | import SetOfTwo from './set_of_two' 12 | import SetOfThree from './set_of_three' 13 | import TextWithImage from './text_with_image' 14 | 15 | export default class Section extends React.Component { 16 | constructor(props) { 17 | super(props); 18 | } 19 | 20 | renderSection() { 21 | switch (this.props.sectionType) { 22 | case 'callToAction': 23 | return ( ) 24 | case 'header': 25 | return (
) 26 | case 'headline': 27 | return ( ) 28 | case 'heroImage': 29 | return ( ) 30 | case 'imageCarousel': 31 | return ( ) 32 | case 'imageWithCaption': 33 | return ( ) 34 | case 'paragraphWithHeadline': 35 | return ( ) 36 | case 'setOfTwo': 37 | return ( ) 38 | case 'setOfThree': 39 | return ( ) 40 | case 'textWithImage': 41 | return ( ) 42 | default: 43 | console.log("Section type not found: " + this.props.sectionType); 44 | return (
Illegal Section Type
) 45 | } 46 | } 47 | 48 | render() { 49 | return ( 50 |
51 | {this.renderSection()} 52 |
53 | ) 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /src/components/set_of_three.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | 3 | import CallToAction from './call_to_action'; 4 | import Headline from './headline' 5 | import ImageCarousel from './image_carousel' 6 | import ImageWithCaption from './image_with_caption'; 7 | import ParagraphWithHeadline from './paragraph_with_headline' 8 | import TextWithImage from './text_with_image' 9 | 10 | export default class SetOfThree extends React.Component { 11 | constructor(props) { 12 | super(props); 13 | } 14 | 15 | render() { 16 | return ( 17 |
18 | {this.props.fields.items.map((item, idx) => { 19 | switch (item.sys.contentType.sys.id) { 20 | case 'callToAction': 21 | return ( ) 22 | case 'headline': 23 | return ( ) 24 | case 'imageWithCaption': 25 | return ( ) 26 | case 'paragraphWithHeadline': 27 | return ( ) 28 | case 'textWithImage': 29 | return ( ) 30 | // case 'imageCarousel': 31 | // return ( 32 | // item.fields.images.map((image, idx) => { 33 | // return ( 34 | // 35 | // ) 36 | // }) 37 | // ) 38 | } 39 | })} 40 |
41 | ) 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /src/components/set_of_two.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | 3 | import CallToAction from './call_to_action'; 4 | import Headline from './headline' 5 | import ImageCarousel from './image_carousel' 6 | import ImageWithCaption from './image_with_caption'; 7 | import ParagraphWithHeadline from './paragraph_with_headline' 8 | import TextWithImage from './text_with_image' 9 | 10 | export default class SetOfTwo extends React.Component { 11 | constructor(props) { 12 | super(props); 13 | } 14 | 15 | render() { 16 | return ( 17 |
18 | {this.props.fields.items.map((item, idx) => { 19 | switch (item.sys.contentType.sys.id) { 20 | case 'callToAction': 21 | return ( ) 22 | case 'headline': 23 | return ( ) 24 | case 'imageWithCaption': 25 | return ( ) 26 | case 'paragraphWithHeadline': 27 | return ( ) 28 | case 'textWithImage': 29 | return ( ) 30 | // case 'imageCarousel': 31 | // return ( 32 | // item.fields.images.map((image, idx) => { 33 | // return ( 34 | // 35 | // ) 36 | // }) 37 | // ) 38 | } 39 | })} 40 |
41 | ) 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /src/components/text_with_image.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | 3 | export default class TextWithImage extends React.Component { 4 | constructor(props) { 5 | super(props); 6 | } 7 | 8 | render() { 9 | //If the component comes through with an image resolved use that, otherwise use the test image 10 | //NOTE: For locales with no fallback or localized images added, this can happen currently 11 | const imageURL = (this.props.fields.image && this.props.fields.image.fields.file) ? this.props.fields.image.fields.file.url : this.props.defaultImageURL; 12 | 13 | return ( 14 |
15 |
{this.props.fields.text}
16 | 19 |
20 | ) 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /src/index.css: -------------------------------------------------------------------------------- 1 | body { 2 | margin: 0; 3 | font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 4 | 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', 5 | sans-serif; 6 | -webkit-font-smoothing: antialiased; 7 | -moz-osx-font-smoothing: grayscale; 8 | } 9 | 10 | code { 11 | font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New', 12 | monospace; 13 | } 14 | 15 | @tailwind base; 16 | @tailwind components; 17 | @tailwind utilities; -------------------------------------------------------------------------------- /src/index.js: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | import ReactDOM from "react-dom"; 3 | import "./index.css"; 4 | import "./assets/css/main.css"; 5 | // import "./assets/css/theme.css" 6 | import "./assets/css/font-awesome.min.css"; 7 | 8 | import "react-app-polyfill/ie9"; 9 | import "react-app-polyfill/ie11"; 10 | import "react-app-polyfill/stable"; 11 | 12 | import App from "./App"; 13 | import reportWebVitals from "./reportWebVitals"; 14 | 15 | import { Provider } from "react-redux"; 16 | 17 | import store from "./reducers"; 18 | import { PersistGate } from "redux-persist/integration/react"; 19 | import { persistStore } from "redux-persist"; 20 | 21 | let persistor = persistStore(store); 22 | ReactDOM.render( 23 |
24 | 25 | 26 | 27 | 28 |
29 | Contentful Learning Services 30 |
31 |
32 |
, 33 | document.getElementById("root") 34 | ); 35 | 36 | // If you want to start measuring performance in your app, pass a function 37 | // to log results (for example: reportWebVitals(console.log)) 38 | // or send to an analytics endpoint. Learn more: https://bit.ly/CRA-vitals 39 | reportWebVitals(); 40 | -------------------------------------------------------------------------------- /src/logo.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/reducers/assets_reducer.js: -------------------------------------------------------------------------------- 1 | import { FETCH_ASSET } from '../actions/index'; 2 | 3 | export default function(state = [], action) { 4 | switch(action.type) { 5 | case FETCH_ASSET: 6 | return [ action.payload.data, ...state]; 7 | default: 8 | return state; 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /src/reducers/index.js: -------------------------------------------------------------------------------- 1 | import { combineReducers } from "redux"; 2 | import { persistStore, persistReducer } from "redux-persist"; 3 | import { configureStore } from "@reduxjs/toolkit"; 4 | import storage from "redux-persist/lib/storage"; // defaults to localStorage for web 5 | import thunk from "redux-thunk"; 6 | import { encryptTransform } from "redux-persist-transform-encrypt"; 7 | 8 | import testSlice from "../commonSlices/testSlice"; 9 | 10 | 11 | 12 | 13 | 14 | const reducers = combineReducers({ 15 | test: testSlice, 16 | }); 17 | 18 | // const encryptor = createEncryptor({ 19 | // secretKey: "99xx45ghty", 20 | // }); 21 | const persistConfig = { 22 | key: "root", 23 | storage, 24 | transforms: [ 25 | encryptTransform({ 26 | secretKey: "my-super-secret-key", 27 | onError: function (error) { 28 | // Handle the error. 29 | }, 30 | }), 31 | ], 32 | }; 33 | const persistedReducer = persistReducer(persistConfig, reducers); 34 | const store = configureStore({ 35 | reducer: persistedReducer, 36 | devTools: process.env.NODE_ENV !== "production", 37 | middleware: [thunk], 38 | }); 39 | 40 | export default store; -------------------------------------------------------------------------------- /src/reducers/products_reducer.js: -------------------------------------------------------------------------------- 1 | import { FETCH_PRODUCTS, FETCH_PRODUCT } from '../actions/index'; 2 | 3 | const INITIAL_STATE = { all: [], product: null }; 4 | 5 | export default function(state = INITIAL_STATE, action) { 6 | switch(action.type) { 7 | case FETCH_PRODUCTS: 8 | return { ...state, all: action.payload.data.items }; 9 | case FETCH_PRODUCT: 10 | return { ...state, product: action.payload.data }; 11 | default: 12 | return state; 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /src/reportWebVitals.js: -------------------------------------------------------------------------------- 1 | const reportWebVitals = onPerfEntry => { 2 | if (onPerfEntry && onPerfEntry instanceof Function) { 3 | import('web-vitals').then(({ getCLS, getFID, getFCP, getLCP, getTTFB }) => { 4 | getCLS(onPerfEntry); 5 | getFID(onPerfEntry); 6 | getFCP(onPerfEntry); 7 | getLCP(onPerfEntry); 8 | getTTFB(onPerfEntry); 9 | }); 10 | } 11 | }; 12 | 13 | export default reportWebVitals; 14 | -------------------------------------------------------------------------------- /src/routes.js: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | import { Route, Switch } from "react-router-dom"; 3 | 4 | import App from "./components/app"; 5 | import ProductShow from "./components/product_show"; 6 | 7 | export default function Routes() { 8 | return ( 9 | 10 | 11 | 12 | 13 | ); 14 | } 15 | -------------------------------------------------------------------------------- /src/setupTests.js: -------------------------------------------------------------------------------- 1 | // jest-dom adds custom jest matchers for asserting on DOM nodes. 2 | // allows you to do things like: 3 | // expect(element).toHaveTextContent(/react/i) 4 | // learn more: https://github.com/testing-library/jest-dom 5 | import '@testing-library/jest-dom'; 6 | -------------------------------------------------------------------------------- /tailwind.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | purge: ['./src/**/*.{js,jsx,ts,tsx}', './public/index.html'], 3 | darkMode: false, // or 'media' or 'class' 4 | theme: { 5 | extend: {}, 6 | }, 7 | variants: { 8 | extend: {}, 9 | }, 10 | plugins: [], 11 | } 12 | -------------------------------------------------------------------------------- /winning-demo-content-model-simple.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/contentful/The-Learning-Demo/5f990cfc6e8b9a1ec67d2777564174056dfb24e8/winning-demo-content-model-simple.png -------------------------------------------------------------------------------- /winning-demo-content-model.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/contentful/The-Learning-Demo/5f990cfc6e8b9a1ec67d2777564174056dfb24e8/winning-demo-content-model.png --------------------------------------------------------------------------------