Advertisement
Guest User

Untitled

a guest
May 27th, 2019
114
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <svg v-show="animationOn === true" xmlns="http://www.w3.org/2000/svg" class="text-translate" width="4100px" height="280px">
  2.           <text x="10"  y="180"
  3.     <svg v-show="animationOn === true" xmlns="http://www.w3.org/2000/svg" class="text-translate" width="4100px" height="280px">
  4.           <text x="10"  y="180"
  5.                 style="font-family: Poppins;
  6.                      font-size: 187px;
  7.                      font-weight:900;
  8.                      stroke: rgb(255, 255, 255);
  9.                      stroke-width: 3px;
  10.                      letter-spacing:6px;
  11.                      ">
  12.             WEB DEVELOPER
  13.           </text>
  14.         </svg>
  15.  
  16.  
  17.  magicScroll: function(_event) {
  18.            const normalized = normalizeWheel(_event);
  19.  
  20.           if(normalized.pixelY == 30 || (normalized.pixelY === 0 && event.keyCode == 40)) {
  21.               normalized.pixelY = 100
  22.           } else if(normalized.pixelY == -30 || (normalized.pixelY === 0 && event.keyCode == 38)) {
  23.               normalized.pixelY = -100
  24.           }
  25.  
  26.             let boundingLeftContact = this.$refs.contactleft.getBoundingClientRect()
  27.           if (normalized.pixelY > 0) {
  28.                    
  29.               if(boundingLeftContact.top < 400 && boundingLeftContact.top > -500 && this.valueScrollText < 500) {
  30.                   this.valueScrollText += Math.floor(normalized.pixelY)  / 2
  31.                   TweenLite.to('.fix', .5, {
  32.                     y: this.valueScrollText,
  33.                   })
  34.               }
  35.               if (this.scroll + normalized.pixelY > this.$refs.contentAbout.offsetHeight - window.innerHeight) {
  36.                   this.scroll = this.$refs.contentAbout.offsetHeight - window.innerHeight
  37.                   TweenLite.to('.about', 0.5, {
  38.                       y: -this.scroll,
  39.                   })
  40.               } else {
  41.                   this.scroll += Math.floor((normalized.pixelY))
  42.                   TweenLite.to('.about', .5, {
  43.                       y: -this.scroll,
  44.                   })
  45.                   TweenLite.to('.text-translate', .5, {
  46.                       x: -this.scroll,
  47.                   })
  48.               }
  49.           } else {
  50.             console.log(boundingLeftContact, this.scroll)
  51.               if (this.scroll + normalized.pixelY <= 0) {
  52.                   this.scroll = 0
  53.                   TweenLite.to('.about', 0.5, {
  54.                       y: -this.scroll,
  55.                   })
  56.                   TweenLite.to('.text-translate', .5, {
  57.                       x: -this.scroll,
  58.                   })
  59.               } else {
  60.                   this.scroll += Math.floor((normalized.pixelY))
  61.                   if(this.valueScrollText <= 0) {
  62.                     this.valueScrollText = 0
  63.                   } else {
  64.                     this.valueScrollText += Math.floor(normalized.pixelY) / 2
  65.                   }
  66.                   TweenLite.to('.about', .5, {
  67.                       y: -this.scroll,
  68.                   })
  69.                   TweenLite.to('.text-translate', .5, {
  70.                       x: -this.scroll,
  71.                   })
  72.                   TweenLite.to('.fix', .5, {
  73.                       y: this.valueScrollText,
  74.                   })
  75.               }
  76.           }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement