<template>
  <div class="header-banner">
    <div class="header-banner_desktop">
      <div id="adfox_167229156853456985"></div><!--New Adfox Dashboard-->
      <div id="adfox_167229138467569665"></div>
    </div>

    <div class="header-banner_mobile">
      <div id="adfox_167048924706448374"></div><!--New Adfox Dashboard-->
      <div id="adfox_163238723987728973"></div>
    </div>
  </div>
</template>

<script>
export default {
  watch: {
    $route (to, from) {
      // eslint-disable-next-line no-undef
      if (this.$nuxt.$device.isDesktop) { Ya.adfoxCode.reload('adfox_167229156853456985') }
      // eslint-disable-next-line no-undef
      if (this.$nuxt.$device.isMobile) { Ya.adfoxCode.reload('adfox_167229138467569665') }
      // eslint-disable-next-line no-undef
      if (this.$nuxt.$device.isDesktop) { Ya.adfoxCode.reload('adfox_163238655688285853') }
      // eslint-disable-next-line no-undef
      if (this.$nuxt.$device.isMobile) { Ya.adfoxCode.reload('adfox_163238723987728973') }
    }
  },
  mounted () {
    if (this.$nuxt.$device.isDesktop) {
      window.yaContextCb.push(() => {
        // eslint-disable-next-line no-undef
        Ya.adfoxCode.create({
          ownerId: 279920,
          containerId: 'adfox_167229138467569665',
          params: {
            pp: 'g',
            ps: 'dbpj',
            p2: 'hiyx'
          }
        })
      })
      window.yaContextCb.push(() => {
        // eslint-disable-next-line no-undef
        Ya.adfoxCode.create({
          ownerId: 720777,
          containerId: 'adfox_167229156853456985',
          params: {
            p1: 'cwohj',
            p2: 'hyrh'
          }
        })
      })
    } else {
      window.yaContextCb.push(() => {
        // eslint-disable-next-line no-undef
        Ya.adfoxCode.create({
          ownerId: 279920,
          containerId: 'adfox_163238723987728973',
          params: {
            pp: 'g',
            ps: 'dbpj',
            p2: 'hizb'
          }
        })
        // eslint-disable-next-line no-undef
        Ya.adfoxCode.create({
          ownerId: 720777,
          containerId: 'adfox_167048924706448374',
          params: {
            p1: 'cwoig',
            p2: 'hyrh'
          }
        })
      })
    }
  }
}
</script>

<style lang="less">
.header-banner {
  overflow: hidden;
  width:100%;
}
.header-banner_desktop {
  position: static;
  /*display: block;*/
  height: 200px;
}
.header-banner_mobile {
  display: none;
}

@media all and (max-width: 576px) {
  .header-banner_desktop {
    display: none;
  }
  .header-banner_mobile {
    position: static;
    text-align: center;
    display: block;
    height: 250px;
  }
}
</style>
