Security News
The Unpaid Backbone of Open Source: Solo Maintainers Face Increasing Security Demands
Solo open source maintainers face burnout and security challenges, with 60% unpaid and 60% considering quitting.
depth-section
Advanced tools
Easy to use 3D models for your page with a parallax scrolling effect.
Stay tuned! New background models and features are on the way!
In your React project, run:
npm install depth-section three
Or
yarn add depth-section three
import { Fragmented } from 'depth-section'
const App = () => (
<>
<div style={{height: '100vh'}} />
<div style={{height: '100vh'}}>
<Fragmented />
</div>
<div style={{height: '100vh'}} />
</>
)
}
export default App
Do not update when the background isn't moving.
Changes in the vertical height on mobile devices causes the canvas to be resized, resulting in the mesh jumping around. Resources:
Right now, the GLTF files used in the backgrounds can only be served from the ChrisCrossCrash.GitHub.io GitHub pages repository. Users should be given the option to download the files and self-host them. Here are some options:
<Fragmented url='/fragmented.glb'>
. The user would have to manually download the file and put it in their public
directory.npm run depth-section --download public
. The user would then have to specify the directory where the files are located with an environment variable.DepthSection
is the core component of the the library on which all other components are built. It has two main responsibilities:
children
on a Three.js canvas with the position and camera offset needed to create a parallax effect when it is scrolled through the viewport.htmlOverlay
prop inside of a container which fills 100% of the canvas's height and width.DepthSection
's children
are @react-three/fiber
components. They don't contain any fancy animation logic relating to the parallax scrolling effect. They are simply 3D elements that appear in the scene.
Let's see how we can use DepthSection
to create a new 3D background:
import { DepthSection } from '../DepthSection/DepthSection'
import type { GroupProps } from '@react-three/fiber'
/** The component to be exported to the application. */
export const TorusKnotSection = (props: { children?: React.ReactNode }) => (
<DepthSection htmlOverlay={props.children}>
<mesh>
<torusKnotBufferGeometry />
<meshStandardMaterial color='#ffff00' />
</mesh>
<ambientLight />
</DepthSection>
)
And then in the application:
import { TorusKnotSection } from 'depth-section'
/** An "About" section with a Depth Section background. */
const AboutSection = () => (
<TorusKnotSection>
<div className='about-section'>
<h1>About</h1>
<p>
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec euismod,
nisi eu aliquam consectetur, nisl nisi consectetur nisl, eget tincidunt
nisl nisl vitae nisl.
</p>
</div>
</TorusKnotSection>
)
FAQs
What's a depth section? The best way to learn is by checking out the [storybook examples](https://depth-section.vercel.app).
The npm package depth-section receives a total of 3 weekly downloads. As such, depth-section popularity was classified as not popular.
We found that depth-section demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Solo open source maintainers face burnout and security challenges, with 60% unpaid and 60% considering quitting.
Security News
License exceptions modify the terms of open source licenses, impacting how software can be used, modified, and distributed. Developers should be aware of the legal implications of these exceptions.
Security News
A developer is accusing Tencent of violating the GPL by modifying a Python utility and changing its license to BSD, highlighting the importance of copyleft compliance.