Skip to content

Commit

Permalink
Add a multi-attribute example.
Browse files Browse the repository at this point in the history
  • Loading branch information
lgarron committed Sep 8, 2020
1 parent 6e34b4a commit fe3a282
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 0 deletions.
24 changes: 24 additions & 0 deletions app/twisty/attributes.html
Original file line number Diff line number Diff line change
Expand Up @@ -142,11 +142,35 @@ <h2><code>back-view=&quot;side-by-side&quot;</code></h2>
<div class="content">
<h2><code>camera-position=&quot;[-3, 4, 5]&quot;</code></h2>
<div class="multi" id="camera-position">
<span>DOM attributes:</span>
<span>Constructor config object:</span>
<span>Dynamic property setter:</span>
<twisty-player
alg="R U R' U R U2' R'"
camera-position="[-3, 4, 5]"
></twisty-player>
</div>
</div>

<div class="content">
<h2>
<code
>alg=&quot;R U R' U R U2' R'&quot;<br />
experimental-stickering=&quot;OLL&quot;<br />
background=&quot;none&quot;<br />
controls=&quot;none&quot;</code
>
</h2>
<div class="multi" id="multiple-attributes">
<span>DOM attributes:</span><span>Constructor config object:</span>
<span>Dynamic property setter:</span>
<twisty-player
alg="R U R' U R U2' R'"
experimental-stickering="OLL"
background="none"
controls="none"
></twisty-player>
</div>
</div>
</body>
</html>
17 changes: 17 additions & 0 deletions app/twisty/attributes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -128,3 +128,20 @@ experimentalSetShareAllNewRenderers(true);
tw.alg = parse("R U R' U R U2' R'");
tw.cameraPosition = new Vector3(-3, 4, 5);
}

{
document.querySelector("#multiple-attributes")!.appendChild(
new TwistyPlayer({
alg: parse("R U R' U R U2' R'"),
experimentalStickering: "OLL",
background: "none",
controls: "none",
}),
);
const tw = new TwistyPlayer();
document.querySelector("#multiple-attributes")!.appendChild(tw);
tw.alg = parse("R U R' U R U2' R'");
tw.experimentalStickering = "OLL";
tw.background = "none";
tw.controls = "none";
}

0 comments on commit fe3a282

Please sign in to comment.