Skip to content

Commit

Permalink
Merge pull request #14 from ucsb/art-banner
Browse files Browse the repository at this point in the history
add new message for art library changes
  • Loading branch information
michael-cr41g authored Apr 1, 2024
2 parents d6e136d + 704f1d3 commit a00fac8
Showing 1 changed file with 11 additions and 21 deletions.
32 changes: 11 additions & 21 deletions js/alertBar.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,27 +3,17 @@
* Code courtesy of UCI
*/
var alertBanner = window.setInterval(function () {
var date = new Date();
if (date.getFullYear() == 2023 && date.getMonth() > 7 && date.getMonth() < 10) {
var prmAlertBar = document.getElementsByClassName('topbar-wrapper');
var alertBarDiv = document.createElement('div');
alertBarDiv.setAttribute('id', 'customAlertBar');
alertBarDiv.setAttribute('style', 'align-content: center;align-items: center;');
alertBarDiv.setAttribute('layout-align', 'center center');
var alertBarInnerDiv = document.createElement('div');

if ((date.getMonth() == 8 && date.getDate() > 10 && date.getDate() < 23)) {
alertBarInnerDiv.setAttribute('style', 'text-align: center;background-color: #FFCE34;padding: 3px 0;font-size: 15px; color: #000000; font-family: Source Sans Pro,Helvetica Neue,Helvetica,Arial,sans-serif;');
alertBarInnerDiv.innerHTML = 'September 18-22, 2023: Art & Architecture General Collection print materials with call numbers N-NC will be unavailable while they are relocated to the <a class="alertBarHoverImg" href="https://www.library.ucsb.edu/files/artslibraryprojectn-nchighlightedpng">2nd floor, Mountain Side<span><img src="custom/01UCSB_INST-UCSB/img/bannerMap.png" alt="second floor map" width="40%" height="auto" /></span></a>.<br> To learn more, <a href="https://www.library.ucsb.edu/arts-library-project">click here</a>.';
}
else if ((date.getMonth() == 8 && date.getDate() > 22) || (date.getMonth() == 9 && date.getDate() < 24)) {
alertBarInnerDiv.setAttribute('style', 'text-align: center;background-color: #FFCE34;padding: 3px 0;font-size: 18px; color: #000000; font-family: hind_regularregular, Helvetica, Arial, sans-serif; line-height: 1.5em; font-weight: 600');
alertBarInnerDiv.innerHTML = 'Art & Architecture General Collection print materials with call numbers N-NC are temporarily located on the <a class="alertBarHoverImg" href="https://www.library.ucsb.edu/files/artslibraryprojectn-nchighlightedpng">2nd floor, Mountain Side<span><img src="custom/01UCSB_INST-UCSB/img/bannerMap.png" alt="second floor map" width="40%" height="auto" /></span></a>.<br> To learn more, <a href="https://www.library.ucsb.edu/arts-library-project">click here</a>.';
}
alertBarDiv.appendChild(alertBarInnerDiv);
prmAlertBar[0].prepend(alertBarDiv);
clearInterval(alertBanner);
}
var prmAlertBar = document.getElementsByClassName('topbar-wrapper');
var alertBarDiv = document.createElement('div');
alertBarDiv.setAttribute('id', 'customAlertBar');
alertBarDiv.setAttribute('style', 'align-content: center;align-items: center;');
alertBarDiv.setAttribute('layout-align', 'center center');
var alertBarInnerDiv = document.createElement('div');
alertBarInnerDiv.setAttribute('style', 'text-align: center;background-color: #FFCE34;padding: 3px 0;font-size: 15px; color: #000000; font-family: Source Sans Pro,Helvetica Neue,Helvetica,Arial,sans-serif;');
alertBarInnerDiv.innerHTML = 'Some Art & Architecture collection materials are currently inaccessible for browsing due to construction and must be requested.<br> Requested materials will be paged Monday-Friday and must be picked up at the Services Desk. <a href="https://www.library.ucsb.edu/arts-library-project">Learn more.</a>';
alertBarDiv.appendChild(alertBarInnerDiv);
prmAlertBar[0].prepend(alertBarDiv);
clearInterval(alertBanner);
}, 5000);
/**
* End Alert Bar
Expand Down

0 comments on commit a00fac8

Please sign in to comment.