Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

vinxi

Package Overview
Dependencies
Maintainers
1
Versions
97
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

vinxi

```tsx import { Canvas, useFrame } from "solid-three/three"; import { createSignal, Show } from "solid-js"; import { OrbitControls } from "src/drei/OrbitControls";

  • 0.0.0-alpha.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
21K
decreased by-12.12%
Maintainers
1
Weekly downloads
 
Created
Source

Usage

import { Canvas, useFrame } from "solid-three/three";
import { createSignal, Show } from "solid-js";
import { OrbitControls } from "src/drei/OrbitControls";

function Box(props: any) {
  const [hovered, setHover] = createSignal(false);
  const [rotation, setRotation] = createSignal(0.5);
  const [active, setActive] = createSignal(false);

  useFrame((s, delta) => setRotation((r) => r + 0.01));

  return (
    <mesh
      onClick={(e) => setActive((t) => !t)}
      onPointerOver={(e) => setHover(true)}
      onPointerOut={(e) => setHover(false)}
      rotation-y={rotation()}
      scale={active() ? 1.5 : 1}
      {...props}
    >
      <boxBufferGeometry />
      <meshStandardMaterial color={hovered() ? "hotpink" : "orange"} />
    </mesh>
  );
}

export default function App() {
  return (
    <Canvas
      camera={{
        position: [0, 2, 5],
      }}
    >
      <ambientLight intensity={0.5} />
      <spotLight position={[10, 10, 10]} angle={0.15} penumbra={1} />
      <pointLight position={[-10, -10, -10]} />
      <Box position={[-1.2, 0, 0]} />
      <Box position={[1.2, 0, 0]} />
      <OrbitControls />
    </Canvas>
  );
}

FAQs

Package last updated on 19 Dec 2021

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc