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: 4 months ago
JSON representation
Easily create screens that render DOM elements in svelte-cubed
- Host: GitHub
- URL: https://github.com/levyks/svelte-cubed-dom
- Owner: Levyks
- License: gpl-3.0
- Created: 2022-05-30T20:04:13.000Z (about 3 years ago)
- Default Branch: master
- Last Pushed: 2022-05-30T20:14:18.000Z (about 3 years ago)
- Last Synced: 2025-02-19T05:34:18.474Z (5 months ago)
- Language: Svelte
- Size: 59.6 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# svelte-cubed-dom
Easily create screens that render DOM elements in svelte-cubed

## 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
```
### 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.