DistancePath.js (826B)
1 /* This Source Code Form is subject to the terms of the Mozilla Public 2 * License, v. 2.0. If a copy of the MPL was not distributed with this 3 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 4 5 "use strict"; 6 7 const dom = require("resource://devtools/client/shared/vendor/react-dom-factories.js"); 8 9 const ComputedStylePath = require("resource://devtools/client/inspector/animation/components/keyframes-graph/ComputedStylePath.js"); 10 11 class DistancePath extends ComputedStylePath { 12 getPropertyName() { 13 return "opacity"; 14 } 15 16 getPropertyValue(keyframe) { 17 return keyframe.distance; 18 } 19 20 toSegmentValue(computedStyle) { 21 return computedStyle; 22 } 23 24 render() { 25 return dom.g( 26 { 27 className: "distance-path", 28 }, 29 super.renderGraph() 30 ); 31 } 32 } 33 34 module.exports = DistancePath;