{"size": 700, "ext": "js", "max_stars_repo_path": "src/scripts/components/skipto-main.js", "max_stars_repo_name": "shamahdotdev/dokter-rasa-web", "max_stars_repo_stars_event_min_datetime": "2021-01-02T23:20:38.000Z", "max_stars_repo_stars_event_max_datetime": "2021-04-16T00:42:07.000Z", "max_issues_repo_path": "src/scripts/components/skipto-main.js", "max_issues_repo_name": "Shaddamah/dokter-rasa-web", "max_issues_repo_issues_event_min_datetime": "2021-08-04T04:47:44.000Z", "max_issues_repo_issues_event_max_datetime": "2022-02-27T09:19:52.000Z", "max_forks_repo_path": "src/scripts/components/skipto-main.js", "max_forks_repo_name": "shamahdotid/dokter-rasa-web", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": 2, "max_issues_count": 4, "max_forks_count": null, "avg_line_length": 26.9230769231, "max_line_length": 108, "alphanum_fraction": 0.6842857143}
class SkipToMain extends HTMLElement {
  connectedCallback() {
    this._render()
  }

  _render() {
    this.setAttribute('tabindex', '0')
    this.setAttribute('role', 'button')
    this.innerHTML = `<span class="material-icons" aria-hidden="true">skip_next</span> Skip to main content`
    this._createEvent()
  }
  _createEvent() {
    this.addEventListener('click', this._focusToMain)
    this.addEventListener('keydown', this._focusToMain)
  }

  _focusToMain(event) {
    event.stopPropagation()
    this._contentButton = document.querySelector('button[data-bookmark]')
    setTimeout(() => {
      this._contentButton.focus()
    }, 50)
  }
}
customElements.define('skipto-main', SkipToMain)
