Skip to content

Commit

Permalink
Merge pull request #68 from uklibraries/click-behavior
Browse files Browse the repository at this point in the history
Click behavior
  • Loading branch information
libmanuk authored Nov 12, 2024
2 parents 74cd6f6 + 8b71838 commit 5518758
Show file tree
Hide file tree
Showing 7 changed files with 374 additions and 297 deletions.
68 changes: 36 additions & 32 deletions css/global_header_footer.css
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,10 @@
margin: 0;
}

.ukl-link {
margin: 0;
}

.ukl-dropdown-content {
list-style-type: none;
margin: 0;
Expand Down Expand Up @@ -119,7 +123,6 @@

.ukl-ext-clamp .ukl-global-header .ukl-slab.ukl-global-header__nav-bar {
display: none;
padding: rr-gridbase(2);
}

.ukl-ext-clamp .ukl-global-header-layout > div {
Expand Down Expand Up @@ -193,7 +196,7 @@
}

.ukl-ext-clamp .ukl-universal-header.ukl-slab {
padding-left: 1.2em;
padding-left: 1.25em;
padding-right: 1em;
}

Expand Down Expand Up @@ -669,44 +672,39 @@ body {
.ukl-nav-links {
display: flex;
flex-direction: column;
gap: 2rem;
padding:2rem;
margin-left: 20px;
}

#ukl-gethome {
display: flex;
justify-content: space-between;
width: 100%;
}

#ukl-gethome:first-child {
align-self: start;
}

.ukl-dropdown {
/* border-width: 1px;
border-color: red;
border-style: solid; */
/* .ukl-dropdown {
width: fit-content;
}
display: flex;
align-items: baseline;
justify-content: space-between;
} */

.ukl-dropdown .ukl-dropdown-content {
display: flex;
flex-direction: column;
position: relative;
width: 100%;
/* filter: drop-shadow(10px 5px 5px #212121); */
}

/* .ukl-dropdown:focus-within .ukl-dropdown-content {
outline: none;
position:inherit;
display:block;
visibility: visible;
opacity: 1;
transform: translateY(0px);
padding-top: 0px;
} */

.ukl-ext-clamp .ukl-global-header-layout {
display: flex;
flex-direction: column;
gap: 1.25rem;
justify-content: center;
align-items: baseline;
}

}
Expand All @@ -733,10 +731,6 @@ body {
}

