mirror of
https://github.com/material-components/material-web.git
synced 2024-10-27 14:07:17 +03:00
286d4733ce
These are WIP. Some known issues: * select, chips, and textfield ripple not working * many tests to be added * some elements tbd, including e.g. top-app-bar and drawer
80 lines
2.3 KiB
HTML
80 lines
2.3 KiB
HTML
<!doctype html>
|
|
<!--
|
|
@license
|
|
Copyright 2018 Google Inc. All Rights Reserved.
|
|
|
|
Licensed under the Apache License, Version 2.0 (the "License");
|
|
you may not use this file except in compliance with the License.
|
|
You may obtain a copy of the License at
|
|
|
|
http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
Unless required by applicable law or agreed to in writing, software
|
|
distributed under the License is distributed on an "AS IS" BASIS,
|
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
See the License for the specific language governing permissions and
|
|
limitations under the License.
|
|
-->
|
|
<html>
|
|
<head>
|
|
<title>slider demo</title>
|
|
<script src="../node_modules/@webcomponents/webcomponentsjs/webcomponents-lite.js"></script>
|
|
<script type="module" src="../node_modules/@material/mwc-slider/mwc-slider.js"></script>
|
|
<script type="module" src="../node_modules/@material/mwc-icon/mwc-icon.js"></script>
|
|
<link rel="stylesheet" href="demo-component.css">
|
|
<style>
|
|
.demo-container {
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
}
|
|
.demo-container > * {
|
|
width: 50%;
|
|
}
|
|
|
|
.demo-colory {
|
|
--mdc-theme-secondary: orange;
|
|
--mdc-theme-text-primary-on-dark: green;
|
|
}
|
|
</style>
|
|
</head>
|
|
<body class="unresolved">
|
|
<header>
|
|
<a href="index.html"><mwc-icon></mwc-icon>
|
|
<span>Slider</span></a>
|
|
</header>
|
|
|
|
<main>
|
|
<h3>Continuous</h3>
|
|
<div class="demo-container">
|
|
<mwc-slider></mwc-slider>
|
|
</div>
|
|
|
|
<h3>Discrete</h3>
|
|
<div class="demo-container demo-colory">
|
|
<mwc-slider discrete markers max="50" value="10" step="5"></mwc-slider>
|
|
</div>
|
|
|
|
<h3>Disabled</h3>
|
|
<div class="demo-container">
|
|
<mwc-slider disabled></mwc-slider>
|
|
</div>
|
|
|
|
<div id="logInput"></div>
|
|
<div id="logChange"></div>
|
|
</main>
|
|
|
|
<script type="module">
|
|
function show(element, e) {
|
|
element.textContent = `Value from ${e.type}: ${e.detail.value}`;
|
|
}
|
|
Array.from(document.querySelectorAll('mwc-slider')).forEach((e) => {
|
|
e.addEventListener('MDCSlider:input', (e) => show(window.logInput, e));
|
|
e.addEventListener('MDCSlider:change', (e) => show(window.logChange, e));
|
|
});
|
|
|
|
addEventListener('load', () => document.body.classList.remove('unresolved'));
|
|
</script>
|
|
</body>
|
|
</html>
|