Amazon Pivot - amazon.de

On click enlarges the amamzon search bar in portrait mode

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला Tampermonkey, Greasemonkey किंवा Violentmonkey यासारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

You will need to install an extension such as Tampermonkey to install this script.

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला Tampermonkey किंवा Violentmonkey यासारखे एक्स्टेंशन इंस्टॉल करावे लागेल..

You will need to install an extension such as Tampermonkey or Userscripts to install this script.

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला Tampermonkey यासारखे एक्स्टेंशन इंस्टॉल करावे लागेल..

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्क्रिप्ट व्यवस्थापक एक्स्टेंशन इंस्टॉल करावे लागेल.

(माझ्याकडे आधीच युझर स्क्रिप्ट व्यवस्थापक आहे, मला इंस्टॉल करू द्या!)

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला Stylus सारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला Stylus सारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला Stylus सारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्टाईल व्यवस्थापक इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्टाईल व्यवस्थापक इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्टाईल व्यवस्थापक इंस्टॉल करावे लागेल.

(माझ्याकडे आधीच युझर स्टाईल व्यवस्थापक आहे, मला इंस्टॉल करू द्या!)

// ==UserScript==
// @name           Amazon Pivot - amazon.de
// @name:de        Amazon Hochkant - amazon.de
// @namespace      meyerk.com
// @match          https://*.amazon.*/*
// @grant          none
// @version        1.6
// @author         MeyerK
// @description    On click enlarges the amamzon search bar in portrait mode
// @description:de Vergrößert auf Klick die Suchleiste im Portät Modus (Desktop)
// @runat          document-end
// ==/UserScript==


class AmazonPivot
{
  constructor()
  {
    this.ttstb = null;
    this.navSearch = null;
    this.navSearchStyle = null;
  }
  
  init()
  {
    this.ttstb = document.getElementById('twotabsearchtextbox');
    this.navSearch = document.getElementById('nav-search');
    this.navSearchStyle = this.navSearch.style;
    
    this.ttstb.addEventListener('focus', this.scaleUp.bind(this));
    this.ttstb.addEventListener('blur', this.scaleDown.bind(this));
    document.addEventListener('keyup', this.handleEsc.bind(this));
  }
  
  handleEsc(ev)
  {
    if (ev.key === "Escape")
    {
      this.scaleDown();
    }
  }
  
  scaleUp()
  {
    this.navSearchStyle.position = 'fixed';
    this.navSearchStyle.left = '10px';
    this.navSearchStyle.right = '10px';
    this.navSearchStyle.zIndex = 100000000000;
  }
  
  scaleDown()
  {
    this.navSearchStyle.position = '';
    this.navSearchStyle.left = '';
    this.navSearchStyle.right = ''; 
    this.navSearchStyle.zIndex = '';    
  }
}

let ap = new AmazonPivot()
ap.init();