Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 14 additions & 4 deletions src/components/stars/stars.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,19 @@ export const GenerativeStarBackground = ({ children, ...props }) => {
);

return (
<div {...props} className={styles.wrapper}>
<div ref={contentRef}>{children}</div>
<div
<div
{...props}
className={styles.wrapper}
style={{
"--radials": radialGradients,
"--stars": background && `url(${background})`,
"--bgHeight": `${bgHeight}px`,
}}
>
<div className={styles.content} ref={contentRef}>
{children}
</div>
{/*<div
style={{ height: bgHeight || undefined }}
className={styles.cloudWrapper}
>
Expand All @@ -62,7 +72,7 @@ export const GenerativeStarBackground = ({ children, ...props }) => {
backgroundImage: background && `url(${background})`,
height: bgHeight || undefined,
}}
/>
/>*/}
</div>
);
};
Expand Down
47 changes: 29 additions & 18 deletions src/components/stars/stars.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -4,32 +4,43 @@
height: 100vh;
overflow-x: hidden;
overflow-y: scroll;
perspective: 1px;
perspective: 0px;
/* perspective-origin: 0 0; */
transform-style: preserve-3d;
}

.content {
position: relative;
display: block;
/* overflow: hidden; */
/* perspective: 0px; */
perspective-origin: 0 0;
transform-style: preserve-3d;
}

.stars {
.content::before,
.content::after {
content: "";
position: absolute;
top: 0;
width: 100%;
height: 100%;
transform-origin: 0 0;
transform: translateZ(-2px) scale(3);
z-index: -5;
left: 0;
right: 0;
display: block;
/* transform-origin: 0 0; */
}

.cloudWrapper {
position: absolute;
top: 0;
width: 100%;
height: 100%;
transform-origin: 0 0;
transform: translateZ(-1.5px) scale(2.5);
.content::before {
background: var(--radials) top center;
transform: translateZ(-1.5px) /*scale(2.5)*/;
width: 400%;
height: calc(var(--bgHeight) * 1);
z-index: -3;
}

.cloud {
position: absolute;
inset: 0;
opacity: 1;
.content::after {
background: var(--stars) top center;
transform: translateZ(-2px) /*scale(3)*/;
width: 400%;
height: calc(var(--bgHeight) * 1);
z-index: -5;
}