@internetarchive/ia-topnav 1.2.2-alpha7 → 1.2.2
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/hamburger.js +36 -0
- package/src/assets/img/icon-upload-unpadded.js +14 -0
- package/src/assets/img/icons.js +2 -2
- package/src/assets/img/user.js +38 -0
- package/src/data/menus.js +1 -0
- package/src/dropdown-menu.js +3 -0
- package/src/primary-nav.js +15 -23
- package/src/styles/base.js +1 -1
- package/src/styles/desktop-subnav.js +3 -3
- package/src/styles/dropdown-menu.js +15 -1
- package/src/styles/ia-topnav.js +4 -0
- package/src/styles/login-button.js +6 -5
- package/src/styles/media-button.js +5 -7
- package/src/styles/media-menu.js +2 -2
- package/src/styles/nav-search.js +7 -9
- package/src/styles/primary-nav.js +62 -67
- 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/icon-hamburger.js +0 -17
package/package.json
CHANGED
|
@@ -0,0 +1,36 @@
|
|
|
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);
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { html } from 'https://offshoot.prod.archive.org/lit.js';
|
|
2
|
+
|
|
3
|
+
export default html`
|
|
4
|
+
<svg
|
|
5
|
+
height="14"
|
|
6
|
+
width="14"
|
|
7
|
+
viewBox="8 8 24 24"
|
|
8
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
9
|
+
aria-labelledby="uploadTitleID uploadDescID"
|
|
10
|
+
>
|
|
11
|
+
<title id="uploadTitleID">Upload files</title>
|
|
12
|
+
<path class="fill-color" d="m20 12.8 8 10.4h-4.8v8.8h-6.4v-8.8h-4.8zm12-4.8v3.2h-24v-3.2z" fill-rule="evenodd"/>
|
|
13
|
+
</svg>
|
|
14
|
+
`;
|
package/src/assets/img/icons.js
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import audio from './icon-audio.js';
|
|
2
2
|
import close from './icon-close.js';
|
|
3
|
-
import hamburger from './icon-hamburger.js';
|
|
4
3
|
import donate from './icon-donate.js';
|
|
5
4
|
import ellipses from './icon-ellipses.js';
|
|
6
5
|
import iaLogo from './icon-ia-logo.js';
|
|
@@ -9,6 +8,7 @@ import search from './icon-search.js';
|
|
|
9
8
|
import software from './icon-software.js';
|
|
10
9
|
import texts from './icon-texts.js';
|
|
11
10
|
import upload from './icon-upload.js';
|
|
11
|
+
import uploadUnpadded from './icon-upload-unpadded.js';
|
|
12
12
|
import user from './icon-user.js';
|
|
13
13
|
import video from './icon-video.js';
|
|
14
14
|
import web from './icon-web.js';
|
|
@@ -16,7 +16,6 @@ import web from './icon-web.js';
|
|
|
16
16
|
export default {
|
|
17
17
|
audio,
|
|
18
18
|
close,
|
|
19
|
-
hamburger,
|
|
20
19
|
donate,
|
|
21
20
|
ellipses,
|
|
22
21
|
iaLogo,
|
|
@@ -25,6 +24,7 @@ export default {
|
|
|
25
24
|
software,
|
|
26
25
|
texts,
|
|
27
26
|
upload,
|
|
27
|
+
uploadUnpadded,
|
|
28
28
|
user,
|
|
29
29
|
video,
|
|
30
30
|
web,
|
|
@@ -0,0 +1,38 @@
|
|
|
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);
|
package/src/data/menus.js
CHANGED
package/src/dropdown-menu.js
CHANGED
|
@@ -2,6 +2,7 @@ import { html, nothing } from 'https://offshoot.prod.archive.org/lit.js';
|
|
|
2
2
|
import TrackedElement from './tracked-element.js';
|
|
3
3
|
import dropdownMenuCSS from './styles/dropdown-menu.js';
|
|
4
4
|
import formatUrl from './lib/formatUrl.js';
|
|
5
|
+
import icons from './assets/img/icons.js';
|
|
5
6
|
|
|
6
7
|
class DropdownMenu extends TrackedElement {
|
|
7
8
|
static get styles() {
|
|
@@ -55,9 +56,11 @@ class DropdownMenu extends TrackedElement {
|
|
|
55
56
|
const calloutText = this.config.callouts?.[link.title];
|
|
56
57
|
return html`<a
|
|
57
58
|
href="${formatUrl(link.url, this.baseHost)}"
|
|
59
|
+
class="${link.class}"
|
|
58
60
|
@click=${this.trackClick}
|
|
59
61
|
data-event-click-tracking="${this.config.eventCategory}|Nav${link.analyticsEvent}"
|
|
60
62
|
aria-label=${calloutText ? `New feature: ${link.title}` : nothing}>
|
|
63
|
+
${link.class === 'mobile-upload' ? icons.uploadUnpadded : nothing}
|
|
61
64
|
${link.title}
|
|
62
65
|
${calloutText ? html`<span class="callout" aria-hidden="true">${calloutText}</span>` : nothing}
|
|
63
66
|
</a>`;
|
package/src/primary-nav.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
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';
|
|
4
5
|
import './login-button.js';
|
|
5
6
|
import './nav-search.js';
|
|
6
7
|
import './media-menu.js';
|
|
@@ -123,7 +124,7 @@ class PrimaryNav extends TrackedElement {
|
|
|
123
124
|
|
|
124
125
|
return html`
|
|
125
126
|
<button
|
|
126
|
-
class="
|
|
127
|
+
class="search-trigger"
|
|
127
128
|
@click="${this.toggleSearchMenu}"
|
|
128
129
|
data-event-click-tracking="${this.config.eventCategory}|NavSearchOpen"
|
|
129
130
|
>
|
|
@@ -143,26 +144,15 @@ class PrimaryNav extends TrackedElement {
|
|
|
143
144
|
|
|
144
145
|
get mobileDonateHeart() {
|
|
145
146
|
return html`
|
|
146
|
-
<a class="mobile-donate-link
|
|
147
|
+
<a class="mobile-donate-link" href=${formatUrl('/donate/?origin=iawww-mbhrt', this.baseHost)}>
|
|
148
|
+
<span class="icon">
|
|
147
149
|
${icons.donate}
|
|
148
|
-
|
|
150
|
+
</span>
|
|
151
|
+
<span class="label">"Donate to the archive"</span>
|
|
149
152
|
</a>
|
|
150
153
|
`;
|
|
151
154
|
}
|
|
152
155
|
|
|
153
|
-
get uploadButtonTemplate() {
|
|
154
|
-
return html`<a href="${formatUrl('/create', this.baseHost)}" class="upload right-side-item">
|
|
155
|
-
${icons.upload}
|
|
156
|
-
<span>Upload</span>
|
|
157
|
-
</a>`;
|
|
158
|
-
}
|
|
159
|
-
|
|
160
|
-
get userStateTemplate() {
|
|
161
|
-
return html`<div class="user-info right-side-item">
|
|
162
|
-
${this.username ? this.userIcon : this.loginIcon}
|
|
163
|
-
</div>`;
|
|
164
|
-
}
|
|
165
|
-
|
|
166
156
|
get secondLogoSlot() {
|
|
167
157
|
return this.allowSecondaryIcon
|
|
168
158
|
? html`
|
|
@@ -191,12 +181,14 @@ class PrimaryNav extends TrackedElement {
|
|
|
191
181
|
>
|
|
192
182
|
${this.secondLogoSlot}
|
|
193
183
|
</div>
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
${
|
|
198
|
-
|
|
199
|
-
|
|
184
|
+
${this.mobileDonateHeart}
|
|
185
|
+
${this.searchMenu}
|
|
186
|
+
<a href="${formatUrl('/create', this.baseHost)}" class="upload">
|
|
187
|
+
${icons.upload}
|
|
188
|
+
<span>Upload</span>
|
|
189
|
+
</a>
|
|
190
|
+
<div class="user-info">
|
|
191
|
+
${this.username ? this.userIcon : this.loginIcon}
|
|
200
192
|
</div>
|
|
201
193
|
<media-menu
|
|
202
194
|
.baseHost=${this.baseHost}
|
|
@@ -213,7 +205,7 @@ class PrimaryNav extends TrackedElement {
|
|
|
213
205
|
data-event-click-tracking="${this.config.eventCategory}|NavHamburger"
|
|
214
206
|
title="Open main menu"
|
|
215
207
|
>
|
|
216
|
-
|
|
208
|
+
<icon-hamburger ?active=${this.openMenu === 'media'}></icon-hamburger>
|
|
217
209
|
</button>
|
|
218
210
|
</nav>
|
|
219
211
|
`;
|
package/src/styles/base.js
CHANGED
|
@@ -78,6 +78,16 @@ export default css`
|
|
|
78
78
|
font-weight: bold;
|
|
79
79
|
}
|
|
80
80
|
|
|
81
|
+
a.mobile-upload {
|
|
82
|
+
display: flex;
|
|
83
|
+
justify-content: left;
|
|
84
|
+
align-items: center;
|
|
85
|
+
}
|
|
86
|
+
a.mobile-upload svg {
|
|
87
|
+
fill: var(--white);
|
|
88
|
+
margin-right: 10px;
|
|
89
|
+
}
|
|
90
|
+
|
|
81
91
|
@media (min-width: 890px) {
|
|
82
92
|
nav {
|
|
83
93
|
overflow: visible;
|
|
@@ -98,7 +108,7 @@ export default css`
|
|
|
98
108
|
width: 12px;
|
|
99
109
|
height: 7px;
|
|
100
110
|
box-sizing: border-box;
|
|
101
|
-
color:
|
|
111
|
+
color: var(--white);
|
|
102
112
|
content: '';
|
|
103
113
|
border-bottom: 7px solid currentColor;
|
|
104
114
|
border-left: 6px solid transparent;
|
|
@@ -146,5 +156,9 @@ export default css`
|
|
|
146
156
|
opacity: 1;
|
|
147
157
|
overflow: visible;
|
|
148
158
|
}
|
|
159
|
+
|
|
160
|
+
a.mobile-upload {
|
|
161
|
+
display: none;
|
|
162
|
+
}
|
|
149
163
|
}
|
|
150
164
|
`;
|
package/src/styles/ia-topnav.js
CHANGED
|
@@ -52,6 +52,10 @@ export default css`
|
|
|
52
52
|
--savePageSubmitText: var(--white);
|
|
53
53
|
--savePageInputBorder: var(--grey60);
|
|
54
54
|
--savePageErrorText: var(--errorYellow);
|
|
55
|
+
|
|
56
|
+
color: var(--primaryTextColor);
|
|
57
|
+
font-size: 2rem;
|
|
58
|
+
font-family: var(--themeFontFamily);
|
|
55
59
|
}
|
|
56
60
|
|
|
57
61
|
primary-nav:focus {
|
|
@@ -4,16 +4,13 @@ export default css`
|
|
|
4
4
|
.dropdown-toggle {
|
|
5
5
|
display: block;
|
|
6
6
|
height: 4rem;
|
|
7
|
+
font-size: 1.6rem;
|
|
7
8
|
text-transform: uppercase;
|
|
9
|
+
text-decoration: none;
|
|
8
10
|
color: var(--grey80);
|
|
9
11
|
cursor: pointer;
|
|
10
12
|
}
|
|
11
13
|
|
|
12
|
-
.dropdown-toggle svg {
|
|
13
|
-
height: 4rem;
|
|
14
|
-
width: 4rem;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
14
|
.dropdown-toggle .fill-color {
|
|
18
15
|
fill: var(--iconFill);
|
|
19
16
|
}
|
|
@@ -52,6 +49,10 @@ export default css`
|
|
|
52
49
|
}
|
|
53
50
|
|
|
54
51
|
@media (min-width: 890px) {
|
|
52
|
+
.logged-out-toolbar {
|
|
53
|
+
transform: translateY(-.5rem);
|
|
54
|
+
}
|
|
55
|
+
|
|
55
56
|
.active {
|
|
56
57
|
background: transparent;
|
|
57
58
|
}
|
|
@@ -33,6 +33,8 @@ export default css`
|
|
|
33
33
|
|
|
34
34
|
.menu-item > .icon {
|
|
35
35
|
display: inline-flex;
|
|
36
|
+
width: 42px;
|
|
37
|
+
height: 42px;
|
|
36
38
|
vertical-align: middle;
|
|
37
39
|
-webkit-box-align: center;
|
|
38
40
|
-ms-flex-align: center;
|
|
@@ -42,11 +44,6 @@ export default css`
|
|
|
42
44
|
justify-content: center;
|
|
43
45
|
}
|
|
44
46
|
|
|
45
|
-
.menu-item > .icon > svg {
|
|
46
|
-
height: 4rem;
|
|
47
|
-
width: 4rem;
|
|
48
|
-
}
|
|
49
|
-
|
|
50
47
|
.menu-item.selected .icon {
|
|
51
48
|
background-color: var(--activeButtonBg);
|
|
52
49
|
border-radius: 1rem 0 0 1rem;
|
|
@@ -64,7 +61,7 @@ export default css`
|
|
|
64
61
|
fill: #f00;
|
|
65
62
|
}
|
|
66
63
|
|
|
67
|
-
@media (min-width:
|
|
64
|
+
@media (min-width: 890px) {
|
|
68
65
|
.menu-item {
|
|
69
66
|
width: auto;
|
|
70
67
|
height: 5rem;
|
|
@@ -94,6 +91,7 @@ export default css`
|
|
|
94
91
|
color: inherit;
|
|
95
92
|
}
|
|
96
93
|
|
|
94
|
+
|
|
97
95
|
.web:after {
|
|
98
96
|
display: none;
|
|
99
97
|
content: "web";
|
|
@@ -142,7 +140,7 @@ export default css`
|
|
|
142
140
|
}
|
|
143
141
|
}
|
|
144
142
|
|
|
145
|
-
@media (min-width:
|
|
143
|
+
@media (min-width: 1300px) {
|
|
146
144
|
.label,
|
|
147
145
|
.web:after {
|
|
148
146
|
display: inline;
|
package/src/styles/media-menu.js
CHANGED
package/src/styles/nav-search.js
CHANGED
|
@@ -24,6 +24,8 @@ export default css`
|
|
|
24
24
|
}
|
|
25
25
|
.search svg {
|
|
26
26
|
position: relative;
|
|
27
|
+
top: -5px;
|
|
28
|
+
right: -3px;
|
|
27
29
|
fill: var(--activeSearchColor);
|
|
28
30
|
}
|
|
29
31
|
.search-activated {
|
|
@@ -63,10 +65,6 @@ export default css`
|
|
|
63
65
|
-ms-grid-row-align: center;
|
|
64
66
|
align-self: center;
|
|
65
67
|
}
|
|
66
|
-
.search-activated .search svg {
|
|
67
|
-
height: 3rem;
|
|
68
|
-
width: 3rem;
|
|
69
|
-
}
|
|
70
68
|
.search-activated .search-field {
|
|
71
69
|
width: 100%;
|
|
72
70
|
height: 100%;
|
|
@@ -95,8 +93,8 @@ export default css`
|
|
|
95
93
|
@media (min-width: 890px) {
|
|
96
94
|
.search svg {
|
|
97
95
|
display: inline;
|
|
98
|
-
width:
|
|
99
|
-
height:
|
|
96
|
+
width: 28px;
|
|
97
|
+
height: 28px;
|
|
100
98
|
vertical-align: -14px;
|
|
101
99
|
}
|
|
102
100
|
.search path {
|
|
@@ -107,7 +105,7 @@ export default css`
|
|
|
107
105
|
.search-activated {
|
|
108
106
|
display: block;
|
|
109
107
|
position: static;
|
|
110
|
-
padding: 1.
|
|
108
|
+
padding: 1.2rem 0.2rem;
|
|
111
109
|
background: transparent;
|
|
112
110
|
}
|
|
113
111
|
|
|
@@ -129,8 +127,8 @@ export default css`
|
|
|
129
127
|
}
|
|
130
128
|
|
|
131
129
|
.search-activated .search svg {
|
|
132
|
-
width:
|
|
133
|
-
height:
|
|
130
|
+
width: 28px;
|
|
131
|
+
height: 28px;
|
|
134
132
|
}
|
|
135
133
|
}
|
|
136
134
|
`;
|
|
@@ -11,10 +11,10 @@ export default css`
|
|
|
11
11
|
position: relative;
|
|
12
12
|
display: -ms-grid;
|
|
13
13
|
display: grid;
|
|
14
|
-
height:
|
|
14
|
+
height: 40px;
|
|
15
15
|
grid-template-areas: 'hamburger empty heart search user';
|
|
16
|
-
-ms-grid-columns:
|
|
17
|
-
grid-template-columns:
|
|
16
|
+
-ms-grid-columns: 40px minmax(1rem, 100%) 40px 40px 40px;
|
|
17
|
+
grid-template-columns: 40px auto 40px 40px 40px;
|
|
18
18
|
-ms-grid-rows: 100%;
|
|
19
19
|
grid-template-rows: 100%;
|
|
20
20
|
background: var(--primaryNavBg);
|
|
@@ -23,22 +23,10 @@ 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: 40px minmax(1rem, 100%) 40px 40px;
|
|
27
|
+
grid-template-columns: 40px auto 40px 40px;
|
|
28
28
|
}
|
|
29
29
|
|
|
30
|
-
.right-side-section {
|
|
31
|
-
display: flex;
|
|
32
|
-
user-select: none;
|
|
33
|
-
align-items: center;
|
|
34
|
-
}
|
|
35
|
-
.right-side-item {
|
|
36
|
-
padding: 0;
|
|
37
|
-
}
|
|
38
|
-
.right-side-item svg1 {
|
|
39
|
-
height: 4rem;
|
|
40
|
-
width: 4rem;
|
|
41
|
-
}
|
|
42
30
|
button {
|
|
43
31
|
background: none;
|
|
44
32
|
color: inherit;
|
|
@@ -68,14 +56,6 @@ export default css`
|
|
|
68
56
|
grid-column-end: user-end;
|
|
69
57
|
}
|
|
70
58
|
|
|
71
|
-
.ia-logo {
|
|
72
|
-
height: 3rem;
|
|
73
|
-
width: 3rem;
|
|
74
|
-
}
|
|
75
|
-
.ia-wordmark {
|
|
76
|
-
height: 3rem;
|
|
77
|
-
width: 9.5rem;
|
|
78
|
-
}
|
|
79
59
|
.ia-logo,
|
|
80
60
|
.ia-wordmark {
|
|
81
61
|
margin-right: 5px;
|
|
@@ -87,36 +67,55 @@ export default css`
|
|
|
87
67
|
grid-area: hamburger;
|
|
88
68
|
padding: 0;
|
|
89
69
|
}
|
|
90
|
-
.hamburger svg {
|
|
91
|
-
height: 4rem;
|
|
92
|
-
width: 4rem;
|
|
93
|
-
fill: var(--activeColor);
|
|
94
|
-
}
|
|
95
70
|
|
|
71
|
+
.mobile-donate-link {
|
|
72
|
+
-ms-grid-row: 1;
|
|
73
|
+
-ms-grid-column: 3;
|
|
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
|
+
}
|
|
96
84
|
.mobile-donate-link svg {
|
|
97
|
-
height:
|
|
98
|
-
width:
|
|
85
|
+
height: 50px;
|
|
86
|
+
width: 50px;
|
|
87
|
+
margin-top: -5px;
|
|
88
|
+
margin-left: -5px;
|
|
99
89
|
}
|
|
100
90
|
.mobile-donate-link .fill-color {
|
|
101
91
|
fill: rgb(255, 0, 0);
|
|
102
92
|
}
|
|
103
|
-
|
|
104
|
-
.sr-only {
|
|
93
|
+
.mobile-donate-link .label {
|
|
105
94
|
position: absolute;
|
|
106
95
|
width: 1px;
|
|
107
96
|
height: 1px;
|
|
108
|
-
margin: -1px;
|
|
109
97
|
padding: 0;
|
|
110
|
-
|
|
98
|
+
margin: -1px;
|
|
111
99
|
overflow: hidden;
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
100
|
+
clip: rect(0,0,0,0);
|
|
101
|
+
border: 0;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
.search-trigger {
|
|
105
|
+
-ms-grid-row: 1;
|
|
106
|
+
-ms-grid-column: 4;
|
|
107
|
+
grid-area: search;
|
|
108
|
+
position: relative;
|
|
109
|
+
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;
|
|
117
116
|
}
|
|
118
117
|
|
|
119
|
-
.
|
|
118
|
+
.search-trigger .fill-color {
|
|
120
119
|
fill: var(--iconFill);
|
|
121
120
|
}
|
|
122
121
|
|
|
@@ -133,9 +132,14 @@ export default css`
|
|
|
133
132
|
display: none;
|
|
134
133
|
}
|
|
135
134
|
|
|
136
|
-
.
|
|
137
|
-
|
|
138
|
-
|
|
135
|
+
.user-info {
|
|
136
|
+
-ms-grid-row: 1;
|
|
137
|
+
-ms-grid-column: 5;
|
|
138
|
+
grid-area: user;
|
|
139
|
+
-ms-grid-row-align: stretch;
|
|
140
|
+
align-self: stretch;
|
|
141
|
+
-ms-grid-column-align: end;
|
|
142
|
+
justify-self: end;
|
|
139
143
|
}
|
|
140
144
|
|
|
141
145
|
.screen-name {
|
|
@@ -146,8 +150,9 @@ export default css`
|
|
|
146
150
|
}
|
|
147
151
|
|
|
148
152
|
.user-menu {
|
|
153
|
+
height: 100%;
|
|
154
|
+
padding: 0.5rem 1rem;
|
|
149
155
|
color: var(--lightTextColor);
|
|
150
|
-
padding: 0.5rem;
|
|
151
156
|
}
|
|
152
157
|
|
|
153
158
|
.user-menu:hover {
|
|
@@ -161,8 +166,8 @@ export default css`
|
|
|
161
166
|
|
|
162
167
|
.user-menu img {
|
|
163
168
|
display: block;
|
|
164
|
-
width:
|
|
165
|
-
height:
|
|
169
|
+
width: 30px;
|
|
170
|
+
height: 30px;
|
|
166
171
|
}
|
|
167
172
|
|
|
168
173
|
.link-home {
|
|
@@ -190,21 +195,15 @@ export default css`
|
|
|
190
195
|
|
|
191
196
|
@media (min-width: 890px) {
|
|
192
197
|
:host {
|
|
193
|
-
--userIconWidth:
|
|
194
|
-
--userIconHeight:
|
|
198
|
+
--userIconWidth: 32px;
|
|
199
|
+
--userIconHeight: 32px;
|
|
195
200
|
}
|
|
196
201
|
|
|
197
|
-
.right-side-section {
|
|
198
|
-
display: contents;
|
|
199
|
-
}
|
|
200
|
-
.right-side-item {
|
|
201
|
-
padding: 0.5rem 0rem;
|
|
202
|
-
}
|
|
203
202
|
nav {
|
|
204
203
|
display: block;
|
|
205
204
|
z-index: 3;
|
|
206
205
|
height: 5rem;
|
|
207
|
-
padding-right:
|
|
206
|
+
padding-right: 1.5rem;
|
|
208
207
|
}
|
|
209
208
|
|
|
210
209
|
slot[name='opt-sec-logo-mobile'] {
|
|
@@ -221,23 +220,18 @@ export default css`
|
|
|
221
220
|
}
|
|
222
221
|
|
|
223
222
|
.hamburger,
|
|
224
|
-
.
|
|
223
|
+
.search-trigger,
|
|
225
224
|
.mobile-donate-link {
|
|
226
225
|
display: none;
|
|
227
226
|
}
|
|
228
227
|
|
|
229
228
|
.user-info {
|
|
230
229
|
float: right;
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
.user-info .user-menu img {
|
|
234
|
-
height: 3rem;
|
|
235
|
-
width: 3rem;
|
|
236
|
-
margin-right: 0;
|
|
230
|
+
padding-top: 1rem;
|
|
237
231
|
}
|
|
238
232
|
|
|
239
233
|
.user-menu {
|
|
240
|
-
padding: 0
|
|
234
|
+
padding-top: 0;
|
|
241
235
|
}
|
|
242
236
|
|
|
243
237
|
.user-menu.active {
|
|
@@ -247,13 +241,12 @@ export default css`
|
|
|
247
241
|
.user-menu img {
|
|
248
242
|
display: inline-block;
|
|
249
243
|
vertical-align: middle;
|
|
250
|
-
margin-right: 0.5rem;
|
|
251
244
|
}
|
|
252
245
|
|
|
253
246
|
.upload {
|
|
254
247
|
display: block;
|
|
255
|
-
padding: 1rem 0.5rem;
|
|
256
248
|
float: right;
|
|
249
|
+
margin-top: 1rem;
|
|
257
250
|
font-size: 1.4rem;
|
|
258
251
|
text-transform: uppercase;
|
|
259
252
|
text-decoration: none;
|
|
@@ -266,6 +259,8 @@ export default css`
|
|
|
266
259
|
}
|
|
267
260
|
|
|
268
261
|
.upload svg {
|
|
262
|
+
width: 32px;
|
|
263
|
+
height: 32px;
|
|
269
264
|
vertical-align: middle;
|
|
270
265
|
fill: var(--iconFill);
|
|
271
266
|
}
|
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: 21.
|
|
8
|
+
right: 21.3rem;
|
|
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:
|
|
22
|
+
right: 27.5rem;
|
|
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('.
|
|
201
|
+
el.shadowRoot.querySelector('primary-nav').shadowRoot.querySelector('.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('.
|
|
43
|
+
expect(el.shadowRoot.querySelector('.search-trigger')).to.equal(null);
|
|
44
44
|
expect(el.shadowRoot.querySelector('nav-search')).to.equal(null);
|
|
45
45
|
});
|
|
46
46
|
|
|
@@ -1,17 +0,0 @@
|
|
|
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 hamburgerDescID"
|
|
8
|
-
>
|
|
9
|
-
<title id="hamburgerTitleID">Hamburger icon</title>
|
|
10
|
-
<desc id="hamburgerDescID">
|
|
11
|
-
An icon used to represent a menu that can be toggled by interacting with this icon.
|
|
12
|
-
</desc>
|
|
13
|
-
<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"/>
|
|
14
|
-
</svg>
|
|
15
|
-
`;
|
|
16
|
-
|
|
17
|
-
|