pluto/website/pages/examples.html
Julien Eluard bc56b45393
[Fixes #2] Added basic doc infrastructure
Signed-off-by: Julien Eluard <julien.eluard@gmail.com>
2018-07-03 14:55:37 +02:00

52 lines
1.2 KiB
HTML

<html>
<head>
<style>
main {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
height: 100%
}
#selection {
padding: 10px;
}
#extension {
border: 40px solid #ddd;
border-width: 55px 7px;
border-radius: 40px;
margin: 50px auto;
width: 30vh;
height: 50vh;
overflow: hidden;
}
#extension iframe {
border: 0;
height: 100%;
width: 100%
}
</style>
</head>
<body>
<script>
function load(urn) {
pluto.examples.load_and_render(urn, document.getElementById("frame").contentWindow.document.body.firstChild, document.getElementById("errors"));
}
</script>
<main>
<div id="selection">
Load demo extension from
<button disabled onclick="load('ipfs:QmSKP6f2uUsFq4mk1Afe4ZktxwQifrLb4xRQYNE1LxidKz')">IPFS</button>
<button onclick="load('url:extensions/demo')">HTTP</button>
</div>
<div id="extension">
<iframe id="frame" srcdoc="<body><main></main></body>"></iframe>
</div>
<div id="errors"></div>
</main>
</body>
</html>