Skip to content

Commit 21286cd

Browse files
committed
innovate hero section
1 parent 1ba1dbf commit 21286cd

3 files changed

Lines changed: 30 additions & 21 deletions

File tree

ims-apis.html

Lines changed: 8 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,8 @@
7777
<!-- Hamburger menu -->
7878
<script src="wp-includes/js/navbar.js"></script>
7979

80+
<!-- Web components -->
81+
<script src="web-components/hero-section/hero-section.js" type="module"></script>
8082
</head>
8183

8284
<!-- --------------- SITE CONTENT --------------- -->
@@ -290,21 +292,12 @@ <h5>IMS support</h5>
290292
<main id="main" class="zs-main" >
291293

292294
<!-- =========================== IMS APIs Hero Banner =========================== -->
293-
<div class="banner innovate-bg">
294-
<section id="intro-section" class="pure-g zs-section apis-hero">
295-
<div id="intro-header" class="pure-u-1"></div>
296-
<div class="pure-u-3-25">
297-
<img class="ims-card-icon" src="wp-content/Icon_Banner_z OS ConnectPage.svg" alt="">
298-
</div>
299-
<div id="intro-info" class="pure-u-1 pure-u-sm-15-24 apis-hero-text">
300-
<h6>Innovate</h6>
301-
<h1 >IBM z/OS Connect</h1>
302-
<p id="p-style" >Create and deploy RESTful APIs that access IMS™ applications and data
303-
in minutes with point and click Eclipse tooling.
304-
</p>
305-
</div>
306-
</section>
307-
</div>
295+
<hero-section
296+
name="IBM z/OS Connect"
297+
image="wp-content/Icon_Banner_z OS ConnectPage.svg"
298+
section="Innovate"
299+
desc="Create and deploy RESTful APIs that access IMS™ applications and data in minutes with point and click Eclipse tooling."
300+
></hero-section>
308301

309302
<!-- =========================== Call APIs from Z =========================== -->
310303
<div class="zs-gray-section apis-section-white">

web-components/hero-section/hero-section.css

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,14 @@
1111
background-size: cover;
1212
background-position: right;
1313
color: black;
14-
}
14+
}
15+
16+
.innovate-bg {
17+
background-image: url(../../wp-content/backgrounds/Innovate_HomepageBG.png);
18+
background-repeat: no-repeat;
19+
background-size: cover;
20+
background-position: 35%;
21+
}
1522

1623
section {
1724
display: grid;

web-components/hero-section/hero-section.js

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ function createComponent(html) {
1010
function setContent(cssSelector, content, shadow) {
1111
const selector = shadow.querySelector(cssSelector);
1212
// Check if span tag is used in desc
13-
if (content.includes('<span>')) {
13+
if ((content != undefined) && (content.includes('<span>'))) {
1414
// Update HTML
1515
selector.innerHTML = content;
1616
} else {
@@ -42,7 +42,6 @@ function createComponent(html) {
4242
// Creates element with default values
4343
constructor() {
4444
super();
45-
this.link2 = "";
4645
}
4746

4847
// Return array of properties to observe
@@ -67,11 +66,18 @@ function createComponent(html) {
6766
setContent('.section', this.section, shadow);
6867
setContent('.name', this.name, shadow);
6968
setContent('.desc', this.desc, shadow);
70-
setLink('.button-primary', this.link, shadow);
71-
setContent('.button-primary-text', this.linktext, shadow);
69+
70+
if (this.link != undefined) {
71+
setLink('.button-primary', this.link, shadow);
72+
setContent('.button-primary-text', this.linktext, shadow);
73+
} else {
74+
// Hide the secondary button if no link is provided
75+
const buttonPrimary = shadow.querySelector('.button-primary');
76+
buttonPrimary.style.display = 'none';
77+
}
7278

7379
// Check if secondary button is used
74-
if (this.link2 != "") {
80+
if (this.link2 != undefined) {
7581
setLink('.button-secondary', this.link2, shadow);
7682
setContent('.button-secondary-text', this.linktext2, shadow);
7783
} else {
@@ -89,6 +95,9 @@ function createComponent(html) {
8995
case 'Learn':
9096
heroSection.classList.add('learn-bg');
9197
break;
98+
case 'Innovate':
99+
heroSection.classList.add('innovate-bg');
100+
break;
92101
}
93102
}
94103
}

0 commit comments

Comments
 (0)