Skip to content

Commit 5cda278

Browse files
committed
Merge branch 'develop'
* develop: 💎 Release new version 1.0.3 Change section to div ⬆️ Update dependency
2 parents 213e3bc + 496b2a6 commit 5cda278

File tree

3 files changed

+409
-329
lines changed

3 files changed

+409
-329
lines changed

package.json

Lines changed: 21 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "vue-parallaxy",
3-
"version": "1.0.2",
3+
"version": "1.0.3",
44
"description": "Vue 2 component for parallax scrolling effects",
55
"author": "Jakub Juszczak <[email protected]>",
66
"license": "MIT",
@@ -34,43 +34,45 @@
3434
"prepublish": "yarn run lint && yarn run build"
3535
},
3636
"devDependencies": {
37-
"@nextindex/next-scss": "^1.0.7",
37+
"@nextindex/next-scss": "^1.1.0",
3838
"autoprefixer": "^6.7.7",
39-
"babel-core": "^6.24.0",
40-
"babel-eslint": "^7.2.1",
39+
"babel-core": "^6.24.1",
40+
"babel-eslint": "^7.2.2",
4141
"babel-loader": "^6.4.1",
4242
"babel-plugin-transform-runtime": "^6.23.0",
43-
"babel-preset-es2015": "^6.24.0",
44-
"babel-preset-stage-2": "^6.22.0",
45-
"babel-register": "^6.24.0",
43+
"babel-preset-es2015": "^6.24.1",
44+
"babel-preset-stage-2": "^6.24.1",
45+
"babel-register": "^6.24.1",
4646
"chai": "^3.5.0",
4747
"chalk": "^1.1.3",
4848
"connect-history-api-fallback": "^1.1.0",
4949
"css-loader": "^0.28.0",
50-
"eslint": "^3.18.0",
51-
"eslint-config-standard": "^7.1.0",
50+
"eslint": "^3.19.0",
51+
"eslint-config-standard": "^10.2.0",
5252
"eslint-friendly-formatter": "^2.0.7",
53-
"eslint-loader": "^1.7.0",
53+
"eslint-loader": "^1.7.1",
5454
"eslint-plugin-html": "^2.0.1",
55+
"eslint-plugin-import": "^2.2.0",
56+
"eslint-plugin-node": "^4.2.2",
5557
"eslint-plugin-promise": "^3.5.0",
56-
"eslint-plugin-standard": "^2.1.1",
58+
"eslint-plugin-standard": "^3.0.1",
5759
"eventsource-polyfill": "^0.9.6",
5860
"express": "^4.15.2",
5961
"extract-text-webpack-plugin": "^1.0.1",
60-
"file-loader": "^0.10.1",
62+
"file-loader": "^0.11.1",
6163
"function-bind": "^1.0.2",
6264
"html-webpack-plugin": "^2.28.0",
6365
"http-proxy-middleware": "^0.17.4",
6466
"inject-loader": "^3.0.0",
6567
"isparta-loader": "^2.0.0",
6668
"json-loader": "^0.5.4",
67-
"karma": "^1.5.0",
69+
"karma": "^1.6.0",
6870
"karma-coverage": "^1.1.1",
6971
"karma-mocha": "^1.2.0",
7072
"karma-phantomjs-launcher": "^1.0.4",
71-
"karma-sinon-chai": "^1.2.0",
73+
"karma-sinon-chai": "^1.3.1",
7274
"karma-sourcemap-loader": "^0.3.7",
73-
"karma-spec-reporter": "^0.0.30",
75+
"karma-spec-reporter": "^0.0.31",
7476
"karma-webpack": "^1.7.0",
7577
"lolex": "^1.6.0",
7678
"mocha": "^3.1.0",
@@ -84,10 +86,10 @@
8486
"sinon": "^2.1.0",
8587
"sinon-chai": "^2.9.0",
8688
"url-loader": "^0.5.8",
87-
"vue": "^2.2.6",
88-
"vue-loader": "^11.3.4",
89-
"vue-style-loader": "^2.0.5",
90-
"vue-template-compiler": "^2.2.6",
89+
"vue": "^2.3.2",
90+
"vue-loader": "^12.0.3",
91+
"vue-style-loader": "^3.0.1",
92+
"vue-template-compiler": "^2.3.2",
9193
"webpack": "^1.13.2",
9294
"webpack-dev-middleware": "^1.10.1",
9395
"webpack-hot-middleware": "^2.17.1",

src/components/Parallax.vue

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
<template>
2-
<section v-bind:class="[sectionClass]" ref="block" v-bind:style="{ height: sectionHeight + 'vh' }">
2+
<div v-bind:class="[sectionClass]" ref="block" v-bind:style="{ height: sectionHeight + 'vh' }">
33
<div
44
v-bind:class="[parallax ? parallaxClass : '', fixed ? fixedClass : '', containerClass]"
55
ref="parallax"
66
>
77
<slot></slot>
88
</div>
9-
</section>
9+
</div>
1010
</template>
1111

1212
<script>
@@ -48,6 +48,10 @@
4848
fixedClass: {
4949
type: String,
5050
default: 'is-fixed'
51+
},
52+
direction: {
53+
type: String,
54+
default: 'up'
5155
}
5256
},
5357
@@ -80,7 +84,7 @@
8084
let animationValue = (window.pageYOffset * this.speedFactor)
8185
8286
if (animationValue <= availableOffset && animationValue >= 0) {
83-
this.el.style.transform = `translate3d(0, ${animationValue * -1}px ,0)`
87+
this.el.style.transform = `translate3d(0, ${animationValue * 1}px ,0)`
8488
}
8589
},
8690
@@ -117,6 +121,12 @@
117121
this.setupListener()
118122
}
119123
}
124+
},
125+
126+
computed: {
127+
directionValue () {
128+
return this.direction === 'down' ? +1 : -1
129+
}
120130
}
121131
}
122132
</script>
@@ -144,7 +154,7 @@
144154
height: 100%;
145155
max-width: none;
146156
width: 100%;
147-
@include object-fit(cover, bottom);
157+
@include object-fit(cover, top);
148158
}
149159
150160
&.is-parallax {
@@ -158,7 +168,7 @@
158168
height: 100%;
159169
max-width: none;
160170
width: 100%;
161-
@include object-fit(cover, bottom);
171+
@include object-fit(cover, top);
162172
}
163173
}
164174

0 commit comments

Comments
 (0)