@internetarchive/ia-topnav 1.1.30 → 1.1.31-heart2
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/primary-nav.js +13 -1
- package/src/styles/primary-nav.js +40 -6
package/package.json
CHANGED
package/src/primary-nav.js
CHANGED
|
@@ -142,6 +142,17 @@ class PrimaryNav extends TrackedElement {
|
|
|
142
142
|
`;
|
|
143
143
|
}
|
|
144
144
|
|
|
145
|
+
get mobileDonateHeart() {
|
|
146
|
+
return html`
|
|
147
|
+
<a class="mobile-donate-link" href=${formatUrl('/donate/?origin=iawww-mbhrt', this.baseHost)}>
|
|
148
|
+
<span class="icon ${this.iconClass}">
|
|
149
|
+
${icons.donate}
|
|
150
|
+
</span>
|
|
151
|
+
<span class="label">"Donate to the archive"</span>
|
|
152
|
+
</a>
|
|
153
|
+
`;
|
|
154
|
+
}
|
|
155
|
+
|
|
145
156
|
get secondLogoSlot() {
|
|
146
157
|
return this.allowSecondaryIcon
|
|
147
158
|
? html`
|
|
@@ -158,7 +169,7 @@ class PrimaryNav extends TrackedElement {
|
|
|
158
169
|
render() {
|
|
159
170
|
const mediaMenuTabIndex = this.openMenu === 'media' ? '' : '-1';
|
|
160
171
|
return html`
|
|
161
|
-
<nav>
|
|
172
|
+
<nav class=${this.hideSearch ? 'hide-search' : nothing}>
|
|
162
173
|
<div class=${`branding ${this.secondLogoClass}`}>
|
|
163
174
|
<a
|
|
164
175
|
href=${formatUrl('/', this.baseHost)}
|
|
@@ -170,6 +181,7 @@ class PrimaryNav extends TrackedElement {
|
|
|
170
181
|
>
|
|
171
182
|
${this.secondLogoSlot}
|
|
172
183
|
</div>
|
|
184
|
+
${this.mobileDonateHeart}
|
|
173
185
|
${this.searchMenu}
|
|
174
186
|
<a href="${formatUrl('/create', this.baseHost)}" class="upload">
|
|
175
187
|
${icons.upload}
|
|
@@ -12,15 +12,21 @@ export default css`
|
|
|
12
12
|
display: -ms-grid;
|
|
13
13
|
display: grid;
|
|
14
14
|
height: 4rem;
|
|
15
|
-
grid-template-areas: 'hamburger empty search user';
|
|
16
|
-
-ms-grid-columns: 4rem minmax(1rem, 100%) 4.3rem 4rem;
|
|
17
|
-
grid-template-columns: 4rem auto 4.3rem 4rem;
|
|
15
|
+
grid-template-areas: 'hamburger empty heart search user';
|
|
16
|
+
-ms-grid-columns: 4rem minmax(1rem, 100%) 4rem 4.3rem 4rem;
|
|
17
|
+
grid-template-columns: 4rem auto 4rem 4.3rem 4rem;
|
|
18
18
|
-ms-grid-rows: 100%;
|
|
19
19
|
grid-template-rows: 100%;
|
|
20
20
|
background: var(--primaryNavBg);
|
|
21
21
|
border-bottom: 1px solid var(--primaryNavBottomBorder);
|
|
22
22
|
}
|
|
23
23
|
|
|
24
|
+
nav.hide-search {
|
|
25
|
+
grid-template-areas: 'hamburger empty heart user';
|
|
26
|
+
-ms-grid-columns: 4rem minmax(1rem, 100%) 4rem 4rem;
|
|
27
|
+
grid-template-columns: 4rem auto 4rem 4rem;
|
|
28
|
+
}
|
|
29
|
+
|
|
24
30
|
button {
|
|
25
31
|
background: none;
|
|
26
32
|
color: inherit;
|
|
@@ -62,9 +68,36 @@ export default css`
|
|
|
62
68
|
padding: 0;
|
|
63
69
|
}
|
|
64
70
|
|
|
65
|
-
.
|
|
71
|
+
.mobile-donate-link {
|
|
66
72
|
-ms-grid-row: 1;
|
|
67
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
|
+
}
|
|
84
|
+
.mobile-donate-link .fill-color {
|
|
85
|
+
fill: rgb(255, 0, 0);
|
|
86
|
+
}
|
|
87
|
+
.mobile-donate-link .label {
|
|
88
|
+
position: absolute;
|
|
89
|
+
width: 1px;
|
|
90
|
+
height: 1px;
|
|
91
|
+
padding: 0;
|
|
92
|
+
margin: -1px;
|
|
93
|
+
overflow: hidden;
|
|
94
|
+
clip: rect(0,0,0,0);
|
|
95
|
+
border: 0;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
.search-trigger {
|
|
99
|
+
-ms-grid-row: 1;
|
|
100
|
+
-ms-grid-column: 4;
|
|
68
101
|
grid-area: search;
|
|
69
102
|
position: relative;
|
|
70
103
|
padding: 0;
|
|
@@ -95,7 +128,7 @@ export default css`
|
|
|
95
128
|
|
|
96
129
|
.user-info {
|
|
97
130
|
-ms-grid-row: 1;
|
|
98
|
-
-ms-grid-column:
|
|
131
|
+
-ms-grid-column: 5;
|
|
99
132
|
grid-area: user;
|
|
100
133
|
-ms-grid-row-align: stretch;
|
|
101
134
|
align-self: stretch;
|
|
@@ -181,7 +214,8 @@ export default css`
|
|
|
181
214
|
}
|
|
182
215
|
|
|
183
216
|
.hamburger,
|
|
184
|
-
.search-trigger
|
|
217
|
+
.search-trigger,
|
|
218
|
+
.mobile-donate-link {
|
|
185
219
|
display: none;
|
|
186
220
|
}
|
|
187
221
|
|