@kano/web-components
Version:
Shared web-components for the Kano ecosystem.
74 lines (68 loc) • 2.84 kB
HTML
<html>
<head>
<meta charset="utf-8">
<script src="../../../../@webcomponents/webcomponentsjs/webcomponents-bundle.js"></script>
<script type="text/javascript">
window.Polymer = {
dom: 'shadow'
};
</script>
<script type="module" src="../../../../@polymer/iron-demo-helpers/demo-snippet.js"></script>
<script type="module" src="../../../../@polymer/iron-demo-helpers/demo-pages-shared-styles.js"></script>
<script type="module" src="../../kano-style/typography.js"></script>
<script type="module" src="../kano-circle-progress.js"></script>
<!-- FIXME(polymer-modulizer):
These imperative modules that innerHTML your HTML are
a hacky way to be sure that any mixins in included style
modules are ready before any elements that reference them are
instantiated, otherwise the CSS @apply mixin polyfill won't be
able to expand the underlying CSS custom properties.
See: https://github.com/Polymer/polymer-modulizer/issues/154
-->
<script type="module">
const $_documentContainer = document.createElement('template');
$_documentContainer.innerHTML = `<custom-style>
<style is="custom-style" include="demo-pages-shared-styles">
kano-circle-progress {
width: 50px;
height: 50px;
--kano-circle-progress: {
stroke: orange;
};
--kano-circle-progress-back: {
stroke: grey;
};
}
</style>
</custom-style>`;
document.body.appendChild($_documentContainer.content);
</script>
</head>
<body>
<script type="module">
const $_documentContainer = document.createElement('template');
$_documentContainer.innerHTML = `<div class="vertical-section-container centered">
<h3>Demo page for 'kano-auth' element</h3>
<demo-snippet>
<template>
<input type="range" name="name" min="0" max="1" step="0.01">
<kano-circle-progress stroke-width="6"></kano-circle-progress>
</template>
</demo-snippet>
</div>`;
document.body.appendChild($_documentContainer.content);
</script>
<script type="module">
import '@polymer/iron-demo-helpers/demo-snippet.js';
import '@polymer/iron-demo-helpers/demo-pages-shared-styles.js';
import '../../kano-style/typography.js';
import '../kano-circle-progress.js';
let progress = document.querySelector('kano-circle-progress'),
range = document.querySelector('input');
range.addEventListener('input', () => {
progress.value = range.value;
});
</script>
</body>
</html>