Skip to content

Commit

Permalink
Added newSuica command
Browse files Browse the repository at this point in the history
  • Loading branch information
boytchev committed Nov 10, 2023
1 parent b465582 commit 750f3a0
Show file tree
Hide file tree
Showing 7 changed files with 50 additions and 1 deletion.
Binary file modified docs/cheat-sheet.pdf
Binary file not shown.
Binary file modified docs/cheat-sheet.pptx
Binary file not shown.
20 changes: 19 additions & 1 deletion docs/suica.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ tag: userguide suica objects properties drawings events
# Table of contents

- [Introduction](#introduction)
- <small>[Drawing canvas](#drawing-canvas): [`suica`](#suica), [`background`](#background), [`orientation`](#orientation), [`proactive`](#proactive)</small>
- <small>[Drawing canvas](#drawing-canvas): [`suica`](#suica), [`newSuica`](#newsuica), [`background`](#background), [`orientation`](#orientation), [`proactive`](#proactive)</small>
- <small>[Creating scenes](#creating-scenes)</small>
- <small>[Creating animations](#creating-animations)</small>
- [Viewing 3D](#viewing-3d)
Expand Down Expand Up @@ -95,6 +95,24 @@ The drawing canvas has additional properties, that can be set as HTML attributes
As a global variable `suica` references the last created Suica instance. It is used to access the Suica canvas if it has no name.


#### newSuica
```js
JS:
newSuica( );
```
Command. Creates a new 3D drawing canvas as if a `<suica>` tag is used.

Example of creating а drawing canvas with JavaScript:

```js
JS:
newSuica( );
cube( );
demo( );
```
[<kbd><img src="../examples/snapshots/newsuica.jpg" width="300"></kbd>](../examples/newsuica.html)


#### background
```html
HTML:
Expand Down
31 changes: 31 additions & 0 deletions examples/newsuica.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<!DOCTYPE html>
<html lang="en">

<head>
<title>newSuica</title>

<meta charset="utf-8">
<meta name="viewport" content="width=device-width, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0">

<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Roboto:wght@300;700&display=swap" rel="stylesheet">
<link rel="shortcut icon" type="image/png" href="logo.png"/>
<link rel="stylesheet" href="examples.css">

<script src="suica.js"></script>
</head>

<body>

<h1>newSuica</h1>
<p>Creating a drawing canvas without HTML tags.</p>

<script>
newSuica();
cube();
demo();
</script>

</body>
</html>
Binary file added examples/snapshots/newSuica.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes.
File renamed without changes

0 comments on commit 750f3a0

Please sign in to comment.