Skip to content

Commit b114a94

Browse files
committed
🎉 Initial commit
0 parents  commit b114a94

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

53 files changed

+7042
-0
lines changed

.babelrc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"presets": ["es2015", "stage-2"],
3+
"plugins": ["transform-runtime"],
4+
"comments": false
5+
}

.editorconfig

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
root = true
2+
3+
[*]
4+
charset = utf-8
5+
indent_style = space
6+
indent_size = 2
7+
end_of_line = lf
8+
insert_final_newline = true
9+
trim_trailing_whitespace = true

.eslintignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
build/*.js
2+
config/*.js

.eslintrc.js

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
module.exports = {
2+
root: true,
3+
parser: 'babel-eslint',
4+
parserOptions: {
5+
sourceType: 'module'
6+
},
7+
// https://github.com/feross/standard/blob/master/RULES.md#javascript-standard-style
8+
extends: 'standard',
9+
// required to lint *.vue files
10+
plugins: [
11+
'html'
12+
],
13+
// add your custom rules here
14+
'rules': {
15+
// allow paren-less arrow functions
16+
'arrow-parens': 0,
17+
// allow async-await
18+
'generator-star-spacing': 0,
19+
// allow debugger during development
20+
'no-debugger': process.env.NODE_ENV === 'production' ? 2 : 0
21+
}
22+
}

.github/CONTRIBUTING.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
Thank you for contributing vue-chartjs!
2+
=========================================
3+
4+
Please follow this steps:
5+
6+
1. Fork it ( https://github.com/apertureless/vue-parallax/fork )
7+
2. Create your feature branch (`git checkout -b my-new-feature`)
8+
3. Commit your changes (`git commit -am 'Add some feature'`)
9+
4. Push to the branch (`git push origin my-new-feature`)
10+
5. Create a new Pull Request

.github/ISSUE_TEMPLATE.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
### Expected Behavior
2+
3+
4+
### Actual Behavior
5+
6+
7+
8+
9+
### Environment
10+
- OS: Write here
11+
- NPM version: Write here
12+
- vue.js version: Write here
13+
- vue-parallax version: Write here
14+

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
## Description
2+
3+
## Fix or Feature?
4+
5+
### Environment
6+
- OS: Write here
7+
- NPM Version: Write here
8+

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
.DS_Store
2+
node_modules/
3+
npm-debug.log
4+
test/unit/coverage

CODE_OF_CONDUCT.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Contributor Code of Conduct
2+
3+
As contributors and maintainers of this project, 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/)

LICENSE.txt

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2016 Jakub Juszczak <jakub@posteo.de>
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
# vue-parallax
2+
3+
Is a compontent for fast 60fps parallax scroll effects in vue 2.
4+
5+
## Demo
6+
7+
[Demo here](https://apertureless.github.io/vue-parallax/)
8+
9+
## Install
10+
11+
`npm install vue-parallax` or `yarn add vue-parallax`
12+
13+
## Usage
14+
*vue-parallax* works with slots. So you can pass an image or even srcsets for better mobile experiences.
15+
16+
```javascript
17+
// Image.vue
18+
19+
<template>
20+
<parallax>
21+
<img src="path/cool-background-image.jpg" alt="very cool bg">
22+
</parallax>
23+
</template>
24+
25+
<script>
26+
import Parallax from 'vue-parallax'
27+
export default {
28+
components: {
29+
Parallax
30+
}
31+
}
32+
</script>
33+
```
34+
35+
36+
## Props
37+
38+
| Prop | Type | Default Value | Description
39+
|----------|:-------------:|------|------|
40+
| parallax | Boolean | true | Activates parallax effect |
41+
| speedFactor | Number | 0.15 | factor on how strong the effect is|
42+
| fixed | Boolean | false | Other parallax effect. Image is fixed in position |
43+
| sectionHeight | Number | 70 | section height for mobile |
44+
| breakpoint | String | '(min-width: 968px)' | Media query for mobile deactivation |
45+
46+
47+
## Build Setup
48+
49+
``` bash
50+
# install dependencies
51+
npm install
52+
53+
# serve with hot reload at localhost:8080
54+
npm run dev
55+
56+
# build for production with minification
57+
npm run build
58+
59+
# run unit tests
60+
npm run unit
61+
62+
# run all tests
63+
npm test
64+
```
65+
66+
For detailed explanation on how things work, checkout the [guide](http://vuejs-templates.github.io/webpack/) and [docs for vue-loader](http://vuejs.github.io/vue-loader).
67+
68+
69+
## Contributing
70+
71+
1. Fork it ( https://github.com/apertureless/vue-parallax/fork )
72+
2. Create your feature branch (`git checkout -b my-new-feature`)
73+
3. Commit your changes (`git commit -am 'Add some feature'`)
74+
4. Push to the branch (`git push origin my-new-feature`)
75+
5. Create a new Pull Request
76+
77+
## License
78+
79+
This software is distributed under [MIT license](LICENSE.txt).

build/build.js

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
// https://github.com/shelljs/shelljs
2+
require('./check-versions')()
3+
require('shelljs/global')
4+
env.NODE_ENV = 'production'
5+
6+
var path = require('path')
7+
var config = require('../config')
8+
var ora = require('ora')
9+
var webpack = require('webpack')
10+
var webpackConfig = require('./webpack.prod.conf')
11+
12+
console.log(
13+
' Tip:\n' +
14+
' Built files are meant to be served over an HTTP server.\n' +
15+
' Opening index.html over file:// won\'t work.\n'
16+
)
17+
18+
var spinner = ora('building for production...')
19+
spinner.start()
20+
21+
var assetsPath = path.join(config.build.assetsRoot, config.build.assetsSubDirectory)
22+
rm('-rf', assetsPath)
23+
mkdir('-p', assetsPath)
24+
cp('-R', 'static/*', assetsPath)
25+
26+
webpack(webpackConfig, function (err, stats) {
27+
spinner.stop()
28+
if (err) throw err
29+
process.stdout.write(stats.toString({
30+
colors: true,
31+
modules: false,
32+
children: false,
33+
chunks: false,
34+
chunkModules: false
35+
}) + '\n')
36+
})

build/check-versions.js

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
var semver = require('semver')
2+
var chalk = require('chalk')
3+
var packageConfig = require('../package.json')
4+
var exec = function (cmd) {
5+
return require('child_process')
6+
.execSync(cmd).toString().trim()
7+
}
8+
9+
var versionRequirements = [
10+
{
11+
name: 'node',
12+
currentVersion: semver.clean(process.version),
13+
versionRequirement: packageConfig.engines.node
14+
},
15+
{
16+
name: 'npm',
17+
currentVersion: exec('npm --version'),
18+
versionRequirement: packageConfig.engines.npm
19+
}
20+
]
21+
22+
module.exports = function () {
23+
var warnings = []
24+
for (var i = 0; i < versionRequirements.length; i++) {
25+
var mod = versionRequirements[i]
26+
if (!semver.satisfies(mod.currentVersion, mod.versionRequirement)) {
27+
warnings.push(mod.name + ': ' +
28+
chalk.red(mod.currentVersion) + ' should be ' +
29+
chalk.green(mod.versionRequirement)
30+
)
31+
}
32+
}
33+
34+
if (warnings.length) {
35+
console.log('')
36+
console.log(chalk.yellow('To use this template, you must update following to modules:'))
37+
console.log()
38+
for (var i = 0; i < warnings.length; i++) {
39+
var warning = warnings[i]
40+
console.log(' ' + warning)
41+
}
42+
console.log()
43+
process.exit(1)
44+
}
45+
}

build/dev-client.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
/* eslint-disable */
2+
require('eventsource-polyfill')
3+
var hotClient = require('webpack-hot-middleware/client?noInfo=true&reload=true')
4+
5+
hotClient.subscribe(function (event) {
6+
if (event.action === 'reload') {
7+
window.location.reload()
8+
}
9+
})

