Skip to content

Commit 3c89180

Browse files
committed
Fix and update slider for larger contents ✨
1 parent bcd879c commit 3c89180

File tree

17 files changed

+166
-2387
lines changed

17 files changed

+166
-2387
lines changed

src/content/images/research/SharingisCaring.svg

Lines changed: 0 additions & 2340 deletions
This file was deleted.
Loading
Loading

src/content/images/research/rdm.png

57.1 KB
Loading
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
---
2+
img: biologicalDataScience.png
3+
index: 2
4+
---
5+
6+
# Biological data science
7+
8+
Modern technologies now allow researchers to simultaneously study biological organisms and processes across various molecular layers and in diverse biological contexts. To leverage this wealth of data, we are developing advanced methods for both supervised and unsupervised analysis of multi-modal omics data using cutting-edge machine learning and statistical modeling techniques. As part of fslabs.org, we contribute to the open-source data analysis library environment, ensuring that our innovations are accessible to the broader research community. Our methods enable comprehensive, data-driven integration and analysis of data derived from multiple omics technologies and varied biological scenarios, thereby enhancing our understanding of complex biological systems.

src/content/research/ml_models.md

Lines changed: 0 additions & 8 deletions
This file was deleted.
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
---
2+
img: predictionOmicsData.png
3+
index: 3
4+
---
5+
6+
# Prediction of acclimation modulators and integrators based on ‘omics data
7+
8+
Acclimation responses involve complex interactions among genes, proteins, and metabolites, resulting in both general and specific elements. Previously, we focused on extracting response-specific structural models from complex 'omics data using functional constraint aggregation and network topology inference.
9+
---
10+
Predicting modulators and integrators based on regulatory network topology and differential expression levels remains challenging, especially with limited acclimation data. However, incorporating additional regulatory characteristics of proteins—such as thermostability, aggregation propensity, intrinsic disorder, and post-translational modifications—can improve this identification.
11+
12+
This project proposes a novel approach using sequential meta-learning to integrate these regulatory characteristics, overcoming data sparsity challenges. In collaboration with CRC experimental groups, we will test our model’s predictions by introducing thermostable protein homologs into plant and algal cells. These experiments are expected to reduce acclimation capabilities and cause growth retardation, validating our approach in experimental evolution assays.

src/content/research/rdf.md

Lines changed: 0 additions & 8 deletions
This file was deleted.
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
---
2+
img: rdm.png
3+
index: 1
4+
---
5+
6+
# Research data management (RDM)
7+
8+
We are committed to the success of FAIR (Findable, Accessible, Interoperable, and Reusable) and open research data. Research data possess immense value, which, when combined with tomorrow's technologies such as machine and deep learning, can unlock answers to questions we cannot even conceive today. Therefore, the flexible contextualization of research data with machine-actionable metadata is essential to advance modern science.
9+
---
10+
We draw inspiration from the open-source software community's success, developing approaches that enable the biological community to collaboratively build a community-wide FAIR research data resource. Our research group participates in the National Research Data Infrastructure (NFDI) initiative with the DataPLANT project, which empowers plant researchers to engage in a thriving RDM ecosystem without barriers.

src/content/research/statistics.md

Lines changed: 0 additions & 9 deletions
This file was deleted.

src/generators/layout.fsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
#r "../_lib/Fornax.Core.dll"
22

3-
43
open Html
54

65
let rptu_navbar() =
@@ -77,7 +76,6 @@ let scaffold (ctx : SiteContents) bodyCnt =
7776
rptu_navbar()
7877
csb_navbar()
7978
main [Class "csb-content"] [
80-
// bodyCnt
8179
yield! bodyCnt
8280
]
8381

