Skip to content

Commit

Permalink
Deployed e104e8c to 0.3 with MkDocs 1.6.0 and mike 1.1.2
Browse files Browse the repository at this point in the history
  • Loading branch information
fusiondoc committed Aug 28, 2024
1 parent 9fad261 commit 54d57ef
Show file tree
Hide file tree
Showing 4 changed files with 58 additions and 40 deletions.
44 changes: 28 additions & 16 deletions 0.3/assets/theme/code.css
Original file line number Diff line number Diff line change
@@ -1,25 +1,29 @@
[data-md-color-scheme="fusiondoc-light"] {
--md-code-fg-color: var(--fusiondoc-grey-9);
--md-code-bg-color: var(--fusiondoc-grey-2);
--md-code-fg-color: var(--fusiondoc-grey-2);
--md-code-bg-color: var(--fusiondoc-grey-10);
--fusiondoc-code-separator: var(--fusiondoc-grey-9);
--fusiondoc-line-numbers: var(--fusiondoc-grey-4);

--md-code-hl-color: var(--fusiondoc-accent-a20);
--md-code-hl-number-color: hsl(290, 60%, 70%);
--md-code-hl-special-color: var(--fusiondoc-grey-7);
--md-code-hl-function-color: var(--fusiondoc-grey-7);
--md-code-hl-constant-color: var(--fusiondoc-grey-7);
--md-code-hl-keyword-color: hsl(40, 75%, 60%);
--md-code-hl-string-color: hsl(330, 80%, 70%);
--md-code-hl-name-color: var(--fusiondoc-grey-8);
--md-code-hl-operator-color: var(--fusiondoc-grey-6);
--md-code-hl-punctuation-color: var(--fusiondoc-grey-6);
--md-code-hl-comment-color: var(--fusiondoc-grey-6);
--md-code-hl-generic-color: var(--fusiondoc-grey-6);
--md-code-hl-variable-color: var(--fusiondoc-grey-6);
--md-code-hl-number-color: hsl(290, 60%, 40%);
--md-code-hl-special-color: var(--fusiondoc-grey-4);
--md-code-hl-function-color: var(--fusiondoc-grey-4);
--md-code-hl-constant-color: var(--fusiondoc-grey-4);
--md-code-hl-keyword-color: hsl(40, 75%, 30%);
--md-code-hl-string-color: hsl(330, 80%, 40%);
--md-code-hl-name-color: var(--fusiondoc-grey-3);
--md-code-hl-operator-color: var(--fusiondoc-grey-5);
--md-code-hl-punctuation-color: var(--fusiondoc-grey-5);
--md-code-hl-comment-color: var(--fusiondoc-grey-5);
--md-code-hl-generic-color: var(--fusiondoc-grey-5);
--md-code-hl-variable-color: var(--fusiondoc-grey-5);
}

[data-md-color-scheme="fusiondoc-dark"] {
--md-code-fg-color: var(--fusiondoc-grey-8);
--md-code-bg-color: var(--fusiondoc-grey-2);
--fusiondoc-code-separator: var(--fusiondoc-grey-3);
--fusiondoc-line-numbers: var(--fusiondoc-grey-6);

--md-code-hl-color: var(--fusiondoc-accent-a20);
--md-code-hl-number-color: hsl(290, 60%, 70%);
Expand Down Expand Up @@ -50,7 +54,7 @@
}

.highlighttable .linenos {
box-shadow: inset -.05rem 0 var(--fusiondoc-grey-3);
box-shadow: inset -.05rem 0 var(--fusiondoc-code-separator);
}

.highlight .hll {
Expand All @@ -61,7 +65,7 @@
}

.highlighttable .linenodiv pre {
color: var(--fusiondoc-grey-6);
color: var(--fusiondoc-line-numbers);
}

.highlight .md-clipboard {
Expand All @@ -76,6 +80,14 @@
color: var(--fusiondoc-grey-10);
}

pre {
box-shadow: var(--md-shadow-z1);
}

.tabbed-set pre {
box-shadow: none;
}

