diff --git a/docs/10_domains/30_pharmaceutical_chemistry.mdx b/docs/10_domains/30_pharmaceutical_chemistry.mdx index eb0e7aa6..1e8efc59 100644 --- a/docs/10_domains/30_pharmaceutical_chemistry.mdx +++ b/docs/10_domains/30_pharmaceutical_chemistry.mdx @@ -3,7 +3,6 @@ title: "Medicinal / Pharmaceutical Chemistry" slug: "/pharmaceutical_chemistry" --- -import Methods from "@site/src/components/Methods.js"; import { LbeChip } from "@site/src/components/lbe/LbeElements.js"; import ElnFinderPharm from "@site/src/components/eln/ElnFinderPharm.js"; diff --git a/src/components/BulletBox.js b/src/components/BulletBox.js index 7ab17142..e4531556 100644 --- a/src/components/BulletBox.js +++ b/src/components/BulletBox.js @@ -1,18 +1,20 @@ +import clsx from "clsx"; + function BulletContainer({ children }) { - return
{children}
; + return
{children}
; } function BulletBox({ children, secondary }) { - let boxStyle = secondary ? "button--secondary" : "button--primary"; + let boxStyle = secondary ? "button--secondary" : "button--primary"; - return ( -
- {children} -
- ); + return ( +
+ {children} +
+ ); } export { BulletContainer, BulletBox }; diff --git a/src/components/IntroButton.js b/src/components/IntroButton.js index 1ea56e22..5c05bb8c 100644 --- a/src/components/IntroButton.js +++ b/src/components/IntroButton.js @@ -1,17 +1,19 @@ -import React from "react"; import useBaseUrl from "@docusaurus/useBaseUrl"; -import styles from "./N4CFeatures.module.css"; +import styles from "@site/src/css/N4CFeatures.module.css"; +import clsx from "clsx"; export default function IntroButton(props) { return ( -
+
diff --git a/src/components/N4CFeatures.js b/src/components/N4CFeatures.js index 04beb372..43e40ebb 100644 --- a/src/components/N4CFeatures.js +++ b/src/components/N4CFeatures.js @@ -2,7 +2,8 @@ import Link from "@docusaurus/Link"; import useBaseUrl from "@docusaurus/useBaseUrl"; import Translate from "@docusaurus/Translate"; -import styles from "./N4CFeatures.module.css"; +import styles from "@site/src/css/N4CFeatures.module.css"; +import clsx from "clsx"; const features = { entry: [ @@ -107,7 +108,7 @@ const features = { function Feature({ title, svg, link, style }) { return ( -
+
{link ? ( { - let value = style.chemotionCarouselDot; - if (currentPage === index) { - value += " " + style.chemotionCarouselDotActive; - } - return value; - }; + const className = (index) => { + let value = styles.chemotionCarouselDot; + if (currentPage === index) { + value += " " + styles.chemotionCarouselDotActive; + } + return value; + }; - return ( -
- {[...Array(totalPages)].map((_, index) => ( - goToPage(index)} - className={className(index)} - > - • - - ))} -
- ); + return ( +
+ {[...Array(totalPages)].map((_, index) => ( + goToPage(index)} + className={className(index)} + > + • + + ))} +
+ ); } -function ChemotionCarousel({icon, images}) { - return ( -
- {icon.alt} -
- } - > - {images.map((image, index) => ( - {image.alt} - ))} - -
-
- ); +function ChemotionCarousel({ icon, images }) { + return ( +
+ {icon.alt} +
+ } + > + {images.map((image, index) => ( + {image.alt} + ))} + +
+
+ ); } export default ChemotionCarousel; diff --git a/src/components/chemotion/ChemotionLifecycle.js b/src/components/chemotion/ChemotionLifecycle.js index c823d80f..6107d916 100644 --- a/src/components/chemotion/ChemotionLifecycle.js +++ b/src/components/chemotion/ChemotionLifecycle.js @@ -1,197 +1,158 @@ import Link from "@docusaurus/Link"; import Translate from "@docusaurus/Translate"; -import styles from "./ChemotionLifecycle.module.css"; +import styles from "@site/src/css/ChemotionLifecycle.module.css"; const ChemotionLifecycle = () => { - return ( -
- - - - - - Experiment - - - Design - - - - - - + return ( +
+ + + + + + Experiment + + + Design + + + + + + - - - - Experiment - - - - + + + + Experiment + + + + - - - - Analysis - - - - + + + + Analysis + + + + - - - - Data Collection & - - - Processing - - - - + + + + Data Collection & + + + Processing + + + + - - - - Data - - - Publication - - - - + + + + Data + + + Publication + + + + - - - - Re-use - - - - - + + + + Re-use + + + + + - + - - -
- ); + + +
+ ); }; export default ChemotionLifecycle; diff --git a/src/components/commons/FloatImage.js b/src/components/commons/FloatImage.js index 58d6d616..7d57f5e7 100644 --- a/src/components/commons/FloatImage.js +++ b/src/components/commons/FloatImage.js @@ -1,7 +1,7 @@ import useBaseUrl from "@docusaurus/useBaseUrl"; import Link from "@docusaurus/Link"; -import styles from "./FloatImage.module.css"; +import styles from "@site/src/css/FloatImage.module.css"; function FloatImage({ url, alt, ...props }) { // Object for custom styles diff --git a/src/components/commons/ShortenDesc.js b/src/components/commons/ShortenDesc.js index 1d0ac69f..0b0bf49c 100644 --- a/src/components/commons/ShortenDesc.js +++ b/src/components/commons/ShortenDesc.js @@ -1,43 +1,41 @@ import React, { useState } from "react"; +import styles from "@site/src/css/ShortenDesc.module.css"; + // shorten the description of the experiment up to the next blank, comma or period after 100 characters function ShortenDesc({ desc, length }) { - const [collapsed, setCollapsed] = useState(true); + const [collapsed, setCollapsed] = useState(true); - if (desc.length <= length) { - return {desc}; - } + if (desc.length <= length) { + return {desc}; + } - return ( - - {collapsed ? ( - setCollapsed(!collapsed)} - style={{ cursor: "pointer" }} - > - {desc.slice(0, length) + - desc.slice(length).split(/[\s,\.]/)[0] + - " ..."} + return ( + + {collapsed ? ( + setCollapsed(!collapsed)} + style={{ cursor: "pointer" }} + > + {desc.slice(0, length) + + desc.slice(length).split(/[\s,\.]/)[0] + + " ..."} - - - ) : ( - setCollapsed(!collapsed)} - style={{ cursor: "pointer" }} - > - {desc} - - - )} - - ); + + + ) : ( + setCollapsed(!collapsed)} + style={{ cursor: "pointer" }} + > + {desc} + + + )} + + ); } export default ShortenDesc; diff --git a/src/components/KbTagCloud.js b/src/components/deprecated/KbTagCloud.js similarity index 100% rename from src/components/KbTagCloud.js rename to src/components/deprecated/KbTagCloud.js diff --git a/src/components/Methods.js b/src/components/deprecated/Methods.js similarity index 100% rename from src/components/Methods.js rename to src/components/deprecated/Methods.js diff --git a/src/components/eln/Eln.module.css b/src/components/eln/Eln.module.css deleted file mode 100644 index 24a2f225..00000000 --- a/src/components/eln/Eln.module.css +++ /dev/null @@ -1,126 +0,0 @@ -/********** ELN-Finder ************/ - -.eln { - display: flex; - flex-direction: row; - flex-wrap: wrap; - justify-content: space-between; -} - -/* Search / Filter section */ - -.eln__searchfilter { - display: flex; - flex-direction: row; - width: 100%; - padding: 0.75rem; - border: 1px dashed var(--ifm-color-primary); - margin-bottom: 0.5rem; -} - -.eln__searchfilter__text { - translate: 0 20%; - min-width: 240px; -} - -.eln__searchfilter__buttons { - flex-grow: 1; -} - -.eln__searchfilter__search { - display: flex; - flex-direction: column; - padding: 0.5rem 0; -} - -.eln__searchfilter__search > span { - text-align: center; -} - -.eln__searchfilter__search > em { - color: var(--ifm-color-primary); - text-align: center; -} - -.eln__searchfilter__search__button { - position: absolute; - right: 1.5rem; - top: 50%; - transform: translate(0, -50%); - padding: 0; - background: none; - border: none; - line-height: 1rem; -} - -.eln__card { - width: 49.5%; - padding: 0.75rem; - border: 1px dashed var(--ifm-color-primary); - margin-bottom: 0.5rem; - transition: all var(--n4c-transform-time) ease-in-out; -} - -.eln__card__header { - display: flex; - justify-content: space-between; - align-items: center; -} - -.eln__card__desc { - padding: 0.5rem; -} - -@media screen and (max-width: 1400px) { - .eln { - display: flex; - flex-direction: column; - } - - .eln__searchfilter { - display: flex; - flex-direction: column; - align-items: center; - width: 100%; - padding: 0.75rem; - border: 1px dashed var(--ifm-color-primary); - margin-bottom: 0.75rem; - } - - .eln__searchfilter__text, - .eln__searchfilter__buttons { - width: 100%; - translate: 0; - } - - .eln__searchfilter__search { - display: flex; - flex-direction: row; - align-items: center; - } - - .eln__card { - width: 100%; - padding: 0.75rem; - border: 1px dashed var(--ifm-color-primary); - margin-bottom: 0.75rem; - transition: all var(--n4c-transform-time) ease-in-out; - } -} - -.eln__card__link { - display: flex; - padding: 0.5rem; -} - -.eln__licenseChip--opensource { - background-color: var(--ifm-color-primary); - color: white; - font-weight: bold; -} - -.eln__filterbutton--secondary { - background-color: var(--ifm-breadcrumb-item-background-active); - color: var(--ifm-color-primary); - font-weight: unset; -} diff --git a/src/components/eln/ElnCard.js b/src/components/eln/ElnCard.js index 7da873ad..8c50852f 100644 --- a/src/components/eln/ElnCard.js +++ b/src/components/eln/ElnCard.js @@ -3,43 +3,43 @@ import RepoButton from "@site/src/components/repos/RepoButton"; import FilterButton from "./elnFilter/FilterButton.js"; import ShortenDesc from "../commons/ShortenDesc.js"; -import styles from "./Eln.module.css"; +import styles from "@site/src/components/eln/ElnStyles"; function ElnCard({ eln, filter, setFilter }) { - return ( -
-
-

{eln.name}

- -
- -
- -
- {eln.subDisc && eln.subDisc.length > 0 && ( -
- {eln.subDisc.map((subdisc, idx) => { - let isActive = filter.subDisc === subdisc; - return ( - - ); - })} -
- )} + return ( +
+
+

{eln.name}

+ +
+ +
+ +
+ {eln.subDisc && eln.subDisc.length > 0 && ( +
+ {eln.subDisc.map((subdisc, idx) => { + let isActive = filter.subDisc === subdisc; + return ( + + ); + })}
- ); + )} +
+ ); } export default ElnCard; diff --git a/src/components/eln/ElnFinder.js b/src/components/eln/ElnFinder.js index ae8d8d17..25e077d9 100644 --- a/src/components/eln/ElnFinder.js +++ b/src/components/eln/ElnFinder.js @@ -6,163 +6,154 @@ import ElnStatus from "./ElnStatus"; import ElnFilter from "./elnFilter/ElnFilter"; import ElnStack from "./ElnStack"; -import styles from "./Eln.module.css"; - +import styles from "@site/src/components/eln/ElnStyles"; // const elnData = require("@site/static/assets/eln_test.json"); function ElnFinder(props) { - // State for ELN data - - const [elnData, setElnData] = useState(null); - const [error, setError] = useState(null); - - // State for filtering + // State for ELN data - const [filter, setFilter] = useImmer( - props.subDisc ? { subDisc: props.subDisc } : {} - ); + const [elnData, setElnData] = useState(null); - // Fetch ELN data + // State for filtering - useEffect(() => { - fetch("../../assets/elnData.json") - .then((response) => response.json()) - .then((data) => { - setElnData(data); - console.log(data); - }) - .catch((error) => { - setError(error); - console.error(error); - }); - }, []); + const [filter, setFilter] = useImmer( + props.subDisc ? { subDisc: props.subDisc } : {}, + ); - // Catch if fetch is still loading + // Fetch ELN data - if (!elnData) { - return Loading...; - } - - // Define working variables - - let elnTable = []; - let allSubDisc = []; - let allLicenses = []; - - // Parse timestamp of ELN data - - const dateDownloaded = moment(elnData.date); - const relativeDate = moment(dateDownloaded).fromNow(); - - // Assemble essential ELN data - - try { - const chemElns = elnData["_embedded"].searchResult["_embedded"].objects; - - chemElns.map((eln) => { - let subDisc = []; - eln["_embedded"].indexableObject.metadata["dc.subject"].map( - (discipline) => - discipline.value.startsWith("Chemistry:") - ? subDisc.push(discipline.value.split(":")[1]) - : null - ); - - elnTable.push({ - name: eln["_embedded"].indexableObject.name, - url: eln["_embedded"].indexableObject.metadata[ - "dc.identifier.uri" - ][0].value, - license: - eln["_embedded"].indexableObject.metadata[ - "K.lizenzmodell" - ][0].value, - desc: eln["_embedded"].indexableObject.metadata[ - "dc.description.abstract" - ][0].value, - subDisc: subDisc, - }); - allSubDisc.push(subDisc); - allLicenses.push( - eln["_embedded"].indexableObject.metadata["K.lizenzmodell"][0] - .value - ); - }); - - allSubDisc = [...new Set(allSubDisc.flat())]; - allLicenses = [...new Set(allLicenses)]; - } catch (error) { + useEffect(() => { + fetch("../../assets/elnData.json") + .then((response) => response.json()) + .then((data) => { + setElnData(data); + console.log(data); + }) + .catch((error) => { console.error(error); - return Failed to process ELN data.; - } - - // Filter ELN data based on filter state + }); + }, []); + + // Catch if fetch is still loading + + if (!elnData) { + return Loading...; + } + + // Define working variables + + let elnTable = []; + let allSubDisc = []; + let allLicenses = []; + + // Parse timestamp of ELN data + + const dateDownloaded = moment(elnData.date); + const relativeDate = moment(dateDownloaded).fromNow(); + + // Assemble essential ELN data + + try { + const chemElns = elnData["_embedded"].searchResult["_embedded"].objects; + + chemElns.map((eln) => { + let subDisc = []; + eln["_embedded"].indexableObject.metadata["dc.subject"].map( + (discipline) => + discipline.value.startsWith("Chemistry:") + ? subDisc.push(discipline.value.split(":")[1]) + : null, + ); + + elnTable.push({ + name: eln["_embedded"].indexableObject.name, + url: eln["_embedded"].indexableObject.metadata["dc.identifier.uri"][0] + .value, + license: + eln["_embedded"].indexableObject.metadata["K.lizenzmodell"][0].value, + desc: eln["_embedded"].indexableObject.metadata[ + "dc.description.abstract" + ][0].value, + subDisc: subDisc, + }); + allSubDisc.push(subDisc); + allLicenses.push( + eln["_embedded"].indexableObject.metadata["K.lizenzmodell"][0].value, + ); + }); - const filteredTable = elnTable.filter((eln) => { - if (Object.keys(filter).length === 0) { - return true; - } + allSubDisc = [...new Set(allSubDisc.flat())]; + allLicenses = [...new Set(allLicenses)]; + } catch (error) { + console.error(error); + return Failed to process ELN data.; + } - if (filter.subDisc && !eln.subDisc.includes(filter.subDisc)) { - return false; - } + // Filter ELN data based on filter state - if (filter.license && eln.license !== filter.license) { - return false; - } + const filteredTable = elnTable.filter((eln) => { + if (Object.keys(filter).length === 0) { + return true; + } - if ( - filter.text && - !JSON.stringify(eln) - .toLowerCase() - .includes(filter.text.toLowerCase()) - ) { - return false; - } + if (filter.subDisc && !eln.subDisc.includes(filter.subDisc)) { + return false; + } - return true; - }); + if (filter.license && eln.license !== filter.license) { + return false; + } - // Determine number of results and generate output - - const numberOfResults = filteredTable.length; - - let resultOutput = null; - - switch (numberOfResults) { - case elnTable.length: - resultOutput = null; - break; - case 0: - resultOutput = "No results found."; - break; - case 1: - resultOutput = "1 result found."; - break; - default: - resultOutput = numberOfResults + " results found."; - break; + if ( + filter.text && + !JSON.stringify(eln).toLowerCase().includes(filter.text.toLowerCase()) + ) { + return false; } - // Render ELN Finder component - - return ( - - -
- - -
-
- ); + return true; + }); + + // Determine number of results and generate output + + const numberOfResults = filteredTable.length; + + let resultOutput = null; + + switch (numberOfResults) { + case elnTable.length: + resultOutput = null; + break; + case 0: + resultOutput = "No results found."; + break; + case 1: + resultOutput = "1 result found."; + break; + default: + resultOutput = numberOfResults + " results found."; + break; + } + + // Render ELN Finder component + + return ( + + +
+ + +
+
+ ); } export default ElnFinder; diff --git a/src/components/eln/ElnFinderPharm.js b/src/components/eln/ElnFinderPharm.js index 9f828d11..89821c10 100644 --- a/src/components/eln/ElnFinderPharm.js +++ b/src/components/eln/ElnFinderPharm.js @@ -6,146 +6,138 @@ import ElnStatus from "./ElnStatus"; import ElnFilter from "./elnFilter/ElnFilter"; import ElnStack from "./ElnStack"; -import styles from "./Eln.module.css"; +import styles from "@site/src/components/eln/ElnStyles"; // const elnData = require("@site/static/assets/eln_test.json"); function ElnFinderPharm(props) { - // State for ELN data + // State for ELN data - const [elnData, setElnData] = useState(null); - const [error, setError] = useState(null); + const [elnData, setElnData] = useState(null); - // State for filtering + // State for filtering - const [filter, setFilter] = useImmer( - props.subDisc ? { subDisc: props.subDisc } : {} - ); + const [filter, setFilter] = useImmer( + props.subDisc ? { subDisc: props.subDisc } : {}, + ); - // Fetch ELN data + // Fetch ELN data - useEffect(() => { - fetch("../../assets/elnDataPharm.json") - .then((response) => response.json()) - .then((data) => { - setElnData(data); - console.log(data); - }) - .catch((error) => { - setError(error); - console.error(error); - }); - }, []); + useEffect(() => { + fetch("../../assets/elnDataPharm.json") + .then((response) => response.json()) + .then((data) => { + setElnData(data); + console.log(data); + }) + .catch((error) => { + console.error(error); + }); + }, []); - // Catch if fetch is still loading + // Catch if fetch is still loading - if (!elnData) { - return Loading...; - } + if (!elnData) { + return Loading...; + } - // Define working variables - - let elnTable = []; - let allLicenses = []; - - // Parse timestamp of ELN data - - const dateDownloaded = moment(elnData.date); - const relativeDate = moment(dateDownloaded).fromNow(); - - // Assemble essential ELN data - - try { - const chemElns = elnData["_embedded"].searchResult["_embedded"].objects; - - chemElns.map((eln) => { - elnTable.push({ - name: eln["_embedded"].indexableObject.name, - url: eln["_embedded"].indexableObject.metadata[ - "dc.identifier.uri" - ][0].value, - license: - eln["_embedded"].indexableObject.metadata[ - "K.lizenzmodell" - ][0].value, - desc: eln["_embedded"].indexableObject.metadata[ - "dc.description.abstract" - ][0].value, - }); - allLicenses.push( - eln["_embedded"].indexableObject.metadata["K.lizenzmodell"][0] - .value - ); - }); - - allLicenses = [...new Set(allLicenses)]; - } catch (error) { - console.error(error); - return Failed to process ELN data.; - } + // Define working variables + + let elnTable = []; + let allLicenses = []; - // Filter ELN data based on filter state + // Parse timestamp of ELN data - const filteredTable = elnTable.filter((eln) => { - if (Object.keys(filter).length === 0) { - return true; - } + const dateDownloaded = moment(elnData.date); + const relativeDate = moment(dateDownloaded).fromNow(); - if (filter.license && eln.license !== filter.license) { - return false; - } + // Assemble essential ELN data - if ( - filter.text && - !JSON.stringify(eln) - .toLowerCase() - .includes(filter.text.toLowerCase()) - ) { - return false; - } + try { + const chemElns = elnData["_embedded"].searchResult["_embedded"].objects; - return true; + chemElns.map((eln) => { + elnTable.push({ + name: eln["_embedded"].indexableObject.name, + url: eln["_embedded"].indexableObject.metadata["dc.identifier.uri"][0] + .value, + license: + eln["_embedded"].indexableObject.metadata["K.lizenzmodell"][0].value, + desc: eln["_embedded"].indexableObject.metadata[ + "dc.description.abstract" + ][0].value, + }); + allLicenses.push( + eln["_embedded"].indexableObject.metadata["K.lizenzmodell"][0].value, + ); }); - // Determine number of results and generate output - - const numberOfResults = filteredTable.length; - - let resultOutput = null; - - switch (numberOfResults) { - case elnTable.length: - resultOutput = null; - break; - case 0: - resultOutput = "No results found."; - break; - case 1: - resultOutput = "1 result found."; - break; - default: - resultOutput = numberOfResults + " results found."; - break; + allLicenses = [...new Set(allLicenses)]; + } catch (error) { + console.error(error); + return Failed to process ELN data.; + } + + // Filter ELN data based on filter state + + const filteredTable = elnTable.filter((eln) => { + if (Object.keys(filter).length === 0) { + return true; + } + + if (filter.license && eln.license !== filter.license) { + return false; + } + + if ( + filter.text && + !JSON.stringify(eln).toLowerCase().includes(filter.text.toLowerCase()) + ) { + return false; } - // Render ELN Finder component - - return ( - - -
- - -
-
- ); + return true; + }); + + // Determine number of results and generate output + + const numberOfResults = filteredTable.length; + + let resultOutput = null; + + switch (numberOfResults) { + case elnTable.length: + resultOutput = null; + break; + case 0: + resultOutput = "No results found."; + break; + case 1: + resultOutput = "1 result found."; + break; + default: + resultOutput = numberOfResults + " results found."; + break; + } + + // Render ELN Finder component + + return ( + + +
+ + +
+
+ ); } export default ElnFinderPharm; diff --git a/src/components/eln/ElnStack.js b/src/components/eln/ElnStack.js index 42b59029..4042873a 100644 --- a/src/components/eln/ElnStack.js +++ b/src/components/eln/ElnStack.js @@ -3,13 +3,13 @@ import React from "react"; import ElnCard from "./ElnCard"; function ElnStack({ filteredTable, filter, setFilter }) { - return ( - - {filteredTable.map((eln, idx) => ( - - ))} - - ); + return ( + + {filteredTable.map((eln, idx) => ( + + ))} + + ); } export default ElnStack; diff --git a/src/components/eln/ElnStatus.js b/src/components/eln/ElnStatus.js index 108f58e2..a94fb8b2 100644 --- a/src/components/eln/ElnStatus.js +++ b/src/components/eln/ElnStatus.js @@ -1,21 +1,18 @@ import Link from "@docusaurus/Link"; function ElnStatus({ relativeDate }) { - return ( -

- - Data kindly provided by{" "} - - ELN Finder - {" "} - ( - {relativeDate !== "Invalid date" - ? "last updated " + relativeDate - : "last update unknown"} - ). - -

- ); + return ( +

+ + Data kindly provided by{" "} + ELN Finder ( + {relativeDate !== "Invalid date" + ? "last updated " + relativeDate + : "last update unknown"} + ). + +

+ ); } export default ElnStatus; diff --git a/src/components/eln/ElnStyles.js b/src/components/eln/ElnStyles.js new file mode 100644 index 00000000..5a4a0d33 --- /dev/null +++ b/src/components/eln/ElnStyles.js @@ -0,0 +1,9 @@ +import elnStyles from "@site/src/css/Eln.module.css"; +import lbeStyles from "@site/src/css/lbe.module.css"; + +const styles = { + ...elnStyles, + ...lbeStyles, +}; + +export default styles; diff --git a/src/components/eln/elnFilter/ElnFilter.js b/src/components/eln/elnFilter/ElnFilter.js index 20f47689..789f8f7b 100644 --- a/src/components/eln/elnFilter/ElnFilter.js +++ b/src/components/eln/elnFilter/ElnFilter.js @@ -3,96 +3,94 @@ import React from "react"; import TextSearch from "./TextSearch"; import FilterButton from "./FilterButton"; -import styles from "../Eln.module.css"; +import styles from "@site/src/components/eln/ElnStyles"; // Assemble buttons for filtering section function ButtonFilters({ allSubDisc, allLicenses, filter, setFilter }) { - let subDiscButtons = []; + let subDiscButtons = []; - if (allSubDisc) { - subDiscButtons = ["All", ...allSubDisc]; - } - let licenseButtons = ["All", ...allLicenses]; + if (allSubDisc) { + subDiscButtons = ["All", ...allSubDisc]; + } + let licenseButtons = ["All", ...allLicenses]; - // Check if active prop should be handed to FilterButton + // Check if active prop should be handed to FilterButton - function isActive(type, label) { - // check if filter value is equal to label + function isActive(type, label) { + // check if filter value is equal to label - if (filter[type] === label) { - return true; - } + if (filter[type] === label) { + return true; + } - // check if object is empty and label is "All" + // check if object is empty and label is "All" - if ( - (label === "All" && Object.keys(filter).length === 0) || - (label === "All" && !filter[type]) - ) { - return true; - } else { - return false; - } + if ( + (label === "All" && Object.keys(filter).length === 0) || + (label === "All" && !filter[type]) + ) { + return true; + } else { + return false; } + } - return ( - - {subDiscButtons.length > 0 && ( -
-
Filter by subdisciplines
-

