Skip to content

Commit

Permalink
Applets page design (#524)
Browse files Browse the repository at this point in the history
* base layout

* layout + ARGO

* carousel component

* button functionality

* new images

* new pictures and descriptions

* Update carousel.tsx

* margin

* Link instead of router
  • Loading branch information
mlacadie authored Dec 19, 2024
1 parent 07c9a78 commit 1f1e41e
Show file tree
Hide file tree
Showing 10 changed files with 244 additions and 6 deletions.
1 change: 1 addition & 0 deletions screen2.0/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
"react-dom": "^18.3.1",
"react-dropzone": "^14.2.3",
"semantic-ui-react": "^2.1.5",
"swiper": "^11.1.15",
"umap-js": "1.4.0",
"umms-gb": "^3.10.0",
"uuid": "^10.0.0"
Expand Down
Binary file added screen2.0/public/ARGOSS.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added screen2.0/public/GWASPlaceHolder.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added screen2.0/public/GWASSS.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added screen2.0/public/GeneExpressionPlaceHolder.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added screen2.0/public/GeneExpressionSS.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added screen2.0/public/argo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
129 changes: 129 additions & 0 deletions screen2.0/src/app/applets/carousel.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,129 @@
import React from "react";
import { Swiper, SwiperSlide } from "swiper/react";
import { Navigation, Pagination, Autoplay, EffectFade } from "swiper/modules";
import { Box, Button, Stack, Typography } from "@mui/material";
import "swiper/swiper-bundle.css";
import { createTheme, ThemeProvider } from "@mui/material/styles";
import ArrowForwardIcon from '@mui/icons-material/ArrowForward';
import Link from "next/link";

const theme = createTheme({
components: {
MuiButton: {
styleOverrides: {
root: {
textTransform: "none",
backgroundColor: "#030f98",
color: "white",
borderRadius: "8px",
boxShadow: "0px 4px 10px rgba(0, 0, 0, 0.2)",
fontSize: "16px",
fontWeight: "500",
padding: "8px 20px",
width: "fit-content",
position: "relative",
"&:hover": {
backgroundColor: "#021170",
},
},
},
},
},
});

// Slide Data
const slides = [
{
id: 1,
image: "/GeneExpressionSS.png",
text: "Gene Expression",
description: "Dive into comprehensive gene expression data across 324 human and 78 mouse datasets. Explore how genes are expressed in hundreds of cell and tissue types, providing valuable insights into their regulatory and functional roles. This tool enables researchers to identify context-specific expression patterns for their genes of interest.",
link: "../applets/gene-expression",
},
{
id: 2,
image: "/GWASSS.png",
text: "GWAS",
description: "Analyze over 1 million variants associated with human phenotypes and diseases through the lens of cCRE overlap. This app helps prioritize causal variants by linking genetic associations to potential regulatory elements. Gain a deeper understanding of the regulatory landscape underlying complex traits and diseases.",
link: "../applets/gwas",
},
// {
// id: 3,
// image: "/ARGOSS.png",
// text: "ARGO",
// description: "ARGO (Aggregate Rank Generator), allows users to input a set of candidate variants and obtain a prioritized list based on overlapping annotations",
// link: ""
// },
];

const ExpandableCarousel = () => {

return (
<ThemeProvider theme={theme}>
<Swiper
modules={[Navigation, Pagination, Autoplay, EffectFade]}
effect="fade"
speed={1000}
slidesPerView={1}
pagination={{ clickable: true }}
navigation
loop
autoplay={{
delay: 5000,
disableOnInteraction: true,
}}
>
{slides.map((slide) => (
<SwiperSlide key={slide.id}>
<Box
sx={{
display: "flex",
alignItems: "center",
height: "60vh",
position: "relative",
}}
>
<Box
sx={{
flex: 1,
height: "100%",
backgroundColor: "#101720",
color: "white",
display: "flex",
justifyContent: "center",
alignItems: "center",
padding: 3,
}}
>
<Stack justifyContent={"center"} alignItems={"center"} spacing={3} paddingX={3}>
<Typography variant="h5" textAlign="center" gutterBottom>
{slide.text}
</Typography>
<Typography variant="body1" textAlign="center" gutterBottom>
{slide.description}
</Typography>
<Button
LinkComponent={Link}
href={slide.link}
disabled={slide.text === "ARGO"}>Learn More<ArrowForwardIcon sx={{ marginLeft: "8px" }} />
</Button>
</Stack>
</Box>
<Box
sx={{
flex: 2,
height: "100%",
backgroundImage: `linear-gradient(to right, #101720, transparent), url(${slide.image})`,
backgroundSize: "cover",
backgroundPosition: "center",
}}
/>
</Box>
</SwiperSlide>
))}
</Swiper>
</ThemeProvider>
);
};

export default ExpandableCarousel;
112 changes: 106 additions & 6 deletions screen2.0/src/app/applets/page.tsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,114 @@
"use client"

import { Typography } from "@mui/material"
import { Box, Button, Divider, IconButton, Stack, Typography } from "@mui/material";
import Grid from "@mui/material/Grid2"
import ExpandMoreIcon from '@mui/icons-material/ExpandMore';
import React from "react";
import Carousel from "./carousel";
import Link from "next/link";

export default function Applets() {

const applets = [
{
id: 1,
title: "Gene Expression",
description: "Explore gene expression patterns across hundreds of cell and tissue types",
imageUrl: "/GeneExpressionPlaceHolder.png",
link: "../applets/gene-expression",
buttonText: "Explore Genes"
},
{
id: 2,
title: "GWAS",
description: "Investigate the overlap between cCREs and GWAS results to prioritize causal variants and identify potential regulatory mechanisms.",
imageUrl: "/GWASPlaceHolder.png",
link: "../applets/gwas",
buttonText: "Explore Studies"
},
// {
// id: 3,
// title: "ARGO",
// description: "Rank genomic regions based on overlapping annotations",
// imageUrl: "/argo.png",
// link: "",
// buttonText: "Under Construction"
// },
];

return (
<main>
<Typography>
This is the applets page <br />
Here we can have info on the different applets
</Typography>
<Carousel />
<Divider variant="middle" sx={{ mx: 40, mb: 2, mt: 2 }}>
<Stack justifyContent={"center"} alignItems={"center"} sx={{ mx: 5 }}>
<Typography variant="h4">Applets</Typography>
<IconButton
onClick={() => {
window.scrollTo({ top: window.innerHeight * 0.6, behavior: 'smooth' });
}}
>
<ExpandMoreIcon />
</IconButton>
</Stack>
</Divider>
{applets.map((applet, index) => (
<React.Fragment key={applet.id}>
<Box
paddingX={5}
>
<Grid container alignItems="center" justifyContent="center" spacing={10}>
{index % 2 === 0 ? (
<>
<Grid size={3}>
<Typography variant="h4" gutterBottom>
{applet.title}
</Typography>
<Typography variant="body1" gutterBottom>
{applet.description}
</Typography>
<Button
LinkComponent={Link}
variant="contained" color="primary" href={applet.link} disabled={applet.buttonText === "Under Construction"}>
{applet.buttonText}
</Button>
</Grid>
<Grid size={3}>
<img
src={applet.imageUrl}
alt={applet.title}
style={{ width: "100%", borderRadius: "8px" }}
/>
</Grid>
</>
) : (
<>
<Grid size={3}>
<img
src={applet.imageUrl}
alt={applet.title}
style={{ width: "100%", borderRadius: "8px" }}
/>
</Grid>
<Grid size={3}>
<Typography variant="h4" gutterBottom>
{applet.title}
</Typography>
<Typography variant="body1" gutterBottom>
{applet.description}
</Typography>
<Button
LinkComponent={Link}
variant="contained" color="primary" href={applet.link}>
{applet.buttonText}
</Button>
</Grid>
</>
)}
</Grid>
</Box>
{index < applets.length - 1 && <Divider variant="middle" sx={{ my: 4, mx: 40 }} />}
</React.Fragment>
))}
</main>
)
);
}
8 changes: 8 additions & 0 deletions screen2.0/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -8183,6 +8183,7 @@ __metadata:
react-dom: "npm:^18.3.1"
react-dropzone: "npm:^14.2.3"
semantic-ui-react: "npm:^2.1.5"
swiper: "npm:^11.1.15"
typescript: "npm:5.6.2"
typescript-eslint: "npm:^8.18.0"
umap-js: "npm:1.4.0"
Expand Down Expand Up @@ -8667,6 +8668,13 @@ __metadata:
languageName: node
linkType: hard

"swiper@npm:^11.1.15":
version: 11.1.15
resolution: "swiper@npm:11.1.15"
checksum: 10/044b7fd031392192a896b4dd8ba92231aaa6b9b5fad5ad9e471f48fe463d563eef2501855e6bde41b4f3968d33361e01ad49ff2bdaa1f6d9c5ae8325171a3f3c
languageName: node
linkType: hard

"symbol-observable@npm:^4.0.0":
version: 4.0.0
resolution: "symbol-observable@npm:4.0.0"
Expand Down

0 comments on commit 1f1e41e

Please sign in to comment.