Skip to content

Commit

Permalink
Merge branch 'main' into deployment
Browse files Browse the repository at this point in the history
  • Loading branch information
carylwyatt committed Aug 6, 2024
2 parents 7830fac + 8445fbc commit e71dae2
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 58 deletions.
46 changes: 24 additions & 22 deletions acf-json/group_6401f51290bb6.json
Original file line number Diff line number Diff line change
Expand Up @@ -416,7 +416,7 @@
},
{
"key": "field_6401f57f4a4a9",
"label": "Presentations",
"label": "Training",
"name": "",
"aria-label": "",
"type": "tab",
Expand All @@ -433,8 +433,8 @@
},
{
"key": "field_640218c61c730",
"label": "Presentations",
"name": "presentations",
"label": "Training",
"name": "training",
"aria-label": "",
"type": "group",
"instructions": "",
Expand Down Expand Up @@ -527,8 +527,8 @@
},
{
"key": "field_640219f05c3d1",
"label": "YouTube",
"name": "youtube",
"label": "Image",
"name": "image",
"aria-label": "",
"type": "group",
"instructions": "",
Expand All @@ -543,10 +543,10 @@
"sub_fields": [
{
"key": "field_640218dedda50",
"label": "Video ID",
"name": "video_id",
"label": "Image from Media Library",
"name": "med_img",
"aria-label": "",
"type": "text",
"type": "image",
"instructions": "",
"required": 1,
"conditional_logic": 0,
Expand All @@ -555,18 +555,23 @@
"class": "",
"id": ""
},
"default_value": "",
"maxlength": "",
"placeholder": "",
"prepend": "",
"append": ""
"return_format": "array",
"library": "all",
"min_width": "",
"min_height": "",
"min_size": "",
"max_width": "",
"max_height": "",
"max_size": "",
"mime_types": "",
"preview_size": "medium"
},
{
"key": "field_640219ff5c3d2",
"label": "Video Title",
"name": "video_title",
"label": "Training URL",
"name": "url",
"aria-label": "",
"type": "text",
"type": "url",
"instructions": "",
"required": 1,
"conditional_logic": 0,
Expand All @@ -575,11 +580,8 @@
"class": "",
"id": ""
},
"default_value": "",
"maxlength": "",
"placeholder": "",
"prepend": "",
"append": ""
"default_value": "URL of training material, linked from image",
"placeholder": ""
}
]
}
Expand Down Expand Up @@ -756,5 +758,5 @@
"active": true,
"description": "",
"show_in_rest": 0,
"modified": 1678389489
"modified": 1722541634
}
27 changes: 12 additions & 15 deletions front-page.php
Original file line number Diff line number Diff line change
Expand Up @@ -116,23 +116,11 @@
</div>
<?php

$pres = get_field( 'presentations' );
// $pres = get_field( 'presentations' );
$training = get_field( 'training' );

?>
<div class="home-pres">
<div class="yt-no-consent pres-card">
<img src="/wp-content/themes/wordpress-hathitrust/images/yt/new_website.jpg" alt=""/>
<div class="d-flex align-items-center gap-2">
<i class="fa-brands fa-youtube fa-fw fa-xl" aria-hidden="true"></i><a target="_blank" rel="noopener" class="text-decoration-underline fw-bold d-inline" href="https://www.youtube.com/watch?v=<?= $pres['youtube']['video_id'] ?>">Video: <?= esc_attr( $pres['youtube']['video_title'] ); ?><i class="fa-solid fa-arrow-up-right-from-square fa-fw ps-2" aria-hidden="true"></i></a>
</div>
<p class="small">This YouTube video has been disabled by your cookie selection. You can watch this video on YouTube: <a target="_blank" rel="noopener" class="text-decoration-underline" href="https://www.youtube.com/watch?v=<?= $pres['youtube']['video_id'] ?>"><?= esc_attr( $pres['youtube']['video_title'] ); ?></a><span class="visually-hidden">(opens in a new tab)</span>.</p>
</div>
<iframe loading="lazy" width="508" height="285" data-cookieblock-src="<?= esc_url( 'https://www.youtube-nocookie.com/embed/' . $pres['youtube']['video_id'] . '?modestbranding=1&rel=0&enablejsapi=1' ); ?>" title="<?= esc_attr( $pres['youtube']['video_title'] ); ?>"></iframe>
<div class="hpres-content">
<a href="<?= esc_url( $pres['cta']['url'] ); ?>" class="allcaps link-arrow"><span><?= esc_html( $pres['cta']['label'] ); ?></span></a>
<div class="hpres-copy"><?= wp_kses_post( $pres['content'] ); ?></div>
</div>
</div>

<section class="home-fc">
<h2 class="h3 allcaps">Featured Collections</h2>
<div class="home-fc-cards">
Expand Down Expand Up @@ -162,6 +150,15 @@
?>
</div>
</section>
<div class="home-pres">
<div class="yt-no-consent pres-card">
<a href="<?= esc_url( $training['image']['url'] ); ?>"><img src="<?= esc_url( $training['image']['med_img']['url'] ); ?>" alt=""/></a>
</div>
<div class="hpres-content">
<a href="<?= esc_url( $training['cta']['url'] ); ?>" class="allcaps link-arrow"><span><?= esc_html( $training['cta']['label'] ); ?></span></a>
<div class="hpres-copy"><?= wp_kses_post( $training['content'] ); ?></div>
</div>
</div>
</div>
<?php

Expand Down
2 changes: 1 addition & 1 deletion src/css/home.css
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@
object-fit: cover;
width: 100%;
border-radius: 0.375rem;
filter: brightness(0.6);
aspect-ratio:16/9;
}

/* FEATURED COLLECTIONS */
Expand Down
20 changes: 0 additions & 20 deletions src/js/cookies.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,25 +55,6 @@ function removeCookie(sKey, sPath, sDomain) {
return true;
}

function loadYouTubeVideo() {
if (window.location.pathname !== '/') {
return;
}

let placeholder = document.querySelector('.yt-no-consent');

if (!placeholder) {
return;
}

let youtubeVideo = document.querySelector('.home-pres iframe');
let youtubeSrc = youtubeVideo.getAttribute('data-cookieblock-src');

youtubeVideo.src = youtubeSrc;
youtubeVideo.removeAttribute('data-cookieblock-src');
placeholder.remove();
}

function loadMapEmbed() {
if (!window.location.pathname.includes('member-list')) {
return;
Expand All @@ -89,7 +70,6 @@ function loadMapEmbed() {

function checkForCookies() {
if (getCookie('HT-marketing-cookie-consent') === 'true') {
loadYouTubeVideo();
loadMapEmbed();
}
if (getCookie('HT-tracking-cookie-consent') === 'true') {
Expand Down

0 comments on commit e71dae2

Please sign in to comment.