From 19209eafc12c0494d4c27f1a417cdab43411d95c Mon Sep 17 00:00:00 2001 From: Max Turer Date: Fri, 1 Mar 2024 18:27:18 +0000 Subject: [PATCH] collections results simplified temporarily and homepage JS incorporated --- app/assets/javascripts/tooltip.js | 41 ++++++++++++ .../scholarspace/components/_collection.scss | 2 +- .../scholarspace/components/_homepage.scss | 63 +++++++++++-------- .../scholarspace/components/_search.scss | 7 +++ .../hyrax/collections/_search_form.html.erb | 2 +- .../_home_categories_featured.html.erb | 12 ++-- 6 files changed, 92 insertions(+), 35 deletions(-) create mode 100644 app/assets/javascripts/tooltip.js diff --git a/app/assets/javascripts/tooltip.js b/app/assets/javascripts/tooltip.js new file mode 100644 index 00000000..14359696 --- /dev/null +++ b/app/assets/javascripts/tooltip.js @@ -0,0 +1,41 @@ +if (window.location.href.replaceAll(window.location.origin, '').replaceAll('/','').length === 0 || +window.location.href.replaceAll(window.location.origin, '').replaceAll('/','') == '?locale=en') { + + window.onload = init; + function init() { + arrow = document.getElementById('arrow-left'); + text = document.getElementById('tooltip-box'); + + etds = document.getElementById('etds'); + journals = document.getElementById('journals'); + articles = document.getElementById('articles'); + posters = document.getElementById('posters'); + presentations = document.getElementById('presentations'); + materials = document.getElementById('materials'); + + etds.addEventListener("mouseover", (event) => { + arrow.style.marginTop = '0'; + text.innerHTML = 'Browse theses and dissertations by GW students'; + }); + journals.addEventListener("mouseover", (event) => { + arrow.style.marginTop = '2.7em'; + text.innerHTML = 'Browse journals published by GW student organizations and other GW-affiliated organizations'; + }); + articles.addEventListener("mouseover", (event) => { + arrow.style.marginTop = '5.5em'; + text.innerHTML = 'Browse individual articles authored by GW faculty, staff, students, and published by GW-affiliated orgnaizations'; + }); + posters.addEventListener("mouseover", (event) => { + arrow.style.marginTop = '8.2em'; + text.innerHTML = 'Browse posters created by GW faculty, staff, and students for various research purposes'; + }); + presentations.addEventListener("mouseover", (event) => { + arrow.style.marginTop = '10.9em'; + text.innerHTML = 'Browse presentations given by GW faculty, staff, and students for conferences and other meetings'; + }); + materials.addEventListener("mouseover", (event) => { + arrow.style.marginTop = '13.6em'; + text.innerHTML = 'Browse digitized and born-digital content from the specialized collections of GW Libraries & Academic Innovation'; + }); + } +} \ No newline at end of file diff --git a/app/assets/stylesheets/scholarspace/components/_collection.scss b/app/assets/stylesheets/scholarspace/components/_collection.scss index 082ab98b..d0ea5951 100755 --- a/app/assets/stylesheets/scholarspace/components/_collection.scss +++ b/app/assets/stylesheets/scholarspace/components/_collection.scss @@ -49,7 +49,7 @@ width: 100%; border-radius: 0; padding: 0.4rem; - margin-left: 0; + margin-left: 0.3rem; .glyphicon-search::before { font-size: 1rem; diff --git a/app/assets/stylesheets/scholarspace/components/_homepage.scss b/app/assets/stylesheets/scholarspace/components/_homepage.scss index 4edb0bc7..5306d01e 100644 --- a/app/assets/stylesheets/scholarspace/components/_homepage.scss +++ b/app/assets/stylesheets/scholarspace/components/_homepage.scss @@ -21,7 +21,7 @@ margin: 0 8em; @media (max-width: 3000px) { - margin: 0; + margin: 0 1.5em; } } @@ -43,7 +43,7 @@ //fix for large screens @media (min-width: 1650px) { - font-size: 9vw; + font-size: 10vw; } } @@ -147,13 +147,14 @@ #arrow-left { width: 0; height: 0; + margin-top: 0; border-top: 1.2em solid transparent; border-bottom: 1.2em solid transparent; border-right: 1.2em solid $gw-hover-buff; } #tooltip-box { - width: 8.5vw; + width: 9em; height: 16em; display: flex; align-items: center; @@ -163,7 +164,7 @@ color: $gw-dark-blue; @media (max-width: 1590px) { - width: 8em; + width: 9em; } } } @@ -172,33 +173,25 @@ @media (min-width: 2050px) { height: 21vw; } + + @media (max-width: 3000px) { + .content-container { + padding: 0; + margin: 0; - @media (max-width: 1280px) { - height: 27vw; - margin: 0; - - #categories-container { - padding: 0.5em 0.5em 0.5em 0; - - @media (max-width: 960px) { - padding-right: 0; + #categories-container, #categories-tooltip { + padding: 0 0.5em 0.5em 0; } } - - #categories-tooltip { - padding: 0.5em 0.5em 0.5em 0; - } } - - @media (max-width: 3000px) { + @media (max-width: 1300px) { .content-container { - padding: 0; + height: 19em; margin: 0; - height: 28vw; - #categories-container { - padding: 2em 0 0.5em 0; + #categories-container, #categories-tooltip { + padding: 0 0 0 0.5em } } } @@ -222,10 +215,26 @@ .image-wrapper { position: relative; + overflow: hidden; - img { - width: 100%; - height: auto; + a { + color: $gw-white; + img { + transition: transform .5s; + } + + &:hover { + color: $gw-hover-buff; + + img { + transform: scale(1.3); + } + } + + img { + width: 100%; + height: auto; + } } .recent-title { @@ -241,7 +250,6 @@ h3 { font-size: 1em; - color: $gw-white; text-decoration: underline; &:hover { @@ -360,6 +368,7 @@ color: $gw-white; font-weight: bold; font-size: 1.5em; + transition: color 0.15s ease-in-out, background-color 0.15s ease-in-out; &:hover { background-color: $gw-hover-buff; diff --git a/app/assets/stylesheets/scholarspace/components/_search.scss b/app/assets/stylesheets/scholarspace/components/_search.scss index c9c039e7..aa82da8c 100644 --- a/app/assets/stylesheets/scholarspace/components/_search.scss +++ b/app/assets/stylesheets/scholarspace/components/_search.scss @@ -148,6 +148,13 @@ li.document { padding: 1em; + + &.blacklight-collection { + .col-md-2, + .col-md-10, + .collection-counts-wrapper { + display: none; + } &:nth-child(odd) { background-color: $gw-light-grey; diff --git a/app/views/hyrax/collections/_search_form.html.erb b/app/views/hyrax/collections/_search_form.html.erb index 68d4f4b9..6a764ece 100644 --- a/app/views/hyrax/collections/_search_form.html.erb +++ b/app/views/hyrax/collections/_search_form.html.erb @@ -3,7 +3,7 @@
<%= text_field_tag :cq, params[:cq], class: "collection-query form-control", placeholder: t('hyrax.collections.search_form.placeholder'), size: '30', type: "search", id: "collection_search" %>
-
diff --git a/app/views/hyrax/homepage/_home_categories_featured.html.erb b/app/views/hyrax/homepage/_home_categories_featured.html.erb index f26db246..5472b51d 100644 --- a/app/views/hyrax/homepage/_home_categories_featured.html.erb +++ b/app/views/hyrax/homepage/_home_categories_featured.html.erb @@ -4,12 +4,12 @@

Browse by Category