@internetarchive/ia-topnav 1.3.0 → 1.3.1-alpha10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/assets/img/icon-donate-unpadded.js +16 -0
- package/src/assets/img/icon-hamburger.js +18 -0
- package/src/assets/img/icon-ia-logo.js +0 -2
- package/src/assets/img/icon-upload.js +2 -2
- package/src/assets/img/icons.js +4 -0
- package/src/assets/img/wordmark-stacked.js +1 -1
- package/src/ia-topnav.js +7 -0
- package/src/primary-nav.js +23 -15
- package/src/styles/desktop-subnav.js +3 -3
- package/src/styles/dropdown-menu.js +1 -1
- package/src/styles/ia-topnav.js +2 -3
- package/src/styles/login-button.js +13 -4
- package/src/styles/media-button.js +6 -4
- package/src/styles/media-menu.js +1 -1
- package/src/styles/media-slider.js +3 -3
- package/src/styles/media-subnav.js +2 -2
- package/src/styles/nav-search.js +9 -7
- package/src/styles/primary-nav.js +65 -66
- package/src/styles/search-menu.js +1 -1
- package/src/styles/signed-out-dropdown.js +2 -2
- package/src/styles/user-menu.js +2 -2
- package/test/ia-topnav.test.js +1 -1
- package/test/primary-nav.test.js +1 -1
- package/src/assets/img/hamburger.js +0 -36
- package/src/assets/img/user.js +0 -38
package/package.json
CHANGED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { html } from 'https://offshoot.prod.archive.org/lit.js';
|
|
2
|
+
|
|
3
|
+
export default html`
|
|
4
|
+
<svg
|
|
5
|
+
width="40"
|
|
6
|
+
height="40"
|
|
7
|
+
viewBox="0 0 40 40"
|
|
8
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
9
|
+
xmlns:svg="http://www.w3.org/2000/svg"
|
|
10
|
+
aria-labelledby="donateTitleID donateDescID"
|
|
11
|
+
>
|
|
12
|
+
<title id="donateTitleID">Donate icon</title>
|
|
13
|
+
<desc id="donateDescID">An illustration of a heart shape</desc>
|
|
14
|
+
<path class="fill-color" d="m32.6,8.12c-1.57,-1.51 -3.46,-2.21 -5.65,-2.11c-1,0.03 -2.14,0.51 -3.42,1.44c-1.28,0.92 -2.28,2.09 -3.03,3.51c-0.71,-1.41 -1.72,-2.59 -3,-3.51c-1.29,-0.93 -2.43,-1.41 -3.41,-1.44c-1.46,-0.07 -2.8,0.23 -4.02,0.88c-1.23,0.65 -2.21,1.6 -2.94,2.83c-0.74,1.24 -1.11,2.63 -1.12,4.17c-0.05,2.56 0.85,5.01 2.68,7.37c1.46,1.88 3.52,4.21 6.19,7.04c2.66,2.81 4.53,4.71 5.62,5.69c1,-0.88 2.85,-2.75 5.55,-5.6s4.81,-5.23 6.31,-7.13c1.81,-2.36 2.71,-4.81 2.66,-7.37c-0.04,-2.35 -0.83,-4.28 -2.4,-5.77z"/>
|
|
15
|
+
</svg>
|
|
16
|
+
`;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { html } from 'https://offshoot.prod.archive.org/lit.js';
|
|
2
|
+
|
|
3
|
+
export default html`
|
|
4
|
+
<svg
|
|
5
|
+
viewBox="0 0 40 40"
|
|
6
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
7
|
+
aria-labelledby="hamburgerTitleID"
|
|
8
|
+
>
|
|
9
|
+
<title id="hamburgerTitleID">Hamburger icon</title>
|
|
10
|
+
<path
|
|
11
|
+
d="m30.5 26.5c.8284271 0 1.5.6715729 1.5 1.5s-.6715729 1.5-1.5 1.5h-21c-.82842712 0-1.5-.6715729-1.5-1.5s.67157288-1.5 1.5-1.5zm0-8c.8284271 0 1.5.6715729 1.5 1.5s-.6715729 1.5-1.5 1.5h-21c-.82842712 0-1.5-.6715729-1.5-1.5s.67157288-1.5 1.5-1.5zm0-8c.8284271 0 1.5.6715729 1.5 1.5s-.6715729 1.5-1.5 1.5h-21c-.82842712 0-1.5-.6715729-1.5-1.5s.67157288-1.5 1.5-1.5z"
|
|
12
|
+
fill="#999"
|
|
13
|
+
fill-rule="evenodd"
|
|
14
|
+
/>
|
|
15
|
+
</svg>
|
|
16
|
+
`;
|
|
17
|
+
|
|
18
|
+
|
|
@@ -3,8 +3,8 @@ import { html } from 'https://offshoot.prod.archive.org/lit.js';
|
|
|
3
3
|
export default html`
|
|
4
4
|
<svg
|
|
5
5
|
width="40"
|
|
6
|
-
height="
|
|
7
|
-
viewBox="0 0 40
|
|
6
|
+
height="40"
|
|
7
|
+
viewBox="0 0 40 40"
|
|
8
8
|
xmlns="http://www.w3.org/2000/svg"
|
|
9
9
|
aria-labelledby="uploadTitleID uploadDescID"
|
|
10
10
|
>
|
package/src/assets/img/icons.js
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import audio from './icon-audio.js';
|
|
2
2
|
import close from './icon-close.js';
|
|
3
|
+
import hamburger from './icon-hamburger.js';
|
|
3
4
|
import donate from './icon-donate.js';
|
|
5
|
+
import donateUnpadded from './icon-donate-unpadded.js';
|
|
4
6
|
import ellipses from './icon-ellipses.js';
|
|
5
7
|
import iaLogo from './icon-ia-logo.js';
|
|
6
8
|
import images from './icon-images.js';
|
|
@@ -16,7 +18,9 @@ import web from './icon-web.js';
|
|
|
16
18
|
export default {
|
|
17
19
|
audio,
|
|
18
20
|
close,
|
|
21
|
+
hamburger,
|
|
19
22
|
donate,
|
|
23
|
+
donateUnpadded,
|
|
20
24
|
ellipses,
|
|
21
25
|
iaLogo,
|
|
22
26
|
images,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { svg } from 'https://offshoot.prod.archive.org/lit.js';
|
|
2
2
|
|
|
3
3
|
export default svg`
|
|
4
|
-
<svg class="ia-wordmark stacked"
|
|
4
|
+
<svg class="ia-wordmark stacked" viewBox="0 0 95 30" xmlns="http://www.w3.org/2000/svg">
|
|
5
5
|
<g fill="#fff" fill-rule="evenodd">
|
|
6
6
|
<g transform="translate(0 17)">
|
|
7
7
|
<path d="m3.07645967 2.60391777c.09263226-.31901841.26275495-.97477846.26275495-1.10630359 0-.74950669-.57227138-.76816274-1.19041353-.88009902v-.41183224h2.90678232l3.77209227 12.60682378h-1.60725868l-1.16012991-3.8963154h-3.94266032l-1.15968456 3.8963154h-.95794221zm-.69607795 5.4317081h3.41670507l-1.76223957-5.469953z"/><path d="m13.2661876 2.75363255c0-1.85487748-.0316196-1.85487748-1.469201-2.13611739v-.41183224h3.8032666c1.1601299 0 4.3599508 0 4.3599508 3.35342446 0 2.13518459-1.143652 2.84737918-2.3652399 3.0903742l2.8448791 6.16302512h-1.7773814l-2.7366596-5.82581707h-.9588329v5.82581707h-1.7007817zm1.7007817 3.35295806h.8817878c1.0042583 0 2.411556-.33674165 2.411556-2.43508055 0-2.0237147-.9588329-2.58572812-2.2579112-2.58572812-1.0354326 0-1.0354326.33720805-1.0354326 1.68650665z"/><path d="m30.9386422 12.2878054c-.5250645.2817063-1.3761234.7121946-2.9682403.7121946-3.3552471 0-4.5612478-2.4537366-4.5612478-6.66860403 0-3.4089262.86531-6.18214759 4.3136347-6.18214759 1.3761234 0 2.3812724.28077351 3.0920468.56201342l.0930776 3.12908549h-.4484648c-.0619033-.95612241-.9125167-2.79187744-2.5821241-2.79187744-2.2726076 0-2.6440273 2.94065941-2.6440273 5.28292612 0 2.95931547.8510588 5.61966783 2.9994146 5.61966783 1.4692009 0 2.2267368-.5620135 2.7059306-.9551897z"/><path d="m35.4546446 2.67900836c0-1.48129014-.0926322-1.64966096-1.5466914-1.83622143v-.41276504l3.2470277-.43002189v5.80669465h4.2049699v-5.60101173h1.7007816v12.60682378h-1.7007816v-6.12571303h-4.2049699v6.12571303h-1.7003363z"/><path d="m46.0300434 12.3447063c1.0973359 0 1.3137748-.2807735 1.3137748-1.7420083v-8.05568117c0-1.46123489-.2164389-1.741542-1.3137748-1.741542v-.46919958h4.3287765v.46919958c-1.0826395 0-1.3137748.28030711-1.3137748 1.741542v8.05568117c0 1.4612348.2311353 1.7420083 1.3137748 1.7420083v.4678004h-4.3287765z"/><path d="m55.1990352 2.60391777c-.494781-1.7051627-.6341747-1.7051627-1.8709043-1.98640261v-.41183224h2.9994145l3.0301436 10.26548988h.0307289l2.9535438-10.26548988h1.0042584l-3.771647 12.60682378h-1.344949z"/><path d="m67.7842867 2.75363255c0-1.85487748-.0463161-1.85487748-1.4687557-2.13611739v-.41183224h7.4061269l.0463161 2.77228859h-.433323c0-1.49854698-.6488711-1.89218957-1.6696073-1.89218957h-1.2060007c-.7726777 0-.9735293.07462419-.9735293.97431206v3.7279446h1.8709043c1.0657162 0 1.174381-.82366447 1.2674586-1.44164603h.4324323v3.93316112h-.4324323c0-1.01162415-.3402454-1.61141607-1.2674586-1.61141607h-1.8709043v4.17755538c0 1.0489362.2008516 1.0867147.9735293 1.0867147h1.7168141c.8804518 0 1.2977423-.3749865 1.3908199-1.835755h.433323l-.0472068 2.715854h-6.1685065z"/>
|
package/src/ia-topnav.js
CHANGED
|
@@ -86,6 +86,13 @@ export default class IATopNav extends LitElement {
|
|
|
86
86
|
}
|
|
87
87
|
}
|
|
88
88
|
|
|
89
|
+
firstUpdated() {
|
|
90
|
+
// close open menu on `esc` click
|
|
91
|
+
document.addEventListener('keydown', e => {
|
|
92
|
+
if (e.key === 'Escape') this.closeMenus();
|
|
93
|
+
}, false);
|
|
94
|
+
}
|
|
95
|
+
|
|
89
96
|
menuSetup() {
|
|
90
97
|
this.localLinks = this.getAttribute('localLinks') !== 'false' && this.getAttribute('localLinks') !== false;
|
|
91
98
|
this.username = this.getAttribute('username')
|
package/src/primary-nav.js
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { html, nothing } from 'https://offshoot.prod.archive.org/lit.js';
|
|
2
2
|
import TrackedElement from './tracked-element.js';
|
|
3
3
|
import icons from './assets/img/icons.js';
|
|
4
|
-
import './assets/img/hamburger.js';
|
|
5
4
|
import './login-button.js';
|
|
6
5
|
import './nav-search.js';
|
|
7
6
|
import './media-menu.js';
|
|
@@ -124,7 +123,7 @@ class PrimaryNav extends TrackedElement {
|
|
|
124
123
|
|
|
125
124
|
return html`
|
|
126
125
|
<button
|
|
127
|
-
class="search-trigger"
|
|
126
|
+
class="mobile-search-trigger"
|
|
128
127
|
@click="${this.toggleSearchMenu}"
|
|
129
128
|
data-event-click-tracking="${this.config.eventCategory}|NavSearchOpen"
|
|
130
129
|
>
|
|
@@ -145,14 +144,25 @@ class PrimaryNav extends TrackedElement {
|
|
|
145
144
|
get mobileDonateHeart() {
|
|
146
145
|
return html`
|
|
147
146
|
<a class="mobile-donate-link" href=${formatUrl('/donate/?origin=iawww-mbhrt', this.baseHost)}>
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
</span>
|
|
151
|
-
<span class="label">"Donate to the archive"</span>
|
|
147
|
+
${icons.donateUnpadded}
|
|
148
|
+
<span class="sr-only">"Donate to the archive"</span>
|
|
152
149
|
</a>
|
|
153
150
|
`;
|
|
154
151
|
}
|
|
155
152
|
|
|
153
|
+
get uploadButtonTemplate() {
|
|
154
|
+
return html`<a href="${formatUrl('/create', this.baseHost)}" class="upload">
|
|
155
|
+
${icons.upload}
|
|
156
|
+
<span>Upload</span>
|
|
157
|
+
</a>`;
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
get userStateTemplate() {
|
|
161
|
+
return html`<div class="user-info">
|
|
162
|
+
${this.username ? this.userIcon : this.loginIcon}
|
|
163
|
+
</div>`;
|
|
164
|
+
}
|
|
165
|
+
|
|
156
166
|
get secondLogoSlot() {
|
|
157
167
|
return this.allowSecondaryIcon
|
|
158
168
|
? html`
|
|
@@ -181,14 +191,12 @@ class PrimaryNav extends TrackedElement {
|
|
|
181
191
|
>
|
|
182
192
|
${this.secondLogoSlot}
|
|
183
193
|
</div>
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
${
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
<div class="user-info">
|
|
191
|
-
${this.username ? this.userIcon : this.loginIcon}
|
|
194
|
+
|
|
195
|
+
<div class="right-side-section">
|
|
196
|
+
${this.mobileDonateHeart}
|
|
197
|
+
${this.searchMenu}
|
|
198
|
+
${this.uploadButtonTemplate}
|
|
199
|
+
${this.userStateTemplate}
|
|
192
200
|
</div>
|
|
193
201
|
<media-menu
|
|
194
202
|
.baseHost=${this.baseHost}
|
|
@@ -205,7 +213,7 @@ class PrimaryNav extends TrackedElement {
|
|
|
205
213
|
data-event-click-tracking="${this.config.eventCategory}|NavHamburger"
|
|
206
214
|
title="Open main menu"
|
|
207
215
|
>
|
|
208
|
-
|
|
216
|
+
${this.openMenu === 'media' ? icons.close : icons.hamburger}
|
|
209
217
|
</button>
|
|
210
218
|
</nav>
|
|
211
219
|
`;
|
package/src/styles/ia-topnav.js
CHANGED
|
@@ -54,7 +54,6 @@ export default css`
|
|
|
54
54
|
--savePageErrorText: var(--errorYellow);
|
|
55
55
|
|
|
56
56
|
color: var(--primaryTextColor);
|
|
57
|
-
font-size: 2rem;
|
|
58
57
|
font-family: var(--themeFontFamily);
|
|
59
58
|
}
|
|
60
59
|
|
|
@@ -69,7 +68,7 @@ export default css`
|
|
|
69
68
|
right: 0;
|
|
70
69
|
bottom: 0;
|
|
71
70
|
left: 0;
|
|
72
|
-
z-index:
|
|
71
|
+
z-index: 3;
|
|
73
72
|
}
|
|
74
73
|
#close-layer.visible {
|
|
75
74
|
display: block;
|
|
@@ -77,7 +76,7 @@ export default css`
|
|
|
77
76
|
|
|
78
77
|
.topnav {
|
|
79
78
|
position: relative;
|
|
80
|
-
z-index:
|
|
79
|
+
z-index: 4;
|
|
81
80
|
}
|
|
82
81
|
|
|
83
82
|
@media (max-width: 889px) {
|
|
@@ -3,14 +3,16 @@ import { css } from 'https://offshoot.prod.archive.org/lit.js';
|
|
|
3
3
|
export default css`
|
|
4
4
|
.dropdown-toggle {
|
|
5
5
|
display: block;
|
|
6
|
-
height: 4rem;
|
|
7
|
-
font-size: 1.6rem;
|
|
8
6
|
text-transform: uppercase;
|
|
9
|
-
text-decoration: none;
|
|
10
7
|
color: var(--grey80);
|
|
11
8
|
cursor: pointer;
|
|
12
9
|
}
|
|
13
10
|
|
|
11
|
+
.dropdown-toggle svg {
|
|
12
|
+
height: 100%;
|
|
13
|
+
width: 4rem;
|
|
14
|
+
}
|
|
15
|
+
|
|
14
16
|
.dropdown-toggle .fill-color {
|
|
15
17
|
fill: var(--iconFill);
|
|
16
18
|
}
|
|
@@ -50,7 +52,8 @@ export default css`
|
|
|
50
52
|
|
|
51
53
|
@media (min-width: 890px) {
|
|
52
54
|
.logged-out-toolbar {
|
|
53
|
-
|
|
55
|
+
padding: 1rem 0.5rem;
|
|
56
|
+
vertical-align: middle;
|
|
54
57
|
}
|
|
55
58
|
|
|
56
59
|
.active {
|
|
@@ -62,6 +65,12 @@ export default css`
|
|
|
62
65
|
vertical-align: middle;
|
|
63
66
|
}
|
|
64
67
|
|
|
68
|
+
.dropdown-toggle svg {
|
|
69
|
+
height: 3rem;
|
|
70
|
+
width: 3rem;
|
|
71
|
+
display: block;
|
|
72
|
+
}
|
|
73
|
+
|
|
65
74
|
span {
|
|
66
75
|
display: inline;
|
|
67
76
|
vertical-align: middle;
|
|
@@ -33,8 +33,6 @@ export default css`
|
|
|
33
33
|
|
|
34
34
|
.menu-item > .icon {
|
|
35
35
|
display: inline-flex;
|
|
36
|
-
width: 42px;
|
|
37
|
-
height: 42px;
|
|
38
36
|
vertical-align: middle;
|
|
39
37
|
-webkit-box-align: center;
|
|
40
38
|
-ms-flex-align: center;
|
|
@@ -44,6 +42,11 @@ export default css`
|
|
|
44
42
|
justify-content: center;
|
|
45
43
|
}
|
|
46
44
|
|
|
45
|
+
.menu-item > .icon > svg {
|
|
46
|
+
height: 4rem;
|
|
47
|
+
width: 4rem;
|
|
48
|
+
}
|
|
49
|
+
|
|
47
50
|
.menu-item.selected .icon {
|
|
48
51
|
background-color: var(--activeButtonBg);
|
|
49
52
|
border-radius: 1rem 0 0 1rem;
|
|
@@ -91,7 +94,6 @@ export default css`
|
|
|
91
94
|
color: inherit;
|
|
92
95
|
}
|
|
93
96
|
|
|
94
|
-
|
|
95
97
|
.web:after {
|
|
96
98
|
display: none;
|
|
97
99
|
content: "web";
|
|
@@ -140,7 +142,7 @@ export default css`
|
|
|
140
142
|
}
|
|
141
143
|
}
|
|
142
144
|
|
|
143
|
-
@media (min-width:
|
|
145
|
+
@media (min-width: 1200px) {
|
|
144
146
|
.label,
|
|
145
147
|
.web:after {
|
|
146
148
|
display: inline;
|
package/src/styles/media-menu.js
CHANGED
|
@@ -22,7 +22,7 @@ export default css`
|
|
|
22
22
|
right: 0;
|
|
23
23
|
left: 0;
|
|
24
24
|
padding: 0;
|
|
25
|
-
height:
|
|
25
|
+
height: 36.8rem;
|
|
26
26
|
overflow-x: hidden;
|
|
27
27
|
font-size: 1.4rem;
|
|
28
28
|
background: var(--mediaSliderBg);
|
|
@@ -43,7 +43,7 @@ export default css`
|
|
|
43
43
|
@media (max-width: 889px) {
|
|
44
44
|
.overflow-clip.open {
|
|
45
45
|
display: block;
|
|
46
|
-
height:
|
|
46
|
+
height: 36.7rem;
|
|
47
47
|
left: 4rem;
|
|
48
48
|
top: 0;
|
|
49
49
|
}
|
|
@@ -73,7 +73,7 @@ export default css`
|
|
|
73
73
|
}
|
|
74
74
|
|
|
75
75
|
.info-box {
|
|
76
|
-
max-width:
|
|
76
|
+
max-width: 100rem;
|
|
77
77
|
padding: 1.5rem 0;
|
|
78
78
|
margin: 0 auto;
|
|
79
79
|
}
|
|
@@ -27,7 +27,7 @@ export default [subnavListCSS, css`
|
|
|
27
27
|
|
|
28
28
|
.icon-links a {
|
|
29
29
|
display: inline-block;
|
|
30
|
-
width:
|
|
30
|
+
width: 12rem;
|
|
31
31
|
margin-bottom: 1.5rem;
|
|
32
32
|
overflow: hidden;
|
|
33
33
|
white-space: nowrap;
|
|
@@ -67,7 +67,7 @@ export default [subnavListCSS, css`
|
|
|
67
67
|
|
|
68
68
|
.icon-links a {
|
|
69
69
|
padding-top: 3.5rem;
|
|
70
|
-
max-width:
|
|
70
|
+
max-width: 16rem;
|
|
71
71
|
}
|
|
72
72
|
|
|
73
73
|
.links {
|
package/src/styles/nav-search.js
CHANGED
|
@@ -24,8 +24,6 @@ export default css`
|
|
|
24
24
|
}
|
|
25
25
|
.search svg {
|
|
26
26
|
position: relative;
|
|
27
|
-
top: -5px;
|
|
28
|
-
right: -3px;
|
|
29
27
|
fill: var(--activeSearchColor);
|
|
30
28
|
}
|
|
31
29
|
.search-activated {
|
|
@@ -65,6 +63,10 @@ export default css`
|
|
|
65
63
|
-ms-grid-row-align: center;
|
|
66
64
|
align-self: center;
|
|
67
65
|
}
|
|
66
|
+
.search-activated .search svg {
|
|
67
|
+
height: 3rem;
|
|
68
|
+
width: 3rem;
|
|
69
|
+
}
|
|
68
70
|
.search-activated .search-field {
|
|
69
71
|
width: 100%;
|
|
70
72
|
height: 100%;
|
|
@@ -93,8 +95,8 @@ export default css`
|
|
|
93
95
|
@media (min-width: 890px) {
|
|
94
96
|
.search svg {
|
|
95
97
|
display: inline;
|
|
96
|
-
width:
|
|
97
|
-
height:
|
|
98
|
+
width: 2.8rem;
|
|
99
|
+
height: 2.8rem;
|
|
98
100
|
vertical-align: -14px;
|
|
99
101
|
}
|
|
100
102
|
.search path {
|
|
@@ -105,7 +107,7 @@ export default css`
|
|
|
105
107
|
.search-activated {
|
|
106
108
|
display: block;
|
|
107
109
|
position: static;
|
|
108
|
-
padding: 1.
|
|
110
|
+
padding: 1.1rem 0.2rem;
|
|
109
111
|
background: transparent;
|
|
110
112
|
}
|
|
111
113
|
|
|
@@ -127,8 +129,8 @@ export default css`
|
|
|
127
129
|
}
|
|
128
130
|
|
|
129
131
|
.search-activated .search svg {
|
|
130
|
-
width:
|
|
131
|
-
height:
|
|
132
|
+
width: 2.8rem;
|
|
133
|
+
height: 2.8rem;
|
|
132
134
|
}
|
|
133
135
|
}
|
|
134
136
|
`;
|
|
@@ -11,10 +11,10 @@ export default css`
|
|
|
11
11
|
position: relative;
|
|
12
12
|
display: -ms-grid;
|
|
13
13
|
display: grid;
|
|
14
|
-
height:
|
|
14
|
+
height: 4rem;
|
|
15
15
|
grid-template-areas: 'hamburger empty heart search user';
|
|
16
|
-
-ms-grid-columns:
|
|
17
|
-
grid-template-columns:
|
|
16
|
+
-ms-grid-columns: 4rem minmax(1rem, 100%) 4rem 4rem 4rem;
|
|
17
|
+
grid-template-columns: 4rem auto 4rem 4rem 4rem;
|
|
18
18
|
-ms-grid-rows: 100%;
|
|
19
19
|
grid-template-rows: 100%;
|
|
20
20
|
background: var(--primaryNavBg);
|
|
@@ -23,10 +23,14 @@ export default css`
|
|
|
23
23
|
|
|
24
24
|
nav.hide-search {
|
|
25
25
|
grid-template-areas: 'hamburger empty heart user';
|
|
26
|
-
-ms-grid-columns:
|
|
27
|
-
grid-template-columns:
|
|
26
|
+
-ms-grid-columns: 4rem minmax(1rem, 100%) 4rem 4rem;
|
|
27
|
+
grid-template-columns: 4rem auto 5rem 4rem;
|
|
28
28
|
}
|
|
29
29
|
|
|
30
|
+
.right-side-section {
|
|
31
|
+
display: flex;
|
|
32
|
+
user-select: none;
|
|
33
|
+
}
|
|
30
34
|
button {
|
|
31
35
|
background: none;
|
|
32
36
|
color: inherit;
|
|
@@ -56,6 +60,15 @@ export default css`
|
|
|
56
60
|
grid-column-end: user-end;
|
|
57
61
|
}
|
|
58
62
|
|
|
63
|
+
.ia-logo {
|
|
64
|
+
height: 3rem;
|
|
65
|
+
width: 2.7rem;
|
|
66
|
+
display: inline-block;
|
|
67
|
+
}
|
|
68
|
+
.ia-wordmark {
|
|
69
|
+
height: 3rem;
|
|
70
|
+
width: 9.5rem;
|
|
71
|
+
}
|
|
59
72
|
.ia-logo,
|
|
60
73
|
.ia-wordmark {
|
|
61
74
|
margin-right: 5px;
|
|
@@ -67,55 +80,43 @@ export default css`
|
|
|
67
80
|
grid-area: hamburger;
|
|
68
81
|
padding: 0;
|
|
69
82
|
}
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
grid-area: heart;
|
|
75
|
-
position: relative;
|
|
76
|
-
padding: 0;
|
|
77
|
-
z-index: 1;
|
|
78
|
-
width: 100%;
|
|
79
|
-
text-align: right;
|
|
80
|
-
-webkit-box-align: center;
|
|
81
|
-
-ms-flex-align: center;
|
|
82
|
-
align-items: center;
|
|
83
|
+
.hamburger svg {
|
|
84
|
+
height: 4rem;
|
|
85
|
+
width: 4rem;
|
|
86
|
+
fill: var(--activeColor);
|
|
83
87
|
}
|
|
88
|
+
|
|
84
89
|
.mobile-donate-link svg {
|
|
85
|
-
height:
|
|
86
|
-
width:
|
|
87
|
-
margin-top: -5px;
|
|
88
|
-
margin-left: -5px;
|
|
90
|
+
height: 4rem;
|
|
91
|
+
width: 4rem;
|
|
89
92
|
}
|
|
90
93
|
.mobile-donate-link .fill-color {
|
|
91
94
|
fill: rgb(255, 0, 0);
|
|
92
95
|
}
|
|
93
|
-
|
|
96
|
+
|
|
97
|
+
.sr-only {
|
|
94
98
|
position: absolute;
|
|
95
99
|
width: 1px;
|
|
96
100
|
height: 1px;
|
|
97
|
-
padding: 0;
|
|
98
101
|
margin: -1px;
|
|
99
|
-
|
|
100
|
-
clip: rect(0,0,0,0);
|
|
102
|
+
padding: 0;
|
|
101
103
|
border: 0;
|
|
104
|
+
overflow: hidden;
|
|
105
|
+
white-space: nowrap;
|
|
106
|
+
clip: rect(1px, 1px, 1px, 1px);
|
|
107
|
+
-webkit-clip-path: inset(50%);
|
|
108
|
+
clip-path: inset(50%);
|
|
109
|
+
user-select: none;
|
|
102
110
|
}
|
|
103
111
|
|
|
104
|
-
.search-trigger {
|
|
105
|
-
-ms-grid-row: 1;
|
|
106
|
-
-ms-grid-column: 4;
|
|
107
|
-
grid-area: search;
|
|
108
|
-
position: relative;
|
|
112
|
+
.mobile-search-trigger {
|
|
109
113
|
padding: 0;
|
|
110
|
-
z-index: 1;
|
|
111
|
-
width: 100%;
|
|
112
|
-
text-align: right;
|
|
113
|
-
-webkit-box-align: center;
|
|
114
|
-
-ms-flex-align: center;
|
|
115
|
-
align-items: center;
|
|
116
114
|
}
|
|
117
|
-
|
|
118
|
-
|
|
115
|
+
.mobile-search-trigger svg {
|
|
116
|
+
height: 4rem;
|
|
117
|
+
width: 4rem;
|
|
118
|
+
}
|
|
119
|
+
.mobile-search-trigger .fill-color {
|
|
119
120
|
fill: var(--iconFill);
|
|
120
121
|
}
|
|
121
122
|
|
|
@@ -132,14 +133,9 @@ export default css`
|
|
|
132
133
|
display: none;
|
|
133
134
|
}
|
|
134
135
|
|
|
135
|
-
.
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
grid-area: user;
|
|
139
|
-
-ms-grid-row-align: stretch;
|
|
140
|
-
align-self: stretch;
|
|
141
|
-
-ms-grid-column-align: end;
|
|
142
|
-
justify-self: end;
|
|
136
|
+
.upload svg {
|
|
137
|
+
height: 3rem;
|
|
138
|
+
width: 3rem;
|
|
143
139
|
}
|
|
144
140
|
|
|
145
141
|
.screen-name {
|
|
@@ -150,9 +146,9 @@ export default css`
|
|
|
150
146
|
}
|
|
151
147
|
|
|
152
148
|
.user-menu {
|
|
153
|
-
height: 100%;
|
|
154
|
-
padding: 0.5rem 1rem;
|
|
155
149
|
color: var(--lightTextColor);
|
|
150
|
+
padding: 0.5rem;
|
|
151
|
+
height: 100%;
|
|
156
152
|
}
|
|
157
153
|
|
|
158
154
|
.user-menu:hover {
|
|
@@ -166,13 +162,13 @@ export default css`
|
|
|
166
162
|
|
|
167
163
|
.user-menu img {
|
|
168
164
|
display: block;
|
|
169
|
-
width:
|
|
170
|
-
height:
|
|
165
|
+
width: 3rem;
|
|
166
|
+
height: 3rem;
|
|
171
167
|
}
|
|
172
168
|
|
|
173
169
|
.link-home {
|
|
174
|
-
display: flex;
|
|
175
170
|
text-decoration: none;
|
|
171
|
+
display: inline-flex;
|
|
176
172
|
}
|
|
177
173
|
|
|
178
174
|
@media only screen and (min-width: 890px) and (max-device-width: 905px) {
|
|
@@ -195,13 +191,17 @@ export default css`
|
|
|
195
191
|
|
|
196
192
|
@media (min-width: 890px) {
|
|
197
193
|
:host {
|
|
198
|
-
--userIconWidth:
|
|
199
|
-
--userIconHeight:
|
|
194
|
+
--userIconWidth: 3.2rem;
|
|
195
|
+
--userIconHeight: 3.2rem;
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
.right-side-section {
|
|
199
|
+
display: contents;
|
|
200
200
|
}
|
|
201
201
|
|
|
202
202
|
nav {
|
|
203
203
|
display: block;
|
|
204
|
-
z-index:
|
|
204
|
+
z-index: 4;
|
|
205
205
|
height: 5rem;
|
|
206
206
|
padding-right: 1.5rem;
|
|
207
207
|
}
|
|
@@ -220,20 +220,24 @@ export default css`
|
|
|
220
220
|
}
|
|
221
221
|
|
|
222
222
|
.hamburger,
|
|
223
|
-
.search-trigger,
|
|
223
|
+
.mobile-search-trigger,
|
|
224
224
|
.mobile-donate-link {
|
|
225
225
|
display: none;
|
|
226
226
|
}
|
|
227
227
|
|
|
228
228
|
.user-info {
|
|
229
|
+
display: block;
|
|
229
230
|
float: right;
|
|
230
|
-
|
|
231
|
+
vertical-align: middle;
|
|
231
232
|
}
|
|
232
233
|
|
|
233
|
-
.user-menu {
|
|
234
|
-
|
|
234
|
+
.user-info .user-menu img {
|
|
235
|
+
height: 3rem;
|
|
236
|
+
width: 3rem;
|
|
237
|
+
margin-right: 0.5rem;
|
|
235
238
|
}
|
|
236
239
|
|
|
240
|
+
|
|
237
241
|
.user-menu.active {
|
|
238
242
|
background: transparent;
|
|
239
243
|
}
|
|
@@ -241,12 +245,13 @@ export default css`
|
|
|
241
245
|
.user-menu img {
|
|
242
246
|
display: inline-block;
|
|
243
247
|
vertical-align: middle;
|
|
248
|
+
margin-right: 0.5rem;
|
|
244
249
|
}
|
|
245
250
|
|
|
246
251
|
.upload {
|
|
247
252
|
display: block;
|
|
253
|
+
padding: 1rem 0.5rem;
|
|
248
254
|
float: right;
|
|
249
|
-
margin-top: 1rem;
|
|
250
255
|
font-size: 1.4rem;
|
|
251
256
|
text-transform: uppercase;
|
|
252
257
|
text-decoration: none;
|
|
@@ -259,8 +264,6 @@ export default css`
|
|
|
259
264
|
}
|
|
260
265
|
|
|
261
266
|
.upload svg {
|
|
262
|
-
width: 32px;
|
|
263
|
-
height: 32px;
|
|
264
267
|
vertical-align: middle;
|
|
265
268
|
fill: var(--iconFill);
|
|
266
269
|
}
|
|
@@ -276,10 +279,6 @@ export default css`
|
|
|
276
279
|
margin-left: 1rem;
|
|
277
280
|
}
|
|
278
281
|
|
|
279
|
-
login-button {
|
|
280
|
-
display: block;
|
|
281
|
-
margin-right: 1rem;
|
|
282
|
-
}
|
|
283
282
|
}
|
|
284
283
|
|
|
285
284
|
@media (min-width: 990px) {
|
|
@@ -5,7 +5,7 @@ export default css`
|
|
|
5
5
|
.initial,
|
|
6
6
|
.closed,
|
|
7
7
|
.open {
|
|
8
|
-
right:
|
|
8
|
+
right: 33.5rem;
|
|
9
9
|
}
|
|
10
10
|
|
|
11
11
|
.search-hidden.initial,
|
|
@@ -25,7 +25,7 @@ export default css`
|
|
|
25
25
|
.search-hidden.initial,
|
|
26
26
|
.search-hidden.closed,
|
|
27
27
|
.search-hidden.open {
|
|
28
|
-
right:
|
|
28
|
+
right: 26rem;
|
|
29
29
|
}
|
|
30
30
|
}
|
|
31
31
|
`;
|
package/src/styles/user-menu.js
CHANGED
|
@@ -5,7 +5,7 @@ export default css`
|
|
|
5
5
|
.initial,
|
|
6
6
|
.closed,
|
|
7
7
|
.open {
|
|
8
|
-
right:
|
|
8
|
+
right: 22.4rem;
|
|
9
9
|
}
|
|
10
10
|
|
|
11
11
|
.search-hidden.initial,
|
|
@@ -19,7 +19,7 @@ export default css`
|
|
|
19
19
|
.initial,
|
|
20
20
|
.closed,
|
|
21
21
|
.open {
|
|
22
|
-
right: 27.
|
|
22
|
+
right: 27.2rem;
|
|
23
23
|
}
|
|
24
24
|
|
|
25
25
|
.search-hidden.initial,
|
package/test/ia-topnav.test.js
CHANGED
|
@@ -198,7 +198,7 @@ describe('<ia-topnav>', () => {
|
|
|
198
198
|
|
|
199
199
|
it('toggles search menu when search toggle button clicked', async () => {
|
|
200
200
|
const el = await fixture(container());
|
|
201
|
-
el.shadowRoot.querySelector('primary-nav').shadowRoot.querySelector('.search-trigger').click();
|
|
201
|
+
el.shadowRoot.querySelector('primary-nav').shadowRoot.querySelector('.mobile-search-trigger').click();
|
|
202
202
|
await el.updateComplete;
|
|
203
203
|
|
|
204
204
|
expect(el.openMenu).to.equal('search');
|
package/test/primary-nav.test.js
CHANGED
|
@@ -40,7 +40,7 @@ describe('<primary-nav>', () => {
|
|
|
40
40
|
hideSearch: true,
|
|
41
41
|
}));
|
|
42
42
|
|
|
43
|
-
expect(el.shadowRoot.querySelector('.search-trigger')).to.equal(null);
|
|
43
|
+
expect(el.shadowRoot.querySelector('.mobile-search-trigger')).to.equal(null);
|
|
44
44
|
expect(el.shadowRoot.querySelector('nav-search')).to.equal(null);
|
|
45
45
|
});
|
|
46
46
|
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import { html, css } from 'https://offshoot.prod.archive.org/lit.js';
|
|
2
|
-
import Icon from './icon.js';
|
|
3
|
-
import icons from './icons.js';
|
|
4
|
-
|
|
5
|
-
class HamBurger extends Icon {
|
|
6
|
-
static get styles() {
|
|
7
|
-
return css`
|
|
8
|
-
svg {
|
|
9
|
-
display: block;
|
|
10
|
-
}
|
|
11
|
-
.fill-color {
|
|
12
|
-
fill: var(--activeColor);
|
|
13
|
-
}
|
|
14
|
-
`;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
static get closed() {
|
|
18
|
-
return html`
|
|
19
|
-
<svg height="40" viewBox="0 0 40 40" width="40" xmlns="http://www.w3.org/2000/svg" aria-labelledby="hamburgerTitleID hamburgerDescID">
|
|
20
|
-
<title id="hamburgerTitleID">Hamburger icon</title>
|
|
21
|
-
<desc id="hamburgerDescID">An icon used to represent a menu that can be toggled by interacting with this icon.</desc>
|
|
22
|
-
<path d="m30.5 26.5c.8284271 0 1.5.6715729 1.5 1.5s-.6715729 1.5-1.5 1.5h-21c-.82842712 0-1.5-.6715729-1.5-1.5s.67157288-1.5 1.5-1.5zm0-8c.8284271 0 1.5.6715729 1.5 1.5s-.6715729 1.5-1.5 1.5h-21c-.82842712 0-1.5-.6715729-1.5-1.5s.67157288-1.5 1.5-1.5zm0-8c.8284271 0 1.5.6715729 1.5 1.5s-.6715729 1.5-1.5 1.5h-21c-.82842712 0-1.5-.6715729-1.5-1.5s.67157288-1.5 1.5-1.5z" fill="#999" fill-rule="evenodd"/>
|
|
23
|
-
</svg>
|
|
24
|
-
`;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
static get opened() {
|
|
28
|
-
return icons.close;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
render() {
|
|
32
|
-
return this.active ? HamBurger.opened : HamBurger.closed;
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
customElements.define('icon-hamburger', HamBurger);
|
package/src/assets/img/user.js
DELETED
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import { html, css } from 'https://offshoot.prod.archive.org/lit.js';
|
|
2
|
-
import Icon from './icon.js';
|
|
3
|
-
|
|
4
|
-
class User extends Icon {
|
|
5
|
-
static get styles() {
|
|
6
|
-
return css`
|
|
7
|
-
svg {
|
|
8
|
-
vertical-align: middle;
|
|
9
|
-
width: var(--userIconWidth);
|
|
10
|
-
height: var(--userIconHeight);
|
|
11
|
-
}
|
|
12
|
-
path {
|
|
13
|
-
fill: var(--baseColor);
|
|
14
|
-
}
|
|
15
|
-
.active {
|
|
16
|
-
fill: var(--activeColor);
|
|
17
|
-
}
|
|
18
|
-
`;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
render() {
|
|
22
|
-
return html`
|
|
23
|
-
<svg
|
|
24
|
-
width="40"
|
|
25
|
-
height="40"
|
|
26
|
-
viewBox="0 0 40 40"
|
|
27
|
-
xmlns="http://www.w3.org/2000/svg"
|
|
28
|
-
aria-labelledby="userTitleID userDescID"
|
|
29
|
-
>
|
|
30
|
-
<title id="userTitleID">User icon</title>
|
|
31
|
-
<desc id="userDescID">An illustration of a person's head and chest.</desc>
|
|
32
|
-
<path class="${this.active ? 'active' : ''}" d="m20.7130435 18.0434783c-3.5658385 0-6.4565218-2.9198821-6.4565218-6.5217392 0-3.60185703 2.8906833-6.5217391 6.4565218-6.5217391s6.4565217 2.91988207 6.4565217 6.5217391c0 3.6018571-2.8906832 6.5217392-6.4565217 6.5217392zm-12.9130435 16.9565217c0-7.9240855 5.7813665-14.3478261 12.9130435-14.3478261s12.9130435 6.4237406 12.9130435 14.3478261z" fill-rule="evenodd"/>
|
|
33
|
-
</svg>
|
|
34
|
-
`;
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
customElements.define('user-image', User);
|