- {subDiscButtons.map((subDisc, idx) => ( - - ))} -

-
- )} -
-
Filter by license
-

- {licenseButtons.map((license, idx) => ( - - ))} -

-
-
- ); + return ( + + {subDiscButtons.length > 0 && ( +
+
Filter by subdisciplines
+

+ {subDiscButtons.map((subDisc, idx) => ( + + ))} +

+
+ )} +
+
Filter by license
+

+ {licenseButtons.map((license, idx) => ( + + ))} +

+
+
+ ); } function ElnFilter({ - allSubDisc, - allLicenses, - filter, - setFilter, - resultOutput, + allSubDisc, + allLicenses, + filter, + setFilter, + resultOutput, }) { - return ( -
-
- -
-
- -
-
- ); + return ( +
+
+ +
+
+ +
+
+ ); } export default ElnFilter; diff --git a/src/components/eln/elnFilter/FilterButton.js b/src/components/eln/elnFilter/FilterButton.js index ee278ba4..92b0ee7b 100644 --- a/src/components/eln/elnFilter/FilterButton.js +++ b/src/components/eln/elnFilter/FilterButton.js @@ -1,32 +1,31 @@ +import styles from "@site/src/components/eln/ElnStyles"; import clsx from "clsx"; -import styles from "../Eln.module.css"; - function FilterButton(props) { - const handleClick = () => { - if (props.label === "All") { - props.setFilter((draft) => { - delete draft[props.type]; - }); - } else { - props.setFilter((draft) => { - draft[props.type] = props.label; - }); - } - }; + const handleClick = () => { + if (props.label === "All") { + props.setFilter((draft) => { + delete draft[props.type]; + }); + } else { + props.setFilter((draft) => { + draft[props.type] = props.label; + }); + } + }; - // Conditional styling for button + // Conditional styling for button - let buttonClass = clsx("lbe__filterbutton", { - [styles["eln__filterbutton--secondary"]]: props.secondary, - "lbe__filterbutton--active": props.active, - }); + let buttonClass = clsx(styles.lbeFilterbutton, { + [styles.elnFilterbuttonSecondary]: props.secondary, + [styles.lbeFilterbuttonActive]: props.active, + }); - return ( - - ); + return ( + + ); } export default FilterButton; diff --git a/src/components/eln/elnFilter/TextSearch.js b/src/components/eln/elnFilter/TextSearch.js index 46580d9d..442504be 100644 --- a/src/components/eln/elnFilter/TextSearch.js +++ b/src/components/eln/elnFilter/TextSearch.js @@ -1,38 +1,38 @@ -import styles from "../Eln.module.css"; +import styles from "@site/src/components/eln/ElnStyles"; function TextSearch({ resultOutput, filter, setFilter }) { - const handleChange = (e) => - setFilter((draft) => { - draft.text = e.target.value; - }); + const handleChange = (e) => + setFilter((draft) => { + draft.text = e.target.value; + }); - return ( -
- - - {filter.text && ( - - )} -   - - {resultOutput} -
- ); + return ( +
+ + + {filter.text && ( + + )} +   + + {resultOutput} +
+ ); } export default TextSearch; diff --git a/src/components/lbe/Authors.js b/src/components/lbe/Authors.js index d38c2c53..73f07799 100644 --- a/src/components/lbe/Authors.js +++ b/src/components/lbe/Authors.js @@ -1,43 +1,43 @@ -import React, {useState} from "react"; +import React, { useState } from "react"; // Import CSS -import styles from "./lbe.module.css"; +import styles from "@site/src/css/lbe.module.css"; // Function for expandible author list -function Authors({authors, length}) { - const [listOpen, ToggleListOpen] = useState(false); // Define state for author list, default "false" - var shortlist = authors.split(", ", length).join(", "); // List of authors with elements given by length +function Authors({ authors, length }) { + const [listOpen, ToggleListOpen] = useState(false); // Define state for author list, default "false" + var shortlist = authors.split(", ", length).join(", "); // List of authors with elements given by length - // If there are less than {length} authors, do not display button + // If there are less than {length} authors, do not display button - if (shortlist == authors) { - return {authors}; - } else if (listOpen) { - return ( - - {authors}{" "} - - - ); - } else - return ( - - {shortlist}, ...{" "} - - - ); + if (shortlist == authors) { + return {authors}; + } else if (listOpen) { + return ( + + {authors}{" "} + + + ); + } else + return ( + + {shortlist}, ...{" "} + + + ); } export default Authors; diff --git a/src/components/lbe/FilterSection.js b/src/components/lbe/FilterSection.js index 06605156..b24a4710 100644 --- a/src/components/lbe/FilterSection.js +++ b/src/components/lbe/FilterSection.js @@ -2,81 +2,79 @@ import React from "react"; // Custom functions -import {TextSearch, FilterButton} from "./LbeElements.js"; +import { TextSearch, FilterButton } from "./LbeElements.js"; // Import CSS -import styles from "./lbe.module.css"; +import styles from "@site/src/css/lbe.module.css"; // Assemble buttons for filtering section -function LbeButtons({repos, subdiscs, journals, lbeState, setLbeState}) { - return ( - -
-

