Skip to content

Commit

Permalink
deploy: e9925d8
Browse files Browse the repository at this point in the history
  • Loading branch information
ethanlchristensen committed Nov 5, 2024
1 parent e0ff711 commit 2415390
Show file tree
Hide file tree
Showing 7 changed files with 35 additions and 23 deletions.
36 changes: 24 additions & 12 deletions _modules/bruhanimate/demos/firework_demo.html
Original file line number Diff line number Diff line change
Expand Up @@ -87,34 +87,46 @@ <h1>Source code for bruhanimate.demos.firework_demo</h1><div class="highlight"><
<span class="sd">limitations under the License.</span>
<span class="sd">&quot;&quot;&quot;</span>

<span class="kn">from</span> <span class="nn">..bruhrenderer</span> <span class="kn">import</span> <span class="n">CenterRenderer</span>
<span class="kn">from</span> <span class="nn">..bruhutil</span> <span class="kn">import</span> <span class="n">Screen</span><span class="p">,</span> <span class="n">text_to_image</span><span class="p">,</span> <span class="n">get_image</span>
<span class="kn">import</span> <span class="nn">os</span>
<span class="n">os</span><span class="o">.</span><span class="n">system</span><span class="p">(</span><span class="s2">&quot; &quot;</span><span class="p">)</span>

<span class="kn">from</span> <span class="nn">bruhanimate.bruhutil</span> <span class="kn">import</span> <span class="n">Screen</span><span class="p">,</span> <span class="n">bruhimage</span><span class="p">,</span> <span class="n">Buffer</span>
<span class="kn">from</span> <span class="nn">bruhanimate.bruhrenderer</span> <span class="kn">import</span> <span class="n">CenterRenderer</span>
<span class="kn">from</span> <span class="nn">bruhanimate.bruheffect</span> <span class="kn">import</span> <span class="n">TwinkleEffect</span>


<div class="viewcode-block" id="show">
<a class="viewcode-back" href="../../../bruhanimate.demos.html#bruhanimate.demos.firework_demo.show">[docs]</a>
<span class="k">def</span> <span class="nf">show</span><span class="p">(</span><span class="n">screen</span><span class="p">):</span>
<span class="n">image</span> <span class="o">=</span> <span class="n">bruhimage</span><span class="o">.</span><span class="n">text_to_image</span><span class="p">(</span><span class="s2">&quot;HAPPY NEW YEAR!&quot;</span><span class="p">,</span> <span class="n">font</span><span class="o">=</span><span class="s2">&quot;js_cursive&quot;</span><span class="p">)</span>

<div class="viewcode-block" id="fireworks">
<a class="viewcode-back" href="../../../bruhanimate.demos.html#bruhanimate.demos.firework_demo.fireworks">[docs]</a>
<span class="k">def</span> <span class="nf">fireworks</span><span class="p">(</span><span class="n">screen</span><span class="p">:</span> <span class="n">Screen</span><span class="p">):</span>
<span class="n">renderer</span> <span class="o">=</span> <span class="n">CenterRenderer</span><span class="p">(</span>
<span class="n">screen</span><span class="o">=</span><span class="n">screen</span><span class="p">,</span>
<span class="n">img</span><span class="o">=</span><span class="n">text_to_image</span><span class="p">(</span><span class="s2">&quot;FIREWORKS!&quot;</span><span class="p">),</span>
<span class="n">img</span><span class="o">=</span><span class="n">image</span><span class="p">,</span>
<span class="n">frames</span><span class="o">=</span><span class="nb">float</span><span class="p">(</span><span class="s2">&quot;inf&quot;</span><span class="p">),</span>
<span class="n">frame_time</span><span class="o">=</span><span class="mf">0.05</span><span class="p">,</span>
<span class="n">effect_type</span><span class="o">=</span><span class="s2">&quot;firework&quot;</span><span class="p">,</span>
<span class="n">background</span><span class="o">=</span><span class="s2">&quot; &quot;</span><span class="p">,</span>
<span class="n">transparent</span><span class="o">=</span><span class="kc">False</span>
<span class="n">transparent</span><span class="o">=</span><span class="kc">True</span>
<span class="p">)</span>

<span class="n">renderer</span><span class="o">.</span><span class="n">effect</span><span class="o">.</span><span class="n">set_firework_rate</span><span class="p">(</span><span class="n">firework_rate</span><span class="o">=</span><span class="mf">0.1</span><span class="p">)</span>
<span class="n">second_effect</span> <span class="o">=</span> <span class="n">TwinkleEffect</span><span class="p">(</span><span class="n">buffer</span><span class="o">=</span><span class="n">Buffer</span><span class="p">(</span><span class="n">screen</span><span class="o">.</span><span class="n">height</span><span class="p">,</span> <span class="n">screen</span><span class="o">.</span><span class="n">width</span><span class="p">),</span> <span class="n">background</span><span class="o">=</span><span class="s2">&quot; &quot;</span><span class="p">)</span>
<span class="n">second_effect</span><span class="o">.</span><span class="n">set_density</span><span class="p">(</span><span class="mf">0.01</span><span class="p">)</span>

<span class="n">renderer</span><span class="o">.</span><span class="n">effect</span><span class="o">.</span><span class="n">set_second_effect</span><span class="p">(</span><span class="n">second_effect</span><span class="p">)</span>
<span class="n">renderer</span><span class="o">.</span><span class="n">effect</span><span class="o">.</span><span class="n">set_firework_rate</span><span class="p">(</span><span class="mf">0.05</span><span class="p">)</span>
<span class="n">renderer</span><span class="o">.</span><span class="n">effect</span><span class="o">.</span><span class="n">set_firework_type</span><span class="p">(</span><span class="s2">&quot;random&quot;</span><span class="p">)</span>
<span class="n">renderer</span><span class="o">.</span><span class="n">effect</span><span class="o">.</span><span class="n">set_firework_color_enabled</span><span class="p">(</span><span class="kc">True</span><span class="p">)</span>
<span class="n">renderer</span><span class="o">.</span><span class="n">effect</span><span class="o">.</span><span class="n">set_firework_color_type</span><span class="p">(</span><span class="s2">&quot;twotone&quot;</span><span class="p">)</span>
<span class="n">renderer</span><span class="o">.</span><span class="n">effect</span><span class="o">.</span><span class="n">set_firework_type</span><span class="p">(</span><span class="s2">&quot;random&quot;</span><span class="p">)</span>

<span class="n">renderer</span><span class="o">.</span><span class="n">run</span><span class="p">()</span></div>
<span class="n">renderer</span><span class="o">.</span><span class="n">run</span><span class="p">(</span><span class="n">end_message</span><span class="o">=</span><span class="kc">True</span><span class="p">)</span></div>



<div class="viewcode-block" id="run">
<a class="viewcode-back" href="../../../bruhanimate.demos.html#bruhanimate.demos.firework_demo.run">[docs]</a>
<span class="k">def</span> <span class="nf">run</span><span class="p">():</span>
<span class="n">Screen</span><span class="o">.</span><span class="n">show</span><span class="p">(</span><span class="n">fireworks</span><span class="p">)</span></div>
<span class="n">Screen</span><span class="o">.</span><span class="n">show</span><span class="p">(</span><span class="n">show</span><span class="p">)</span></div>



<span class="k">if</span> <span class="vm">__name__</span> <span class="o">==</span> <span class="s2">&quot;__main__&quot;</span><span class="p">:</span>
Expand Down
4 changes: 2 additions & 2 deletions bruhanimate.bruheffect.html
Original file line number Diff line number Diff line change
Expand Up @@ -1705,7 +1705,7 @@ <h2>Submodules<a class="headerlink" href="#submodules" title="Link to this headi

<dl class="py method">
<dt class="sig sig-object py" id="bruhanimate.bruheffect.plasma_effect.PlasmaEffect.update_plasma_values">
<span class="sig-name descname"><span class="pre">update_plasma_values</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">a</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">int</span></span><span class="w"> </span><span class="o"><span class="pre">=</span></span><span class="w"> </span><span class="default_value"><span class="pre">31</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">b</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">int</span></span><span class="w"> </span><span class="o"><span class="pre">=</span></span><span class="w"> </span><span class="default_value"><span class="pre">18</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">c</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">int</span></span><span class="w"> </span><span class="o"><span class="pre">=</span></span><span class="w"> </span><span class="default_value"><span class="pre">15</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">d</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">int</span></span><span class="w"> </span><span class="o"><span class="pre">=</span></span><span class="w"> </span><span class="default_value"><span class="pre">3</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/bruhanimate/bruheffect/plasma_effect.html#PlasmaEffect.update_plasma_values"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#bruhanimate.bruheffect.plasma_effect.PlasmaEffect.update_plasma_values" title="Link to this definition"></a></dt>
<span class="sig-name descname"><span class="pre">update_plasma_values</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">a</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">int</span></span><span class="w"> </span><span class="o"><span class="pre">=</span></span><span class="w"> </span><span class="default_value"><span class="pre">2</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">b</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">int</span></span><span class="w"> </span><span class="o"><span class="pre">=</span></span><span class="w"> </span><span class="default_value"><span class="pre">3</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">c</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">int</span></span><span class="w"> </span><span class="o"><span class="pre">=</span></span><span class="w"> </span><span class="default_value"><span class="pre">47</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">d</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">int</span></span><span class="w"> </span><span class="o"><span class="pre">=</span></span><span class="w"> </span><span class="default_value"><span class="pre">50</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/bruhanimate/bruheffect/plasma_effect.html#PlasmaEffect.update_plasma_values"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#bruhanimate.bruheffect.plasma_effect.PlasmaEffect.update_plasma_values" title="Link to this definition"></a></dt>
<dd><p>Function to set the plasma values.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
Expand Down Expand Up @@ -2730,7 +2730,7 @@ <h2>Submodules<a class="headerlink" href="#submodules" title="Link to this headi

