|
@@ -9,10 +9,11 @@
|
|
class="img-wrapper"
|
|
class="img-wrapper"
|
|
@scroll="onImgWrapperScroll"
|
|
@scroll="onImgWrapperScroll"
|
|
>
|
|
>
|
|
|
|
+ <span id="test">tesdfasdf</span>
|
|
<img
|
|
<img
|
|
ref="tree-image"
|
|
ref="tree-image"
|
|
class="tree-image"
|
|
class="tree-image"
|
|
- src="@/assets/image/tall-tree.png"
|
|
|
|
|
|
+ src="@/assets/image/tall-tree-no-fruit.png"
|
|
alt=""
|
|
alt=""
|
|
@load="onTreeImgLoad"
|
|
@load="onTreeImgLoad"
|
|
>
|
|
>
|
|
@@ -42,12 +43,15 @@
|
|
</template>
|
|
</template>
|
|
|
|
|
|
<script>
|
|
<script>
|
|
|
|
+import VisSenseFactory from 'vissense'
|
|
|
|
+const VisSense = VisSenseFactory(window)
|
|
|
|
|
|
export default {
|
|
export default {
|
|
data() {
|
|
data() {
|
|
return {
|
|
return {
|
|
showTree: false,
|
|
showTree: false,
|
|
showSlideTip: false,
|
|
showSlideTip: false,
|
|
|
|
+ visMonitor: null,
|
|
}
|
|
}
|
|
},
|
|
},
|
|
computed: {
|
|
computed: {
|
|
@@ -56,6 +60,15 @@ export default {
|
|
created() {
|
|
created() {
|
|
},
|
|
},
|
|
mounted() {
|
|
mounted() {
|
|
|
|
+ const testNode = document.getElementById('test')
|
|
|
|
+ this.visMonitor = VisSense(testNode).monitor({
|
|
|
|
+ percentagechange: function (VisMon) {
|
|
|
|
+ if (VisMon._state.percentage > 0.5) {
|
|
|
|
+ console.log('asfsfd')
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ this.visMonitor.start()
|
|
},
|
|
},
|
|
destroyed() {
|
|
destroyed() {
|
|
},
|
|
},
|
|
@@ -99,7 +112,7 @@ export default {
|
|
> .img-wrapper {
|
|
> .img-wrapper {
|
|
height: 100%;
|
|
height: 100%;
|
|
widows: 100%;
|
|
widows: 100%;
|
|
- animation: emerge 1s 1s linear forwards;
|
|
|
|
|
|
+ animation: emerge 1s 0.7s linear forwards;
|
|
overflow: auto;
|
|
overflow: auto;
|
|
opacity: 0;
|
|
opacity: 0;
|
|
> .tree-image {
|
|
> .tree-image {
|