Skip to content

Commit

Permalink
collections results simplified temporarily and homepage JS incorporated
Browse files Browse the repository at this point in the history
  • Loading branch information
maxturer committed Mar 1, 2024
1 parent 457f9ca commit 19209ea
Show file tree
Hide file tree
Showing 6 changed files with 92 additions and 35 deletions.
41 changes: 41 additions & 0 deletions app/assets/javascripts/tooltip.js
Original file line number Diff line number Diff line change
@@ -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';
});
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
63 changes: 36 additions & 27 deletions app/assets/stylesheets/scholarspace/components/_homepage.scss
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
margin: 0 8em;

@media (max-width: 3000px) {
margin: 0;
margin: 0 1.5em;
}
}

Expand All @@ -43,7 +43,7 @@

//fix for large screens
@media (min-width: 1650px) {
font-size: 9vw;
font-size: 10vw;
}
}

Expand Down Expand Up @@ -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;
Expand All @@ -163,7 +164,7 @@
color: $gw-dark-blue;

@media (max-width: 1590px) {
width: 8em;
width: 9em;
}
}
}
Expand All @@ -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
}
}
}
Expand All @@ -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 {
Expand All @@ -241,7 +250,6 @@

h3 {
font-size: 1em;
color: $gw-white;
text-decoration: underline;

&:hover {
Expand Down Expand Up @@ -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;
Expand Down
7 changes: 7 additions & 0 deletions app/assets/stylesheets/scholarspace/components/_search.scss
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion app/views/hyrax/collections/_search_form.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<div class="input-group">
<%= 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" %>
<div class="input-group-btn">
<button type="submit" class="btn-base" id="collection_submit">
<button type="submit" class="btn-base gw-btn" id="collection_submit">
<span class="glyphicon glyphicon-search" aria-hidden="true"></span>
</button>
</div>
Expand Down
12 changes: 6 additions & 6 deletions app/views/hyrax/homepage/_home_categories_featured.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@
<h2 class="h2-section-header">Browse by Category</h2>
<div class="content-container">
<div id="categories-container">
<a class="btn-base btn-categories" href="/catalog?f%5Bhas_model_ssim%5D%5B%5D=GwEtd">Theses and Dissertations</a>
<a class="btn-base btn-categories">Journals</a>
<a class="btn-base btn-categories">Articles</a>
<a class="btn-base btn-categories">Posters</a>
<a class="btn-base btn-categories">Presentations</a>
<a class="btn-base btn-categories">Archival Materials</a>
<a class="btn-base btn-categories" id="etds" href="/catalog?f%5Bhas_model_ssim%5D%5B%5D=GwEtd">Theses and Dissertations</a>
<a class="btn-base btn-categories" id="journals" href="/catalog?f[resource_type_sim][]=Journal">Journals</a>
<a class="btn-base btn-categories" id="articles" href="/catalog?f[resource_type_sim][]=Article">Articles</a>
<a class="btn-base btn-categories" id="posters" href="/catalog?f[resource_type_sim][]=Poster">Posters</a>
<a class="btn-base btn-categories" id="presentations" href="/catalog?f[resource_type_sim][]=Presentation">Presentations</a>
<a class="btn-base btn-categories" id="materials" href="/catalog?f[resource_type_sim][]=Archival+materials">Archival Materials</a>
</div>
<div id="categories-tooltip">
<div id="arrow-left"></div>
Expand Down

0 comments on commit 19209ea

Please sign in to comment.