npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

r3f-splashscreen

v0.1.1

Published

The `SplashScreen` component adds a visually appealing splash screen to your React applications, utilizing React, Three.js, and React Three Fiber to render an animated, shader-driven blob with customizable text overlay. This component is built for easy in

Downloads

3

Readme

R3F-SplashScreen

The SplashScreen component adds a visually appealing splash screen to your React applications, utilizing React, Three.js, and React Three Fiber to render an animated, shader-driven blob with customizable text overlay. This component is built for easy integration and customization, perfect for creating an engaging user experience right from the start.

Installation

To include the SplashScreen in your project, install the package via npm:

npm install r3f-splashscreen

Import and use the component in your application:

import SplashScreen from 'your-splash-screen-package-name';

function App() {
  return (
    <SplashScreen
      name="Welcome to Our App"
      duration={5000}
      backgroundColor="#000000"
      fontColor="#FFFFFF"
      blobColor="#00FFFF"
      fontUrl="https://example.com/path-to-your-font.ttf"
      distortionScale={1.5}
      waveSpeed={2}
    />
  );
}

export default App;

Visual Demonstration

Below is a GIF that shows what the SplashScreen component looks like in action:

SplashScreen Example

Props

Here's a detailed guide to the props available in the SplashScreen component:

  • name (string): The text displayed on the splash screen. This can be your application's name or any greeting.
  • duration (number): The length of time (in milliseconds) that the splash screen remains visible.
  • backgroundColor (string): The CSS color value for the splash screen's background.
  • fontColor (string): The CSS color value for the text, ensuring good contrast with the background for readability.
  • blobColor (string): The CSS color value for the animated blob.
  • fontUrl (string): The URL of the custom font file used for the text, enabling typographic consistency with your brand.
  • distortionScale (number): Adjusts the intensity of the distortion effect on the blob, with higher values resulting in more dramatic effects.
  • waveSpeed (number): Controls the speed of the wave animations on the blob. Increasing this speeds up the animation, while decreasing it slows it down.

Internal Mechanics

The component utilizes key internal elements:

  • WaveShaderMaterial: A custom shader material designed to create dynamic, wavy surface distortions on the blob, influenced by blobColor, distortionScale, and waveSpeed.
  • AnimatedBlob: A functional component responsible for the real-time frame updates of the blob animation, employing the useFrame hook from React Three Fiber to continuously update and animate the blob based on the elapsed time.

Experimenting with SplashScreen

To experiment with different configurations of the SplashScreen, you can modify the properties directly in the test/app.tsx file:

  1. Clone the repository:
    git clone https://github.com/LayerDynamics/r3f-splashscreen.git
  2. Navigate to the test directory:
    cd r3f-splashscreen
  3. Open test/app.tsx and modify the props such as name, duration, backgroundColor, etc.
  4. Install dependencies and run the project:
    npm install
    npm run dev
  5. View the changes in your browser to see how different settings affect the component.

Best Practices

  • Performance Optimization: Adjust the geometry detail and shader complexity based on your target platform's capabilities to ensure optimal performance.
  • Device Compatibility: Test the component across different devices and screen sizes to ensure consistent behavior and appearance.