Welcome to mirror list, hosted at ThFree Co, Russian Federation.

navbar.html « partials « layouts - github.com/lxndrblz/anatole.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 33e1267042e8faf788d6f5f37539679c23a80c7f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
<div
  class="{{ with .Site.Params.doNotLoadAnimations }}
    .

  {{ else }}
    animated fadeInDown

  {{ end }}"
>
  <a role="button" class="navbar-burger" data-target="navMenu" aria-label="menu" aria-expanded="false">
    <span aria-hidden="true" class="navbar-burger__line"></span>
    <span aria-hidden="true" class="navbar-burger__line"></span>
    <span aria-hidden="true" class="navbar-burger__line"></span>
  </a>
  <nav class="nav">
    <ul class="nav__list" id="navMenu">
      {{ $url := .RelPermalink }}
      {{ range $menuId, $menuItem := .Site.Menus.main }}
        {{ $active := eq $url $menuItem.URL }}
        {{ if $menuItem.HasChildren }}

          <li class="nav__list-item">
            <div class="optionswitch">
              <input class="optionswitch__picker" type="checkbox" id="{{ $menuId }}" hidden />

              {{ $labelClass := "optionswitch__label" }}
              {{ range $menuItem.Children }}
                {{ if eq $url .URL }}
                  {{ $labelClass = "optionswitch__label nav__link--active" }}


                {{ end }}


              {{ end }}


              <label class="{{ $labelClass }}" for="{{ $menuId }}"
                >{{ $menuItem.Name }} <i class="fa fa-angle-down" aria-hidden="true"></i
              ></label>

              <div class="optionswitch__triangle"></div>
              <ul class="optionswitch__list">
                {{ range $menuItem.Children }}
                  <li class="optionswitch__list-item">{{ .Pre }}
                    <a
                      href="{{ .URL }}"
                      {{ if strings.HasPrefix .URL "http" }}
                        target="_blank" rel="noopener noreferrer"

                      {{ end }}
                      title="{{ .Title }}"
                      >{{ .Name }}</a
                    >
                  </li>

                {{ end }}
              </ul>
            </div>
          </li>

        {{ else }}
          <li class="nav__list-item">{{ .Pre }}
            <a
              {{ if $active }}
                class="nav__link--active"

              {{ end }}
              href="{{ .URL }}"
              {{ if strings.HasPrefix .URL "http" }}
                target="_blank" rel="noopener noreferrer"

              {{ end }}
              title="{{ .Title }}"
              >{{ $menuItem.Name }}</a
            >
          </li>

        {{ end }}


      {{ end }}
    </ul>
    <ul class="nav__list nav__list--end">
      {{ if and .IsTranslated .Site.IsMultiLingual }}
        <li class="nav__list-item">
          <div class="optionswitch">
            <input class="optionswitch__picker" type="checkbox" id="languagepicker" hidden />
            <label class="optionswitch__label" for="languagepicker"
              >{{ .Site.Language.LanguageName }} <i class="fa fa-angle-down" aria-hidden="true"></i
            ></label>
            <div class="optionswitch__triangle"></div>
            <ul class="optionswitch__list">
              {{ range $.Translations }}
                <li class="optionswitch__list-item">
                  <a href="{{ .RelPermalink }}" title="{{ .Language.LanguageName }}"
                    ><span
                      {{ if eq . $.Site.Language }}
                        class="active"

                      {{ end }}
                      aria-label="{{ i18n "ariaLanguage" }}{{ .Language.LanguageName }}"
                      >{{ .Language.LanguageName }}</span
                    >
                  </a>
                </li>

              {{ end }}
            </ul>
          </div>
        </li>

      {{ end }}
      {{ if not .Site.Params.disableThemeSwitcher }}
        <li class="nav__list-item">
          <div class="themeswitch">
            <a title="Switch Theme">
              <i class="fas fa-adjust fa-fw" aria-hidden="true"></i>
            </a>
          </div>
        </li>

      {{ end }}
    </ul>
  </nav>
</div>