<dl class="py method">
<dt class="sig sig-object py" id="bruhanimate.bruheffect.PlasmaEffect.update_plasma_values">
<span class="sig-name descname"><span class="pre">update_plasma_values</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">a</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">int</span></span><span class="w"> </span><span class="o"><span class="pre">=</span></span><span class="w"> </span><span class="default_value"><span class="pre">31</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">b</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">int</span></span><span class="w"> </span><span class="o"><span class="pre">=</span></span><span class="w"> </span><span class="default_value"><span class="pre">18</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">c</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">int</span></span><span class="w"> </span><span class="o"><span class="pre">=</span></span><span class="w"> </span><span class="default_value"><span class="pre">15</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">d</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">int</span></span><span class="w"> </span><span class="o"><span class="pre">=</span></span><span class="w"> </span><span class="default_value"><span class="pre">3</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/bruhanimate/bruheffect/plasma_effect.html#PlasmaEffect.update_plasma_values"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#bruhanimate.bruheffect.PlasmaEffect.update_plasma_values" title="Link to this definition"></a></dt>
<span class="sig-name descname"><span class="pre">update_plasma_values</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">a</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">int</span></span><span class="w"> </span><span class="o"><span class="pre">=</span></span><span class="w"> </span><span class="default_value"><span class="pre">2</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">b</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">int</span></span><span class="w"> </span><span class="o"><span class="pre">=</span></span><span class="w"> </span><span class="default_value"><span class="pre">3</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">c</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">int</span></span><span class="w"> </span><span class="o"><span class="pre">=</span></span><span class="w"> </span><span class="default_value"><span class="pre">47</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">d</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">int</span></span><span class="w"> </span><span class="o"><span class="pre">=</span></span><span class="w"> </span><span class="default_value"><span class="pre">50</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/bruhanimate/bruheffect/plasma_effect.html#PlasmaEffect.update_plasma_values"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#bruhanimate.bruheffect.PlasmaEffect.update_plasma_values" title="Link to this definition"></a></dt>
<dd><p>Function to set the plasma values.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
Expand Down
8 changes: 4 additions & 4 deletions bruhanimate.demos.html
Original file line number Diff line number Diff line change
Expand Up @@ -141,13 +141,13 @@ <h2>Submodules<a class="headerlink" href="#submodules" title="Link to this headi
See the License for the specific language governing permissions and
limitations under the License.</p>
<dl class="py function">
<dt class="sig sig-object py" id="bruhanimate.demos.firework_demo.fireworks">
<span class="sig-prename descclassname"><span class="pre">bruhanimate.demos.firework_demo.</span></span><span class="sig-name descname"><span class="pre">fireworks</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">screen</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><a class="reference internal" href="bruhanimate.bruhutil.html#bruhanimate.bruhutil.bruhscreen.Screen" title="bruhanimate.bruhutil.bruhscreen.Screen"><span class="pre">Screen</span></a></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/bruhanimate/demos/firework_demo.html#fireworks"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#bruhanimate.demos.firework_demo.fireworks" title="Link to this definition"></a></dt>
<dt class="sig sig-object py" id="bruhanimate.demos.firework_demo.run">
<span class="sig-prename descclassname"><span class="pre">bruhanimate.demos.firework_demo.</span></span><span class="sig-name descname"><span class="pre">run</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/bruhanimate/demos/firework_demo.html#run"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#bruhanimate.demos.firework_demo.run" title="Link to this definition"></a></dt>
<dd></dd></dl>

<dl class="py function">
<dt class="sig sig-object py" id="bruhanimate.demos.firework_demo.run">
<span class="sig-prename descclassname"><span class="pre">bruhanimate.demos.firework_demo.</span></span><span class="sig-name descname"><span class="pre">run</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/bruhanimate/demos/firework_demo.html#run"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#bruhanimate.demos.firework_demo.run" title="Link to this definition"></a></dt>
<dt class="sig sig-object py" id="bruhanimate.demos.firework_demo.show">
<span class="sig-prename descclassname"><span class="pre">bruhanimate.demos.firework_demo.</span></span><span class="sig-name descname"><span class="pre">show</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">screen</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/bruhanimate/demos/firework_demo.html#show"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#bruhanimate.demos.firework_demo.show" title="Link to this definition"></a></dt>
<dd></dd></dl>

</section>
Expand Down
Loading

0 comments on commit 2415390

Please sign in to comment.