code:not(pre code, .highlight) {
background-color: var(--fusiondoc-bg-2) !important;
color: inherit !important;
Expand Down
8 changes: 6 additions & 2 deletions 0.3/assets/theme/paragraph.css
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
.js .md-typeset .tabbed-labels::before {
background-color: transparent;
height: 100%;
box-shadow: 0 -0.325rem var(--md-code-bg-color) inset, 0 -0.4rem var(--fusiondoc-orange) inset;
box-shadow: 0 -0.325rem var(--md-code-bg-color) inset, 0 -0.4rem var(--fusiondoc-accent) inset;
}

.md-typeset .tabbed-labels>label {
Expand All @@ -41,6 +41,10 @@
border-top-right-radius: 0.25rem;
}

.md-typeset .tabbed-set {
box-shadow: var(--md-shadow-z1);
}

h1 > .twemoji:first-child,
h2 > .twemoji:first-child,
h3 > .twemoji:first-child,
Expand Down Expand Up @@ -72,7 +76,7 @@ h6 > .twemoji:first-child {
.md-typeset .tabbed-set>input:nth-child(18):checked~.tabbed-labels>:nth-child(18),
.md-typeset .tabbed-set>input:nth-child(19):checked~.tabbed-labels>:nth-child(19),
.md-typeset .tabbed-set>input:nth-child(20):checked~.tabbed-labels>:nth-child(20) {
color: var(--fusiondoc-orange);
color: var(--fusiondoc-accent);
font-weight: 700;
}

Expand Down
44 changes: 23 additions & 21 deletions 0.3/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2973,20 +2973,26 @@ <h2 class="first" id="representing-change">Representing change<a class="headerli
</code></pre></div>
<p>You can write out your logic using Fusion's built-in state objects.
Here's the two basic ones, Value and Computed:</p>
<div class="highlight"><pre><span></span><code><span class="c1">-- This creates a state object that you can set manually.</span>
<div class="highlight"><pre><span></span><code><span class="c1">-- Start tracking some new objects.</span>
<span class="kd">local</span> <span class="n">scope</span> <span class="o">=</span> <span class="n">Fusion</span><span class="p">:</span><span class="n">scoped</span><span class="p">()</span>

<span class="c1">-- This creates a state object that you can set manually.</span>
<span class="c1">-- You can change its value using myName:set().</span>
<span class="kd">local</span> <span class="n">myName</span> <span class="o">=</span> <span class="n">Value</span><span class="p">(</span><span class="s2">&quot;Daniel&quot;</span><span class="p">)</span>
<span class="kd">local</span> <span class="n">myName</span> <span class="o">=</span> <span class="n">scope</span><span class="p">:</span><span class="n">Value</span><span class="p">(</span><span class="s2">&quot;Daniel&quot;</span><span class="p">)</span>

<span class="c1">-- This creates a state object from a calculation.</span>
<span class="c1">-- It determines its own value automatically.</span>
<span class="kd">local</span> <span class="n">myGreeting</span> <span class="o">=</span> <span class="n">scope</span><span class="p">:</span><span class="n">Computed</span><span class="p">(</span><span class="kr">function</span><span class="p">(</span><span class="n">use</span><span class="p">)</span>
<span class="kr">return</span> <span class="s2">&quot;Hello! My name is &quot;</span> <span class="o">..</span> <span class="n">use</span><span class="p">(</span><span class="n">myName</span><span class="p">)</span>
<span class="kr">end</span><span class="p">)</span>

<span class="c1">-- Discard all the objects.</span>
<span class="n">scope</span><span class="p">:</span><span class="n">doCleanup</span><span class="p">()</span>
</code></pre></div>
<p>To watch what a state object does, you can use an Observer.
For example, you can run some code when an object changes value.</p>
<div class="highlight"><pre><span></span><code><span class="c1">-- This observer watches for when the greeting changes.</span>
<span class="kd">local</span> <span class="n">myObserver</span> <span class="o">=</span> <span class="n">Observer</span><span class="p">(</span><span class="n">myGreeting</span><span class="p">)</span>
<span class="kd">local</span> <span class="n">myObserver</span> <span class="o">=</span> <span class="n">scope</span><span class="p">:</span><span class="n">Observer</span><span class="p">(</span><span class="n">myGreeting</span><span class="p">)</span>

<span class="c1">-- Let’s print out the greeting when there’s a new one.</span>
<span class="kd">local</span> <span class="n">disconnect</span> <span class="o">=</span> <span class="n">myObserver</span><span class="p">:</span><span class="n">onChange</span><span class="p">(</span><span class="kr">function</span><span class="p">()</span>
Expand All @@ -3003,41 +3009,37 @@ <h2 class="second" id="building-instances">Building instances<a class="headerlin
<p>Fusion offers comprehensive APIs to build or enrich instances from code, so
you can easily integrate with your game scripts.</p>
<hr />
<p>Fusion provides dedicated functions to create and modify instances. They allow
you to easily configure your instance in one place.</p>
<p>Fusion provides dedicated functions to create instances. They allow you to
easily configure your instance in one place.</p>
<div class="highlight"><pre><span></span><code><span class="c1">-- This will create a red part in the workspace.</span>
<span class="kd">local</span> <span class="n">myPart</span> <span class="o">=</span> <span class="n">New</span> <span class="s2">&quot;Part&quot;</span> <span class="p">{</span>
<span class="kd">local</span> <span class="n">myPart</span> <span class="o">=</span> <span class="n">scope</span><span class="p">:</span><span class="n">New</span> <span class="s2">&quot;Part&quot;</span> <span class="p">{</span>
<span class="n">Parent</span> <span class="o">=</span> <span class="n">workspace</span><span class="p">,</span>
<span class="n">BrickColor</span> <span class="o">=</span> <span class="n">BrickColor</span><span class="p">.</span><span class="n">Red</span><span class="p">()</span>
<span class="p">}</span>

<span class="c1">-- This adds on some extras after.</span>
<span class="n">Hydrate</span><span class="p">(</span><span class="n">myPart</span><span class="p">)</span> <span class="p">{</span>
<span class="n">Material</span> <span class="o">=</span> <span class="s2">&quot;Wood&quot;</span><span class="p">,</span>
<span class="n">Transparency</span> <span class="o">=</span> <span class="mf">0.5</span>
<span class="p">}</span>
</code></pre></div>
<p>They offer powerful features to keep all your instance code close together. For
example, you can listen for events or add children.</p>
<div class="highlight"><pre><span></span><code><span class="c1">-- This will create a rounded button.</span>
<span class="c1">-- When you click it, it’ll greet you.</span>
<span class="kd">local</span> <span class="n">myButton</span> <span class="o">=</span> <span class="n">New</span> <span class="s2">&quot;TextButton&quot;</span> <span class="p">{</span>
<span class="kd">local</span> <span class="n">myButton</span> <span class="o">=</span> <span class="n">scope</span><span class="p">:</span><span class="n">New</span> <span class="s2">&quot;TextButton&quot;</span> <span class="p">{</span>
<span class="n">Text</span> <span class="o">=</span> <span class="s2">&quot;Click me&quot;</span><span class="p">,</span>

<span class="p">[</span><span class="n">OnEvent</span> <span class="s2">&quot;Activated&quot;</span><span class="p">]</span> <span class="o">=</span> <span class="kr">function</span><span class="p">()</span>
<span class="nb">print</span><span class="p">(</span><span class="s2">&quot;Hello! I’m a button.&quot;</span><span class="p">)</span>
<span class="kr">end</span><span class="p">,</span>
<span class="p">[</span><span class="n">Children</span><span class="p">]</span> <span class="o">=</span> <span class="n">New</span> <span class="s2">&quot;UICorner&quot;</span> <span class="p">{</span>

<span class="p">[</span><span class="n">Children</span><span class="p">]</span> <span class="o">=</span> <span class="n">scope</span><span class="p">:</span><span class="n">New</span> <span class="s2">&quot;UICorner&quot;</span> <span class="p">{</span>
<span class="n">CornerRadius</span> <span class="o">=</span> <span class="n">UDim</span><span class="p">.</span><span class="n">new</span><span class="p">(</span><span class="mi">1</span><span class="p">,</span> <span class="mi">0</span><span class="p">)</span>
<span class="p">}</span>
<span class="p">}</span>
</code></pre></div>
<p>You can also plug state objects in directly. The instance updates as the state
object changes value.</p>
<div class="highlight"><pre><span></span><code><span class="c1">-- Creating a state object you can control...</span>
<span class="kd">local</span> <span class="n">message</span> <span class="o">=</span> <span class="n">Value</span><span class="p">(</span><span class="s2">&quot;Hello!&quot;</span><span class="p">)</span>
<span class="kd">local</span> <span class="n">message</span> <span class="o">=</span> <span class="n">scope</span><span class="p">:</span><span class="n">Value</span><span class="p">(</span><span class="s2">&quot;Hello!&quot;</span><span class="p">)</span>

<span class="c1">-- Now you can plug that state object into the Text property.</span>
<span class="kd">local</span> <span class="n">myLabel</span> <span class="o">=</span> <span class="n">New</span> <span class="s2">&quot;TextLabel&quot;</span> <span class="p">{</span>
<span class="kd">local</span> <span class="n">myLabel</span> <span class="o">=</span> <span class="n">scope</span><span class="p">:</span><span class="n">New</span> <span class="s2">&quot;TextLabel&quot;</span> <span class="p">{</span>
<span class="n">Text</span> <span class="o">=</span> <span class="n">message</span>
<span class="p">}</span>
<span class="nb">print</span><span class="p">(</span><span class="n">myLabel</span><span class="p">.</span><span class="n">Text</span><span class="p">)</span> <span class="c1">--&gt; Hello!</span>
Expand All @@ -3056,14 +3058,14 @@ <h2 class="third" id="animating-anything">Animating anything<a class="headerlink
<p>Fusion lets you use tweens or physically based springs to animate any value you
want - not just instance properties.</p>
<div class="highlight"><pre><span></span><code><span class="c1">-- This could be anything you want, as long as it&#39;s a state object.</span>
<span class="kd">local</span> <span class="n">health</span> <span class="o">=</span> <span class="n">Value</span><span class="p">(</span><span class="mi">100</span><span class="p">)</span>
<span class="kd">local</span> <span class="n">health</span> <span class="o">=</span> <span class="n">scope</span><span class="p">:</span><span class="n">Value</span><span class="p">(</span><span class="mi">100</span><span class="p">)</span>

<span class="c1">-- Easily make it tween between values...</span>
<span class="kd">local</span> <span class="n">style</span> <span class="o">=</span> <span class="n">TweenInfo</span><span class="p">.</span><span class="n">new</span><span class="p">(</span><span class="mf">0.5</span><span class="p">,</span> <span class="n">Enum</span><span class="p">.</span><span class="n">EasingStyle</span><span class="p">.</span><span class="n">Quad</span><span class="p">)</span>
<span class="kd">local</span> <span class="n">tweenHealth</span> <span class="o">=</span> <span class="n">Tween</span><span class="p">(</span><span class="n">health</span><span class="p">,</span> <span class="n">style</span><span class="p">)</span>
<span class="kd">local</span> <span class="n">tweenHealth</span> <span class="o">=</span> <span class="n">scope</span><span class="p">:</span><span class="n">Tween</span><span class="p">(</span><span class="n">health</span><span class="p">,</span> <span class="n">style</span><span class="p">)</span>

<span class="c1">-- ...or use spring physics for extra responsiveness.</span>
<span class="kd">local</span> <span class="n">springHealth</span> <span class="o">=</span> <span class="n">Spring</span><span class="p">(</span><span class="n">health</span><span class="p">,</span> <span class="mi">30</span><span class="p">,</span> <span class="mf">0.9</span><span class="p">)</span>
<span class="kd">local</span> <span class="n">springHealth</span> <span class="o">=</span> <span class="n">scope</span><span class="p">:</span><span class="n">Spring</span><span class="p">(</span><span class="n">health</span><span class="p">,</span> <span class="mi">30</span><span class="p">,</span> <span class="mf">0.9</span><span class="p">)</span>
</code></pre></div>
<p>Tween and Spring are state objects, just like anything else that changes in
your program. That means it's easy to process them afterwards.</p>
Expand All @@ -3073,7 +3075,7 @@ <h2 class="third" id="animating-anything">Animating anything<a class="headerlink
<span class="kr">end</span><span class="p">)</span>

<span class="c1">-- You can format it as text and put it in some UI, too.</span>
<span class="kd">local</span> <span class="n">myText</span> <span class="o">=</span> <span class="n">New</span> <span class="s2">&quot;TextLabel&quot;</span> <span class="p">{</span>
<span class="kd">local</span> <span class="n">myText</span> <span class="o">=</span> <span class="n">scope</span><span class="p">:</span><span class="n">New</span> <span class="s2">&quot;TextLabel&quot;</span> <span class="p">{</span>
<span class="n">Text</span> <span class="o">=</span> <span class="n">scope</span><span class="p">:</span><span class="n">Computed</span><span class="p">(</span><span class="kr">function</span><span class="p">(</span><span class="n">use</span><span class="p">)</span>
<span class="kr">return</span> <span class="s2">&quot;Health: &quot;</span> <span class="o">..</span> <span class="n">use</span><span class="p">(</span><span class="n">wholeHealth</span><span class="p">)</span>
<span class="kr">end</span><span class="p">)</span>
Expand All @@ -3091,7 +3093,7 @@ <h2 class="third" id="animating-anything">Animating anything<a class="headerlink
<span class="kr">end</span><span class="p">)</span>

<span class="c1">-- Plug it right into your animation!</span>
<span class="kd">local</span> <span class="n">tweenHealth</span> <span class="o">=</span> <span class="n">Tween</span><span class="p">(</span><span class="n">health</span><span class="p">,</span> <span class="n">style</span><span class="p">)</span>
<span class="kd">local</span> <span class="n">tweenHealth</span> <span class="o">=</span> <span class="n">scope</span><span class="p">:</span><span class="n">Tween</span><span class="p">(</span><span class="n">health</span><span class="p">,</span> <span class="n">style</span><span class="p">)</span>
</code></pre></div>
<hr />
<h2 id="sparked-your-curiosity">Sparked your curiosity?<a class="headerlink" href="#sparked-your-curiosity" title="Permanent link">&para;</a></h2>
Expand Down
2 changes: 1 addition & 1 deletion 0.3/search/search_index.json

Large diffs are not rendered by default.

0 comments on commit 54d57ef

Please sign in to comment.