Original by @ChrisShank = @chrisshank.com. Reactions: 👀 1
I was wondering about ways to make web tiles easier to embed and I liked the way web applets did it with <applet-frame>. Reworking the first example on the README could look something like this:
<!-- the scheme of the src attribute determines the loader -->
<tile-frame src="at://did:plc:izttpdp3l6vss5crelt5kcux/ing.dasl.masl/3mcjwwoqjqs2v"></tile-frame>
<style>
tile-frame {
display: inline-block;
vertical-align: top;
padding: 50px;
width: 570px;
}
</style>
<script type="module">
import { TileFrame } from '@dasl/tiles/tile-frame';
import { ATTileLoader } from '@dasl/tiles/loader/at';
// Static properties to configure where and how tiles are loaded.
TileFrame.loadDomain = 'load.webtiles.bast';
TileFrame.addLoader(new ATTileLoader());
// Register the custom element
TileFrame.define()
</script>
Original by @ChrisShank = @chrisshank.com.
Still some work to do but, but sketched it out in a little more detail.
The
TileMothershipandTileclass are combined into a custom element. this removes a bunch of boilerplate to configure and render a web tile. Having an addressable UI element also sets us up easier two way communication between the web tile and the outside world, whether that's initial parameters configured via HTML attributes or more complex data assigned via the DOM class.https://github.com/ChrisShank/dasl-tiles/blob/main/loader.js