@progressive-development/pd-page 0.0.60 → 0.0.62
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 +11 -10
- package/src/PdContactUs.js +19 -34
- package/src/PdFooter.js +84 -148
- package/src/PdMenu.js +146 -73
- package/src/PdTeaser.js +21 -13
- package/src/shared-global-styles.js +43 -0
- package/stories/footer.stories.js +26 -5
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"description": "Progressive development page helper, teaser, menu, footer.",
|
|
4
4
|
"license": "SEE LICENSE IN LICENSE",
|
|
5
5
|
"author": "PD Progressive Development",
|
|
6
|
-
"version": "0.0.
|
|
6
|
+
"version": "0.0.62",
|
|
7
7
|
"main": "index.js",
|
|
8
8
|
"module": "index.js",
|
|
9
9
|
"scripts": {
|
|
@@ -17,24 +17,25 @@
|
|
|
17
17
|
"storybook:build": "npm run analyze -- --exclude dist && build-storybook"
|
|
18
18
|
},
|
|
19
19
|
"dependencies": {
|
|
20
|
-
"@progressive-development/pd-contact": "0.0.
|
|
21
|
-
"@progressive-development/pd-dialog": "0.0.
|
|
22
|
-
"@progressive-development/pd-forms": "^0.1.
|
|
23
|
-
"@progressive-development/pd-icon": "^0.
|
|
24
|
-
"lit": "^2.0
|
|
20
|
+
"@progressive-development/pd-contact": "0.0.36",
|
|
21
|
+
"@progressive-development/pd-dialog": "0.0.49",
|
|
22
|
+
"@progressive-development/pd-forms": "^0.1.4",
|
|
23
|
+
"@progressive-development/pd-icon": "^0.1.8",
|
|
24
|
+
"lit": "^2.2.0",
|
|
25
|
+
"pwa-helpers": "^0.9.1"
|
|
25
26
|
},
|
|
26
27
|
"devDependencies": {
|
|
27
28
|
"@custom-elements-manifest/analyzer": "^0.4.17",
|
|
28
29
|
"@open-wc/eslint-config": "^4.3.0",
|
|
29
30
|
"@open-wc/testing": "next",
|
|
30
|
-
"@web/dev-server": "^0.1.
|
|
31
|
+
"@web/dev-server": "^0.1.30",
|
|
31
32
|
"@web/dev-server-storybook": "next",
|
|
32
|
-
"@web/test-runner": "^0.13.
|
|
33
|
+
"@web/test-runner": "^0.13.27",
|
|
33
34
|
"eslint": "^7.32.0",
|
|
34
|
-
"eslint-config-prettier": "^8.
|
|
35
|
+
"eslint-config-prettier": "^8.4.0",
|
|
35
36
|
"husky": "^4.3.8",
|
|
36
37
|
"lint-staged": "^10.5.4",
|
|
37
|
-
"prettier": "^2.
|
|
38
|
+
"prettier": "^2.5.1"
|
|
38
39
|
},
|
|
39
40
|
"customElements": "custom-elements.json",
|
|
40
41
|
"eslintConfig": {
|
package/src/PdContactUs.js
CHANGED
|
@@ -12,6 +12,8 @@ import '@progressive-development/pd-forms/pd-input.js';
|
|
|
12
12
|
import '@progressive-development/pd-forms/pd-input-area.js';
|
|
13
13
|
import '@progressive-development/pd-contact/pd-contact.js';
|
|
14
14
|
|
|
15
|
+
import { SharedGlobalStyles } from './shared-global-styles.js';
|
|
16
|
+
|
|
15
17
|
/**
|
|
16
18
|
* An example element.
|
|
17
19
|
*
|
|
@@ -25,50 +27,29 @@ export class PdContactUs extends LitElement {
|
|
|
25
27
|
*/
|
|
26
28
|
|
|
27
29
|
static get styles() {
|
|
28
|
-
return
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
--my-background-img: var(--pd-bg-image);
|
|
30
|
+
return [
|
|
31
|
+
SharedGlobalStyles,
|
|
32
|
+
css`
|
|
33
|
+
:host {
|
|
33
34
|
|
|
34
35
|
display: flex;
|
|
35
36
|
flex-flow: row;
|
|
36
|
-
background-color: var(--
|
|
37
|
+
background-color: var(--pd-contactus-bg-col, var(--pd-default-col));
|
|
37
38
|
|
|
38
|
-
background-image: var(--
|
|
39
|
+
background-image: var(--pd-contactus-bg-image);
|
|
39
40
|
background-repeat: no-repeat;
|
|
40
41
|
|
|
41
42
|
min-height: 500px; /* Temporär hier... */
|
|
42
43
|
width: 100%;
|
|
43
44
|
}
|
|
44
45
|
|
|
45
|
-
h1,
|
|
46
|
-
h2,
|
|
47
|
-
h3,
|
|
48
|
-
h4 {
|
|
49
|
-
font-family: var(--my-primary-font, 'Oswald');
|
|
50
|
-
font-style: normal;
|
|
51
|
-
color: #fefefe;
|
|
52
|
-
margin: 0;
|
|
53
|
-
padding: 0;
|
|
54
|
-
}
|
|
55
|
-
|
|
56
46
|
h2 {
|
|
57
|
-
|
|
47
|
+
font-family: var(--pd-default-font-title-family);
|
|
48
|
+
font-style: normal;
|
|
49
|
+
color: var(--pd-contactus-font-col, var(--pd-default-bg-col));
|
|
58
50
|
margin-top: 1.4em;
|
|
59
51
|
margin-bottom: 2.5rem;
|
|
60
|
-
font-size: 2.5rem;
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
p {
|
|
64
|
-
margin-bottom: 1rem;
|
|
65
|
-
line-height: 1.5;
|
|
66
|
-
text-rendering: optimizeLegibility;
|
|
67
|
-
margin: 0;
|
|
68
|
-
padding: 0;
|
|
69
|
-
|
|
70
|
-
color: #323031;
|
|
71
|
-
font-size: 1.1rem;
|
|
52
|
+
font-size: var(--pd-contactus-font-h2-size, 2.5rem);
|
|
72
53
|
}
|
|
73
54
|
|
|
74
55
|
.content-block {
|
|
@@ -80,7 +61,7 @@ export class PdContactUs extends LitElement {
|
|
|
80
61
|
max-width: 1170px;
|
|
81
62
|
margin: 0 auto;
|
|
82
63
|
text-align: left;
|
|
83
|
-
padding-left:
|
|
64
|
+
padding-left: 30px;
|
|
84
65
|
}
|
|
85
66
|
|
|
86
67
|
.contact-block {
|
|
@@ -99,7 +80,8 @@ export class PdContactUs extends LitElement {
|
|
|
99
80
|
}
|
|
100
81
|
|
|
101
82
|
.company-contact {
|
|
102
|
-
--
|
|
83
|
+
--app-font-content-col: var(--pd-contactus-font-col, var(--pd-default-bg-col));;
|
|
84
|
+
--app-font-title-col: var(--pd-contactus-font-col, var(--pd-default-bg-col));;
|
|
103
85
|
}
|
|
104
86
|
|
|
105
87
|
/* Size Elements for small width */
|
|
@@ -111,7 +93,7 @@ export class PdContactUs extends LitElement {
|
|
|
111
93
|
justify-content: left;
|
|
112
94
|
}
|
|
113
95
|
}
|
|
114
|
-
|
|
96
|
+
`];
|
|
115
97
|
}
|
|
116
98
|
|
|
117
99
|
static get properties() {
|
|
@@ -147,6 +129,7 @@ export class PdContactUs extends LitElement {
|
|
|
147
129
|
class="quarter3"
|
|
148
130
|
placeHolder="Naam"
|
|
149
131
|
valueName="name"
|
|
132
|
+
autoCompleteName="full-name"
|
|
150
133
|
required
|
|
151
134
|
></pd-input>
|
|
152
135
|
</pd-form-row>
|
|
@@ -157,6 +140,8 @@ export class PdContactUs extends LitElement {
|
|
|
157
140
|
class="quarter3"
|
|
158
141
|
placeHolder="Email"
|
|
159
142
|
valueName="mail"
|
|
143
|
+
autoCompleteName="email"
|
|
144
|
+
name="email"
|
|
160
145
|
field-type="mail"
|
|
161
146
|
required
|
|
162
147
|
></pd-input>
|
package/src/PdFooter.js
CHANGED
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
8
|
import { LitElement, html, css } from 'lit';
|
|
9
|
+
import { SharedGlobalStyles } from './shared-global-styles.js';
|
|
9
10
|
|
|
10
11
|
/**
|
|
11
12
|
* An example element.
|
|
@@ -15,117 +16,93 @@ import { LitElement, html, css } from 'lit';
|
|
|
15
16
|
*/
|
|
16
17
|
export class PdFooter extends LitElement {
|
|
17
18
|
/**
|
|
18
|
-
* Fired when
|
|
19
|
-
* @event
|
|
19
|
+
* Fired when footer link clicked.
|
|
20
|
+
* @event footer-link
|
|
20
21
|
*/
|
|
21
22
|
|
|
23
|
+
static get properties() {
|
|
24
|
+
return {
|
|
25
|
+
version: { type: String },
|
|
26
|
+
copyright: { type: String },
|
|
27
|
+
madeBy: { type: Object },
|
|
28
|
+
footerLinks: { type: Array }
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
|
|
22
32
|
static get styles() {
|
|
23
|
-
return
|
|
33
|
+
return [
|
|
34
|
+
SharedGlobalStyles,
|
|
35
|
+
css`
|
|
24
36
|
:host {
|
|
25
|
-
--my-height: var(--squi-teaser-height, 130px);
|
|
26
|
-
|
|
27
|
-
--my-header-background-color: var(--squi-test, #084c61);
|
|
28
|
-
--my-header-text-color: var(--squi-test, white);
|
|
29
|
-
|
|
30
|
-
--my-footer-background-color: var(--squi-test, #2bcadb);
|
|
31
|
-
|
|
32
37
|
display: flex;
|
|
33
|
-
flex-flow:
|
|
34
|
-
justify-content:
|
|
35
|
-
background-color:
|
|
36
|
-
height: var(--my-height);
|
|
38
|
+
flex-flow: column;
|
|
39
|
+
justify-content: end;
|
|
40
|
+
background-color: var(--pd-footer-bg-col, var(--pd-default-col));
|
|
37
41
|
width: 100%;
|
|
42
|
+
white-space: nowrap;
|
|
38
43
|
}
|
|
39
44
|
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
font-
|
|
46
|
-
|
|
47
|
-
|
|
45
|
+
.footer-links {
|
|
46
|
+
display: flex;
|
|
47
|
+
align-items: center;
|
|
48
|
+
justify-content: right;
|
|
49
|
+
height: 100%;
|
|
50
|
+
color: var(--pd-footer-font-col, var(--pd-default-bg-col));
|
|
51
|
+
font-family: var(--pd-footer-font-family, var(--pd-default-font-title-family));
|
|
52
|
+
font-size: var(--pd-footer-font-size, 1.1em);
|
|
48
53
|
}
|
|
49
54
|
|
|
50
|
-
.
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
+
.footer-links ul {
|
|
56
|
+
display: flex;
|
|
57
|
+
flex-wrap: wrap;
|
|
58
|
+
list-style: none;
|
|
59
|
+
gap: 1em;
|
|
60
|
+
margin: 0px;
|
|
61
|
+
padding: 2em 2.5em 2em 2.5em;
|
|
55
62
|
}
|
|
56
63
|
|
|
57
|
-
.
|
|
58
|
-
|
|
59
|
-
padding-right: 30px;
|
|
64
|
+
.footer-links li {
|
|
65
|
+
cursor: pointer;
|
|
60
66
|
}
|
|
61
67
|
|
|
62
|
-
.
|
|
63
|
-
|
|
64
|
-
justify-content: flex-end;
|
|
65
|
-
list-style: none;
|
|
66
|
-
margin-top: 0px;
|
|
67
|
-
margin-bottom: 0px;
|
|
68
|
-
height: 100%;
|
|
68
|
+
.footer-links li:hover {
|
|
69
|
+
color: var(--pd-default-hover-col);
|
|
69
70
|
}
|
|
70
71
|
|
|
71
|
-
.
|
|
72
|
+
.bottom-line {
|
|
73
|
+
background-color: var(--pd-footer-bottom-col, var(--pd-default-light-col));
|
|
74
|
+
font-size: var(--pd-footer-bottom-font-size, 0.9em);
|
|
75
|
+
color: var(--pd-footer-bottom-font-col, var(--pd-default-dark-col));
|
|
76
|
+
padding: 0.5em;
|
|
72
77
|
display: flex;
|
|
78
|
+
gap: 1em;
|
|
79
|
+
flex-wrap: wrap;
|
|
80
|
+
justify-content: space-between;
|
|
73
81
|
align-items: center;
|
|
74
|
-
padding: 0rem 1rem;
|
|
75
|
-
height: 100%;
|
|
76
82
|
}
|
|
77
83
|
|
|
78
|
-
.
|
|
79
|
-
|
|
80
|
-
.left-content p {
|
|
81
|
-
color: #2bcadb;
|
|
82
|
-
font-size: 1.1rem;
|
|
83
|
-
white-space: nowrap;
|
|
84
|
+
.copyright {
|
|
85
|
+
font-weight: bold;
|
|
84
86
|
}
|
|
85
87
|
|
|
86
88
|
.version {
|
|
87
|
-
|
|
88
|
-
font-style: italic;
|
|
89
|
-
font-size: 0.9rem;
|
|
89
|
+
font-weight: normal;
|
|
90
90
|
}
|
|
91
91
|
|
|
92
92
|
.madeBy {
|
|
93
|
-
color: white;
|
|
94
|
-
font-size: 0.9rem;
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
.madeBy:hover {
|
|
98
|
-
border-bottom: 1px solid #ffc857;
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
.madeBy:hover,
|
|
102
|
-
.item a:hover {
|
|
103
|
-
color: #ffc857;
|
|
104
93
|
cursor: pointer;
|
|
94
|
+
font-style: italic;
|
|
105
95
|
}
|
|
106
96
|
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
.right-content ul {
|
|
110
|
-
height: 40%;
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
.right-content {
|
|
114
|
-
width: 30%;
|
|
115
|
-
}
|
|
97
|
+
.madeBy:hover {
|
|
98
|
+
color: var(--pd-default-col);
|
|
116
99
|
}
|
|
117
|
-
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
static get properties() {
|
|
121
|
-
return {
|
|
122
|
-
version: { type: String },
|
|
123
|
-
};
|
|
124
|
-
}
|
|
100
|
+
`];
|
|
101
|
+
}
|
|
125
102
|
|
|
126
103
|
constructor() {
|
|
127
|
-
super();
|
|
128
|
-
this.
|
|
104
|
+
super();
|
|
105
|
+
this.footerLinks = [];
|
|
129
106
|
this._mailTo = 'info@progressive-development.com';
|
|
130
107
|
}
|
|
131
108
|
|
|
@@ -133,81 +110,40 @@ export class PdFooter extends LitElement {
|
|
|
133
110
|
|
|
134
111
|
render() {
|
|
135
112
|
return html`
|
|
136
|
-
|
|
137
|
-
<
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
>Voorwaarden</a
|
|
155
|
-
>
|
|
156
|
-
</li>
|
|
157
|
-
<li class="item">
|
|
158
|
-
<a
|
|
159
|
-
@keypress="${() => {
|
|
160
|
-
console.log();
|
|
161
|
-
}}"
|
|
162
|
-
@click="${this._policyClicked}"
|
|
163
|
-
>Privacy</a
|
|
164
|
-
>
|
|
165
|
-
</li>
|
|
166
|
-
<li class="item">
|
|
167
|
-
<a
|
|
168
|
-
@keypress="${() => {
|
|
169
|
-
console.log();
|
|
170
|
-
}}"
|
|
171
|
-
@click="${this._cookiePolicyClicked}"
|
|
172
|
-
>Cookies</a
|
|
173
|
-
>
|
|
174
|
-
</li>
|
|
175
|
-
</ul>
|
|
176
|
-
</div>
|
|
177
|
-
`;
|
|
178
|
-
}
|
|
179
|
-
|
|
180
|
-
_mailToProgressiveDevelopment() {
|
|
181
|
-
window.location.href = `mailto:${this._mailTo}`;
|
|
113
|
+
|
|
114
|
+
<div class="footer-links">
|
|
115
|
+
<ul>
|
|
116
|
+
${this.footerLinks.map(link => html`
|
|
117
|
+
<li class="item">
|
|
118
|
+
<a @click="${this._footerLinkClicked}" data-link="${link.key}">${link.name}</a>
|
|
119
|
+
</li>
|
|
120
|
+
`)}
|
|
121
|
+
</ul>
|
|
122
|
+
</div>
|
|
123
|
+
<div class="bottom-line">
|
|
124
|
+
<div>
|
|
125
|
+
${this.copyright ? html`<span class="copyright">© ${this.copyright}, </span>` : ''}
|
|
126
|
+
${this.version ? html`<span class="version">${this.version}</span>` : ''}
|
|
127
|
+
</div>
|
|
128
|
+
${this.madeBy ? html`<span class="madeBy" @click="${this._clickMadeby}">${this.madeBy.txt}</span>` : ''}
|
|
129
|
+
</div>
|
|
130
|
+
`;
|
|
182
131
|
}
|
|
183
132
|
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
}
|
|
191
|
-
})
|
|
192
|
-
);
|
|
193
|
-
}
|
|
194
|
-
|
|
195
|
-
_policyClicked() {
|
|
196
|
-
// this.shadowRoot.getElementById('privacyPopupId').showPopup();
|
|
197
|
-
this.dispatchEvent(
|
|
198
|
-
new CustomEvent('show-policy', {
|
|
199
|
-
detail: {
|
|
200
|
-
policy: 'policy'
|
|
201
|
-
}
|
|
202
|
-
})
|
|
203
|
-
);
|
|
133
|
+
_clickMadeby() {
|
|
134
|
+
if (this.madeBy.email) {
|
|
135
|
+
window.location.href = `mailto:${this.madeBy.email}`;
|
|
136
|
+
} else if (this.madeBy.link) {
|
|
137
|
+
window.open(this.madeBy.link, '_blank');
|
|
138
|
+
}
|
|
204
139
|
}
|
|
205
140
|
|
|
206
|
-
|
|
141
|
+
_footerLinkClicked(e) {
|
|
142
|
+
const linkKey = e.target.dataset.link;
|
|
207
143
|
this.dispatchEvent(
|
|
208
|
-
new CustomEvent('
|
|
144
|
+
new CustomEvent('footer-link', {
|
|
209
145
|
detail: {
|
|
210
|
-
|
|
146
|
+
link: linkKey
|
|
211
147
|
}
|
|
212
148
|
})
|
|
213
149
|
);
|
package/src/PdMenu.js
CHANGED
|
@@ -5,9 +5,13 @@
|
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
7
|
import { LitElement, html, css } from 'lit';
|
|
8
|
+
import { installMediaQueryWatcher } from 'pwa-helpers/media-query.js';
|
|
8
9
|
|
|
10
|
+
import { ICON_TOOGLE_ARROW as burgerIcon } from '@progressive-development/pd-icon/src/PdIcon.js';
|
|
9
11
|
import '@progressive-development/pd-icon/pd-icon.js';
|
|
10
12
|
|
|
13
|
+
import { SharedGlobalStyles } from './shared-global-styles.js';
|
|
14
|
+
|
|
11
15
|
/**
|
|
12
16
|
* An example element.
|
|
13
17
|
*
|
|
@@ -15,90 +19,140 @@ import '@progressive-development/pd-icon/pd-icon.js';
|
|
|
15
19
|
* @csspart button - The button
|
|
16
20
|
*/
|
|
17
21
|
export class PdMenu extends LitElement {
|
|
22
|
+
|
|
18
23
|
/**
|
|
19
24
|
* Fired when route menu item clicked
|
|
20
25
|
* @event route-event
|
|
21
26
|
*/
|
|
22
27
|
|
|
23
28
|
static get styles() {
|
|
24
|
-
return
|
|
25
|
-
|
|
26
|
-
|
|
29
|
+
return [
|
|
30
|
+
SharedGlobalStyles,
|
|
31
|
+
css`
|
|
27
32
|
|
|
28
|
-
|
|
29
|
-
|
|
33
|
+
:host {
|
|
34
|
+
display: block;
|
|
35
|
+
position: relative;
|
|
36
|
+
height: var(--pd-menu-height, 100px);
|
|
37
|
+
background-color: var(--pd-menu-bg-col, var(--pd-default-col));
|
|
38
|
+
box-shadow: var(--pd-menu-shadow, 3px 3px 5px grey);
|
|
39
|
+
}
|
|
30
40
|
|
|
41
|
+
.menu-container {
|
|
42
|
+
height: 100%;
|
|
43
|
+
padding-left: 10px;
|
|
44
|
+
padding-right: 10px;
|
|
31
45
|
display: flex;
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
width:
|
|
35
|
-
|
|
36
|
-
box-shadow: 3px 3px 5px grey;
|
|
46
|
+
align-items: center;
|
|
47
|
+
white-space: nowrap;
|
|
48
|
+
max-width: 1170px;
|
|
49
|
+
margin: 0 auto;
|
|
37
50
|
}
|
|
38
51
|
|
|
39
|
-
ul {
|
|
40
|
-
padding-left: 0px;
|
|
52
|
+
ul {
|
|
41
53
|
display: flex;
|
|
42
|
-
|
|
43
|
-
align-items: flex-start;
|
|
44
|
-
max-width: 1170px;
|
|
45
|
-
margin: 0 auto;
|
|
54
|
+
align-items: center;
|
|
46
55
|
list-style: none;
|
|
47
|
-
|
|
48
|
-
|
|
56
|
+
gap: 1em;
|
|
57
|
+
margin: 0;
|
|
58
|
+
padding: 0;
|
|
49
59
|
}
|
|
50
60
|
|
|
51
61
|
li {
|
|
52
62
|
display: flex;
|
|
53
|
-
align-items: center;
|
|
54
|
-
padding: 0rem 1.1rem;
|
|
63
|
+
align-items: center;
|
|
55
64
|
cursor: pointer;
|
|
56
65
|
height: 100%;
|
|
57
66
|
}
|
|
58
67
|
|
|
59
68
|
.item {
|
|
60
|
-
color:
|
|
61
|
-
font-family:
|
|
62
|
-
font-size: 1.
|
|
63
|
-
|
|
64
|
-
--pd-icon-fill: var(--my-header-text-color);
|
|
65
|
-
}
|
|
66
|
-
.item.active {
|
|
67
|
-
color: #ffc857;
|
|
69
|
+
color: var(--pd-menu-font-col, var(--pd-default-bg-col));
|
|
70
|
+
font-family: var(--pd-menu-font-family, var(--pd-default-font-title-family));
|
|
71
|
+
font-size: var(--pd-footer-font-size, 1.2em);
|
|
68
72
|
}
|
|
73
|
+
|
|
74
|
+
.item.active,
|
|
69
75
|
.item:hover {
|
|
70
|
-
color:
|
|
71
|
-
/*border-bottom: 1px solid #FFC857;*/
|
|
72
|
-
/* Hack? => Set also Icon to hover color, else they react different
|
|
73
|
-
(hover on text => icon not with hover color...)
|
|
74
|
-
This is also the reason why icon-fill is defined for item, not for topMenuItem
|
|
75
|
-
Erkennbar: Farbe Icon leicht unterschiedlich zu Farbe Text nach hover icon.
|
|
76
|
-
*/
|
|
77
|
-
--pd-icon-fill: #ffc857;
|
|
76
|
+
color: var(--pd-default-hover-col);
|
|
78
77
|
}
|
|
79
78
|
|
|
80
|
-
.topItemLogo {
|
|
81
|
-
--pd-icon-
|
|
82
|
-
--icon-transition: none;
|
|
83
|
-
pointer-events: none;
|
|
79
|
+
.item:hover .topItemLogo {
|
|
80
|
+
--pd-icon-stroke-col: var(--pd-default-hover-col);
|
|
84
81
|
}
|
|
85
82
|
|
|
86
83
|
.topMenu {
|
|
87
|
-
|
|
84
|
+
width: 100%;
|
|
85
|
+
justify-content: end;
|
|
86
|
+
padding-left: 10px;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
.burger-menu {
|
|
90
|
+
display: flex;
|
|
91
|
+
width: 100%;
|
|
92
|
+
visibility: hidden;
|
|
93
|
+
justify-content: end;
|
|
88
94
|
}
|
|
89
95
|
|
|
96
|
+
.topItemLogo {
|
|
97
|
+
--pd-icon-size: 1.6rem;
|
|
98
|
+
/* TODO: noch vars übernehmen
|
|
99
|
+
--pd-icon-bg-col: var(--pd-menu-bg-col, var(--pd-default-col));
|
|
100
|
+
--pd-icon-col: var(--pd-menu-bg-col, var(--pd-default-dark-col));
|
|
101
|
+
--pd-icon-stroke-col: var(--pd-menu-font-col, var(--pd-default-bg-col));
|
|
102
|
+
*/
|
|
103
|
+
|
|
104
|
+
--pd-icon-bg-col: transparent;
|
|
105
|
+
--pd-icon-stroke-col: var(--pd-default-bg-col);
|
|
106
|
+
--pd-icon-col: var(--pd-default-dark-col);
|
|
107
|
+
pointer-events: none;
|
|
108
|
+
}
|
|
109
|
+
|
|
90
110
|
::slotted(.logo) {
|
|
91
|
-
max-width: 8rem;
|
|
92
|
-
width:
|
|
111
|
+
max-width: 8rem;
|
|
112
|
+
width: 100%;
|
|
113
|
+
padding-right: 3em;
|
|
93
114
|
}
|
|
94
115
|
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
116
|
+
/**
|
|
117
|
+
* Style for drop down menu on small screens.
|
|
118
|
+
*/
|
|
119
|
+
@media (max-width: 500px) {
|
|
120
|
+
|
|
121
|
+
:host([_activeBurgerMenu]) ul {
|
|
122
|
+
visibility: visible;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
.burger-menu {
|
|
126
|
+
visibility: visible;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
ul {
|
|
130
|
+
visibility: hidden;
|
|
131
|
+
position: absolute;
|
|
132
|
+
flex-direction: column;
|
|
133
|
+
top: var(--pd-menu-height, 100px);
|
|
134
|
+
right: 0px;
|
|
135
|
+
background-color: var(--pd-menu-burger-bg-col, var(--pd-default-light-col));
|
|
136
|
+
border: 1px solid var(--pd-menu-burger-font-col, var(--pd-default-dark-col));
|
|
137
|
+
padding: 0.8em;
|
|
99
138
|
}
|
|
139
|
+
|
|
140
|
+
li {
|
|
141
|
+
align-self: flex-start;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
.item {
|
|
145
|
+
color: var(--pd-menu-burger-font-col, var(--pd-default-dark-col));
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
li:hover {
|
|
149
|
+
background-color: var(--pd-default-dark-col);
|
|
150
|
+
}
|
|
151
|
+
|
|
100
152
|
}
|
|
101
|
-
|
|
153
|
+
|
|
154
|
+
/* Media Query für 500 => Alles darunter mit Burger Menu */
|
|
155
|
+
`];
|
|
102
156
|
}
|
|
103
157
|
|
|
104
158
|
static get properties() {
|
|
@@ -107,6 +161,9 @@ export class PdMenu extends LitElement {
|
|
|
107
161
|
topMenuItems: { type: Array },
|
|
108
162
|
teaserClosed: { type: Boolean }, // TODO: Definiert um scroll position anzugleichen, unabhängiger machen...
|
|
109
163
|
_activeSecIndex: { type: Number },
|
|
164
|
+
_smallScreen: { type: Boolean, state: true },
|
|
165
|
+
_activeBurgerMenu: { type: Boolean, reflect: true },
|
|
166
|
+
|
|
110
167
|
};
|
|
111
168
|
}
|
|
112
169
|
|
|
@@ -117,6 +174,7 @@ export class PdMenu extends LitElement {
|
|
|
117
174
|
this.teaserClosed = false;
|
|
118
175
|
|
|
119
176
|
this._activeSecIndex = 0;
|
|
177
|
+
this._activeBurgerMenu = false;
|
|
120
178
|
}
|
|
121
179
|
|
|
122
180
|
firstUpdated() {
|
|
@@ -150,55 +208,70 @@ export class PdMenu extends LitElement {
|
|
|
150
208
|
}
|
|
151
209
|
|
|
152
210
|
render() {
|
|
211
|
+
|
|
212
|
+
installMediaQueryWatcher(`(max-width: 500px)`, matches => {
|
|
213
|
+
if (matches) {
|
|
214
|
+
this._smallScreen = true;
|
|
215
|
+
} else {
|
|
216
|
+
this._smallScreen = false;
|
|
217
|
+
}
|
|
218
|
+
});
|
|
219
|
+
|
|
153
220
|
return html`
|
|
221
|
+
<div class="menu-container">
|
|
222
|
+
<slot class="logo-icon" name="slotLogo"></slot>
|
|
154
223
|
<ul>
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
</li>
|
|
224
|
+
${this._renderItems(this._smallScreen ? [...this.menuItems, ...this.topMenuItems] : this.menuItems, this._smallScreen)}
|
|
225
|
+
</ul>
|
|
158
226
|
|
|
159
|
-
|
|
227
|
+
${!this._smallScreen ? html`
|
|
228
|
+
<ul class="topMenu">
|
|
229
|
+
${this._renderItems(this.topMenuItems)}
|
|
230
|
+
</ul>
|
|
231
|
+
` : html`
|
|
232
|
+
<div class="burger-menu">
|
|
233
|
+
<pd-icon class="round" icon="${burgerIcon}" ?activeIcon="${!this._activeBurgerMenu}" @click="${this._toggleBurgerMenu}"></pd-icon>
|
|
234
|
+
</div>
|
|
235
|
+
`}
|
|
236
|
+
|
|
237
|
+
</div>
|
|
238
|
+
`;
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
_renderItems(items, disableIcons) {
|
|
242
|
+
return html`
|
|
243
|
+
${items.map(
|
|
160
244
|
(item, index) => html`
|
|
161
245
|
<li
|
|
162
246
|
class="item ${this._activeSecIndex === index + 1
|
|
163
247
|
? 'active'
|
|
164
|
-
: ''}
|
|
248
|
+
: ''}"
|
|
165
249
|
data-sec="${item.sec}"
|
|
166
250
|
data-route="${item.route}"
|
|
167
251
|
@click="${this._menuItemClicked}"
|
|
168
252
|
>
|
|
169
|
-
|
|
170
|
-
</li>
|
|
171
|
-
`
|
|
172
|
-
)}
|
|
173
|
-
</ul>
|
|
174
|
-
|
|
175
|
-
<ul class="topMenu">
|
|
176
|
-
${this.topMenuItems.map(
|
|
177
|
-
topItem => html`
|
|
178
|
-
<li
|
|
179
|
-
class="item"
|
|
180
|
-
data-sec="${topItem.sec}"
|
|
181
|
-
data-route="${topItem.route}"
|
|
182
|
-
@click="${this._menuItemClicked}"
|
|
183
|
-
>
|
|
184
|
-
${topItem.icon
|
|
253
|
+
${item.icon && !disableIcons
|
|
185
254
|
? html`<pd-icon
|
|
186
255
|
class="topItemLogo"
|
|
187
|
-
icon="${
|
|
256
|
+
icon="${item.icon}"
|
|
188
257
|
></pd-icon>`
|
|
189
258
|
: ''}
|
|
190
|
-
${
|
|
191
|
-
</li>
|
|
259
|
+
${item.name}
|
|
260
|
+
</li>
|
|
192
261
|
`
|
|
193
262
|
)}
|
|
194
|
-
</ul>
|
|
195
263
|
`;
|
|
196
264
|
}
|
|
197
265
|
|
|
266
|
+
_toggleBurgerMenu() {
|
|
267
|
+
this._activeBurgerMenu = !this._activeBurgerMenu;
|
|
268
|
+
}
|
|
269
|
+
|
|
198
270
|
_menuItemClicked(e) {
|
|
199
271
|
const secParam = e.target.dataset.sec;
|
|
200
272
|
const routeParam = e.target.dataset.route;
|
|
201
273
|
if (secParam !== 'undefined' && secParam !== '') {
|
|
274
|
+
// TODO: Check if element exists
|
|
202
275
|
this._scrollToContent(secParam);
|
|
203
276
|
} else if (routeParam !== 'undefined' && routeParam !== '') {
|
|
204
277
|
this.dispatchEvent(
|
package/src/PdTeaser.js
CHANGED
|
@@ -7,6 +7,8 @@ import { LitElement, html, css } from 'lit';
|
|
|
7
7
|
|
|
8
8
|
import '@progressive-development/pd-icon/pd-icon.js';
|
|
9
9
|
|
|
10
|
+
import { SharedGlobalStyles } from './shared-global-styles.js';
|
|
11
|
+
|
|
10
12
|
/**
|
|
11
13
|
* An example element.
|
|
12
14
|
*
|
|
@@ -20,17 +22,17 @@ export class PdTeaser extends LitElement {
|
|
|
20
22
|
*/
|
|
21
23
|
|
|
22
24
|
static get styles() {
|
|
23
|
-
return
|
|
25
|
+
return [
|
|
26
|
+
SharedGlobalStyles,
|
|
27
|
+
css`
|
|
24
28
|
:host {
|
|
25
29
|
|
|
26
|
-
--my-height: var(--
|
|
30
|
+
--my-height: var(--pd-teaser-height, 420px);
|
|
27
31
|
|
|
28
|
-
display: block;
|
|
29
|
-
background-color:
|
|
30
|
-
|
|
32
|
+
display: block;
|
|
33
|
+
background-color: var(--pd-teaser-bg-col, var(--pd-default-col));
|
|
31
34
|
}
|
|
32
35
|
|
|
33
|
-
/* Layout Grid for the Wizard Component */
|
|
34
36
|
.teaser {
|
|
35
37
|
display: grid;
|
|
36
38
|
grid-template-columns: minmax(10px, 200px) auto;
|
|
@@ -38,8 +40,7 @@ export class PdTeaser extends LitElement {
|
|
|
38
40
|
grid-template-areas:
|
|
39
41
|
". content"
|
|
40
42
|
}
|
|
41
|
-
|
|
42
|
-
/* Layout Grid for the Wizard Component */
|
|
43
|
+
|
|
43
44
|
.teaser-flex {
|
|
44
45
|
display: flex;
|
|
45
46
|
justify-content: left;
|
|
@@ -58,16 +59,23 @@ export class PdTeaser extends LitElement {
|
|
|
58
59
|
position: absolute;
|
|
59
60
|
top: calc(var(--my-height) / 2);
|
|
60
61
|
left: 10px;
|
|
61
|
-
z-index: 1;
|
|
62
|
-
--pd-icon-fill: white;
|
|
62
|
+
z-index: 1;
|
|
63
63
|
}
|
|
64
64
|
|
|
65
65
|
.next {
|
|
66
66
|
position: absolute;
|
|
67
67
|
top: calc(var(--my-height) / 2);
|
|
68
68
|
right: 10px;
|
|
69
|
-
z-index: 1;
|
|
70
|
-
|
|
69
|
+
z-index: 1;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
pd-icon {
|
|
73
|
+
--pd-icon-bg-col: transparent;
|
|
74
|
+
--pd-icon-stroke-col: var(--pd-default-bg-col);
|
|
75
|
+
--pd-icon-col: var(--pd-default-dark-col);
|
|
76
|
+
--pd-icon-bg-col-hover: transparent;
|
|
77
|
+
--pd-icon-stroke-col-hover: var(--pd-default-hover-col);
|
|
78
|
+
--pd-icon-col-hover: var(--pd-default-dark-col);
|
|
71
79
|
}
|
|
72
80
|
|
|
73
81
|
.content {
|
|
@@ -150,7 +158,7 @@ export class PdTeaser extends LitElement {
|
|
|
150
158
|
}
|
|
151
159
|
}
|
|
152
160
|
|
|
153
|
-
|
|
161
|
+
`];
|
|
154
162
|
}
|
|
155
163
|
|
|
156
164
|
static get properties() {
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright (c) 2021 PD Progressive Development UG. All rights reserved.
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import { css } from 'lit';
|
|
7
|
+
|
|
8
|
+
export const SharedGlobalStyles = css`
|
|
9
|
+
|
|
10
|
+
:host {
|
|
11
|
+
/**
|
|
12
|
+
* Set default fonts for all pd-components.
|
|
13
|
+
* Use content, title and input categories for fonts.
|
|
14
|
+
*/
|
|
15
|
+
--pd-default-font-title-family: var(--app-font-title-family);
|
|
16
|
+
--pd-default-font-content-family: var(--app-font-content-family);
|
|
17
|
+
--pd-default-font-input-family: var(--app-font-input-family);
|
|
18
|
+
|
|
19
|
+
--pd-default-font-title-col: var(--app-font-title-col, #0A3A48);
|
|
20
|
+
--pd-default-font-content-col: var(--app-font-content-col, #353738);
|
|
21
|
+
--pd-default-font-input-col: var(--app-font-input-col, #353738);
|
|
22
|
+
|
|
23
|
+
--pd-default-font-content-size: var(--app-font-content-size, 1em);
|
|
24
|
+
--pd-default-font-input-size: var(--app-font-input-size, 1em);
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* Set default colors for all pd-components
|
|
28
|
+
*/
|
|
29
|
+
--pd-default-col: var(--app-primary-col, #067394);
|
|
30
|
+
--pd-default-light-col: var(--app-primary-light-col, #AFC1D2);
|
|
31
|
+
--pd-default-dark-col: var(--app-primary-dark-col, #0A3A48);
|
|
32
|
+
--pd-default-bg-col: var(--app-primary-bg-col, #fefefe);
|
|
33
|
+
|
|
34
|
+
--pd-default-hover-col: var(--app-hover-col, #ffc857);
|
|
35
|
+
--pd-default-error-col: var(--app-error-col, #cc2029);
|
|
36
|
+
--pd-default-error-light-col: var(--app-error-light-col, #ffe8e8);
|
|
37
|
+
--pd-default-success-col: var(--app-success-col, #42a01c);
|
|
38
|
+
--pd-default-success-light-col: var(--app-success-light-col, #f5ffe8);
|
|
39
|
+
--pd-default-disabled-col: var(--app-disabled-col, #888585);
|
|
40
|
+
--pd-default-disabled-light-col: var(--app-disabled-light-col, lightgrey);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
`;
|
|
@@ -7,14 +7,35 @@ export default {
|
|
|
7
7
|
argTypes: {},
|
|
8
8
|
};
|
|
9
9
|
|
|
10
|
-
function Template() {
|
|
10
|
+
function Template({links, version, copyright, madeBy}) {
|
|
11
11
|
return html`
|
|
12
|
-
<pd-footer version="
|
|
13
|
-
|
|
14
|
-
<span slot="privacy"><p>My Privacy</p></span>
|
|
12
|
+
<pd-footer version="${version}" copyright="${copyright}" .madeBy="${madeBy}"
|
|
13
|
+
.footerLinks="${links}">
|
|
15
14
|
</pd-footer>
|
|
16
15
|
`;
|
|
17
16
|
}
|
|
18
17
|
|
|
19
18
|
export const Footer = Template.bind({});
|
|
20
|
-
Footer.args = {
|
|
19
|
+
Footer.args = {
|
|
20
|
+
links: [
|
|
21
|
+
{name: "Datenschutzerklärung", key: 'legal'},
|
|
22
|
+
{name: "Impressum"},
|
|
23
|
+
{name: "Location-Wiki"}
|
|
24
|
+
],
|
|
25
|
+
version: "1.2.2 Test",
|
|
26
|
+
copyright: "ticomi",
|
|
27
|
+
madeBy: {
|
|
28
|
+
txt: "made by PD Progressive Development",
|
|
29
|
+
email: "info@progressive-development.com"
|
|
30
|
+
}
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
export const FooterSmallContent = Template.bind({});
|
|
34
|
+
FooterSmallContent.args = {
|
|
35
|
+
links: [
|
|
36
|
+
{name: "Datenschutzerklärung", key: 'legal'},
|
|
37
|
+
{name: "Impressum"},
|
|
38
|
+
{name: "Location-Wiki"}
|
|
39
|
+
],
|
|
40
|
+
version: "1.2.2 Test",
|
|
41
|
+
};
|