Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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
- Host: GitHub
- URL: https://github.com/levyks/svelte-cubed-dom
- Owner: Levyks
- License: gpl-3.0
- Created: 2022-05-30T20:04:13.000Z (over 2 years ago)
- Default Branch: master
- Last Pushed: 2022-05-30T20:14:18.000Z (over 2 years ago)
- Last Synced: 2024-11-03T17:02:50.029Z (15 days 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
![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
```
### 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.