.ukl-menu-button-more {
display: block;
float: right;
justify-content:flex-end;
margin-left: auto;
width: 7mm;
height: 7mm;
background-size: 100%;
Expand All @@ -756,12 +750,6 @@ body {
background-image: url("data:image/svg+xml;charset=utf8,%3Csvg viewBox='0 0 32 32' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath stroke='rgba(255,255,255, 1)' stroke-width='2' stroke-linecap='round' stroke-miterlimit='10' d='M8 8 L24 24 M8 24 L24 8'/%3E%3C/svg%3E");
}

@media screen and (min-width: 770px) and (max-width: 1190px) {
.ukl-ext-clamp .ukl-slab__wrapper {
padding-right: 15px;
}
}

/* was 769 */
@media screen and (min-width: 1024px) {
.ukl-menu-button {
Expand Down Expand Up @@ -864,17 +852,28 @@ body {
opacity: 1;
}

.ukl-dropbtn.ukl-c {
.ukl-dropbtn {
display: flex;
flex-direction: row;
align-items: center;
gap: 0.5rem;
gap: .5rem;
}

@media screen and (max-width: 1023px){
.ukl-global-header-layout {
display: flex;
flex-direction: column;
gap: 1.25rem;
}
.ukl-dropdown-content {
width: 50%;
}

.ukl-nav-links, .ukl-utility-links {
display: flex;
flex-direction: column;
gap: 1.25rem;
}
}

/* dd container */
Expand Down Expand Up @@ -902,3 +901,8 @@ div#ukl-gethome>a>img {
height: auto;
object-fit:cover;
}

/* Hide empty menu elements */
.ukl-link:has(.ukl-getlink:empty), #ukl-gethdrw:empty {
display: none;
}
41 changes: 41 additions & 0 deletions docs/script-mockup.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# Usage
This is a mostly complete version of the script. The only thing needed to change to make this work for a specific site is knowledge of which config you require (e.g., "atlas", "exploreuk", "nkaa"). You change the `data-base_path` to that name and the script will take care of the rest, including fallback behavior.

```html
<script
id="ukl-header-script"
type="module"
src="./js/universalheader.js"
data-base_path="[YOUR CONFIG NAME HERE]"
onerror="
(() => {
this_script = document.querySelector('#ukl-header-script');
// Use the fallback css
const styles = document.querySelector('#ukl-header-styles');
styles.href='https://cdn.jsdelivr.net/gh/uklibraries/UKL_HeaderFooter@dev/css/global_header_footer.css'
// Create a new script and use fallback js
const script = document.createElement('script');
script.id = 'ukl-header-script';
script.type = 'module';
script.src = 'https://cdn.jsdelivr.net/gh/uklibraries/UKL_HeaderFooter@dev/js/universalheader.js';
script.dataset.base_path = this_script.dataset.base_path;
document.head.appendChild(script);
// Remove footer script and footer
const old_footer=document.querySelector('#ukl-footer');
if (old_footer) old_footer.remove();
const old_footer_script=document.querySelector('#ukl-footer-script');
if (old_footer_script) old_footer_script.remove();
// Create a new footer script and use fallback js
const footer_script = document.createElement('script');
footer_script.src='https://cdn.jsdelivr.net/gh/uklibraries/UKL_HeaderFooter@dev/js/combofootershared.js';
document.body.appendChild(footer_script);
if (this_script) this_script.remove();
})();
"
></script>
```
8 changes: 4 additions & 4 deletions js/combofootershared.js → js/comboFooterShared.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

50 changes: 25 additions & 25 deletions js/config/global/globalConfig.js
Original file line number Diff line number Diff line change
@@ -1,30 +1,30 @@
export default {
DangerTitleText: "0 - UK ALERT - DELAYED OPENING",
DangerMsgText:
danger_title_text: "0 - UK ALERT - DELAYED OPENING",
danger_msg_text:
"URGENT: University of Kentucky campus operations on a 2-hour delay. All library facilities will open at 10 am, today, Friday, Jan 19.",
DangerMsgToggle: "off",
DangerMsgBackground: "#c12c2b",
DangerMsgColor: "#fff",
DangerLinkColor: "#fff",
WarningTitleText: "0 - UK ALERT - EARLY CANCELLATION",
WarningMsgText:
danger_msg_toggle: "off",
danger_msg_background: "#c12c2b",
danger_msg_color: "#fff",
danger_link_color: "#fff",
warning_title_text: "0 - UK ALERT - EARLY CANCELLATION",
warning_msg_text:
"We are currently experiencing technical difficulties with some online databases. We are working to resolve this issue as soon as possible. Thank you for your patience. ",
WarningMsgToggle: "on",
WarningMsgBackground: "#FFDC00",
WarningMsgColor: "#000",
WarningLinkColor: "#0033A0",
AnnouncementTitleText: "0 - UK ALERT - EARLY CANCELLATION",
AnnouncementMsgText:
warning_msg_toggle: "on",
warning_msg_background: "#FFDC00",
warning_msg_color: "#000",
warning_link_color: "#0033A0",
announcement_title_text: "0 - UK ALERT - EARLY CANCELLATION",
announcement_msg_text:
"We are currently experiencing technical difficulties with some online databases. We are working to resolve this issue as soon as possible. Thank you for your patience. ",
AnnouncementMsgToggle: "off",
AnnouncementMsgBackground: "#a1d3ed",
AnnouncementMsgColor: "#000",
AnnouncementLinkColor: "#0033A0",
SurveyTitleText: "Help us improve library services, spaces, and collections!",
SurveyMsgText: "Take the ",
SurveyMsgLinkLabel: "LibQUAL+ survey",
SurveyMsgLinkURL: "https://www.libqual.org/survey/RWSLDQ72YU886X8HRA",
SurveyMsgToggle: "on",
SurveyMsgBackground: "#4CBCC0",
SurveyMsgColor: "#0033a0",
announcement_msg_toggle: "off",
announcement_msg_background: "#a1d3ed",
announcement_msg_color: "#000",
announcement_link_color: "#0033A0",
survey_title_text: "Help us improve library services, spaces, and collections!",
survey_msg_text: "Take the ",
survey_msg_link_label: "LibQUAL+ survey",
survey_msg_link_url: "https://www.libqual.org/survey/RWSLDQ72YU886X8HRA",
survey_msg_toggle: "on",
survey_msg_background: "#4CBCC0",
survey_msg_color: "#0033a0",
};
5 changes: 0 additions & 5 deletions js/testScript.js

This file was deleted.

Loading

0 comments on commit 5518758

Please sign in to comment.