foundry-component-library 0.2.9 → 0.2.10
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.
- package/lib/components/ServiceHubsTeaserEffects/TileBalls.tsx +35 -0
- package/lib/components/ServiceHubsTeaserEffects/TileFluid.tsx +29 -0
- package/lib/components/ServiceHubsTeaserEffects/TileGlass.tsx +23 -0
- package/lib/components/ServiceHubsTeaserEffects/TileRays.tsx +94 -0
- package/lib/components/ServiceHubsTeaserEffects/bubbles/Bubble.tsx +35 -0
- package/lib/components/ServiceHubsTeaserEffects/bubbles/Bubbles.tsx +44 -0
- package/lib/components/ServiceHubsTeaserEffects/fluid/Fluid.tsx +192 -0
- package/lib/components/ServiceHubsTeaserEffects/fluid/constant.ts +23 -0
- package/lib/components/ServiceHubsTeaserEffects/fluid/effect/Fluid.tsx +22 -0
- package/lib/components/ServiceHubsTeaserEffects/fluid/effect/FluidEffect.tsx +58 -0
- package/lib/components/ServiceHubsTeaserEffects/fluid/glsl/advection.frag +16 -0
- package/lib/components/ServiceHubsTeaserEffects/fluid/glsl/base.vert +26 -0
- package/lib/components/ServiceHubsTeaserEffects/fluid/glsl/clear.frag +7 -0
- package/lib/components/ServiceHubsTeaserEffects/fluid/glsl/composite.frag +41 -0
- package/lib/components/ServiceHubsTeaserEffects/fluid/glsl/curl.frag +22 -0
- package/lib/components/ServiceHubsTeaserEffects/fluid/glsl/divergence.frag +41 -0
- package/lib/components/ServiceHubsTeaserEffects/fluid/glsl/gradientSubstract.frag +26 -0
- package/lib/components/ServiceHubsTeaserEffects/fluid/glsl/pressure.frag +28 -0
- package/lib/components/ServiceHubsTeaserEffects/fluid/glsl/splat.frag +19 -0
- package/lib/components/ServiceHubsTeaserEffects/fluid/glsl/vorticity.frag +36 -0
- package/lib/components/ServiceHubsTeaserEffects/fluid/glsl.d.ts +14 -0
- package/lib/components/ServiceHubsTeaserEffects/fluid/hooks/useDoubleFBO.tsx +37 -0
- package/lib/components/ServiceHubsTeaserEffects/fluid/hooks/useFBOs.tsx +71 -0
- package/lib/components/ServiceHubsTeaserEffects/fluid/hooks/useMaterials.tsx +242 -0
- package/lib/components/ServiceHubsTeaserEffects/fluid/hooks/usePointer.tsx +54 -0
- package/lib/components/ServiceHubsTeaserEffects/fluid/index.ts +5 -0
- package/lib/components/ServiceHubsTeaserEffects/fluid/types.ts +27 -0
- package/lib/components/ServiceHubsTeaserEffects/fluid/utils.ts +12 -0
- package/lib/components/ServiceHubsTeaserEffects/glass/Lens.tsx +66 -0
- package/lib/components/ServiceHubsTeaserEffects/index.tsx +67 -0
- package/lib/components/ServiceHubsTeaserEffects/rays/LightSource.tsx +64 -0
- package/lib/components/ServiceHubsTeaserEffects/rays/noise.js +97 -0
- package/lib/components/ServiceHubsTeaserEffects/styles.module.scss +135 -0
- package/lib/index.ts +2 -0
- package/package.json +6 -2
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { useRef } from "react";
|
|
3
|
+
import Container from "../Container";
|
|
4
|
+
import styles from "./styles.module.scss";
|
|
5
|
+
import TextSection from "../TextSection";
|
|
6
|
+
import TileGlass from "./TileGlass";
|
|
7
|
+
import TileBalls from "./TileBalls";
|
|
8
|
+
import TileRays from "./TileRays";
|
|
9
|
+
import TileFluid from "./TileFluid";
|
|
10
|
+
import { NextLink } from "../../types";
|
|
11
|
+
|
|
12
|
+
const ServiceHubsTeaserEffects = ({
|
|
13
|
+
caption,
|
|
14
|
+
heading,
|
|
15
|
+
text,
|
|
16
|
+
tiles,
|
|
17
|
+
Link,
|
|
18
|
+
}: {
|
|
19
|
+
caption: string;
|
|
20
|
+
heading: string;
|
|
21
|
+
text: string;
|
|
22
|
+
tiles: {
|
|
23
|
+
id: string;
|
|
24
|
+
uri: string;
|
|
25
|
+
title: string;
|
|
26
|
+
customFieldsHub: {
|
|
27
|
+
heading: string;
|
|
28
|
+
};
|
|
29
|
+
}[];
|
|
30
|
+
Link: NextLink;
|
|
31
|
+
}) => {
|
|
32
|
+
const wrapperRef = useRef<HTMLDivElement>(null);
|
|
33
|
+
|
|
34
|
+
return (
|
|
35
|
+
<div className={styles.benefits}>
|
|
36
|
+
<TextSection caption={caption} heading={heading} text={text} isSmall />
|
|
37
|
+
<Container noMobilePadding>
|
|
38
|
+
<div className={styles.wrapper} ref={wrapperRef}>
|
|
39
|
+
<div className={styles.tiles}>
|
|
40
|
+
{tiles.map((tile, i) => {
|
|
41
|
+
const colors: Array<"pink" | "yellow" | "brown" | "blue"> = [
|
|
42
|
+
"pink",
|
|
43
|
+
"yellow",
|
|
44
|
+
"brown",
|
|
45
|
+
"blue",
|
|
46
|
+
];
|
|
47
|
+
const background = colors[i % colors.length];
|
|
48
|
+
|
|
49
|
+
return (
|
|
50
|
+
<div className={styles.tileWrapper} key={tile.id}>
|
|
51
|
+
<div className={`${styles.tile} ${styles[background]}`}>
|
|
52
|
+
{i === 0 && <TileGlass />}
|
|
53
|
+
{i === 1 && <TileFluid />}
|
|
54
|
+
{i === 2 && <TileRays />}
|
|
55
|
+
{i === 3 && <TileBalls />}
|
|
56
|
+
</div>
|
|
57
|
+
</div>
|
|
58
|
+
);
|
|
59
|
+
})}
|
|
60
|
+
</div>
|
|
61
|
+
</div>
|
|
62
|
+
</Container>
|
|
63
|
+
</div>
|
|
64
|
+
);
|
|
65
|
+
};
|
|
66
|
+
|
|
67
|
+
export default ServiceHubsTeaserEffects;
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import { useRef, useMemo } from "react";
|
|
4
|
+
import { useFrame } from "@react-three/fiber";
|
|
5
|
+
import * as THREE from "three";
|
|
6
|
+
import noise from "./noise";
|
|
7
|
+
|
|
8
|
+
export function LightSource(props) {
|
|
9
|
+
const meshRef = useRef();
|
|
10
|
+
|
|
11
|
+
// shared time uniform
|
|
12
|
+
const time = useMemo(() => ({ value: 0 }), []);
|
|
13
|
+
|
|
14
|
+
const material = useMemo(() => {
|
|
15
|
+
const m = new THREE.MeshBasicMaterial({
|
|
16
|
+
color: 0xf197f4,
|
|
17
|
+
transparent: true,
|
|
18
|
+
onBeforeCompile: (shader) => {
|
|
19
|
+
shader.uniforms.time = time;
|
|
20
|
+
|
|
21
|
+
shader.fragmentShader = `
|
|
22
|
+
uniform float time;
|
|
23
|
+
${shader.fragmentShader}
|
|
24
|
+
`
|
|
25
|
+
.replace(
|
|
26
|
+
`void main() {`,
|
|
27
|
+
`
|
|
28
|
+
${noise}
|
|
29
|
+
void main() {
|
|
30
|
+
`
|
|
31
|
+
)
|
|
32
|
+
.replace(
|
|
33
|
+
`vec4 diffuseColor = vec4( diffuse, opacity );`,
|
|
34
|
+
`
|
|
35
|
+
vec2 uv = vUv - 0.5;
|
|
36
|
+
vec3 col = vec3(0.0);
|
|
37
|
+
|
|
38
|
+
float f = smoothstep(0.5, 0.0, length(uv));
|
|
39
|
+
f = pow(f, 4.0);
|
|
40
|
+
|
|
41
|
+
float n = snoise(vec3(uv * 7.0, time)) * 0.5 + 0.5;
|
|
42
|
+
n = n * 0.5 + 0.5;
|
|
43
|
+
|
|
44
|
+
col = mix(col, diffuse, f * n);
|
|
45
|
+
vec4 diffuseColor = vec4(col, opacity);
|
|
46
|
+
`
|
|
47
|
+
);
|
|
48
|
+
},
|
|
49
|
+
});
|
|
50
|
+
|
|
51
|
+
m.defines = { USE_UV: "" };
|
|
52
|
+
return m;
|
|
53
|
+
}, [time]);
|
|
54
|
+
|
|
55
|
+
useFrame((_, delta) => {
|
|
56
|
+
time.value += delta;
|
|
57
|
+
});
|
|
58
|
+
|
|
59
|
+
return (
|
|
60
|
+
<mesh ref={meshRef} material={material} {...props}>
|
|
61
|
+
<circleGeometry args={[50, 64]} />
|
|
62
|
+
</mesh>
|
|
63
|
+
);
|
|
64
|
+
}
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
const noise = `
|
|
2
|
+
vec4 permute(vec4 x) {
|
|
3
|
+
return mod(((x * 34.0) + 1.0) * x, 289.0);
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
vec4 taylorInvSqrt(vec4 r) {
|
|
7
|
+
return 1.79284291400159 - 0.85373472095314 * r;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
vec3 fade(vec3 t) {
|
|
11
|
+
return t * t * t * (t * (t * 6.0 - 15.0) + 10.0);
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
float snoise(vec3 v) {
|
|
15
|
+
const vec2 C = vec2(1.0 / 6.0, 1.0 / 3.0);
|
|
16
|
+
const vec4 D = vec4(0.0, 0.5, 1.0, 2.0);
|
|
17
|
+
|
|
18
|
+
vec3 i = floor(v + dot(v, C.yyy));
|
|
19
|
+
vec3 x0 = v - i + dot(i, C.xxx);
|
|
20
|
+
|
|
21
|
+
vec3 g = step(x0.yzx, x0.xyz);
|
|
22
|
+
vec3 l = 1.0 - g;
|
|
23
|
+
vec3 i1 = min(g.xyz, l.zxy);
|
|
24
|
+
vec3 i2 = max(g.xyz, l.zxy);
|
|
25
|
+
|
|
26
|
+
vec3 x1 = x0 - i1 + C.xxx;
|
|
27
|
+
vec3 x2 = x0 - i2 + C.yyy;
|
|
28
|
+
vec3 x3 = x0 - D.yyy;
|
|
29
|
+
|
|
30
|
+
i = mod(i, 289.0);
|
|
31
|
+
vec4 p = permute(
|
|
32
|
+
permute(
|
|
33
|
+
permute(
|
|
34
|
+
i.z + vec4(0.0, i1.z, i2.z, 1.0)
|
|
35
|
+
) + i.y + vec4(0.0, i1.y, i2.y, 1.0)
|
|
36
|
+
) + i.x + vec4(0.0, i1.x, i2.x, 1.0)
|
|
37
|
+
);
|
|
38
|
+
|
|
39
|
+
float n_ = 1.0 / 7.0;
|
|
40
|
+
vec3 ns = n_ * D.wyz - D.xzx;
|
|
41
|
+
|
|
42
|
+
vec4 j = p - 49.0 * floor(p * ns.z * ns.z);
|
|
43
|
+
vec4 x_ = floor(j * ns.z);
|
|
44
|
+
vec4 y_ = floor(j - 7.0 * x_);
|
|
45
|
+
|
|
46
|
+
vec4 x = x_ * ns.x + ns.yyyy;
|
|
47
|
+
vec4 y = y_ * ns.x + ns.yyyy;
|
|
48
|
+
vec4 h = 1.0 - abs(x) - abs(y);
|
|
49
|
+
|
|
50
|
+
vec4 b0 = vec4(x.xy, y.xy);
|
|
51
|
+
vec4 b1 = vec4(x.zw, y.zw);
|
|
52
|
+
|
|
53
|
+
vec4 s0 = floor(b0) * 2.0 + 1.0;
|
|
54
|
+
vec4 s1 = floor(b1) * 2.0 + 1.0;
|
|
55
|
+
vec4 sh = -step(h, vec4(0.0));
|
|
56
|
+
|
|
57
|
+
vec4 a0 = b0.xzyw + s0.xzyw * sh.xxyy;
|
|
58
|
+
vec4 a1 = b1.xzyw + s1.xzyw * sh.zzww;
|
|
59
|
+
|
|
60
|
+
vec3 p0 = vec3(a0.xy, h.x);
|
|
61
|
+
vec3 p1 = vec3(a0.zw, h.y);
|
|
62
|
+
vec3 p2 = vec3(a1.xy, h.z);
|
|
63
|
+
vec3 p3 = vec3(a1.zw, h.w);
|
|
64
|
+
|
|
65
|
+
vec4 norm = taylorInvSqrt(
|
|
66
|
+
vec4(dot(p0, p0), dot(p1, p1), dot(p2, p2), dot(p3, p3))
|
|
67
|
+
);
|
|
68
|
+
p0 *= norm.x;
|
|
69
|
+
p1 *= norm.y;
|
|
70
|
+
p2 *= norm.z;
|
|
71
|
+
p3 *= norm.w;
|
|
72
|
+
|
|
73
|
+
vec4 m = max(
|
|
74
|
+
0.6 - vec4(
|
|
75
|
+
dot(x0, x0),
|
|
76
|
+
dot(x1, x1),
|
|
77
|
+
dot(x2, x2),
|
|
78
|
+
dot(x3, x3)
|
|
79
|
+
),
|
|
80
|
+
0.0
|
|
81
|
+
);
|
|
82
|
+
m = m * m;
|
|
83
|
+
|
|
84
|
+
return 42.0 *
|
|
85
|
+
dot(
|
|
86
|
+
m * m,
|
|
87
|
+
vec4(
|
|
88
|
+
dot(p0, x0),
|
|
89
|
+
dot(p1, x1),
|
|
90
|
+
dot(p2, x2),
|
|
91
|
+
dot(p3, x3)
|
|
92
|
+
)
|
|
93
|
+
);
|
|
94
|
+
}
|
|
95
|
+
`;
|
|
96
|
+
|
|
97
|
+
export default noise;
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
@use "../variables" as *;
|
|
2
|
+
|
|
3
|
+
.benefits {
|
|
4
|
+
overflow: hidden;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
.wrapper {
|
|
8
|
+
width: 100%;
|
|
9
|
+
// overflow-x: scroll;
|
|
10
|
+
user-select: none;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
.tiles {
|
|
14
|
+
display: flex;
|
|
15
|
+
flex-wrap: wrap;
|
|
16
|
+
gap: 16px;
|
|
17
|
+
padding-bottom: 64px;
|
|
18
|
+
|
|
19
|
+
@media #{$QUERY-sm} {
|
|
20
|
+
padding-bottom: 32px;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
.tileWrapper {
|
|
25
|
+
z-index: 0;
|
|
26
|
+
position: relative;
|
|
27
|
+
width: calc(25% - 12px);
|
|
28
|
+
max-width: 100%;
|
|
29
|
+
height: 351px;
|
|
30
|
+
|
|
31
|
+
&:hover {
|
|
32
|
+
z-index: 1;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
@media screen and (max-width: $screen-sm) {
|
|
36
|
+
max-width: 80%;
|
|
37
|
+
height: 300px;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
&:first-child {
|
|
41
|
+
@media #{$QUERY-sm} {
|
|
42
|
+
margin-left: 20px;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
&:last-child {
|
|
47
|
+
@media #{$QUERY-sm} {
|
|
48
|
+
margin-right: 20px;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
.tile {
|
|
54
|
+
flex-shrink: 0;
|
|
55
|
+
white-space: pre-wrap;
|
|
56
|
+
padding: 0;
|
|
57
|
+
display: flex;
|
|
58
|
+
flex-direction: column;
|
|
59
|
+
align-items: center;
|
|
60
|
+
justify-content: center;
|
|
61
|
+
text-align: center;
|
|
62
|
+
box-sizing: border-box;
|
|
63
|
+
background-color: $color-pink;
|
|
64
|
+
color: $color-brown;
|
|
65
|
+
font-size: 25px;
|
|
66
|
+
width: 100%;
|
|
67
|
+
height: 100%;
|
|
68
|
+
font-family: $font-secondary;
|
|
69
|
+
|
|
70
|
+
path {
|
|
71
|
+
stroke: $color-brown;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
&.yellow {
|
|
75
|
+
background-color: $color-yellow;
|
|
76
|
+
color: $color-blue;
|
|
77
|
+
|
|
78
|
+
path {
|
|
79
|
+
stroke: $color-blue;
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
&.brown {
|
|
84
|
+
background-color: $color-brown;
|
|
85
|
+
color: $color-pink;
|
|
86
|
+
|
|
87
|
+
path {
|
|
88
|
+
stroke: $color-pink;
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
&.blue {
|
|
93
|
+
background-color: $color-blue;
|
|
94
|
+
color: $color-white;
|
|
95
|
+
|
|
96
|
+
path {
|
|
97
|
+
stroke: $color-white;
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
// &:hover {
|
|
102
|
+
// .face {
|
|
103
|
+
// display: none;
|
|
104
|
+
// }
|
|
105
|
+
|
|
106
|
+
// .tails {
|
|
107
|
+
// display: block;
|
|
108
|
+
// }
|
|
109
|
+
// }
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
.text {
|
|
113
|
+
margin-bottom: 42px;
|
|
114
|
+
|
|
115
|
+
&:last-child {
|
|
116
|
+
margin-bottom: 0;
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
.face {
|
|
121
|
+
display: block;
|
|
122
|
+
font-size: 35px;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
// .tails {
|
|
126
|
+
// text-align: left;
|
|
127
|
+
// padding-left: 30px;
|
|
128
|
+
// display: none;
|
|
129
|
+
// font-size: 21px;
|
|
130
|
+
// font-family: $font-secondary;
|
|
131
|
+
// }
|
|
132
|
+
|
|
133
|
+
// .tailsText {
|
|
134
|
+
// margin-bottom: 30px;
|
|
135
|
+
// }
|
package/lib/index.ts
CHANGED
|
@@ -31,6 +31,7 @@ import OfficesTeaser from "./components/OfficesTeaser";
|
|
|
31
31
|
import PartnerNetwork from "./components/PartnerNetwork";
|
|
32
32
|
import QuoteSection from "./components/QuoteSection";
|
|
33
33
|
import ServiceHubsTeaser from "./components/ServiceHubsTeaser";
|
|
34
|
+
import ServiceHubsTeaserEffects from "./components/ServiceHubsTeaserEffects";
|
|
34
35
|
import PostContent from "./components/single/Content";
|
|
35
36
|
import PostTop from "./components/single/Top";
|
|
36
37
|
import TeamBenefits from "./components/TeamBenefits";
|
|
@@ -74,6 +75,7 @@ export {
|
|
|
74
75
|
PartnerNetwork,
|
|
75
76
|
QuoteSection,
|
|
76
77
|
ServiceHubsTeaser,
|
|
78
|
+
ServiceHubsTeaserEffects,
|
|
77
79
|
PostContent,
|
|
78
80
|
PostTop,
|
|
79
81
|
TeamBenefits,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "foundry-component-library",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.10",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -63,6 +63,10 @@
|
|
|
63
63
|
"**/*.css"
|
|
64
64
|
],
|
|
65
65
|
"dependencies": {
|
|
66
|
-
"
|
|
66
|
+
"@react-three/drei": "^10.7.7",
|
|
67
|
+
"@react-three/fiber": "^9.4.2",
|
|
68
|
+
"@react-three/postprocessing": "^3.0.4",
|
|
69
|
+
"graphql-request": "^7.1.2",
|
|
70
|
+
"three": "^0.182.0"
|
|
67
71
|
}
|
|
68
72
|
}
|