import { Directive, ElementRef, HostListener } from '@angular/core';

@Directive({
  selector: '[ydlifeScroll]'
})
export class ScrollDirective {

  constructor(private el:ElementRef) { }

  @HostListener('touchmove') onTouchmove(){
    this.el.nativeElement.querySelector('#menuContainer').style.transform = 'translateX(40px)'
  }
  @HostListener('touchend') onTouchcancel(){
    setTimeout(()=>{
      this.el.nativeElement.querySelector('#menuContainer').style.transform = 'translateX(0)'
    },1000)
  }
}
