'use strict'

export class Cursor {

  constructor () {
    this._size = 14
    this._timeout = 400
    this._initTransition = `all ${this._timeout}ms ease-in-out`
    this._position = {
      x: 0,
      y: 0
    }

    this._point = window.document.getElementById('mocha-extjs-testing-tool-pointer')

    if (!this._point) {
      this._point = document.createElement('div')

      this._point.id = 'mocha-extjs-testing-tool-pointer'
      this._point.style.top = `${this._position.y}px`
      this._point.style.left = `${this._position.x}px`
      this._point.style.width = `${this._size}px`
      this._point.style.zIndex = '90000'
      this._point.style.height = `${this._size}px`
      this._point.style.border = '2px solid #ffffff'
      this._point.style.opacity = '1'
      this._point.style.position = 'absolute'
      this._point.style.transition = this._initTransition
      this._point.style.borderRadius = `0 ${this._size / 2}px ${this._size / 2}px ${this._size / 2}px`
      this._point.style.backgroundColor = '#ee3300'

      window.document.body.appendChild(this._point)
    }
  }

  moveTo (x, y, callback) {
    const translate = `translate(${x}px, ${y}px)`

    this._point.style.transform = translate

    setTimeout(() => {
      this._point.style.transition = 'all 50ms ease-in-out'
      this._point.style.transform = `${translate} scale(0.5)`
      setTimeout(() => {
        this._point.style.transform = `${translate} scale(1)`
        setTimeout(() => {
          this._point.style.transition = this._initTransition
          return callback(null)
        }, 50)
      }, 50)
    }, this._timeout)
  }

  hide () {
    this._point.style.display = 'none'
  }

  show () {
    this._point.style.display = 'block'
  }

}

@@ -1118,24 +1118,176 @@
 callback) %7B%0A
+    if (window.callPhantom) %7B%0A      this._point.style.left = %60$%7Bx%7Dpx%60%0A      this._point.style.top = %60$%7By%7Dpx%60%0A      return callback(null)%0A    %7D else %7B%0A  
     const tr
@@ -1324,17 +1324,18 @@
 %7By%7Dpx)%60%0A
-%0A
+  
     this
@@ -1370,17 +1370,18 @@
 anslate%0A
-%0A
+  
     setT
@@ -1391,24 +1391,26 @@
 out(() =%3E %7B%0A
+  
       this._
@@ -1455,32 +1455,34 @@
 e-in-out'%0A      
+ 
+ 
 this._point.styl
@@ -1521,16 +1521,18 @@
 e(0.5)%60%0A
+  
       se
@@ -1548,32 +1548,34 @@
 () =%3E %7B%0A        
+  
 this._point.styl
@@ -1612,32 +1612,34 @@
 ale(1)%60%0A        
+ 
+ 
 setTimeout(() =%3E
@@ -1633,32 +1633,34 @@
 Timeout(() =%3E %7B%0A
+  
           this._
@@ -1711,24 +1711,26 @@
 n%0A          
+  
 return callb
@@ -1743,31 +1743,35 @@
 ll)%0A        
+ 
+ 
 %7D, 50)%0A
+  
       %7D, 50)
@@ -1775,16 +1775,18 @@
 50)%0A    
+  
 %7D, this.
@@ -1795,16 +1795,22 @@
 imeout)%0A
+    %7D%0A
   %7D%0A%0A  h

Move cursove on phantomjs screenshots