build/dev-server.js

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
require('./check-versions')()
2+
var config = require('../config')
3+
if (!process.env.NODE_ENV) process.env.NODE_ENV = JSON.parse(config.dev.env.NODE_ENV)
4+
var path = require('path')
5+
var express = require('express')
6+
var webpack = require('webpack')
7+
var opn = require('opn')
8+
var proxyMiddleware = require('http-proxy-middleware')
9+
var webpackConfig = process.env.NODE_ENV === 'testing'
10+
? require('./webpack.prod.conf')
11+
: require('./webpack.dev.conf')
12+
13+
// default port where dev server listens for incoming traffic
14+
var port = process.env.PORT || config.dev.port
15+
// Define HTTP proxies to your custom API backend
16+
// https://github.com/chimurai/http-proxy-middleware
17+
var proxyTable = config.dev.proxyTable
18+
19+
var app = express()
20+
var compiler = webpack(webpackConfig)
21+
22+
var devMiddleware = require('webpack-dev-middleware')(compiler, {
23+
publicPath: webpackConfig.output.publicPath,
24+
stats: {
25+
colors: true,
26+
chunks: false
27+
}
28+
})
29+
30+
var hotMiddleware = require('webpack-hot-middleware')(compiler)
31+
// force page reload when html-webpack-plugin template changes
32+
compiler.plugin('compilation', function (compilation) {
33+
compilation.plugin('html-webpack-plugin-after-emit', function (data, cb) {
34+
hotMiddleware.publish({ action: 'reload' })
35+
cb()
36+
})
37+
})
38+
39+
// proxy api requests
40+
Object.keys(proxyTable).forEach(function (context) {
41+
var options = proxyTable[context]
42+
if (typeof options === 'string') {
43+
options = { target: options }
44+
}
45+
app.use(proxyMiddleware(context, options))
46+
})
47+
48+
// handle fallback for HTML5 history API
49+
app.use(require('connect-history-api-fallback')())
50+
51+
// serve webpack bundle output
52+
app.use(devMiddleware)
53+
54+
// enable hot-reload and state-preserving
55+
// compilation error display
56+
app.use(hotMiddleware)
57+
58+
// serve pure static assets
59+
var staticPath = path.posix.join(config.dev.assetsPublicPath, config.dev.assetsSubDirectory)
60+
app.use(staticPath, express.static('./static'))
61+
62+
module.exports = app.listen(port, function (err) {
63+
if (err) {
64+
console.log(err)
65+
return
66+
}
67+
var uri = 'http://localhost:' + port
68+
console.log('Listening at ' + uri + '\n')
69+
70+
// when env is testing, don't need open it
71+
if (process.env.NODE_ENV !== 'testing') {
72+
opn(uri)
73+
}
74+
})

0 commit comments

Comments
 (0)