Skip to content

Commit 5cea90d

Browse files
committed
[AV-77311] Updating landing-page.css to add new CSS for new landing page style.
Added new collapse.js to try and add collapsible sections to landing page. Created a new body-landing-page-capella.hbs to allow for any layout changes Updated footer-scripts.hbs to try and inject new collapse.js but it's not working atm.
1 parent 25c4ff3 commit 5cea90d

File tree

4 files changed

+125
-1
lines changed

4 files changed

+125
-1
lines changed

src/css/landing-page.css

Lines changed: 80 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@
173173
}
174174

175175
.doc.landing-page-doc img {
176-
max-width: 100%;
176+
overflow: visible;
177177
}
178178

179179
.doc.landing-page-doc ul {
@@ -256,6 +256,85 @@
256256
box-shadow: 0 0 15px -5px #ccc;
257257
}
258258

259+
/* CSS for card-style landing page */
260+
261+
.centered > h2 {
262+
text-align: center;
263+
}
264+
265+
.card-container {
266+
display: flex;
267+
flex-wrap: wrap;
268+
width: 80%;
269+
margin: 20px auto;
270+
}
271+
272+
.card-box {
273+
width: 30%;
274+
margin: 1.66%;
275+
padding: 2rem;
276+
background-color: white;
277+
border-bottom: 20px solid var(--color-brand-orange);
278+
box-shadow: 0 0 29.48px 0 rgba(0, 0, 0, 0.1);
279+
border-radius: 8.8px;
280+
}
281+
282+
.card-box > .fa-regular {
283+
color: var(--color-brand-red);
284+
}
285+
286+
.card-box > h3 {
287+
margin-block-start: 0;
288+
padding-left: 0;
289+
text-align: center;
290+
}
291+
292+
.card-box > div.ulist > ul li {
293+
list-style-type: disc;
294+
color: var(--color-link);
295+
font-weight: var(--weight-semibold);
296+
}
297+
298+
.card-box > div.ulist > ul li:hover {
299+
text-decoration: underline;
300+
}
301+
302+
.ten-minutes-container {
303+
display: flex;
304+
}
305+
306+
.ten-minutes-container > .collapsible-section {
307+
flex: 1;
308+
}
309+
310+
.ten-minutes-container > .collapsible-section > .collapsible {
311+
border: 1px solid #ccc;
312+
padding: 10px;
313+
margin: 5px;
314+
cursor: pointer;
315+
}
316+
317+
.ten-minutes-container > .collapsible-section > .collapsible h3 {
318+
margin: 0;
319+
}
320+
321+
.ten-minutes-container > .collapsible-section > .collapsible .content {
322+
display: none;
323+
margin-top: 10px;
324+
}
325+
326+
.image-section {
327+
flex: 1;
328+
display: flex;
329+
justify-content: center;
330+
align-items: center;
331+
}
332+
333+
.image-section img {
334+
max-width: 100%;
335+
height: auto;
336+
}
337+
259338
/* CSS for nav filter */
260339
.nav.tutorials-filter .nav-menu {
261340
padding: 20px;

src/helpers/collapse.js

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
function toggleCollapse (index) {
2+
const collapsibles = document.querySelectorAll('.collapsible')
3+
const images = ['image1.jpg', 'image2.jpg', 'image3.jpg', 'image4.jpg']
4+
const imageElement = document.getElementById('image')
5+
6+
collapsibles.forEach((collapsible, i) => {
7+
const content = collapsible.querySelector('.content')
8+
if (i === index) {
9+
content.style.display = content.style.display === 'block' ? 'none' : 'block'
10+
imageElement.src = images[index]
11+
} else {
12+
content.style.display = 'none'
13+
}
14+
})
15+
}
16+
17+
document.addEventListener('DOMContentLoaded', () => {
18+
const collapsibles = document.querySelectorAll('.collapsible')
19+
collapsibles.forEach((collapsible, index) => {
20+
collapsible.addEventListener('click', () => {
21+
toggleCollapse(index)
22+
})
23+
})
24+
})
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<div class="body container">
2+
{{#if (eq (nav-mode) 'client')}}
3+
{{#with (nav-group-for-page (nav-groups))}}
4+
{{#if ./components.length}}
5+
<aside class="nav left-sidebar">
6+
<div class="nav-container">
7+
<a href="#" class="menu-expand-toggle"><span>Navigation</span><i class="fas fa-times-circle"></i><i class="fas fa-chevron-circle-left"></i></a>
8+
</div>
9+
</aside>
10+
{{/if}}
11+
{{/with}}
12+
{{/if}}
13+
<main class="article" data-ceiling="topbar">
14+
<article class="doc landing-page-doc">
15+
{{{page.contents}}}
16+
</article>
17+
</main>
18+
</div>

src/partials/footer-scripts.hbs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,3 +49,6 @@ MathJax.Hub.Register.StartupHook("AsciiMath Jax Ready", function () {
4949
{{#if (eq env.SHOW_FEEDBACK_BUTTON 'true')}}
5050
<script async id="feedback-script" src="{{{uiRootPath}}}/js/vendor/feedback.js?v=1" data-collector-id="{{#if env.JIRA_COLLECTOR_ID}}{{env.JIRA_COLLECTOR_ID}}{{else}}709818cb{{/if}}"></script>
5151
{{/if}}
52+
{{#if (eq page.layout 'landing-page-capella')}}
53+
<script async id="collapsible" src="{{{uiRootPath}}}/js/collapse.js"></script>
54+
{{/if}}

0 commit comments

Comments
 (0)