Skip to content

Commit 06265da

Browse files
committed
try footer update
1 parent 4fe98ae commit 06265da

2 files changed

Lines changed: 179 additions & 2 deletions

File tree

blocks/footer/footer.css

Lines changed: 149 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
footer {
2-
background-color: var(--light-color);
3-
font-size: var(--body-font-size-xs);
2+
background-color: #1a1a1a;
3+
color: #fff;
4+
font-size: var(--body-font-size-s);
45
}
56

67
footer .footer > div {
@@ -13,8 +14,154 @@ footer .footer p {
1314
margin: 0;
1415
}
1516

17+
/* Footer wrapper layout */
18+
footer .footer-wrapper {
19+
display: flex;
20+
flex-direction: column;
21+
gap: 24px;
22+
}
23+
24+
/* Logo section */
25+
footer .footer-logo {
26+
display: flex;
27+
align-items: center;
28+
gap: 16px;
29+
}
30+
31+
footer .footer-logo img {
32+
height: 48px;
33+
width: auto;
34+
}
35+
36+
footer .footer-logo .tagline {
37+
font-style: italic;
38+
font-size: 1.25rem;
39+
color: #fff;
40+
border-left: 1px solid #666;
41+
padding-left: 16px;
42+
}
43+
44+
/* Social media icons */
45+
footer .footer-social {
46+
display: flex;
47+
gap: 16px;
48+
align-items: center;
49+
}
50+
51+
footer .footer-social a {
52+
color: #fff;
53+
text-decoration: none;
54+
transition: color 0.2s ease;
55+
}
56+
57+
footer .footer-social a:hover {
58+
color: #ff6b6b;
59+
}
60+
61+
footer .footer-social svg,
62+
footer .footer-social img {
63+
width: 24px;
64+
height: 24px;
65+
}
66+
67+
/* Footer navigation links */
68+
footer .footer-nav {
69+
display: flex;
70+
flex-wrap: wrap;
71+
gap: 24px;
72+
align-items: center;
73+
}
74+
75+
footer .footer-nav a {
76+
color: #fff;
77+
text-decoration: none;
78+
font-size: var(--body-font-size-s);
79+
transition: color 0.2s ease;
80+
}
81+
82+
footer .footer-nav a:hover {
83+
color: #ff6b6b;
84+
}
85+
86+
/* Footer bottom section */
87+
footer .footer-bottom {
88+
display: flex;
89+
flex-direction: column;
90+
gap: 16px;
91+
padding-top: 24px;
92+
border-top: 1px solid #333;
93+
}
94+
95+
footer .footer-bottom-row {
96+
display: flex;
97+
flex-wrap: wrap;
98+
justify-content: space-between;
99+
align-items: center;
100+
gap: 16px;
101+
}
102+
103+
/* Copyright text */
104+
footer .footer-copyright {
105+
color: #999;
106+
font-size: var(--body-font-size-xs);
107+
}
108+
109+
/* Default block styling from fragment */
110+
footer .footer .default-content-wrapper {
111+
display: flex;
112+
flex-direction: column;
113+
gap: 24px;
114+
}
115+
116+
footer .footer .default-content-wrapper p {
117+
display: flex;
118+
flex-wrap: wrap;
119+
gap: 16px;
120+
align-items: center;
121+
}
122+
123+
footer .footer .default-content-wrapper a {
124+
color: #fff;
125+
text-decoration: none;
126+
transition: color 0.2s ease;
127+
}
128+
129+
footer .footer .default-content-wrapper a:hover {
130+
color: #ff6b6b;
131+
}
132+
133+
footer .footer .default-content-wrapper img {
134+
height: 48px;
135+
width: auto;
136+
}
137+
138+
/* Icon styling */
139+
footer .footer .icon {
140+
display: inline-block;
141+
width: 24px;
142+
height: 24px;
143+
}
144+
145+
footer .footer .icon img {
146+
width: 24px;
147+
height: 24px;
148+
}
149+
16150
@media (width >= 900px) {
17151
footer .footer > div {
18152
padding: 40px 32px 24px;
19153
}
154+
155+
footer .footer-wrapper {
156+
flex-direction: row;
157+
flex-wrap: wrap;
158+
justify-content: space-between;
159+
align-items: flex-start;
160+
}
161+
162+
footer .footer-bottom {
163+
flex-direction: row;
164+
justify-content: space-between;
165+
align-items: center;
166+
}
20167
}

blocks/footer/footer.js

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,35 @@ export default async function decorate(block) {
1616
const footer = document.createElement('div');
1717
while (fragment.firstElementChild) footer.append(fragment.firstElementChild);
1818

19+
// Structure the footer content
20+
const wrapper = footer.querySelector('.default-content-wrapper');
21+
if (wrapper) {
22+
// Find and style logo
23+
const logoImg = wrapper.querySelector('picture img, img');
24+
if (logoImg) {
25+
logoImg.closest('p')?.classList.add('footer-logo-row');
26+
}
27+
28+
// Find and style social links (links with icons)
29+
const socialLinks = wrapper.querySelectorAll('a .icon, a > span.icon');
30+
if (socialLinks.length > 0) {
31+
socialLinks.forEach((icon) => {
32+
const link = icon.closest('a');
33+
if (link) {
34+
link.classList.add('footer-social-link');
35+
}
36+
});
37+
}
38+
39+
// Find copyright text (usually the last paragraph)
40+
const paragraphs = wrapper.querySelectorAll('p');
41+
if (paragraphs.length > 0) {
42+
const lastP = paragraphs[paragraphs.length - 1];
43+
if (lastP.textContent.toLowerCase().includes('copyright') || lastP.textContent.includes('©')) {
44+
lastP.classList.add('footer-copyright');
45+
}
46+
}
47+
}
48+
1949
block.append(footer);
2050
}

0 commit comments

Comments
 (0)