Skip to content

Commit 27c1353

Browse files
committed
comment code
1 parent c5e1626 commit 27c1353

6 files changed

Lines changed: 273 additions & 465 deletions

File tree

ims-advocacy.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -286,7 +286,7 @@ <h5>IMS support</h5>
286286
<div id="content" class="main-content">
287287
<main id="main">
288288
<!-- =========================== Hero =========================== -->
289-
<section class="engage-bg dark-gray-bg">
289+
<section class="engage-bg">
290290
<div id="intro-section" class="pure-g hero">
291291
<div class="pure-u-1 pure-u-md-1-24">
292292
<img src="wp-content/icons/icon_engage.svg" alt="" class="icon">

ims-videos.html

Lines changed: 208 additions & 451 deletions
Large diffs are not rendered by default.

wp-includes/css/nav.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -716,7 +716,7 @@ body .pn-listing .pn-list__item .entry-content p {
716716
}
717717

718718
/* link */
719-
a, a:visited {
719+
a {
720720
display: inline-block;
721721
color: #0F62FE;
722722
text-decoration: none;

wp-includes/css/page.css

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -209,6 +209,10 @@
209209
padding: 3em;
210210
}
211211

212+
.hero div:nth-child(2) {
213+
padding-left: 1em;
214+
}
215+
212216
.main-content section:first-child {
213217
width: 100%;
214218
background-color:var(--bg-dark-gray-01);
@@ -242,6 +246,11 @@
242246
padding-right: 2em;
243247
}
244248

249+
/* Targets all section containing card grid (ex. videos, course, etc.) */
250+
.card-section {
251+
padding: 2em 4em !important;
252+
}
253+
245254
.card-section-header {
246255
margin-left: 1em;
247256
padding-right: 2em;
@@ -350,21 +359,35 @@
350359
padding: 2em;
351360
}
352361

362+
/* Decrease card section padding for smaller screens */
363+
.card-section {
364+
padding: 1em !important;
365+
}
366+
367+
/* Decrease padding for smaller screens */
353368
.pure-g-pad > div {
354369
padding: 0.4em;
355370
}
356371

372+
/* Decrease highlight link padding for smaller screens */
357373
.highlight-link {
358374
padding-bottom: 1rem;
359375
}
360376

377+
/* Decrease font size for smaller screens */
361378
.dark-gray-bg h4 {
362379
font-size: var(--plex-20) !important;
363380
}
381+
382+
/* Remove padding from hero content for smaller screens */
383+
.hero div:nth-child(2) {
384+
padding-left: 0em;
385+
}
364386
}
365387

366388
/* 1024px and above screen sizes */
367389
@media screen and (min-width: 64em) {
390+
/* Resize quote block to full height for larger screens */
368391
.quote-blk {
369392
height: 100%;
370393
}

wp-includes/css/web-components/video-card.css

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,18 @@ a {
3434
color: var(--blue);
3535
}
3636

37+
/* Styling for a group of links */
3738
.link-g {
3839
margin-top: 1em;
40+
display: flex;
41+
flex-flow: column nowrap;
42+
}
43+
44+
.link-g a {
45+
margin: 0.2em 0em;
3946
}
4047

48+
/* Styling for video card */
4149
.video-card {
4250
background-color: var(--bg-light-gray);
4351
margin: 1em;
@@ -50,10 +58,12 @@ a {
5058
flex-grow: 1;
5159
}
5260

61+
/* Places 'watch now' at the bottom of the video card */
5362
.video-card div:nth-child(1) {
5463
flex-grow: 4;
5564
}
5665

66+
/* Styling for inline group (level, time) */
5767
.inline-g {
5868
display: flex;
5969
flex-flow: row wrap;
@@ -65,16 +75,9 @@ a {
6575
margin: 0em;
6676
}
6777

68-
/* 768px and below screen sizes */
69-
@media screen and (max-width: 48em) {
70-
.video-card {
71-
margin: 1em 0em;
72-
padding: 1.5em;
73-
}
74-
}
75-
7678
/* 1024px and above screen sizes */
7779
@media screen and (min-width: 64em) {
80+
/* Set consistent height for video card */
7881
.video-card {
7982
height: 18.75em;
8083
}

wp-includes/js/web-components.js

Lines changed: 29 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,28 @@
11
// Web component
22
class VideoCard extends HTMLElement {
33

4+
// Creates element with default values
45
constructor() {
56
super();
67
this.level = 'Varies';
78
this.time = 'Varies';
9+
this.linktext = 'now';
810
}
911

12+
// Return array of properties to observe
1013
static get observedAttributes() {
11-
return ['name', 'desc', 'level', 'time', 'link'];
14+
return ['name', 'desc', 'level', 'time', 'link', 'linktext', 'link2', 'linktext2', 'link3', 'linktext3'];
1215
}
1316

17+
// Called when an attribute is defined or changed
1418
attributeChangedCallback(property, oldValue, newValue) {
1519
if (oldValue === newValue) return;
1620
this[property] = newValue;
1721
}
1822

23+
// Invoked when element is added to document
1924
connectedCallback() {
25+
// Create shadow root for element
2026
const shadow = this.attachShadow({mode: 'closed'});
2127
shadow.append(
2228
document.getElementById('video-card').content.cloneNode(true)
@@ -38,10 +44,29 @@ class VideoCard extends HTMLElement {
3844
const videoTime = shadow.querySelector('.video-time');
3945
videoTime.textContent = `${this.time}`;
4046

41-
// Set video link
47+
// Set video links
4248
const videoLink = shadow.querySelector('.video-link');
43-
videoLink.href = this.link;
44-
videoLink.setAttribute('alt', `Watch ${this.name} now`);
49+
const videoLink2 = shadow.querySelector('.video-link-2');
50+
const videoLink3 = shadow.querySelector('.video-link-3');
51+
const links = [
52+
[this.link, this.linktext, videoLink],
53+
[this.link2, this.linktext2, videoLink2],
54+
[this.link3, this.linktext3, videoLink3]
55+
]
56+
57+
links.forEach(link => {
58+
const url = link[0];
59+
const linkText = link[1];
60+
const linkObj = link[2];
61+
62+
// Check if urls have been defined
63+
if (url != undefined) {
64+
linkObj.href = url;
65+
const altText = (linkText != 'now') ? `Watch ${this.name}, ${linkText}` : `Watch ${this.name}`; // Change link text if defined
66+
linkObj.setAttribute('alt', altText);
67+
linkObj.textContent = `Watch ${linkText} →`;
68+
}
69+
})
4570
}
4671
}
4772

0 commit comments

Comments
 (0)