Skip to content

Commit

Permalink
Add dark mode theme to website (#139)
Browse files Browse the repository at this point in the history
  • Loading branch information
agriyakhetarpal authored May 6, 2024
2 parents f16a3e3 + d848d8f commit 4262061
Show file tree
Hide file tree
Showing 25 changed files with 1,407 additions and 1,337 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ in an online text editor (Visual Studio Code). Once the workspace is ready, you

1. Fork this repository
2. Install the extended version of Hugo from [https://gohugo.io/installation/](https://gohugo.io/installation/)
and add it to your `PATH`
and [`dart-sass`](https://sass-lang.com/dart-sass/) and add them to your `PATH`
3. Clone your forked repository and add the theme repository as a submodule,
from [https://github.com/scientific-python/scientific-python-hugo-theme](https://github.com/scientific-python/scientific-python-hugo-theme). You
may update the submodule and pull the latest changes with
Expand Down
173 changes: 12 additions & 161 deletions assets/css/overrides.css
Original file line number Diff line number Diff line change
@@ -1,168 +1,19 @@
/* Overrides for the PyBaMM hero on the homepage */
/* White backgrounds behind images */

/* We use these styles to provide precedence over submodule theme changes to come close
to near-parity with NumPy and SciPy websites (which use older versions of the theme) */


/* Make PyBaMM logo smaller */
.hero-logo {
max-height: 75px;
padding: 0px 0 0 15px;
}

/* Hero button should be left aligned */
.hero-cta {
padding: 15px 0;
display: flex;
flex-wrap: wrap;
align-self: normal;
}

/* Add space between navbar and hero, reduce distance between title and subtitle */
.hero-title-content {
margin: 6vh auto;
max-width: 1200px;
}

/* Move PyBaMM logo in hero to text superscript */
.hero-title {
align-content: auto;
align-items: normal;
display: flex;
flex-direction: row;
font-family: var(--fontFamily), sans-serif;
font-weight: 900;
font-size: 6em;
color: var(--colorPrimaryDark);
}

/* Removes padding between hero title and subtitle */
.hero-title {
padding: 0 0 0 0;
}

/* General improvements */

/* Do not induce padding on code blocks */
.highlight {
padding: 10px 0px;
}

/* Media settings for narrower screens */

@media only screen and (max-width: 1090px) {
.hero-content {
flex-direction: column;
padding: 0;
align-items: center;
}

.hero-title-content {
flex-direction: column;
align-items: center;
align-self: center;
justify-content: center;
}

button.cta-button {
align-items: center;
align-self: center;
}

.hero-cta {
align-self: center;
}

.flex-column {
/* align all items center */
align-items: center;
}

.footer-column {
padding-inline-end: 20px;
}
}

@media only screen and (max-width: 600px) {
.flex-column {
margin: 0 30px;
}

.hero-title {
font-size: 4em;
}

.hero-subtitle {
text-align: center;
padding-top: 20px;
}

.hero-cta {
align-self: center;
}

.hero-title {
flex-direction: column;
}

}

@media only screen and (max-width: 400px) {
.hero-title {
flex-direction: column;
}

.hero-logo {
align-self: center;
}
}

/* Accessibility improvements */

.footer-link, .footer-link:hover {
line-height: 2rem;
}

.copyright {
font-size: 16px;
}

.footer-link:hover {
color: var(--colorHighlight);
}

/* Individual highlights */

.cta-button:hover {
color: var(--colorHighlight);
}

.news-title a:hover, .news-date a:hover {
color: var(--colorHighlight);
}

/* Animations */

a, a:hover, a:active {
transition: color 0.25s ease-in-out;
}

/* Adjustments for headings */

.content-container h2, .content-container h3, .content-container h4, .content-container h5, .content-container h6 {
margin-top: 0.75rem;
}

.title:not(.is-spaced) + .subtitle {
margin-top: -0.2rem;
figure {
background-color: white;
padding: 15px;
border-radius: 15px;
}

/* Navigation bar dropdown */
/* Captions should be black above white background */

.navbar.is-fresh .navbar-item.has-dropdown .navbar-link {
color: var(--colorPrimaryDark);
figure figcaption p span {
color: black !important;
}

.navbar.is-fresh .navbar-item.has-dropdown .navbar-link:hover {
color: #4DABCF
/* Let table of contents inherit the bounds set by the
content-container class */
#TableOfContents {
position: inherit;
}
40 changes: 6 additions & 34 deletions config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,10 @@ markup:
unsafe: true

params:
title: PyBaMM Team # for copyright
title: PyBaMM website
description: "PyBaMM (Python Battery Mathematical Modelling) is an open-source battery simulation package written in Python."

author:
name: PyBaMM Team
# Privacy-preserving analytics
plausible:
dataDomain: pybamm.org
Expand Down Expand Up @@ -81,10 +82,7 @@ params:
- title: About PyBaMM
url: /about/
- title: Ionworks
url: https://ion-works.com/
is_external: true
- title: PyBaMM on Twitter
url: https://twitter.com/pybamm_/
url: https://ionworks.com/
is_external: true
- title: Governance
url: /governance/
Expand All @@ -94,32 +92,6 @@ params:
- title: News
url: /news/

- title: Contribute
url: /contribute/

# Grid of features
keyfeatures:
features:

- title: Enhanced Simulation Performance
text: PyBaMM enables efficient simulations of battery performance and aging, accelerating battery design and innovation.

- title: Modular Framework
text: The flexible nature of PyBaMM allows for quick model interchangeability, making it useful in different stages of battery R&D.

- title: Open Source
text: PyBaMM is open source, which means anyone can use, modify, and distribute the software. This makes it accessible to researchers worldwide,
enhancing global battery technology research.

- title: Comprehensive Model Library
text: PyBaMM's model library includes a wide range of physics-based models, making it a vital tool in diverse battery research.

- title: Detailed Visualization Tools
text: PyBaMM includes data visualization tools that enable researchers to better interpret their simulation results, facilitating the identification of trends and potential improvements.

- title: Python Ecosystem
text: PyBaMM can be combined with any of the advanced data science and machine learning tools in Python's extensive ecosystem.

footer:
logo: pybamm_logo_whitetext.svg
socialmediatitle: ""
Expand Down Expand Up @@ -156,7 +128,7 @@ params:
title: ""
links:
- text: Contact
link: /contact/
link: /community/

- text: Get involved
link: /contribute/
Expand All @@ -165,7 +137,7 @@ params:
link: /training/

- text: Ionworks
link: https://ion-works.com/
link: https://ionworks.com/

- text: News
link: /news/
Expand Down
2 changes: 1 addition & 1 deletion content/404.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ It looks like you've followed a broken link or entered a URL that doesn't exist

[Go back to PyBaMM Home](/)

Seeing something you shouldn't? Please feel free to [contact us](/contact) and let us know what you were looking for, or open
Seeing something you shouldn't? Please feel free to [contact us](/community) and let us know what you were looking for, or open
an issue on our [GitHub repository](https://www.github.com/pybamm-team/pybamm.org/issues).

<div style="height: 100px"></div>
2 changes: 1 addition & 1 deletion content/GOVERNANCE.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ handled on a case-by-case basis.

- [Ferran Brosa Planella](https://www.brosaplanella.xyz) - University of Warwick and Ionworks
- [Saransh Chopra](https://saransh-cpp.github.io) - Cluster Innovation Centre, University of Delhi
- Scott Marquis - Northvolt
- [Scott Marquis](https://se.linkedin.com/in/scottmar93) - Northvolt
- [Gregory Offer](https://www.imperial.ac.uk/people/gregory.offer) - Imperial College London
- [Valentin Sulzer](https://sites.google.com/view/valentinsulzer) - Ionworks
- [Martin Robinson](https://www.sabsr3.ox.ac.uk/people/dr-martin-robinson) - University of Oxford
Expand Down
47 changes: 47 additions & 0 deletions content/_index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
---
title: Homepage
---

{{< grid columns="1 2 2 3" >}}
[[item]]
type = 'card'
title = 'Enhanced Simulation Performance'
body = '''
PyBaMM enables efficient simulations of battery performance and aging, accelerating battery design and innovation.
'''

[[item]]
type = 'card'
title = 'Modular Framework'
body = '''
The flexible nature of PyBaMM allows for quick model interchangeability, making it useful in different stages of battery R&D.
'''

[[item]]
type = 'card'
title = 'Open Source'
body = '''
PyBaMM is open source, which means anyone can use, modify, and distribute the software. This makes it accessible to researchers worldwide, enhancing global battery technology research.
'''

[[item]]
type = 'card'
title = 'Comprehensive Model Library'
body = '''
PyBaMM's model library includes a wide range of physics-based models, making it a vital tool in diverse battery research.
'''

[[item]]
type = 'card'
title = 'Detailed Visualization Tools'
body = '''
PyBaMM includes data visualization tools that enable researchers to better interpret their simulation results, facilitating the identification of trends and potential improvements.
'''

[[item]]
type = 'card'
title = 'Python Ecosystem'
body = '''
PyBaMM can be combined with any of the advanced data science and machine learning tools in Python's extensive ecosystem.
'''
{{< /grid >}}
Loading

0 comments on commit 4262061

Please sign in to comment.