A music player that connects to your cloud/distributed storage. diffuse.sh
Something went wrong. Try again.
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185---layout: layouts/kitchen.vtobase: ../title: Create | Diffuseexamples: - url: "facets/examples/now-playing/index.html" title: "Now playing" desc: > Shows what's currently set to "now playing" in the queue, along with a button to shift the queue to the next track. - url: "facets/examples/generate-playlist/index.html" title: "Generate playlist" desc: > Make a list of what previously played in the queue.---<style> h2 { font-size: var(--fs-lg); opacity: 0.6; }</style><h1 id="create" hidden>Create</h1><!-- BUILD --><section style="margin-top: var(--space-lg);"> <form id="code-form" class="columns"> <div class="flex" style="flex-basis: 35%"> <div id="html-input-container" class="code-editor monospace-font"> </div> </div> <div style="flex: 1; font-size: var(--fs-sm); max-width: var(--container-sm)"> <p style="margin-top: 0"> <label for="name-input">Name</label> <input id="name-input" type="text" placeholder="Name" name="name" value="New facet" required /> </p> <p> <label for="kind-input">Kind</label> <select id="kind-input" name="kind"> <option value="interactive" selected>Interactive (Interface)</option> <option value="prelude">Prelude (Feature)</option> </select> </p> <p> <label for="description-input">Description</label> <textarea id="description-input" placeholder="Description" name="description" rows="5"></textarea> </p> <p> <span class="button-row"> <button class="button--bg-accent" name="save">Save</button> <button class="button--bg-accent" name="save+open">Save & Open</button> <button type="button" id="import-button">Import</button> <input type="file" accept=".html" id="import-input" hidden /> </span> </p> </div> </form></section><!-- GENERATE --><div class="columns"> <section class="flex"> <h2 id="generate">Generate</h2> <p> <strong>You can generate interfaces or features easily using AI.</strong> Diffuse provides a skill to use with LLMs. Claude usage example: </p> <ul> <li> <p> <a href="skills/diffuse-facet.zip" class="button" download>Download skill</a> </p> </li> <li> <p> Open up <a href="https://claude.ai/customize/skills" target="_blank">skills screen</a> <small>(Customise tab in sidebar)</small> </p> </li> <li> <p> <span class="with-icon"> <i class="ph-bold ph-plus"></i> <span>Create skill</span> <i class="ph-bold ph-arrow-right"></i> <span>Upload skill</span> </span> </p> </li> <li> <p> Select downloaded zip file </p> </li> <li> <p> Try in chat and follow directions </p> </li> </ul> <p> <small> <i class="ph-fill ph-info"></i> Alternatively you can install the skill using <a href="https://v-it.org">v-it.org</a>: <code>vit follow tokono.ma</code><br /> The skill identifier is <code>skill-diffuse-facet</code> </small> </p> </section> <section class="flex"> <h2 id="notes">Notes</h2> <p> Facets will be injected into a <span style="white-space: nowrap"><code><div id="container"></code></span> element in the body. </p> <p> While you have the ability to do whatever you want in a custom facet, the existing facets are designed to work a certain way; so here's some things to keep in mind: </p> <ul> <li><span>Prelude (feature) facets are loaded in alphabetical order by the facet loader.</span></li> <li><span>Most elements are configured in broadcast mode so they communicate across tabs. There are a few exceptions such as inputs, where we prefer parallelisation.</span></li> <li><span>All URLs in a facet are relative to the root of Diffuse (not the root of the server) due to the base element in the header of the facet loader.</span></li> </ul> </section></div><!-- FOUNDATION --><div class="columns"> <section class="flex"> <h2 id="foundation">Foundation</h2> <p> <strong>Diffuse comes with a foundation that preconfigures a lot of the built-in Diffuse web components so you don't have to set them up yourself</strong>, along with a combination of components for certain features. It internally tracks the DOM addition of the custom elements, so no need to worry about setting up an element multiple times. It also provides signals which can be used to track element creations. An example of this can be found in the "scrobbles" feature. </p> <p> That said, you are not required not use this! You can, for example, setup a Diffuse audio engine element yourself that's in a different group so that it doesn't communicate with the default one; in case you want to make a dj-deck, or something like that, which would have multiple audio items playing at the same time. This does mean you will need to pay attention to more things, such as, how does this interact with other features the user has enabled. </p> <p> <small><i class="ph-fill ph-info"></i> Refer to the <a href="elements/">elements index</a> to find out what each element does.</small> </p> <div class="code-block"> <code> {{- echo -}} import foundation from "common/foundation.js" {{ /echo }}{{ echo -}}await foundation.configurator.artwork(){{- /echo }}{{ echo -}}await foundation.configurator.input(){{- /echo }}{{ echo -}}await foundation.configurator.metadata(){{- /echo }}{{ echo -}}await foundation.configurator.scrobbles(){{- /echo }}{{ echo -}}await foundation.engine.audio(){{- /echo }}{{ echo -}}await foundation.engine.queue(){{- /echo }}{{ echo -}}await foundation.engine.repeatShuffle(){{- /echo }}{{ echo -}}await foundation.engine.scope(){{- /echo }}{{ echo -}}await foundation.orchestrator.autoQueue(){{- /echo }}{{ echo -}}await foundation.orchestrator.favourites(){{- /echo }}{{ echo -}}await foundation.orchestrator.mediaSession(){{- /echo }}{{ echo -}}await foundation.orchestrator.output(){{- /echo }}{{ echo -}}await foundation.orchestrator.queueAudio(){{- /echo }}{{ echo -}}await foundation.orchestrator.processTracks(){{- /echo }}{{ echo -}}await foundation.orchestrator.scopedTracks(){{- /echo }}{{ echo -}}await foundation.orchestrator.scrobbleAudio(){{- /echo }}{{ echo -}}await foundation.orchestrator.sources(){{- /echo }}{{ echo -}}await foundation.orchestrator.artwork(){{- /echo -}} </code> </div> </section> <section class="flex"> <h2 id="examples">Examples</h2> <p> Some simple examples to help you understand how to write your own facet. Click the edit button to load them into the code editor above. </p> {{ await comp.examples({ id: "examples", items: examples }) }} </section></div>