foundry-component-library 0.2.8 → 0.2.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,12 +1,25 @@
1
1
  "use client";
2
- import { useRef } from "react";
3
2
  import styles from "./styles.module.scss";
4
3
  import Container from "../Container";
5
4
  import { NextImage } from "../../types";
6
- import useDrag from "../../hooks/useDrag";
7
5
  import WavyText from "../TextAnimations/WavyText";
8
6
  import { motion } from "framer-motion";
9
7
 
8
+ // Infinite marquee animation settings
9
+ const marqueeVariants = {
10
+ animate: {
11
+ x: [0, -"100%"],
12
+ transition: {
13
+ x: {
14
+ repeat: Infinity,
15
+ repeatType: "loop",
16
+ duration: 20,
17
+ ease: "linear",
18
+ },
19
+ },
20
+ },
21
+ };
22
+
10
23
  const Awards = ({
11
24
  heading,
12
25
  awards,
@@ -22,49 +35,41 @@ const Awards = ({
22
35
  }[];
23
36
  Image: NextImage;
24
37
  }) => {
25
- const sectionRef = useRef(null);
26
- const { handleMouseDown, handleMouseMove, handleMouseUp, dragStyle } =
27
- useDrag(sectionRef);
38
+ if (!awards) return null;
28
39
 
29
- if (!awards) return;
40
+ // Duplicate awards to create seamless looping
41
+ const marqueeItems = [...awards, ...awards];
30
42
 
31
43
  return (
32
44
  <motion.div
33
45
  className={styles.awards}
34
46
  initial={{ opacity: 0, y: -5 }}
35
47
  animate={{ opacity: 1, y: 0 }}
36
- transition={{
37
- duration: 1,
38
- }}
39
- >
48
+ transition={{ duration: 1 }}>
40
49
  <Container>
41
50
  {heading && <WavyText className={styles.heading} text={heading} />}
42
51
  </Container>
43
52
  <Container noMobilePadding>
44
- <div
45
- ref={sectionRef}
46
- className={styles.items}
47
- onMouseDown={handleMouseDown}
48
- onMouseMove={handleMouseMove}
49
- onMouseUp={handleMouseUp}
50
- onMouseLeave={handleMouseUp}
51
- style={dragStyle as React.CSSProperties}
52
- >
53
- {awards.map((award, i) => {
54
- const { image, heading, text } = award;
55
-
56
- if (!image) return;
53
+ <div className={styles.marqueeWrapper}>
54
+ <motion.div
55
+ className={styles.marquee}
56
+ variants={marqueeVariants}
57
+ animate="animate">
58
+ {marqueeItems.map((award, i) => {
59
+ const { image, heading, text } = award;
60
+ if (!image) return null;
57
61
 
58
- return (
59
- <div key={image.sourceUrl + i} className={styles.award}>
60
- <div className={styles.image}>
61
- {image && <Image src={image?.sourceUrl} alt="" fill />}
62
+ return (
63
+ <div key={image.sourceUrl + i} className={styles.award}>
64
+ <div className={styles.image}>
65
+ {image && <Image src={image.sourceUrl} alt="" fill />}
66
+ </div>
67
+ {heading && <div className={styles.text}>{heading}</div>}
68
+ {text && <div className={styles.client}>{text}</div>}
62
69
  </div>
63
- {heading && <div className={styles.text}>{heading}</div>}
64
- {text && <div className={styles.client}>{text}</div>}
65
- </div>
66
- );
67
- })}
70
+ );
71
+ })}
72
+ </motion.div>
68
73
  </div>
69
74
  </Container>
70
75
  </motion.div>
@@ -21,14 +21,29 @@
21
21
  }
22
22
  }
23
23
 
24
- .items {
24
+ /* NEW — wrapper that clips the scrolling track */
25
+ .marqueeWrapper {
26
+ overflow: hidden;
27
+ width: 100%;
28
+ position: relative;
29
+ }
30
+
31
+ /* NEW — marquee track */
32
+ .marquee {
25
33
  display: flex;
34
+ gap: 48px;
35
+ width: max-content;
36
+ animation: marquee 20s linear infinite;
26
37
 
27
38
  @media #{$QUERY-sm} {
28
39
  gap: 24px;
40
+ animation-duration: 16s;
29
41
  }
30
42
  }
31
43
 
44
+ /* Remove if using marquee (track should scroll) */
45
+ /* .items { display: flex; } */
46
+
32
47
  .award {
33
48
  width: 20%;
34
49
  text-align: center;
@@ -85,3 +100,13 @@
85
100
  font-size: 16px;
86
101
  }
87
102
  }
103
+
104
+ /* NEW — marquee animation: scroll half the track (because items are duplicated) */
105
+ @keyframes marquee {
106
+ 0% {
107
+ transform: translateX(0);
108
+ }
109
+ 100% {
110
+ transform: translateX(-50%);
111
+ }
112
+ }
@@ -113,6 +113,11 @@ type HomePage = {
113
113
  sourceUrl: string;
114
114
  };
115
115
  }[];
116
+ quotes?: {
117
+ name?: string;
118
+ position?: string;
119
+ text?: string;
120
+ }[];
116
121
  };
117
122
  };
118
123
  };
@@ -260,6 +265,11 @@ export default async function getHomePage({
260
265
  sourceUrl
261
266
  }
262
267
  }
268
+ quotes {
269
+ name
270
+ position
271
+ text
272
+ }
263
273
  }
264
274
  }
265
275
  }
@@ -1,19 +1,54 @@
1
1
  import { gql } from "graphql-request";
2
2
  import { Page } from "../../lib/types";
3
3
  import client from "./client";
4
+ import { ContactPage } from "./getContactPage";
4
5
 
5
6
  export default async function getPageBySlug(
6
- slug: string
7
- ): Promise<Page | null> {
7
+ slug: string,
8
+ language: string
9
+ ): Promise<{ page: Page; contactPage: ContactPage }> {
10
+ const contactPage = language === "DE" ? "contact-de" : "contact";
11
+
8
12
  const query = gql`
9
13
  query GetPageBySlug($slug: ID!) {
10
14
  page(id: $slug, idType: URI) {
11
15
  title
16
+ content
17
+ }
18
+ contactPage: page(id: "${contactPage}", idType: URI) {
19
+ customFieldsContact {
20
+ facebook
21
+ instagram
22
+ linkedin
23
+ berlinImage {
24
+ sourceUrl
25
+ }
26
+ berlinText
27
+ berlinEmail
28
+ berlinPhone
29
+ zurichImage {
30
+ sourceUrl
31
+ }
32
+ zurichText
33
+ zurichEmail
34
+ zurichPhone
35
+ newyorkImage {
36
+ sourceUrl
37
+ }
38
+ newyorkText
39
+ newyorkEmail
40
+ newyorkPhone
41
+ contactTeaserHeading
42
+ contactTeaserText
43
+ }
12
44
  }
13
45
  }
14
46
  `;
15
47
 
16
48
  const variables = { slug };
17
- const data: { page: Page } = await client.request(query, variables);
18
- return data.page;
49
+ const data: { page: Page; contactPage: ContactPage } = await client.request(
50
+ query,
51
+ variables
52
+ );
53
+ return data;
19
54
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "foundry-component-library",
3
- "version": "0.2.8",
3
+ "version": "0.2.9",
4
4
  "type": "module",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",