Skip to content

Commit

Permalink
Merge pull request #44 from SciCatProject/ui-updates-pt2
Browse files Browse the repository at this point in the history
New ui updates
  • Loading branch information
nitrosx authored Jan 9, 2024
2 parents a57e5d4 + 11563eb commit dd71d1b
Show file tree
Hide file tree
Showing 7 changed files with 112 additions and 28 deletions.
33 changes: 22 additions & 11 deletions _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ description: >- # this means to ignore newlines until "baseurl:"
baseurl: "" # the subpath of your site, e.g. /blog
url: "http://scicatproject.github.io" # the base hostname & protocol for your site, e.g. http://example.com

version: 2.1.0
last_updated: 2023/10/31
version: 2.2.0
last_updated: 2024/01/09

pill_1:
icon: fa-gears
Expand Down Expand Up @@ -74,6 +74,16 @@ feature_4:
text: Fully open source with a committed and welcoming team of developers.
attribution: (Photo by <a href="https://unsplash.com/@timmossholder?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Tim Mossholder</a> on <a href="https://unsplash.com/s/photos/open-source?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Unsplash</a>)


backend_release:
url: https://github.com/SciCatProject/scicat-backend-next
version: Elastic Search, v4.4.0

frontend_release:
url: https://github.com/SciCatProject/frontend
version: Elastic Search, v4.4.0


facilities:
- image: /assets/images/ess_logo.png
url: https://www.ess.eu
Expand Down Expand Up @@ -117,15 +127,15 @@ team:
- name: Björn Pedersen
company: Heinz Maier-Leibnitz Zentrum
email:
role: PR and issue review Leader
role: PR and Issue Review Leader
- name: Daphne van Dijken
company: Max IV
email:
role: Release 4.4 Leader
- name: Max Novelli
company: ESS
role: Release Jobs Leader
- name: Igor Khokhriakov
company: DESY
email:
role: Release 4.5 Leader
role: Release Search UI Leader
collaborators:
- name: Junjie Quan
company: European Spallation Source
Expand All @@ -148,15 +158,16 @@ team:


efforts:
- name: Release 4.4
- name: Release Jobs
type: release
leader: Daphne Van Dijken
description: Complete migration and refactor of jobs in backend v4.x
link: https://github.com/orgs/SciCatProject/projects/3
- name: Release 4.5
- name: Release Search UI
type: release
description: Improve search functionalities and UI
link: https://github.com/orgs/SciCatProject/projects/4
leader: Igor Khokhriakov
description: Improving usability of frontend search UI and adding needed functionality to backend
link: https://github.com/orgs/SciCatProject/projects/5
- name: pySciCat
type: official project
description: Low level python library that offers each endpoint as function in python. It requires a good level of knowledge of SciCat backend. Suggested for developing third party applications that will interface with SciCat, like data ingestors, dedicated custom UIs, or ETL processes retrieving data from and storing results in SciCat
Expand Down
2 changes: 1 addition & 1 deletion _includes/footer.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<div class="container">
<div class="row">
<div class="col-lg-4 col-sm-12 text-center">
<p class="text-muted mb-4 mb-lg-0">&copy; SciCat 2020-2023. All Rights Reserved.</p>
<p class="text-muted mb-4 mb-lg-0">&copy; SciCat 2020-<script>document.write(new Date().getFullYear())</script>. All Rights Reserved.</p>
</div>
<div class="col-lg-4 col-sm-12 text-center">
<p class="text-muted mb-4 mb-lg-0">Version: {{ site.version }}</p>
Expand Down
2 changes: 1 addition & 1 deletion _includes/header.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<header class="masthead text-white text-center">
<header id="header-logo" class="masthead text-white text-center">
<div class="overlay"></div>
<div class="container">
<div class="row">
Expand Down
11 changes: 8 additions & 3 deletions _includes/intro.html
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,12 @@ <h2>{{ site.feature_4.title }}</h2>
</div>
</div>
</section>
<section class="latest">
<h3>Latest Releases</h3>
<h4>
<a href="{{ site.backend_release.url }}" target="_blank">Backend</a>: {{ site.backend_release.version }}
|
<a href="{{ site.frontend_release.url }}" target="_blank">Frontend</a>: {{ site.frontend_release.version }}
</h4>
</section>
</section>



63 changes: 55 additions & 8 deletions _includes/nav.html
Original file line number Diff line number Diff line change
@@ -1,40 +1,87 @@
<script>
onClick = (event) => {
// Map element Ids to the respective navbar item
const sections = {
intro: "nav-link-intro",
facilities: "nav-link-facilities",
team: "nav-link-team",
effort: "nav-link-effort",
resources: "nav-link-resources"
};

// Remove class "active" from all navbar items
function deactivateNavLinks() {
let navLinks = document.querySelectorAll(".nav-link");
for (let i = 0; i < navLinks.length; i++) {
navLinks[i].classList.remove("active");
}
}

// Given a specific element Id, check if the element is currenty visible on the screen
function isElementVisible(elemId) {
let elm = document.getElementById(elemId).getBoundingClientRect();
let viewHeight = Math.max(document.documentElement.clientHeight, window.innerHeight);
return !(elm.bottom < 0 || elm.top - viewHeight >= 0);
}

/*
1. Indicate the active section, by changing the navbar item background color.
Changes are applied either when clicking on a navbar item or when reaching a section by scrolling.
When scrolling all the way to the top of the page, highlight the navbar item "Home".
2. Show or hide the project logo from the left corner of the navbar, depending on the scroll position.
Hide it when the intro section logo appears on screen.
*/
onClick = (event) => {
deactivateNavLinks();
event.target.classList.add("active");
}

function activateNavLink(id) {
deactivateNavLinks();
document.getElementById(id).classList.add("active");
}

window.onscroll = function() {
Object.keys(sections).forEach((elemId) => {
if (window.scrollY == 0) {
activateNavLink("nav-link-home");
}
else if (isElementVisible(elemId)) {
activateNavLink(sections[elemId]);
}
});

// show/hide logo
document.getElementById("nav-logo").style.display = isElementVisible("header-logo") ? "none" : "block";
};
</script>

<nav class="navbar fixed-top affix-top navbar-expand-lg navbar-light bg-light navbar-fixed-top">
<div class="container-fluid">
<div class="navbar-header">
<a class="navbar-brand" href="#"><img src="assets/images/SciCat_logo_full_100x48.png"></a>
<a id="nav-logo" class="navbar-brand" href="#"><img src="assets/images/SciCat_logo_full_100x48.png"></a>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
</div>
<div class="navbar-menu collapse navbar-collapse justify-content-center" id="navbarSupportedContent">
<ul class="nav navbar-nav nav-pills mb-2 mb-lg-0">
<li class="nav-item mx-lg-3">
<a class="page-scroll nav-link active" aria-current="page" href="#" onclick="onClick(event);">Home</a>
<a class="page-scroll nav-link active" id="nav-link-home" aria-current="page" href="#" onclick="onClick(event);">Home</a>
</li>
<li class="nav-item mx-lg-3">
<a class="page-scroll nav-link" href="#intro" onclick="onClick(event);">Intro</a>
<a class="page-scroll nav-link" id="nav-link-intro" href="#intro" onclick="onClick(event);">Intro</a>
</li>
<li class="nav-item mx-lg-3">
<a class="page-scroll nav-link" href="#facilities" onclick="onClick(event);">Facilities</a>
<a class="page-scroll nav-link" id="nav-link-facilities" href="#facilities" onclick="onClick(event);">Facilities</a>
</li>
<li class="nav-item mx-lg-3">
<a class="page-scroll nav-link" href="#team" onclick="onClick(event);">Team</a>
<a class="page-scroll nav-link" id="nav-link-team" href="#team" onclick="onClick(event);">Team</a>
</li>
<li class="nav-item mx-lg-3">
<a class="page-scroll nav-link" href="#effort" onclick="onClick(event);">Effort</a>
<a class="page-scroll nav-link" id="nav-link-effort" href="#effort" onclick="onClick(event);">Effort</a>
</li>
<li class="nav-item mx-lg-3">
<a class="page-scroll nav-link" href="#resources" onclick="onClick(event);">Resources</a>
<a class="page-scroll nav-link" id="nav-link-resources" href="#resources" onclick="onClick(event);">Resources</a>
</li>
</div>
</nav>
1 change: 0 additions & 1 deletion _layouts/home.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
{% include nav.html %}
{% include header.html %}
{% include intro.html %}
{% include breaker.html %}
{% include facilities.html %}
{% include breaker.html %}
{% include team.html %}
Expand Down
28 changes: 25 additions & 3 deletions _sass/base.scss
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,11 @@ h1, h2, h3, h4, h5 {
top: 5px;
left: 5px;
}

#nav-logo {
display: none;
}

.navbar-menu {
padding-left: 120px;
padding-right: 120px;
Expand All @@ -57,7 +62,6 @@ header.masthead {
background: url("/assets/images/bg-masthead.jpg") no-repeat center center;
background-size: cover;
padding-top: 2rem;
padding-bottom: 2rem;
height: 62vh;

.overlay {
Expand Down Expand Up @@ -90,8 +94,10 @@ header.masthead {
}

.pills-icons {
padding-top: 3rem;
padding-bottom: 3rem;
.container {
margin-top: 4rem;
margin-bottom: 4rem;
}

.pills-icons-item {
max-width: 20rem;
Expand Down Expand Up @@ -164,6 +170,22 @@ header.masthead {
}
}

.latest {
margin-top: 3rem;
margin-bottom: 4rem;
padding: 7px 0;
background-color: rgba(0, 0, 0, 0.831);
color: white;
text-align: center;

h4 {
font-weight: 500;
}
a {
color: white;
}
}

.facility {
margin-bottom: 30px !important;
}
Expand Down

0 comments on commit dd71d1b

Please sign in to comment.