From 849350c7324ec7319956647e2bf1b9fa8324ffa0 Mon Sep 17 00:00:00 2001 From: darkicewolf50 Date: Sat, 23 Mar 2024 13:15:32 -0600 Subject: [PATCH] added Subteams: cleared comments added scroll to subteam code --- src/Teams/SubTeams.js | 90 +++++++++++++++++++++++++++++++++++-------- 1 file changed, 73 insertions(+), 17 deletions(-) diff --git a/src/Teams/SubTeams.js b/src/Teams/SubTeams.js index 7abed12..c996b12 100644 --- a/src/Teams/SubTeams.js +++ b/src/Teams/SubTeams.js @@ -30,6 +30,19 @@ const SubTeams = () => { } }; + /** + * @param {index} Int - requires the number of the section to go to + * @returns {null} null - moves screen to a specific subteam section + * @description moves screen to the subteam's section upon click + * @author Brock + * @todo add css pointer talbe elements + */ + const ScrolltoSubteamSection = (index) => { + const section = document.querySelectorAll(".subteamSection")[index]; + if (section) { + section.scrollIntoView({ behavior: "smooth" }); + } + }; return (

Get to Know Our Subteams

@@ -42,49 +55,70 @@ const SubTeams = () => { {/* this really sucks it needs to be changed */} {/* row 1 */} - + { + ScrolltoSubteamSection(0); + }}> {subteamsArray[0] {/* row 2 */} - + { + ScrolltoSubteamSection(1); + }}> {subteamsArray[1] {/* row 3 */} - + { + ScrolltoSubteamSection(2); + }}> {subteamsArray[2] {/* row 4 */} - + { + ScrolltoSubteamSection(3); + }}> {subteamsArray[3] {/* row 5 */} - + { + ScrolltoSubteamSection(4); + }}> {subteamsArray[4] {/* row 6 */} - + { + ScrolltoSubteamSection(5); + }}> {subteamsArray[5] {/* row 7 */} - + { + ScrolltoSubteamSection(6); + }}> {subteamsArray[6] { {/* row 1 */} - + { + ScrolltoSubteamSection(0); + }}>

{subteamsArray[0].shortDescription}

{/* row 2 */} - + { + ScrolltoSubteamSection(1); + }}>

{subteamsArray[1].shortDescription}

{/* row 3 */} - + { + ScrolltoSubteamSection(2); + }}>

{subteamsArray[2].shortDescription}

{/* row 4 */} - + { + ScrolltoSubteamSection(3); + }}>

{subteamsArray[3].shortDescription}

{/* row 5 */} - + { + ScrolltoSubteamSection(4); + }}>

{subteamsArray[4].shortDescription}

{/* row 6 */} - + { + ScrolltoSubteamSection(5); + }}>

{subteamsArray[5].shortDescription}

{/* row 7 */} - + { + ScrolltoSubteamSection(6); + }}>

{subteamsArray[6].shortDescription}

- {/* lays out content from the .yml file gets the name of the subteam and ready for layout */} + {/* lays out content from the subteams dict gets the name of the subteam and index */} {Object.keys(subteamsDict).map((subteamName, index) => { const subteam = subteamsDict[subteamName]; //changes location of content based if the second one creates a checkerboard layout const className = index % 2 === 0 ? "SubteamsEnd" : ""; return (
+ {/* changes layout if the second or first one */} {index % 2 === 0 ? ( <> -
+
{subteamName { ) : ( <> -
+

{subteamName}