HEX
Server: nginx/1.18.0
System: Linux test-ipsremont 5.4.0-214-generic #234-Ubuntu SMP Fri Mar 14 23:50:27 UTC 2025 x86_64
User: ips (1000)
PHP: 8.0.30
Disabled: pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare,
Upload Files
File: //var/www/iq.affiliate/src/components/Header/Header.svelte
<script lang="ts">
  import logo from '../../assets/images/logo.svg';
  import burger from '../../assets/images/burger.svg';
  import close from '../../assets/images/close.svg';
  import Button from '../Button/Button.svelte';
  import Dropdown from '../Dropdown/Dropdown.svelte';
  import { showForm, menu, indicator } from '../../store.js';
	import MenuMobile from './MenuMobile.svelte';
	import Lang from './Lang.svelte';
	import { goto } from '$app/navigation';
	import { t, locale, defaultLocale } from '$lib/translations';
	import { base } from '$app/paths';
  import { buttonClickHandler } from "$lib/utils";

  let menuOpen = false;
  let indicatorShow = false;

  let onClick = () => {
    menu.set(!menuOpen);
  };
</script>

<header class="header {menuOpen ? 'active' : ''}">

  <div class="headerContainer">
    <a
      class="headerLogo"
      href="{base}/{$locale}"
    >
      <img class="logo" alt="logo" src={logo} />
    </a>
    <nav class="headerNav">
      <a class="headerNavElement" href="{base}/{$locale !== defaultLocale ? $locale : ''}#advantages">{$t('Advantages')}</a>
      <a class="headerNavElement" href="{base}/{$locale !== defaultLocale ? $locale : ''}#payments">{$t('Payments')}</a>
      <a class="headerNavElement" href="{base}/{$locale !== defaultLocale ? $locale : ''}#offers">{$t('Offers')}</a>
      <a class="headerNavElement" href="{base}/{$locale !== defaultLocale ? $locale : ''}#reviews">{$t('Reviews')}</a>
    </nav>
    <div class="headerControls">
      <div class="dropdown">
        <Lang />
        <!-- <Dropdown title="Language"
          options={[
            { name: 'English' },
            { name: 'Русский'},
            { name: 'Italiano' },
          ]} /> -->
      </div>
      <span
        class="headerControlElement"
        role="button"
        on:click={buttonClickHandler}
        tabindex="0"
        on:keydown={() => false}
        >{$t('Log in')}
      </span>
      <div class="button">
        <Button className="primary" text={$t('Sign up')} onClick={buttonClickHandler}/>
      </div>
      <div
        class="headerBurger"
        on:click={onClick}
        on:keydown={() => false}
        tabindex="0"
        role="button"
        aria-label="Burger"
      >
        {#if menuOpen}
          <img src={close} alt="close menu icon" width="20" height="20" />
        {:else}
          <img src={burger} alt="burger menu icon" width="20" height="20" />
        {/if}
      </div>
    </div>
  </div>
  <MenuMobile />
</header>

<style lang="scss">
  @import 'src/scss/variables';
  @import 'src/scss/media';

  .header {
    width: 100%;
    position: sticky;
    top: 0;
    z-index: 15;
    color: $blue100;

    &.active {
      background: #f0ede8;

      .headerContainer {
        position: relative;
        z-index: 51;
      }
    }
  }
  .dropdown {
    order: 1;
    @include breakpoint-down('deskS') {
      order: 3;
    }
    @include breakpoint-down('tabM') {
      display: none;
    }
  }
  .headerControlElement {
    order: 2;
    @include breakpoint-down('tabM') {
      display: none;
    }
  }
  .button {
    order: 3;
  }
  .headerContainer {
    max-width: 1254px;
    margin-inline: auto;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 0;

    @include breakpoint-down('deskS') {
      max-width: 960px;
    }

    @include breakpoint-down('tabM') {
      padding: 20px 0;
      max-width: 656px;
    }

    @include breakpoint-down('tabS') {
      max-width: none;
      padding: 12px 26px;
    }

    @include breakpoint-down('mobM') {
      padding: 12px 20px;
    }
  }

  .headerLogo {
    min-width: 153px;
    height: 32px;
    display: flex;
    cursor: pointer;

    @include breakpoint-down('mobM') {
      min-width: 95.63px;
      height: 20px;

      img {
        object-position: left;
      }
    }

    img {
      width: 100%;
      height: 100%;
      object-fit: contain;
    }
  }

  .headerNav {
    display: flex;
    align-items: center;
    gap: 8px;

    .headerNavElement{
      height: 48px;
      padding: 14px 12px;
      color: $blue100;
      cursor: pointer;
      font-weight: 500;
      letter-spacing: 0.8px;
      &:hover{
        color: $blue200
      }
    }

    @include breakpoint-down('tabM') {
      display: none;
    }
  }

  .headerControls {
    display: flex;
    align-items: center;
    gap: 20px;
    height: 48px;

    @include breakpoint-down('tabS') {
      gap: 12px;
      height: 44px;
    }
    @include breakpoint-down('mobM') {
      gap: 12px;
    }

    .headerControlElement {
      padding: 14px 12px;
      color: $blue100;
      cursor: pointer;
      @include breakpoint-down('tabS') {
        height: 44px;
      }
      &:hover{
        color: $blue200
      }
    }
  }

  .headerBurger {
    display: none;
    border-color: none;
    width: 44px;
    height: 44px;
    align-items: center;
    justify-content: center;
    background: $blue500;
    order: 4;

    @include breakpoint-down('tabM') {
      display: flex;
      border-radius: 16px;
    }
  }

  :global(.headerControls .lang) {
    @include breakpoint-down('tabS') {
      display: none;
    }
  }

  :global(.header.active .headerControls .button) {
    @include breakpoint-down('tabS') {
      display: none;
    }
  }

  :global(.header .headerControls .button) {
    @include breakpoint-down('mobM') {
      // display: none;
    }
  }
</style>