7-rows edit

announcements-row  edit

Announcement row example 2. Fuga tempora iste eum quam.

Variation: Long title, short text. Lorem ipsum dolor sit amet consectetur adipisicing elit. Quidem quisquam suscipit culpa sit vero eius voluptate? Repellendus fugit beatae eveniet! Lorem ipsum dolor sit amet consectetur adipisicing elit., silver theme, 2 cards, short link text

Loading...

Home
Copy
Edit
<!-- components/7-rows/announcements-row.php --> <?php $json_str = file_get_contents(__DIR__ . '/announcements-row.json'); $data = json_decode($json_str, true); global $cardArray; global $themeArray; global $linkArray; global $maxCards; $themeArray = $data['themes']; $linkArray = $data['links']; $cardArray = $data['announcements']; $maxCards = $data['loop'][1]; function outputRowCode($arrayNum) { global $cardArray; global $themeArray; global $linkArray; global $maxCards; // if $cardArray length is larger than $themeArray length, start $themeArray over at beginning when it runs out if ($arrayNum >= count($themeArray)) { $theme = $themeArray[$arrayNum % count($themeArray)]; } else { $theme = $themeArray[$arrayNum]; } if ($arrayNum >= count($linkArray)) { $link = $linkArray[$arrayNum % count($linkArray)]; } else { $link = $linkArray[$arrayNum]; } // random number for slideshow ids $randomNum = rand(1, 200); $loopNum = 0; ?> <section class=" page-theme-wrapper h-theme-<?php echo $theme; ?>"> <div class="-loading wm-row AnnRow h-theme-silver js-show-summaries" data-id="ER1666677468532<?php echo $randomNum; ?>" id="ER1666677468532<?php echo $randomNum; ?>"> <div aria-labelledby="slideshow-heading" class="wm-slideshow wm-row__mainWrapper" role="group"> <h3 class="wm-row__title AnnRow__title" id="slideshow-heading">Announcement row example <?php echo $arrayNum + 1; ?>. Fuga tempora iste eum quam.</h3> <div class="wm-row__intro-text AnnRow__intro-text">Variation: <?php echo $cardArray[$arrayNum]["variation"]; ?>, <?php echo $theme; ?> theme, <?php echo $arrayNum + 1 > $maxCards ? 2 : $arrayNum + 1; ?> cards, <?php echo $link['variation']; ?></div> <div class="wm-slideshow__track AnnRow__slideshow-track"> <ul class="wm-slideshow__slides wm-cards h-theme-cards AnnRow__cards"> <?php // if we're over the max cards allowed, arbitrarily output 2 cards for ($j = 0; $j < $arrayNum + 1; $j++) { ?> <li class="h-theme-card wm-card --text-card AnnRow__card wm-slideshow__slide"> <a class="AnnRow__url" href=""> <div class="wm-card__text-section AnnRow__text-section"> <h4 class="wm-description-text__title AnnRow__description-text-title"><?php echo $cardArray[$arrayNum]["title"]; ?></h4> <div class="wm-description-text__caption AnnRow__description-text-caption"><?php echo $cardArray[$arrayNum]["text"]; ?></div> </div> </a> </li> <?php if ($arrayNum + 1 > $maxCards && $j == 1) { break; } } ?> </ul> </div> <div class="wm-slideshow__dots AnnRow__slideshow-dots"> </div> <div class="AnnRow__message h-theme-card"> <p>Loading...</p> </div> <a class="wm-row__moreButton AnnRow__moreButton" href="" target="_self"><?php echo $link["title"]; ?></a> </div> </div> </section> <?php }; // for each announcement variation, output variation description, then row for ($i = 0; $i < count($cardArray); $i++) { outputRowCode($i); } ?> <script src="<?php echo $base_url; ?>/js/wm-row-slideshow-js.js" type="text/javascript"></script> <script> document.addEventListener("DOMContentLoaded", function() { initWMRowSlideshow(); }); </script>
Copy
Copy
Edit
/* scss/7-rows/_announcements-feed-row.scss */ //====================================================================== // ANNOUNCEMENTS FEED ROW //====================================================================== .AnnRow { // remove side padding @include wm-row__noSidePadding(); &__text-section { overflow: visible; } // overwrite .wm-description-text styles &__description-text-title, &__description-text-title > a { font-family: font(alt-heading-serif); font-size: toRem(21); line-height: 1.2; letter-spacing: 0.17px; text-transform: none; margin: 0 0 4px 0; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; transition: all 0.1s ease-in-out; } &__description-text-caption { font-size: toRem(14); line-height: 1.6; letter-spacing: 0.22px; text-overflow: ellipsis; overflow: hidden; display: -webkit-box !important; -webkit-line-clamp: 8; -webkit-box-orient: vertical; white-space: normal; transition: all 0.1s ease-in-out; } &__description-text-byline-date { font-size: toRem(13); line-height: 1.7; letter-spacing: 0.22px; } &__moreButton { @include wm-row__moreButton; &:after { bottom: -2px; } } // hide slideshow on load &.-loading, &.-no-slides { .wm-slideshow__track, .wm-slideshow__dots { display: none; } } // no news stories message // hide message when loaded and there are slides &__message, &__message { display: none; } // show message when loaded or there are no slides .-loading &__message, .-no-slides &__message { display: flex; width: 90%; max-width: 300px; height: auto; margin: 45px auto 0; padding: 43px 50px; box-sizing: border-box; justify-content: center; align-items: center; font-family: font(text-sans); font-size: $base-text-size; line-height: $font-base-line_height; color: var(--theme-title-color); background-color: var(--theme-base-color); border: 1px solid rgba(var(--theme-base-accent-rgb-color), 0.4); } // Accessibility styles & [aria-busy="true"], & [aria-hidden="true"], &:not(.-loading) .sr-only { display: none; } }