├── .babelrc ├── .editorconfig ├── .eslintrc ├── .gitignore ├── .jshintrc ├── .node-version ├── .npmrc ├── .nvmrc ├── .travis.yml ├── CODE_OF_CONDUCT.md ├── LICENSE ├── README.md ├── demo ├── demo.css ├── index.html └── index.js ├── package-lock.json ├── package.json ├── src ├── Bullet.js ├── Button.js ├── Item.js ├── Paginator.js ├── Slider.js ├── SliderTest.js └── index.js ├── test └── test-setup.js ├── webpack.config.demo.js ├── webpack.config.dist.js └── webpack.config.page.js /.babelrc: -------------------------------------------------------------------------------- 1 | { 2 | "presets": [ 3 | "env", 4 | "react", 5 | "stage-0" 6 | ] 7 | } 8 | -------------------------------------------------------------------------------- /.editorconfig: -------------------------------------------------------------------------------- 1 | root = true 2 | 3 | [*] 4 | end_of_line = lf 5 | insert_final_newline = false 6 | indent_style = space 7 | indent_size = 2 8 | -------------------------------------------------------------------------------- /.eslintrc: -------------------------------------------------------------------------------- 1 | { 2 | "root": true, 3 | "parser": "babel-eslint", 4 | "extends": [ 5 | "standard", 6 | "standard-react", 7 | "prettier", 8 | "prettier/react" 9 | ], 10 | "globals": { 11 | "afterEach": false, 12 | "beforeAll": false, 13 | "beforeEach": false, 14 | "describe": false, 15 | "expect": false, 16 | "it": false, 17 | "Image": false 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | npm-debug.log 3 | *.swp 4 | .DS_Store 5 | **/*-bundle.*.js* 6 | demo/bundle.js* 7 | page/ 8 | dist/ 9 | -------------------------------------------------------------------------------- /.jshintrc: -------------------------------------------------------------------------------- 1 | { 2 | "node": true, 3 | "browser": true, 4 | "bitwise": true, 5 | "camelcase": false, 6 | "curly": true, 7 | "esnext": true, 8 | "immed": true, 9 | "newcap": true, 10 | "noarg": true, 11 | "undef": true, 12 | "unused": false, 13 | "strict": true, 14 | "globals": { 15 | "$": false, 16 | "Promise": true 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /.node-version: -------------------------------------------------------------------------------- 1 | v4.0.0 2 | -------------------------------------------------------------------------------- /.npmrc: -------------------------------------------------------------------------------- 1 | save-exact=true 2 | -------------------------------------------------------------------------------- /.nvmrc: -------------------------------------------------------------------------------- 1 | v8.7.0 2 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | # faster builds on new travis setup not using sudo 2 | sudo: false 3 | 4 | language: node_js 5 | 6 | notifications: 7 | email: false 8 | 9 | node_js: 10 | - "8.7.0" 11 | -------------------------------------------------------------------------------- /CODE_OF_CONDUCT.md: -------------------------------------------------------------------------------- 1 | # Contributor Code of Conduct 2 | 3 | As contributors and maintainers of React Component Starter Kit, we pledge to respect all people who contribute through reporting issues, posting feature requests, updating documentation, submitting pull requests or patches, and other activities. 4 | 5 | We are committed to making participation in this project a harassment-free experience for everyone, regardless of level of experience, gender, gender identity and expression, sexual orientation, disability, personal appearance, body size, race, age, or religion. 6 | 7 | Examples of unacceptable behavior by participants include the use of sexual language or imagery, derogatory comments or personal attacks, trolling, public or private harassment, insults, or other unprofessional conduct. 8 | 9 | Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct. Project maintainers who do not follow the Code of Conduct may be removed from the project team. 10 | 11 | Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by opening an issue or contacting one or more of the project maintainers. 12 | 13 | This Code of Conduct is adapted from the [Contributor Covenant](http://contributor-covenant.org), version 1.0.0, available at [http://contributor-covenant.org/version/1/0/0/](http://contributor-covenant.org/version/1/0/0/) 14 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright Davi Ferreira, http://www.daviferreira.com/ 2 | 3 | This software consists of voluntary contributions made by many 4 | individuals. For exact contribution history, see the revision history 5 | available at https://github.com/daviferreira/react-component-boilerplate 6 | 7 | The following license applies to all parts of this software except as 8 | documented below: 9 | 10 | ==== 11 | 12 | Permission is hereby granted, free of charge, to any person obtaining 13 | a copy of this software and associated documentation files (the 14 | "Software"), to deal in the Software without restriction, including 15 | without limitation the rights to use, copy, modify, merge, publish, 16 | distribute, sublicense, and/or sell copies of the Software, and to 17 | permit persons to whom the Software is furnished to do so, subject to 18 | the following conditions: 19 | 20 | The above copyright notice and this permission notice shall be 21 | included in all copies or substantial portions of the Software. 22 | 23 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 24 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 25 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 26 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 27 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 28 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 29 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 30 | 31 | ==== 32 | 33 | All files located in the node_modules directory are 34 | externally maintained libraries used by this software which have their 35 | own licenses; we recommend you read them, as their terms may differ from 36 | the terms above. 37 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Viewport Slider, React 2 | 3 | **react-viewport-slider** is a react component (obviously) that displays a sequence of contents using 100% of the viewport with and height. 4 | 5 | [![NPM info](https://nodei.co/npm/react-viewport-slider.png?downloads=true)](https://www.npmjs.com/package/react-viewport-slider) 6 | 7 | [![Travis build status](https://travis-ci.org/daviferreira/react-viewport-slider.svg?branch=master)](https://travis-ci.org/daviferreira/react-viewport-slider) [![Dependency Status](https://david-dm.org/daviferreira/react-viewport-slider.svg)](https://david-dm.org/daviferreira/react-viewport-slider) [![devDependency Status](https://david-dm.org/daviferreira/react-viewport-slider/dev-status.svg)](https://david-dm.org/daviferreira/react-viewport-slider#info=devDependencies) 8 | 9 | ## Usage 10 | 11 | ### CommonJS 12 | 13 | Install via NPM: 14 | 15 | ``` 16 | npm install react-viewport-slider 17 | ``` 18 | 19 | Then: 20 | 21 | ```javascript 22 | import Slider from ‘react-viewport-slider’; 23 | 24 | // http://alpha.wallhaven.cc/wallpaper/164335 25 | const wallpaper = 26 | 'http://wallpapers.wallhaven.cc/wallpapers/full/wallhaven-164335.png'; 27 | … 28 | 29 | render: function () { 30 | return ( 31 | 32 | 33 |
Hello, world.
34 |
35 | 36 |
Sup?
37 |
38 | 39 |
Yo.
40 |
41 |
42 | 43 | ); 44 | } 45 | 46 | … 47 | 48 | ``` 49 | 50 | ## development 51 | 52 | ``` 53 | npm install 54 | 55 | npm run demo 56 | 57 | npm test 58 | ``` 59 | 60 | ## LICENSE 61 | 62 | MIT: https://github.com/daviferreira/react-viewport-slider/blob/master/LICENSE 63 | -------------------------------------------------------------------------------- /demo/demo.css: -------------------------------------------------------------------------------- 1 | *, *:after, *:before { 2 | box-sizing: border-box; 3 | } 4 | 5 | body { 6 | font-family: 'Helvetica Neue', Helvetica, arial, sans-serif; 7 | } 8 | 9 | .viewport-slider-item { 10 | align-items: center; 11 | color: #fff; 12 | display: flex; 13 | flex-direction: column; 14 | justify-content: center; 15 | position: relative; 16 | } 17 | 18 | .viewport-slider-button { 19 | border: 1px solid #fff; 20 | color: #fff; 21 | cursor: pointer; 22 | opacity: .5; 23 | padding: 12px; 24 | text-decoration: none; 25 | text-transform: uppercase; 26 | transition: opacity .35s; 27 | } 28 | 29 | .viewport-slider-button:hover { 30 | opacity: 1; 31 | } 32 | 33 | .viewport-slider-paginator { 34 | background-color: #ccc; 35 | border: 1px solid #fff; 36 | box-shadow: 0 0 2px #ccc; 37 | } 38 | 39 | .viewport-slider-paginator-bullet { 40 | background: #fff; 41 | cursor: pointer; 42 | opacity: .4; 43 | transition: opacity .35s; 44 | } 45 | 46 | .viewport-slider-paginator-bullet:hover { 47 | opacity: .6; 48 | } 49 | 50 | .viewport-slider-paginator-bullet.is-active { 51 | opacity: 1; 52 | } 53 | 54 | .content { 55 | font-size: 6em; 56 | font-weight: bold; 57 | letter-spacing: -1px; 58 | margin: 0; 59 | } 60 | 61 | .has-overlay::after { 62 | content: ''; 63 | background-color: #d5af86; 64 | left: 0; 65 | height: 100%; 66 | opacity: .7; 67 | position: absolute; 68 | top: 0; 69 | width: 100%; 70 | z-index: 1; 71 | } 72 | 73 | .has-overlay > div { 74 | z-index: 2; 75 | } 76 | 77 | .love { 78 | display: flex; 79 | flex-direction: column; 80 | text-align: center; 81 | } 82 | 83 | .love i { 84 | animation: heartbeat 1.6s ease 0s infinite normal; 85 | color: #de808c; 86 | font-size: 120px; 87 | margin-bottom: 40px; 88 | } 89 | 90 | .love iframe { 91 | margin-bottom: 10px; 92 | } 93 | 94 | .love iframe:last-child { 95 | margin-bottom: none; 96 | } 97 | 98 | @keyframes heartbeat { 99 | 0% { 100 | transform: scale(1); 101 | } 102 | 14% { 103 | transform: scale(1.3); 104 | } 105 | 28% { 106 | transform: scale(1); 107 | } 108 | 42% { 109 | transform: scale(1.3); 110 | } 111 | 70% { 112 | transform: scale(1); 113 | } 114 | } 115 | -------------------------------------------------------------------------------- /demo/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | ViewportSlider Demo 6 | 7 | 8 | 9 |
10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /demo/index.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | import 'normalize.css'; 4 | import './demo.css'; 5 | 6 | import React from 'react'; 7 | import ReactDOM from 'react-dom'; 8 | 9 | import Slider from '../src/Slider'; 10 | 11 | // http://alpha.wallhaven.cc/wallpaper/164335 12 | const wallpaper = 13 | 'http://wallpapers.wallhaven.cc/wallpapers/full/wallhaven-164335.png'; 14 | 15 | class Demo extends React.Component { 16 | render() { 17 | return ( 18 | 19 | 20 |
Hello, world.
21 |
22 | 23 |
Sup?
24 |
25 | 32 |
Yo.
33 |
34 | 35 |
36 | 37 |