Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/levyks/svelte-cubed-dom

Easily create screens that render DOM elements in svelte-cubed
https://github.com/levyks/svelte-cubed-dom

Last synced: 8 days ago
JSON representation

Easily create screens that render DOM elements in svelte-cubed

Awesome Lists containing this project

README

        

# svelte-cubed-dom

Easily create screens that render DOM elements in svelte-cubed

![Screenshot](https://i.imgur.com/IYMopa2.png)

## Installation

```
npm install svelte-cubed-dom
```

## Usage

### Put a `CSSRenderer` component somewhere in the component three "below" `SC.Canvas`

Pass as it `scCanvas` prop the object binded to the `SC.Canvas` component (this will probably not be needed once [this PR](https://github.com/Rich-Harris/svelte-cubed/pull/17) is merged)

```svelte

import * as THREE from 'three';
import * as SC from 'svelte-cubed';
import { CSSRenderer } from 'svelte-cubed-dom';

let scCanvas: SC.Canvas;



```

### Just put a `Screen` component anywhere you need it

```svelte

import { Screen } from 'svelte-cubed-dom';


Hello from


svelte-cubed-dom


GitHub
NPM


```

### Disclaimer

I don't know Three.js that well, so there might be some problems with the approach I've taken. If you have any suggestions, please let me know.