blob: c4604e43f13d2b6259b7e4c85c31fa88e10a84bf [file] [log] [blame]
<!--
Copyright (C) 2018 The Android Open Source Project
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.
-->
<dom-module id="gr-opacity-diff-mode">
<template>
<style>
:host {
display: block;
}
.wrapper {
box-shadow: 0 1px 3px rgba(0, 0, 0, .3);
}
img {
display: block;
height: var(--img-height);
margin: auto;
position: absolute;
width: var(--img-width);
}
#imageRevision {
opacity: var(--my-opacity-value);
z-index: 1;
}
#imageDiffContainer {
height: var(--div-height);
margin: auto;
width: var(--div-width);
}
#controlsContainer {
border-top: 1px solid var(--border-color, #ddd);
display: flex;
}
#controlsBox {
display: flex;
justify-content: space-between;
margin: 0 1em;
min-width: 32em;
width: 100%;
}
label {
padding: 1em .5em;
}
input {
padding: 1em 0;
}
.cell {
align-items: center;
display: flex;
}
#opacitySlider {
width: 10em;
}
</style>
<div class="wrapper">
<div id="imageDiffContainer">
<img id="imageBase"/>
<img data-opacity$="{{opacityValue}}" id="imageRevision"/>
</div>
<div id="controlsContainer">
<div id="controlsBox">
<div class="cell">
<input
id="scaleSizesToggle"
on-tap="handleScaleSizesToggle"
type="checkbox">
<label for="scaleSizesToggle">
Scale to same size
</label>
</div>
<div class="cell">
<label for="opacitySlider">
Revision image opacity
</label>
<input
id="opacitySlider"
max="1.0"
min="0.0"
on-input="handleOpacityChange"
step=".01"
type="range"
value="0.5"/>
</div>
</div>
</div>
</div>
</template>
<script src="gr-opacity-diff-mode.js"></script>
</dom-module>