@@ -110,6 +108,7 @@ let scaffold (ctx : SiteContents) bodyCnt =
110108
})(document);
111109
"""
112110
]
111+
113112
]
114113
]
115114

src/generators/sections/research.fsx

Lines changed: 49 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,47 @@
55

66
open Html
77

8+
let private SliderHeight = "fit-content"
9+
let private createModalId(slide: Researchloader.FrameSlide) =
10+
sprintf "More-Content-Modal-%i" slide.Index
11+
12+
13+
let private createResearchModal(slide: Researchloader.FrameSlide) =
14+
let id = createModalId slide
15+
// Bulma Modal
16+
div [Class "modal"; HtmlProperties.Id id] [
17+
div [Class "modal-background"] []
18+
div [Class "modal-content"] [
19+
div [Class "box"] [
20+
div [Class "content"] [
21+
!!slide.MainContent
22+
match slide.MoreContent with
23+
| Some c ->
24+
!!c
25+
| None -> ()
26+
]
27+
]
28+
]
29+
button [Class "modal-close is-large"; HtmlProperties.Custom("aria-label", "close")] []
30+
]
31+
32+
33+
let private createMoreContentModalButton (slide: Researchloader.FrameSlide) =
34+
let id = createModalId slide
35+
div [] [
36+
// Trigger Button
37+
button [Class "button is-primary is-small js-modal-trigger"; HtmlProperties.Custom("data-target", id)] [
38+
!!"More"
39+
]
40+
]
841

942
let private createFrameSlide (slide: Researchloader.FrameSlide) =
1043
let innerFlexBoxContainer = HtmlProperties.Style [Display "flex"; CSSProperties.Height "100%"; AlignItems "center"]
1144
li [Class "splide__slide"] [
1245
// container
13-
div [Class "is-flex fixed-grid research__bg"; HtmlProperties.Style [CSSProperties.Height "100%"; AlignItems "center"; JustifyContent "center"]] [
14-
div [Class "grid research__grid"; HtmlProperties.Style [CSSProperties.Custom("justify-items", "end"); CSSProperties.Height "fit-content";]] [
15-
div [Class "cell research__cell"] [
46+
div [Class "is-flex fixed-grid research__bg has-1-cols-mobile"; HtmlProperties.Style [CSSProperties.Height "100%"; AlignItems "center"; JustifyContent "center"]] [
47+
div [Class "grid research__grid"; HtmlProperties.Style [CSSProperties.Custom("justify-items", "end"); CSSProperties.Height "fit-content"; CSSProperties.MaxHeight SliderHeight]] [
48+
div [Class "cell research__cell"; HtmlProperties.Style [CSSProperties.Width "100%"; CSSProperties.MaxWidth "unset"]] [
1649
div [innerFlexBoxContainer] [
1750
div [] [
1851
img [
@@ -27,7 +60,13 @@ let private createFrameSlide (slide: Researchloader.FrameSlide) =
2760
]
2861
div [Class "cell research__cell"] [
2962
div [innerFlexBoxContainer] [
30-
div [Class "content research__content"] [!!slide.Content]
63+
div [Class "content research__content"] [
64+
!!slide.MainContent
65+
match slide.MoreContent with
66+
| Some _ ->
67+
createMoreContentModalButton(slide)
68+
| None -> ()
69+
]
3170
]
3271
]
3372
]
@@ -39,7 +78,7 @@ let generate (ctx : SiteContents) (_: string) =
3978
ctx.TryGetValues<Researchloader.FrameSlide> ()
4079
|> Option.defaultValue Seq.empty
4180
|> Seq.toList
42-
div [HtmlProperties.Style [CSSProperties.Height "400px"]] [
81+
div [HtmlProperties.Style [CSSProperties.Height SliderHeight]] [
4382
section [Class "splide"; HtmlProperties.Custom("aria-label","current research information")] [
4483
// div [Class "splide__slider"] [
4584
// ]
@@ -64,8 +103,12 @@ let generate (ctx : SiteContents) (_: string) =
64103
]
65104
script [] [
66105
!!"""document.addEventListener( 'DOMContentLoaded', function() {
67-
var splide = new Splide( '.splide', { type: 'loop', autoplay: true } );
106+
var splide = new Splide( '.splide', { type: 'loop', autoplay: false } );
68107
splide.mount();
69108
} );"""
70109
]
110+
section [] [
111+
for researchSlide in researchList do
112+
createResearchModal researchSlide
113+
]
71114
]

src/loaders/researchloader.fsx

Lines changed: 31 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -39,22 +39,43 @@ module ContentReader =
3939
let frontmatter, content =
4040
fileContent
4141
|> Array.splitAt indexOfSeperator
42+
|> fun (x, y) -> x,y.[1..] //skip closing ---
43+
let moreContentIndex = content |> Array.tryFindIndex isSeparator
44+
let content, moreContent =
45+
match moreContentIndex with
46+
| Some i ->
47+
let content, moreContent = content |> Array.splitAt i
48+
content, Some moreContent.[1..] //skip closing ---
49+
| None ->
50+
content, None
4251
frontmatter
4352
|> Seq.choose splitKey
4453
|> Map.ofSeq
45-
|> fun x -> x.Add(
54+
|> fun x ->
55+
match moreContent with
56+
| None -> x
57+
| Some moreContent ->
58+
let moreContent = moreContent |> String.concat "\n"
59+
x.Add("more", moreContent)
60+
|> fun x ->
61+
x.Add(
4662
"content",
47-
content.[1..] //skip closing ---
63+
content
4864
|> String.concat "\n"
49-
)
65+
)
66+
5067

5168
type FrameSlide = {
52-
Content: string
69+
/// This will always be on the slider
70+
MainContent: string
71+
/// This is hidden behind "More" button. Only exists if content after empty line exists.
72+
MoreContent: string option
5373
Image: string option
5474
ImageUrl: string option
75+
Index: int
5576
} with
56-
static member create(content: string, ?image, ?imageurl) =
57-
{ Content = content; Image = image; ImageUrl = imageurl }
77+
static member create(content: string, index:int, ?moreContent, ?image, ?imageurl) =
78+
{ MainContent = content; Index = index; MoreContent = moreContent; Image = image; ImageUrl = imageurl }
5879

5980
let getImageUrl (imageName: string) =
6081
imgDir + imageName
@@ -65,10 +86,11 @@ let loadFile (filePath: string) =
6586
let lines = File.ReadAllLines(filePath)
6687
let metadata = ContentReader.getData lines
6788
let content = metadata.["content"] |> fun c -> Markdown.ToHtml(c, ContentReader.pipeline)
89+
let moreContent = metadata |> Map.tryFind "more" |> Option.map (fun mc -> Markdown.ToHtml(mc, ContentReader.pipeline))
6890
let image = metadata |> Map.tryFind key_image |> Option.map getImageUrl
6991
let imageUrl = metadata |> Map.tryFind key_image_url
7092
let index = metadata |> Map.tryFind "index" |> Option.map int |> Option.defaultValue System.Int32.MaxValue
71-
index, FrameSlide.create(content, ?image=image, ?imageurl=imageUrl)
93+
FrameSlide.create(content, index, ?moreContent=moreContent, ?image=image, ?imageurl=imageUrl)
7294

7395
let loader (projectRoot: string) (siteContent: SiteContents) =
7496
let postsPath = Path.Combine(projectRoot, contentDir)
@@ -77,8 +99,8 @@ let loader (projectRoot: string) (siteContent: SiteContents) =
7799
files
78100
|> Array.filter (fun n -> n.EndsWith ".md")
79101
|> Array.map (loadFile)
80-
|> Array.sortBy fst
81-
|> Array.map snd
102+
|> Array.sortBy (fun x -> x.Index)
103+
|> Array.mapi (fun i x -> { x with Index = i }) // make index unique
82104
|> Array.iter siteContent.Add
83105
// siteContent.Add({disableLiveRefresh = false})
84106
siteContent

src/style/css/main.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/style/css/main.css.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/style/js/main.js

Lines changed: 46 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,4 +163,49 @@ window.addEventListener('scroll', function() {
163163
if (scrollpos >= scrollChange) { add_class_on_scroll() }
164164
else { remove_class_on_scroll() }
165165
})
166-
/// End: change csb-navbar color on scroll to top
166+
/// End: change csb-navbar color on scroll to top
167+
168+
document.addEventListener('DOMContentLoaded', () => {
169+
// Functions to open and close a modal
170+
function openModal($el) {
171+
$el.classList.add('is-active');
172+
}
173+
174+
function closeModal($el) {
175+
$el.classList.remove('is-active');
176+
}
177+
178+
function closeAllModals() {
179+
(document.querySelectorAll('.modal') || []).forEach(($modal) => {
180+
closeModal($modal);
181+
});
182+
}
183+
184+
// Add a click event on buttons to open a specific modal
185+
(document.querySelectorAll('.js-modal-trigger') || []).forEach(($trigger) => {
186+
187+
$trigger.addEventListener('click', () => {
188+
const modal = $trigger.dataset.target;
189+
console.log("modal", modal)
190+
const $target = document.getElementById(modal);
191+
console.log("clicked", $target)
192+
openModal($target);
193+
});
194+
});
195+
196+
// Add a click event on various child elements to close the parent modal
197+
(document.querySelectorAll('.modal-background, .modal-close, .modal-card-head .delete, .modal-card-foot .button') || []).forEach(($close) => {
198+
const $target = $close.closest('.modal');
199+
200+
$close.addEventListener('click', () => {
201+
closeModal($target);
202+
});
203+
});
204+
205+
// Add a keyboard event to close all modals
206+
document.addEventListener('keydown', (event) => {
207+
if(event.key === "Escape") {
208+
closeAllModals();
209+
}
210+
});
211+
});

src/style/scss/sections/_research.scss

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,9 @@
1313
border-top-right-radius: 8px;
1414
border-bottom-right-radius: 8px;
1515
}
16-
@media (max-width: 639px) {
17-
border-radius: unset;
16+
17+
@media (max-width: 768px) {
18+
border-radius: unset;
1819
}
1920
}
2021

@@ -29,6 +30,10 @@
2930
max-width: 80%;
3031
column-gap: unset;
3132

33+
@media (max-width: 768px) {
34+
row-gap: unset; // Adjusted max-width for tiny screens
35+
}
36+
3237
@media (max-width: 639px) {
3338
max-width: unset; // Adjusted max-width for tiny screens
3439
}

0 commit comments

Comments
 (0)