Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <svg v-show="animationOn === true" xmlns="http://www.w3.org/2000/svg" class="text-translate" width="4100px" height="280px">
- <text x="10" y="180"
- <svg v-show="animationOn === true" xmlns="http://www.w3.org/2000/svg" class="text-translate" width="4100px" height="280px">
- <text x="10" y="180"
- style="font-family: Poppins;
- font-size: 187px;
- font-weight:900;
- stroke: rgb(255, 255, 255);
- stroke-width: 3px;
- letter-spacing:6px;
- ">
- WEB DEVELOPER
- </text>
- </svg>
- magicScroll: function(_event) {
- const normalized = normalizeWheel(_event);
- if(normalized.pixelY == 30 || (normalized.pixelY === 0 && event.keyCode == 40)) {
- normalized.pixelY = 100
- } else if(normalized.pixelY == -30 || (normalized.pixelY === 0 && event.keyCode == 38)) {
- normalized.pixelY = -100
- }
- let boundingLeftContact = this.$refs.contactleft.getBoundingClientRect()
- if (normalized.pixelY > 0) {
- if(boundingLeftContact.top < 400 && boundingLeftContact.top > -500 && this.valueScrollText < 500) {
- this.valueScrollText += Math.floor(normalized.pixelY) / 2
- TweenLite.to('.fix', .5, {
- y: this.valueScrollText,
- })
- }
- if (this.scroll + normalized.pixelY > this.$refs.contentAbout.offsetHeight - window.innerHeight) {
- this.scroll = this.$refs.contentAbout.offsetHeight - window.innerHeight
- TweenLite.to('.about', 0.5, {
- y: -this.scroll,
- })
- } else {
- this.scroll += Math.floor((normalized.pixelY))
- TweenLite.to('.about', .5, {
- y: -this.scroll,
- })
- TweenLite.to('.text-translate', .5, {
- x: -this.scroll,
- })
- }
- } else {
- console.log(boundingLeftContact, this.scroll)
- if (this.scroll + normalized.pixelY <= 0) {
- this.scroll = 0
- TweenLite.to('.about', 0.5, {
- y: -this.scroll,
- })
- TweenLite.to('.text-translate', .5, {
- x: -this.scroll,
- })
- } else {
- this.scroll += Math.floor((normalized.pixelY))
- if(this.valueScrollText <= 0) {
- this.valueScrollText = 0
- } else {
- this.valueScrollText += Math.floor(normalized.pixelY) / 2
- }
- TweenLite.to('.about', .5, {
- y: -this.scroll,
- })
- TweenLite.to('.text-translate', .5, {
- x: -this.scroll,
- })
- TweenLite.to('.fix', .5, {
- y: this.valueScrollText,
- })
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement