pages/assets/public_lit_docs_infoboxes.md.a41a0b44.js

16 lines
4.3 KiB
JavaScript
Raw Normal View History

import{_ as s,o,c as a,Q as n}from"./chunks/framework.1169fbc9.js";const b=JSON.parse('{"title":"Infoboxes","description":"","frontmatter":{},"headers":[],"relativePath":"public/lit/docs/infoboxes.md","filePath":"public/lit/docs/infoboxes.md","lastUpdated":1701137263000}'),e={name:"public/lit/docs/infoboxes.md"},t=n(`<h1 id="infoboxes" tabindex="-1">Infoboxes <a class="header-anchor" href="#infoboxes" aria-label="Permalink to &quot;Infoboxes&quot;"></a></h1><p>Infoboxes are good for displaying &quot;lore&quot;, or story elements, as well as for explaining complicated things.</p><p>In the default tab layout, the first infobox will be displayed at the very top of the tab.</p><p>Infoboxes are defined like other Big Features:</p><div class="language-js vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">js</span><pre class="shiki github-dark vp-code-dark"><code><span class="line"><span style="color:#B392F0;">infoboxes</span><span style="color:#E1E4E8;">: {</span></span>
<span class="line"><span style="color:#E1E4E8;"> </span><span style="color:#B392F0;">lore</span><span style="color:#E1E4E8;">: {</span></span>
<span class="line"><span style="color:#E1E4E8;"> </span><span style="color:#B392F0;">title</span><span style="color:#E1E4E8;">: </span><span style="color:#9ECBFF;">&quot;foo&quot;</span><span style="color:#E1E4E8;">,</span></span>
<span class="line"><span style="color:#E1E4E8;"> </span><span style="color:#B392F0;">body</span><span style="color:#E1E4E8;">() { </span><span style="color:#F97583;">return</span><span style="color:#E1E4E8;"> </span><span style="color:#9ECBFF;">&quot;bar&quot;</span><span style="color:#E1E4E8;"> },</span></span>
<span class="line"><span style="color:#E1E4E8;"> etc</span></span>
<span class="line"><span style="color:#E1E4E8;"> },</span></span>
<span class="line"><span style="color:#E1E4E8;"> etc</span></span>
<span class="line"><span style="color:#E1E4E8;">}</span></span></code></pre><pre class="shiki github-light vp-code-light"><code><span class="line"><span style="color:#6F42C1;">infoboxes</span><span style="color:#24292E;">: {</span></span>
<span class="line"><span style="color:#24292E;"> </span><span style="color:#6F42C1;">lore</span><span style="color:#24292E;">: {</span></span>
<span class="line"><span style="color:#24292E;"> </span><span style="color:#6F42C1;">title</span><span style="color:#24292E;">: </span><span style="color:#032F62;">&quot;foo&quot;</span><span style="color:#24292E;">,</span></span>
<span class="line"><span style="color:#24292E;"> </span><span style="color:#6F42C1;">body</span><span style="color:#24292E;">() { </span><span style="color:#D73A49;">return</span><span style="color:#24292E;"> </span><span style="color:#032F62;">&quot;bar&quot;</span><span style="color:#24292E;"> },</span></span>
<span class="line"><span style="color:#24292E;"> etc</span></span>
<span class="line"><span style="color:#24292E;"> },</span></span>
<span class="line"><span style="color:#24292E;"> etc</span></span>
<span class="line"><span style="color:#24292E;">}</span></span></code></pre></div><p>Features:</p><ul><li><p>title: The text displayed above the main box. Can be a function to be dynamic, and can use basic HTML.</p></li><li><p>body: The text displayed inside the box. Can be a function to be dynamic, and can use basic HTML.</p></li><li><p>style, titleStyle, bodyStyle: <strong>optional</strong>. Apply CSS to the infobox, or to the title button or body of the infobox, in the form of an object where the keys are CSS attributes, and the values are the values for those attributes (both as strings).</p></li><li><p>unlocked(): <strong>optional</strong>. A function returning a bool to determine if the infobox is visible or not. Default is unlocked.</p></li><li><p>layer: <strong>assigned automagically</strong>. It&#39;s the same value as the name of this layer, so you can do <code>player[this.layer].points</code> or similar</p></li><li><p>id: <strong>assigned automagically</strong>. It&#39;s the &quot;key&quot; which the bar was stored under, for convenient access. The infobox in the example&#39;s id is &quot;lore&quot;.</p></li></ul>`,7),l=[t];function p(i,r,c,y,d,E){return o(),a("div",null,l)}const h=s(e,[["render",p]]);export{b as __pageData,h as default};