Filter by repositories

-

- {repos.map((props, idx) => ( - - ))} -

-
-
-

Filter by subdisciplines

-

- {subdiscs.map((props, idx) => ( - - ))} -

-
-
-

Filter by journals

-

- {journals.map((props, idx) => ( - - ))} -

-
-
- ); +function LbeButtons({ repos, subdiscs, journals, lbeState, setLbeState }) { + return ( + +
+

Filter by repositories

+

+ {repos.map((props, idx) => ( + + ))} +

+
+
+

Filter by subdisciplines

+

+ {subdiscs.map((props, idx) => ( + + ))} +

+
+
+

Filter by journals

+

+ {journals.map((props, idx) => ( + + ))} +

+
+
+ ); } function FilterSection({ - repos, - subdiscs, - journals, - lbeState, - setLbeState, - resultOutput, + repos, + subdiscs, + journals, + lbeState, + setLbeState, + resultOutput, }) { - return ( -
-
- - -
-
- ); + return ( +
+
+ + +
+
+ ); } export default FilterSection; diff --git a/src/components/lbe/Lbe.js b/src/components/lbe/Lbe.js index 12e3084e..30e3f7e4 100644 --- a/src/components/lbe/Lbe.js +++ b/src/components/lbe/Lbe.js @@ -1,5 +1,5 @@ -import React, {useState, useEffect} from "react"; -import {useLocation} from "react-router-dom"; +import React, { useState, useEffect } from "react"; +import { useLocation } from "react-router-dom"; // Custom functions @@ -8,149 +8,145 @@ import LbeBody from "./LbeBody.js"; // Import CSS -import styles from "./lbe.module.css"; +import styles from "@site/src/css/lbe.module.css"; // Import global data -import {lbeTable} from "./Data.js"; +import { lbeTable } from "./Data.js"; // Main function function Lbe() { - // Get URL params - const location = useLocation(); - const queryParameters = new URLSearchParams(location.search); - const queryText = queryParameters.get("text"); - const querySubd = queryParameters.get("subd"); - const queryDoi = queryParameters.get("doi"); - - // Define React state object - const [lbeState, setLbeState] = useState({}); - - // Conditions for initial states - - if (queryText !== null) { - useEffect(() => { - setLbeState({ - search: queryText, - switch: "text", - }); - }, []); - } else if (querySubd !== null) { - useEffect(() => { - setLbeState({ - subd: querySubd, - switch: "subd", - }); - }, []); - } else if (queryDoi !== null) { - useEffect(() => { - setLbeState({ - switch: "doi", - }); - }, []); - } else { - useEffect(() => { - setLbeState({ - repo: "All", - subd: "All", - journal: "All", - switch: "subd", - }); - }, []); - } - - // Get list of subdisciplines - var subdiscs = Array.from( - new Set(lbeTable.map((obj) => obj.subdiscipline).flat()), - ).sort((a, b) => a.localeCompare(b, undefined, {sensitivity: "base"})); - subdiscs.unshift("All"); // Add "All" option at the beginning - - // Get list of tags - var categories = Array.from( - new Set(lbeTable.map((obj) => obj.tags).flat()), - ).sort((a, b) => a.localeCompare(b, undefined, {sensitivity: "base"})); - categories.unshift("All"); // Add "All" option at the beginning - - // Get list of journals - var journals = Array.from(new Set(lbeTable.map((obj) => obj.journal))).sort( - (a, b) => a.localeCompare(b, undefined, {sensitivity: "base"}), - ); - journals.unshift("All"); // Add "All" option at the beginning - - // Get list of repos - var repos = Array.from( - new Set( - lbeTable.map((obj) => obj.linkdata.map((obj) => obj.name)).flat(), - ), - ).sort((a, b) => a.localeCompare(b, undefined, {sensitivity: "base"})); - repos.unshift("All"); // Add "All" option at the beginning - - var result = []; - - // Render all datasets if "All" is selected - - if (lbeState.repo == "All" || lbeState.subd == "All") { - result = lbeTable; - } else { - // Determine result set based on lbeState.switch states - switch (lbeState.switch) { - case "tag": - result = lbeTable.filter((n) => n.tags.includes(tagFilter)); - break; - case "repo": - result = lbeTable.filter((n) => - n.linkdata.map((n) => n.name).includes(lbeState.repo), - ); - break; - case "subd": - result = lbeTable.filter((n) => - n.subdiscipline.includes(lbeState.subd), - ); - break; - case "journal": - result = lbeTable.filter((n) => - n.journal.includes(lbeState.journal), - ); - break; - case "search": - result = lbeTable.filter((obj) => - JSON.stringify(obj) - .toLowerCase() - .includes(lbeState.search.toLowerCase()), - ); // Squash object with JSON.stringify() for better searchability - if (lbeState.search == "") { - var resultOutput = ""; - } else if (result.length == 1) { - var resultOutput = result.length + " entry found..."; - } else { - var resultOutput = result.length + " entries found..."; - } - break; - case "doi": - result = lbeTable.filter((n) => n.linkpub.includes(queryDoi)); - } - } - - if (lbeState.switch !== "search") { - result.sort((a, b) => b.pubyear - a.pubyear); - } - - return ( -
- - -
- ); + // Get URL params + const location = useLocation(); + const queryParameters = new URLSearchParams(location.search); + const queryText = queryParameters.get("text"); + const querySubd = queryParameters.get("subd"); + const queryDoi = queryParameters.get("doi"); + + // Define React state object + const [lbeState, setLbeState] = useState({}); + + // Conditions for initial states + + if (queryText !== null) { + useEffect(() => { + setLbeState({ + search: queryText, + switch: "text", + }); + }, []); + } else if (querySubd !== null) { + useEffect(() => { + setLbeState({ + subd: querySubd, + switch: "subd", + }); + }, []); + } else if (queryDoi !== null) { + useEffect(() => { + setLbeState({ + switch: "doi", + }); + }, []); + } else { + useEffect(() => { + setLbeState({ + repo: "All", + subd: "All", + journal: "All", + switch: "subd", + }); + }, []); + } + + // Get list of subdisciplines + var subdiscs = Array.from( + new Set(lbeTable.map((obj) => obj.subdiscipline).flat()), + ).sort((a, b) => a.localeCompare(b, undefined, { sensitivity: "base" })); + subdiscs.unshift("All"); // Add "All" option at the beginning + + // Get list of tags + var categories = Array.from( + new Set(lbeTable.map((obj) => obj.tags).flat()), + ).sort((a, b) => a.localeCompare(b, undefined, { sensitivity: "base" })); + categories.unshift("All"); // Add "All" option at the beginning + + // Get list of journals + var journals = Array.from(new Set(lbeTable.map((obj) => obj.journal))).sort( + (a, b) => a.localeCompare(b, undefined, { sensitivity: "base" }), + ); + journals.unshift("All"); // Add "All" option at the beginning + + // Get list of repos + var repos = Array.from( + new Set(lbeTable.map((obj) => obj.linkdata.map((obj) => obj.name)).flat()), + ).sort((a, b) => a.localeCompare(b, undefined, { sensitivity: "base" })); + repos.unshift("All"); // Add "All" option at the beginning + + var result = []; + + // Render all datasets if "All" is selected + + if (lbeState.repo == "All" || lbeState.subd == "All") { + result = lbeTable; + } else { + // Determine result set based on lbeState.switch states + switch (lbeState.switch) { + case "tag": + result = lbeTable.filter((n) => n.tags.includes(tagFilter)); + break; + case "repo": + result = lbeTable.filter((n) => + n.linkdata.map((n) => n.name).includes(lbeState.repo), + ); + break; + case "subd": + result = lbeTable.filter((n) => + n.subdiscipline.includes(lbeState.subd), + ); + break; + case "journal": + result = lbeTable.filter((n) => n.journal.includes(lbeState.journal)); + break; + case "search": + result = lbeTable.filter((obj) => + JSON.stringify(obj) + .toLowerCase() + .includes(lbeState.search.toLowerCase()), + ); // Squash object with JSON.stringify() for better searchability + if (lbeState.search == "") { + var resultOutput = ""; + } else if (result.length == 1) { + var resultOutput = result.length + " entry found..."; + } else { + var resultOutput = result.length + " entries found..."; + } + break; + case "doi": + result = lbeTable.filter((n) => n.linkpub.includes(queryDoi)); + } + } + + if (lbeState.switch !== "search") { + result.sort((a, b) => b.pubyear - a.pubyear); + } + + return ( +
+ + +
+ ); } export default Lbe; diff --git a/src/components/lbe/LbeBody.js b/src/components/lbe/LbeBody.js index de5a757a..1a34f9d9 100644 --- a/src/components/lbe/LbeBody.js +++ b/src/components/lbe/LbeBody.js @@ -7,7 +7,7 @@ import { Details } from "@site/src/theme/common/Details"; // Import CSS -import styles from "./lbe.module.css"; +import styles from "@site/src/css/lbe.module.css"; // Function for single lbe dataset block diff --git a/src/components/lbe/LbeElements.js b/src/components/lbe/LbeElements.js index f13523e0..3b436041 100644 --- a/src/components/lbe/LbeElements.js +++ b/src/components/lbe/LbeElements.js @@ -1,149 +1,149 @@ import React from "react"; -import {Link} from "react-router-dom"; +import { Link } from "react-router-dom"; import useBaseUrl from "@docusaurus/useBaseUrl"; import Funnel from "@site/static/img/funnel.svg"; // Import CSS -import styles from "./lbe.module.css"; +import styles from "@site/src/css/lbe.module.css"; +import clsx from "clsx"; // Import global data -import {lbeTable, filterAttr} from "./Data.js"; +import { lbeTable, filterAttr } from "./Data.js"; // Button for Repo Links -function RepoButton({name, url}) { - return ( -
- ); +function RepoButton({ name, url }) { + return ( + + ); } // Handles text input -function TextSearch({lbeState, setLbeState, resultOutput}) { - const handleChange = (e) => - setLbeState( - e.target.value === "" - ? { - repo: "All", - subd: "All", - journal: "All", - switch: "subd", - } - : { - search: e.target.value, - switch: "search", - }, - [e.target.value], - ); - - return ( -
- {" "} -   {resultOutput} -
- ); +function TextSearch({ lbeState, setLbeState, resultOutput }) { + const handleChange = (e) => + setLbeState( + e.target.value === "" + ? { + repo: "All", + subd: "All", + journal: "All", + switch: "subd", + } + : { + search: e.target.value, + switch: "search", + }, + [e.target.value], + ); + + return ( +
+ {" "} +   {resultOutput} +
+ ); } // Function for handling button clicks -function HandleClick({name, newState, setLbeState}) { - if (name == "All") { - setLbeState({ - journal: "All", - subd: "All", - repo: "All", - switch: "subd", - }); - } else { - setLbeState(newState); - } +function HandleClick({ name, newState, setLbeState }) { + if (name == "All") { + setLbeState({ + journal: "All", + subd: "All", + repo: "All", + switch: "subd", + }); + } else { + setLbeState(newState); + } } // Function for filtering buttons function FilterButton({ - type, - name, - numbered, - funnel, - title, - lbeState, - setLbeState, + type, + name, + numbered, + funnel, + title, + lbeState, + setLbeState, }) { - // type and name are strings, numbered is boolean - - // Initialize variables - - var buttonClass = styles.lbeFilterbutton; - var number = 0; - var label = ""; - - // Define how the state object should be set when clicked - - var newState = {[type]: name, switch: type}; - - // Styling of active button - - if (name === lbeState[type]) { - buttonClass = - styles.lbeFilterbutton + " " + styles.lbeFilterbuttonActive; - } - - // Determine number (when needed) - - if (numbered) { - if (name === "All") { - number = lbeTable.length; - } else { - number = lbeTable - .map((m) => JSON.stringify(m[filterAttr[type]])) - .filter((m) => m.includes(name)).length; - } - label = name + " (" + number + ")"; - } else { - label = name; - } - - return ( - - ); + // type and name are strings, numbered is boolean + + // Initialize variables + + var buttonClass = styles.lbeFilterbutton; + var number = 0; + var label = ""; + + // Define how the state object should be set when clicked + + var newState = { [type]: name, switch: type }; + + // Styling of active button + + if (name === lbeState[type]) { + buttonClass = clsx(styles.lbeFilterbutton, styles.lbeFilterbuttonActive); + } + + // Determine number (when needed) + + if (numbered) { + if (name === "All") { + number = lbeTable.length; + } else { + number = lbeTable + .map((m) => JSON.stringify(m[filterAttr[type]])) + .filter((m) => m.includes(name)).length; + } + label = name + " (" + number + ")"; + } else { + label = name; + } + + return ( + + ); } -function LbeChip({title}) { - return ( - - - - ); +function LbeChip({ title }) { + return ( + + + + ); } -export {RepoButton, TextSearch, FilterButton, LbeChip}; +export { RepoButton, TextSearch, FilterButton, LbeChip }; diff --git a/src/components/lbe/ShortenButtons.js b/src/components/lbe/ShortenButtons.js index 8059db70..41ce0db9 100644 --- a/src/components/lbe/ShortenButtons.js +++ b/src/components/lbe/ShortenButtons.js @@ -1,58 +1,56 @@ -import React, {useState} from "react"; +import React, { useState } from "react"; -import {RepoButton} from "./LbeElements"; +import { RepoButton } from "./LbeElements"; -import styles from "./lbe.module.css"; +import styles from "@site/src/css/lbe.module.css"; function ShortenButtons(props) { - const [less, setLess] = useState(true); + const [less, setLess] = useState(true); - let number = props.number || 3; - let items = props.items || []; + let number = props.number || 3; + let items = props.items || []; - if (items.length <= number) { - return ( - - {items.map((item, idx) => ( - - ))} - - ); - } + if (items.length <= number) { + return ( + + {items.map((item, idx) => ( + + ))} + + ); + } - return ( - - {less ? ( - - {items.map((item, idx) => - idx < number ? ( - - ) : null, - )} - setLess(!less)} - style={{cursor: "pointer"}} - > - show all ⏵ - - - ) : ( - - {items.map((item, idx) => ( - - ))} - setLess(!less)} - style={{cursor: "pointer"}} - > - ⏴ collapse - - - )} - - ); + return ( + + {less ? ( + + {items.map((item, idx) => + idx < number ? : null, + )} + setLess(!less)} + style={{ cursor: "pointer" }} + > + show all ⏵ + + + ) : ( + + {items.map((item, idx) => ( + + ))} + setLess(!less)} + style={{ cursor: "pointer" }} + > + ⏴ collapse + + + )} + + ); } export default ShortenButtons; diff --git a/src/components/repos/DecisionTree.js b/src/components/repos/DecisionTree.js index 53dcdcea..937e06d2 100644 --- a/src/components/repos/DecisionTree.js +++ b/src/components/repos/DecisionTree.js @@ -1,446 +1,436 @@ import React from "react"; import Link from "@docusaurus/Link"; -import styles from "./DecisionTree.module.css"; +import styles from "@site/src/css/DecisionTree.module.css"; const DecisionTree = () => { - return ( - - - - - - - What type of data do you have? - - - - - - - - - - intermolecular and - - - supramolecular - - - interactions of - - - molecular systems - - - - - - - SupraBank - - - - + return ( + + + + + + + What type of data do you have? + + + - - - + + + + + + intermolecular and + + + supramolecular + + + interactions of + + + molecular systems + + + + + + + SupraBank + + + + - - - enzyme kinetics data - - - - - - - STRENDA - - - DB - - - - + + + - - - - - - multidisciplinary - - - - - - - RADAR4Chem - - - - + + + enzyme kinetics data + + + + + + + STRENDA + + + DB + + + + - - + + + + + + multidisciplinary + + + + + + + RADAR4Chem + + + + - + + - - - simulations - - + - - - - - NOMAD - - - - + + + simulations + + - - + + + + + NOMAD + + + + - + + - - > - - crystal structures of - - - molecular organic and - - - molecular inorganic - - - compounds - - + + + crystal structures of + + + molecular organic and + + + molecular inorganic + + + compounds + + - - - - - CSD - - - - + + + + + CSD + + + + - - + + - - - - inorganic crystal - - - structures - - - - - - - ICSD - - - - + + + + inorganic crystal + + + structures + + + + + + + ICSD + + + + - - - - - - molecules and their - - - properties, - - - identification, reactions - - - and experimental - - - investigations - - + + + + + + molecules and their + + + properties, + + + identification, reactions + + + and experimental + + + investigations + + - - + + - - - - nuclear magnetic - - - resonance (NMR) - - + + + + nuclear magnetic + + + resonance (NMR) + + - - - - - Chemotion - - - Repository - - - - - - - - nmrXiv - - - - + + + + + Chemotion + + + Repository + + + + + + + + nmrXiv + + + + - - + + - - - - mass spectrometry - - - reference spectra - - + + + + mass spectrometry + + + reference spectra + + - - - - - MassBank EU - - - - - - - ); + + + + + MassBank EU + + + + + + + ); }; export default DecisionTree; diff --git a/src/components/repos/RepoButton.js b/src/components/repos/RepoButton.js index 1093b8c2..0c88c5a6 100644 --- a/src/components/repos/RepoButton.js +++ b/src/components/repos/RepoButton.js @@ -3,17 +3,20 @@ import Link from "@docusaurus/Link"; import IconExternalLink from "@theme/Icon/ExternalLink"; +import styles from "@site/src/css/lbe.module.css"; +import clsx from "clsx"; + function RepoButton(props) { - return ( - - - - - - ); + return ( + + + + + + ); } export default RepoButton; diff --git a/src/components/chemotion/ChemotionCarousel.module.css b/src/css/ChemotionCarousel.module.css similarity index 100% rename from src/components/chemotion/ChemotionCarousel.module.css rename to src/css/ChemotionCarousel.module.css diff --git a/src/components/chemotion/ChemotionLifecycle.module.css b/src/css/ChemotionLifecycle.module.css similarity index 100% rename from src/components/chemotion/ChemotionLifecycle.module.css rename to src/css/ChemotionLifecycle.module.css diff --git a/src/components/repos/DecisionTree.module.css b/src/css/DecisionTree.module.css similarity index 100% rename from src/components/repos/DecisionTree.module.css rename to src/css/DecisionTree.module.css diff --git a/src/css/Eln.module.css b/src/css/Eln.module.css new file mode 100644 index 00000000..a4545f1f --- /dev/null +++ b/src/css/Eln.module.css @@ -0,0 +1,128 @@ +@import "@site/src/css/lbe.module.css"; + +/********** ELN-Finder ************/ + +.eln { + display: flex; + flex-direction: row; + flex-wrap: wrap; + justify-content: space-between; +} + +/* Search / Filter section */ + +.elnSearchfilter { + display: flex; + flex-direction: row; + width: 100%; + padding: 0.75rem; + border: 1px dashed var(--ifm-color-primary); + margin-bottom: 0.5rem; +} + +.elnSearchfilterText { + translate: 0 20%; + min-width: 240px; +} + +.elnSearchfilterButtons { + flex-grow: 1; +} + +.elnSearchfilterSearch { + display: flex; + flex-direction: column; + padding: 0.5rem 0; +} + +.elnSearchfilterSearch > span { + text-align: center; + display: flex; +} + +.elnSearchfilterSearch > em { + color: var(--ifm-color-primary); + text-align: center; +} + +.elnSearchfilterSearchButton { + position: relative; + right: 1.5rem; + align-self: center; + padding: 0; + background: none; + border: none; + line-height: 1rem; +} + +.elnCard { + width: 49.5%; + padding: 0.75rem; + border: 1px dashed var(--ifm-color-primary); + margin-bottom: 0.5rem; + transition: all var(--n4c-transform-time) ease-in-out; +} + +.elnCardHeader { + display: flex; + justify-content: space-between; + align-items: center; +} + +.elnCardDesc { + padding: 0.5rem; +} + +@media screen and (max-width: 1400px) { + .eln { + display: flex; + flex-direction: column; + } + + .elnSearchfilter { + display: flex; + flex-direction: column; + align-items: center; + width: 100%; + padding: 0.75rem; + border: 1px dashed var(--ifm-color-primary); + margin-bottom: 0.75rem; + } + + .elnSearchfilterText, + .elnSearchfilterButtons { + width: 100%; + translate: 0; + } + + .elnSearchfilterSearch { + display: flex; + flex-direction: row; + align-items: center; + } + + .elnCard { + width: 100%; + padding: 0.75rem; + border: 1px dashed var(--ifm-color-primary); + margin-bottom: 0.75rem; + transition: all var(--n4c-transform-time) ease-in-out; + } +} + +.elnCardLink { + display: flex; + padding: 0.5rem; +} + +.elnLicenseChipOpensource { + background-color: var(--ifm-color-primary); + color: white; + font-weight: bold; +} + +.elnFilterbuttonSecondary { + background-color: var(--ifm-breadcrumb-item-background-active); + color: var(--ifm-color-primary); + font-weight: unset; +} diff --git a/src/components/commons/FloatImage.module.css b/src/css/FloatImage.module.css similarity index 100% rename from src/components/commons/FloatImage.module.css rename to src/css/FloatImage.module.css diff --git a/src/components/N4CFeatures.module.css b/src/css/N4CFeatures.module.css similarity index 100% rename from src/components/N4CFeatures.module.css rename to src/css/N4CFeatures.module.css diff --git a/src/css/ShortenDesc.module.css b/src/css/ShortenDesc.module.css new file mode 100644 index 00000000..6ba8d61a --- /dev/null +++ b/src/css/ShortenDesc.module.css @@ -0,0 +1,8 @@ +.authorTrigger { + border: none; + background: none; + scale: 90%; + color: var(--ifm-color-primary); + padding: 0 0.5em; + margin: 0; +} diff --git a/src/css/custom.css b/src/css/custom.css index 189af505..a2db82cc 100644 --- a/src/css/custom.css +++ b/src/css/custom.css @@ -410,39 +410,3 @@ table { table thead tr { border-bottom: 1px solid var(--ifm-color-primary); } - -/********** Methods Table ************/ - -.methods__searchfilter { - padding: 10px; - margin: 15px 0px; - border: 1px dashed var(--ifm-color-primary); - display: flex; -} - -.methods__searchfilter__row { - align-items: center; - flex-wrap: wrap; -} - -.methods__searchfilter__filter { - width: calc(8 / 12 * 100%); - padding: 0 var(--ifm-spacing-horizontal); -} - -.methods__searchfilter__search { - width: calc(4 / 12 * 100%); - padding: 0var (--ifm-spacing-horizontal); -} - -@media screen and (max-width: 1350px) { - .methods__searchfilter__filter { - width: unset; - padding: 0 var(--ifm-spacing-horizontal); - } - - .methods__searchfilter__search { - width: unset; - padding: var(--ifm-spacing-horizontal); - } -} diff --git a/src/css/deprecated.css b/src/css/deprecated.css new file mode 100644 index 00000000..482304ed --- /dev/null +++ b/src/css/deprecated.css @@ -0,0 +1,35 @@ +/********** Methods Table ************/ + +/* .methods__searchfilter { + padding: 10px; + margin: 15px 0px; + border: 1px dashed var(--ifm-color-primary); + display: flex; +} + +.methods__searchfilter__row { + align-items: center; + flex-wrap: wrap; +} + +.methods__searchfilter__filter { + width: calc(8 / 12 * 100%); + padding: 0 var(--ifm-spacing-horizontal); +} + +.methods__searchfilter__search { + width: calc(4 / 12 * 100%); + padding: 0var (--ifm-spacing-horizontal); +} + +@media screen and (max-width: 1350px) { + .methods__searchfilter__filter { + width: unset; + padding: 0 var(--ifm-spacing-horizontal); + } + + .methods__searchfilter__search { + width: unset; + padding: var(--ifm-spacing-horizontal); + } +} */ diff --git a/src/components/lbe/lbe.module.css b/src/css/lbe.module.css similarity index 100% rename from src/components/lbe/lbe.module.css rename to src/css/lbe.module.css diff --git a/src/pages/index.js b/src/pages/index.js index 9829479f..34d13c63 100644 --- a/src/pages/index.js +++ b/src/pages/index.js @@ -6,6 +6,7 @@ import N4CFeatures from "../components/N4CFeatures"; import Translate from "@docusaurus/Translate"; import styles from "./index.module.css"; +import clsx from "clsx"; export default function Home() { const { siteConfig } = useDocusaurusContext(); @@ -18,11 +19,13 @@ export default function Home() {
-

{siteConfig.title}

+

+ {siteConfig.title} +

-
+

A place for all knowledge regarding Research Data Management @@ -30,10 +33,10 @@ export default function Home() {

-
+
Get started