Skip to content

Commit 9d6fcf6

Browse files
committed
add form
1 parent 426767f commit 9d6fcf6

File tree

5 files changed

+96
-15
lines changed

5 files changed

+96
-15
lines changed

blocks/form/form.css

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
.form-container .form-wrapper {
2+
max-width: unset;
3+
padding: 0;
4+
width: 100vw;
5+
height: calc(100vh - 3px);
6+
}
7+
8+
.form {
9+
position: relative;
10+
padding: 40px 24px;
11+
min-height: 300px;
12+
13+
}
14+
15+
.form > .form-overlay {
16+
display: flex;
17+
width: 943px;
18+
padding: 40px 56px;
19+
flex-direction: column;
20+
align-items: center;
21+
gap: 24px;
22+
23+
border-radius: 10px;
24+
border: 1px solid #DEDEDE;
25+
26+
background: #FFF;
27+
28+
/* Drop shadow/elevated */
29+
box-shadow: 0 0 2px 0 var(--Alias-drop-shadow-elevated-key, rgba(0, 0, 0, 0.12)), 0 2px 6px 0 var(--Alias-drop-shadow-transition, rgba(0, 0, 0, 0.04)), 0 4px 12px 0 var(--Alias-drop-shadow-ambient, rgba(0, 0, 0, 0.08));
30+
}
31+
32+
.form picture {
33+
position: absolute;
34+
z-index: -1;
35+
inset: 0;
36+
object-fit: cover;
37+
box-sizing: border-box;
38+
}
39+
40+
.form picture img {
41+
flex-shrink: 0;
42+
width: 100%;
43+
/* aspect-ratio: 190/127; */
44+
}

blocks/form/form.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
export default async function decorate(block) {
2+
const overlay = document.createElement('div');
3+
overlay.className = 'form-overlay';
4+
[...block.children].forEach((row, index) => {
5+
if(row.querySelector('picture')) {
6+
row.className = 'form-background';
7+
}
8+
else {
9+
overlay.append(row)
10+
}
11+
});
12+
block.append(overlay);
13+
}

blocks/header/header.css

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
/* header and nav layout */
2+
23
header .nav-wrapper {
34
background-color: var(--background-color);
45
width: 100%;

scripts/aem.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -600,6 +600,7 @@ function decorateBlocks(main) {
600600
* @returns {Promise}
601601
*/
602602
async function loadHeader(header) {
603+
return;
603604
const headerBlock = buildBlock('header', '');
604605
header.append(headerBlock);
605606
decorateBlock(headerBlock);

styles/styles.css

Lines changed: 37 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
--background-color: white;
1616
--light-color: #f8f8f8;
1717
--dark-color: #505050;
18-
--text-color: #131313;
18+
--text-color: #2c2c2c;
1919
--link-color: #3b63fb;
2020
--link-hover-color: #1d3ecf;
2121

@@ -53,7 +53,7 @@
5353
src: local('Arial');
5454
}
5555

56-
@media (width >= 900px) {
56+
@media (width >=900px) {
5757
:root {
5858
/* body sizes */
5959
--body-font-size-m: 18px;
@@ -78,6 +78,7 @@ body {
7878
font-family: var(--body-font-family);
7979
font-size: var(--body-font-size-m);
8080
line-height: 1.6;
81+
overflow: hidden;
8182
}
8283

8384
body.appear {
@@ -98,6 +99,10 @@ footer .footer[data-block-status="loaded"] {
9899
visibility: visible;
99100
}
100101

102+
header {
103+
display: none;
104+
}
105+
101106
h1,
102107
h2,
103108
h3,
@@ -112,12 +117,29 @@ h6 {
112117
scroll-margin: 40px;
113118
}
114119

115-
h1 { font-size: var(--heading-font-size-xxl); }
116-
h2 { font-size: var(--heading-font-size-xl); }
117-
h3 { font-size: var(--heading-font-size-l); }
118-
h4 { font-size: var(--heading-font-size-m); }
119-
h5 { font-size: var(--heading-font-size-s); }
120-
h6 { font-size: var(--heading-font-size-xs); }
120+
h1 {
121+
font-size: var(--heading-font-size-xxl);
122+
}
123+
124+
h2 {
125+
font-size: var(--heading-font-size-xl);
126+
}
127+
128+
h3 {
129+
font-size: var(--heading-font-size-l);
130+
}
131+
132+
h4 {
133+
font-size: var(--heading-font-size-m);
134+
}
135+
136+
h5 {
137+
font-size: var(--heading-font-size-s);
138+
}
139+
140+
h6 {
141+
font-size: var(--heading-font-size-xs);
142+
}
121143

122144
p,
123145
dl,
@@ -142,7 +164,7 @@ pre {
142164
white-space: pre;
143165
}
144166

145-
main > div {
167+
main>div {
146168
margin: 40px 16px;
147169
}
148170

@@ -228,22 +250,22 @@ main img {
228250
}
229251

230252
/* sections */
231-
main > .section {
253+
main>.section {
232254
margin: 40px 0;
233255
}
234256

235-
main > .section > div {
257+
main>.section>div {
236258
max-width: 1200px;
237259
margin: auto;
238260
padding: 0 24px;
239261
}
240262

241-
main > .section:first-of-type {
263+
main>.section:first-of-type {
242264
margin-top: 0;
243265
}
244266

245-
@media (width >= 900px) {
246-
main > .section > div {
267+
@media (width >=900px) {
268+
main>.section>div {
247269
padding: 0 32px;
248270
}
249271
}
@@ -254,4 +276,4 @@ main .section.highlight {
254276
background-color: var(--light-color);
255277
margin: 0;
256278
padding: 40px 0;
257-
}
279+
}

0 commit comments

Comments
 (0)