Files
Kingsborough-LibGuide/groups/home/LibAnswers-4-js-css.html
T

547 lines
16 KiB
HTML

<style>
body {
color: #111;
overflow-x: hidden;
}
/* style slide out chat */
#lcs_slide_out_button-21944 { font-size: 1.5em; }
#login-div {
float: right;
padding-right: 17px;
font-size: 1.21em; /* I would like to set this at 1.2em, but for some strange reason this breaks the OneSearch dropdown button */
}
/* style alert */
#corona-alert {
text-align: center;
background-color: #faf870;
padding: 5px;
}
#corona-alert-text {
color: #111;
font-size: 1.5em;
}
/* style header */
#header-div {
padding: 30px;
text-align: center;
}
/* style navbar */
nav.navbar-default.yamm {
background-color: white;
border: none;
font-size: 1.4em;
color: #111;
margin-top: 20px;
border-radius: 0px;
}
.navbar-default .navbar-nav >li >a { color: #111; }
#navbar-center {
display: flex;
justify-content: center;
float: none;
}
.faux-card {
margin-left: 16px;
}
/* style background image */
.kbcc-background-image {
background: linear-gradient(to bottom, rgba(255,255,255,0.6) 0%,rgba(255,255,255,0.6) 100%), url("https://libapps.s3.amazonaws.com/accounts/16298/images/library_front_view.jpg");
background-position: 50% 71%;
padding: 20px 0px;
border-radius: 5px;
background-size: cover;
margin: -30px 0px 30px 0px;
}
/* style jumbotron */
.onesearch-jumbotron {
text-align: center;
margin-top: -40px;
}
#onesearch-header {
font-size: 10em;
margin-bottom: 0px;
}
.zero-margin {
margin-left: -2px;
margin-right: -2px;
}
#dropdownMenu1 { border-radius: 0px; }
a.searchmenu { color: #111; }
.highlight-menu-item { padding: 2px; }
.highlight-menu-item:hover {
background-color: #eee;
cursor: pointer;
}
/* style link list */
.link-list { font-size: 1.5em; }
/* style for nav by the jumbotron */
.nav-divs-by-jumbotron {
text-align: center;
padding: 6px;
margin: 6px 0px;
color: white;
background-color: #003466;
border-radius: 3px;
}
.nav-divs-by-jumbotron>h2 {
font-size: 1.5em;
margin-bottom: 4px;
margin-top: 4px;
}
a.no-underline { text-decoration: none; }
.nav-divs-by-jumbotron:hover { background-color: #444; }
#eq_32886 {
background-color: #003466;
border: none;
}
#eq_32886:hover { background-color: #444; }
.nav-divs-by-jumbotron:hover > h2 > #eq_32886 { background-color: #444; }
#bookastudyroom { cursor: pointer; }
/* style the panels with the text content */
.panel>.show-panel {
background-color: #003466;
text-align: center;
}
.hide-body-border {
border: none;
box-shadow: none;
}
.glyphicon-panel-title { font-size: 2em; }
.content-panel-title {
color: white;
font-size: 2em;
}
.content-panel-title>h2 {
margin: 7px 0px;
font-size: 1em;
}
.panel-heading { padding: 2px; }
/* style the gallery */
.slick-slide img {
padding: 2px;
max-height: 350px !important;
object-fit: contain;
margin: 0px;
}
.s-lib-public-side-header { display: none; }
.slick-active { outline: 0; }
/* style the hours */
.hours { text-align:center; }
.hours-panel-body { padding: 10px 5px 0px 5px; }
.padding-0 {
padding-left: 4px;
padding-right: 4px;
flex:1 1 auto;
display: flex;
}
.equal {
display: -webkit-box;
display: -moz-box;
display: -ms-flexbox;
display: -webkit-flex;
display: flex;
}
.panel { flex:1 0 100%; }
.panel-outline-color {
border: solid #555 1px;
font-size: 1.2em;
line-height: 1.4em;
}
.vertical-align {
display: flex;
align-items: center;
justify-content: center;
height: 100%;
}
.more-link {
text-align: center;
width: 100%;
}
/* style the yamm menu */
.dropdown-margin { margin-right: 50px; }
.bigger-fancy-text { font-size: 1.2em; }
.yamm1 { max-width: 900px; }
.yamm2 { max-width: 675px; }
.yamm3 { max-width: 300px; }
.yamm4 { max-width: 460px; }
#yamm4-margins { margin: -15px 0px; }
/* style footer */
#orange-line {
height:10px;
background-color: #ff4e00;
}
#main-blue-footer {
background-color: #003466;
color: white;
padding: 30px;
}
.whiteahrefs a:link, .whiteahrefs a:hover, .whiteahrefs a:visited, .whiteahrefs a:active {
color: white;
text-decoration:none;
}
.whiteahrefs a i {
margin: 4px 5px 0px 0px;
font-size: 1.5em
}
.whiteahrefs { margin-top: 10px; }
#lighthouse-logo > img { max-width: 150px; }
/* media queries */
@media only screen and (min-width: 1px) {
#library-logo {
max-width: 100%;
max-height: 150px;
}
#kb-cuny-logo {
max-width: 100%;
max-height: 150px;
}
#corona-alert { margin: -25px 6px 0px 12px; }
.form-width { width: 210px; }
.zero-margin { margin: 7px auto; }
.nav-by-jumbotron { margin-top: 40px !important; }
#main-blue-footer { min-height: 450px; }
.library-address { float: left; }
#cuny-logo {
float: left;
clear: both;
margin-top: 10px;
}
.libapps {
float: left;
clear: left;
}
}
@media only screen and (min-width: 768px) {
#corona-alert { margin: -20px 12px 0px 12px; }
.zero-margin { margin: -2px; }
#blue-border1 {
box-shadow: 0px 5px 0 #003466, 0px -5px 0 #003466, -5px -5px 0 #003466, -5px 5px 0 #003466;
}
#blue-border2 {
box-shadow: 0px -5px 0 #003466, 0px 5px 0 #003466;
}
#blue-border3 {
box-shadow: 0px 5px 0 #003466, 0px -5px 0 #003466, 5px -5px 0 #003466, 5px 5px 0 #003466;
}
.nav-by-jumbotron { margin-top: 0px !important; }
#lighthouse-logo {
display: inline-block;
float: left;
}
#main-blue-footer { min-height: 210px; }
.library-address {
display: inline-block;
margin: -10px 30px;
font-size: 1.1em;
}
#cuny-logo {
float: right;
clear: none;
margin: -10px 0px;
}
.libapps {
float: right;
clear: both;
}
}
@media only screen and (min-width: 992px) {
#header-div { text-align: left; }
#kb-cuny-logo {
max-width: 38%;
max-height: 300px;
margin-top: -15px;
}
#library-logo {
float: right;
max-width: 62%;
max-height: 300px;
margin-top: -15px;
margin-right: -32px;
}
#corona-alert { margin-top: -10px; }
nav.navbar-default.yamm { margin-top: 10px; }
.form-width { width: 340px; }
}
@media only screen and (min-width: 1200px) {
#kb-cuny-logo { margin-top: 0px; }
#library-logo { margin-top: -3px; }
}
/*!
* Yamm!3 - Yet another megamenu for Bootstrap 3
* http://geedmo.github.com/yamm3
*
* @geedmo - Licensed under the MIT license
*/
.yamm .nav,
.yamm .collapse,
.yamm .dropup,
.yamm .dropdown {
position: static;
}
.yamm .container {
position: relative;
}
.yamm .dropdown-menu {
left: auto;
}
.yamm .yamm-content {
padding: 20px 30px;
}
.yamm .dropdown.yamm-fw .dropdown-menu {
left: 0;
right: 0;
}
/* End of Yamm */
</style>
<!-- scripts to make the Book a Study Room widget run -->
<script src="https://kbcc-cuny.libcal.com/js/equipment.min.js"></script>
<script>
jQuery(function(){
jQuery("#eq_32886, #bookastudyroom").LibCalEquipmentBooking({iid: 5570, gid: 32886, eid: 0, width: 560, height: 680});
});
</script>
<!-- the configuration file for the hours widget -->
<script type="text/javascript" src="//libapps.s3.amazonaws.com/sites/2365/include/hours-babel.js"></script>
<!-- the code for the hours widget -->
<!-- please forgive the old-timey JS; it is there because we need to support IE10 & IE11 -->
<script type="text/javascript">
function hoursFunction() {
const h = JSON.parse(hours);
const options_weekday = { weekday: 'long' };
const options_weekday_short = { weekday: 'short' };
const options_date = { month: 'short', day: 'numeric' };
for (var i = 0; i < h.length; i++) {
let targetDate = new Date(h[i].Date + "T00:00:00.000-05:00");
let today = new Date();
if (window.innerWidth < 500) {
weekday = targetDate.toLocaleDateString("en-US", options_weekday_short)
} else {
weekday = targetDate.toLocaleDateString("en-US", options_weekday)
}
if (targetDate.getFullYear() === today.getFullYear() &&
targetDate.getMonth() === today.getMonth() &&
targetDate.getDate() === today.getDate()) {
document.getElementById('hours0').innerHTML = "<p><strong>Today</strong><br />" + targetDate.toLocaleDateString("en-US", options_date) + "<br />" + h[i].Hours + "</p>";
var start = true;
var count = 1;
} else if (start === true && count < 3 && h[i].Hours === "Closed" ) {
document.getElementById('hours' + count).innerHTML = "<span style='color:#666;'><p>" + weekday + "<br />" + targetDate.toLocaleDateString("en-US", options_date) + "<br />" + h[i].Hours + "</p></span>";
count++;
} else if (start === true && count < 3 && h[i].Hours != "Closed") {
document.getElementById('hours' + count).innerHTML = "<p>" + weekday + "<br />" + targetDate.toLocaleDateString("en-US", options_date) + "<br />" + h[i].Hours + "</p>";
count++;
}
}
};
</script>
<!-- polyfills to make .forEach and .includes work in IE10 and IE11 -->
<script type="text/javascript">
if (window.NodeList && !NodeList.prototype.forEach) {
NodeList.prototype.forEach = Array.prototype.forEach;
}
String.prototype.includes = function(match) {
return this.indexOf(match) !== -1;
}
</script>
<!-- script to make OneSearch dropdown work -->
<!-- please forgive the old-timey JS; it is there because we need to support IE10 & IE11 -->
<script type="text/javascript">
function customizeSearch(facet) {
// re-render the dropdown menu with the current pick
document.getElementById('dropdownMenu1').innerHTML = facet + ' <span class="caret"></span>';
document.getElementById("primoQueryTemp").setAttribute("placeholder", "Enter search term here");
// reset any previously selected facets
document.querySelectorAll('.deleteWithDropdownChange').forEach( function(e) { e.remove(); });
document.getElementById("formToAppendInputsTo").setAttribute("action", "https://cuny-kb.primo.exlibrisgroup.com/discovery/search");
document.getElementById("tabSetting").setAttribute("value", "Everything");
document.getElementById("SearchScopeSetting").setAttribute("value", "IZ_CI_AW");
// add the facet that matches the user's dropdown selection
if (facet === "Books") {
document.getElementById("formToAppendInputsTo").insertAdjacentHTML('afterbegin', '<input name="facet" value="rtype,include,books" type="hidden" class="deleteWithDropdownChange" />');
} else if (facet === "Articles") {
document.getElementById("formToAppendInputsTo").insertAdjacentHTML('afterbegin', '<input name="mfacet" value="rtype,include,articles,1" type="hidden" class="deleteWithDropdownChange"/><input name="mfacet" value="rtype,include,newspaper_articles,1" type="hidden" class="deleteWithDropdownChange" />');
} else if (facet === "Videos") {
document.getElementById("formToAppendInputsTo").insertAdjacentHTML('afterbegin', '<input name="facet" value="rtype,include,videos" type="hidden" class="deleteWithDropdownChange" />');
} else if (facet === "Journals") {
document.getElementById("formToAppendInputsTo").setAttribute('action', 'https://cuny-kb.primo.exlibrisgroup.com/discovery/jsearch');
document.getElementById("tabSetting").setAttribute("value", "jsearch_slot");
} else if (facet === "Newspapers") {
document.getElementById("formToAppendInputsTo").setAttribute('action', 'https://cuny-kb.primo.exlibrisgroup.com/discovery/npsearch');
} else if (facet === "Course Reserves") {
document.getElementById("tabSetting").setAttribute("value", "CourseReserves");
document.getElementById("SearchScopeSetting").setAttribute("value", "CourseReserves");
} else {
console.log("no match");
}
// store the facet, for use on page reload
sessionStorage.facet = facet;
}
// if the stored facet exists on page load, render the dropdown with that facet, then clear the stored facet
function sessionFunction() {
if (sessionStorage.facet && sessionStorage.searchTerms) {
stored_terms = sessionStorage.searchTerms;
document.getElementById("primoQueryTemp").value = stored_terms;
stored_facet = sessionStorage.facet;
customizeSearch(stored_facet);
}
sessionStorage.clear();
};
</script>
<!-- OneSearch widget script from OLS, modified -->
<!-- please forgive the old-timey JS; it is there because we need to support IE10 & IE11 -->
<script type="text/javascript">
function addPrimoQuery(e) {
// prevent the user from submitting the form if no dropdown item has been selected. Added by ME.
e.preventDefault();
e.stopPropagation();
if (document.getElementById("dropdownMenu1").innerHTML.includes('Define') === true) {
$("#dropdownMenu1").trigger('click.bs.dropdown.data-api');
document.getElementById("primoQueryTemp").value = "";
document.getElementById("primoQueryTemp").setAttribute("placeholder", "Please make a selection");
return true;
};
// save the search terms, for use on page reload
sessionStorage.searchTerms = document.getElementById("primoQueryTemp").value;
// original OLS widget
document.getElementById("primoQuery").value = "any,contains," + document.getElementById("primoQueryTemp").value.replace(/[,]/g, " ");
// If you changed the form name at the top, change it below to match
document.forms.searchPrimoForm1.submit();
}
</script>
<!-- run the hours widget and the sessionStorage stuff on load -->
<script>
window.onload = function () {
hoursFunction()
sessionFunction()
}
</script>
<!-- Load bootstrap accessibility libraries (https://github.com/paypal/bootstrap-accessibility-plugin) -->
<!--<link rel="stylesheet" type="text/css" href="//libapps.s3.amazonaws.com/sites/2365/include/bootstrap-accessibility.min.css">-->
<!--<script type="text/javascript" src="//libapps.s3.amazonaws.com/sites/2365/include/bootstrap-accessibility.min.js"></script>-->
<!-- FontAwesome -->
<script type="text/javascript" src="//libapps.s3.amazonaws.com/sites/2365/include/fa.js"></script>
<!-- If browser is IE, run an alternate version of lg-public.min.js with no ECMAscript 6 -->
<script type="text/javascript">
if (window.document.documentMode) {
document.write('<script src="//libapps.s3.amazonaws.com/sites/2365/include/lg-public.min.js"><\/script>');
}
</script>