This repository has been archived by the owner on Dec 23, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 47
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Fatou Mounzeo
committed
Jul 16, 2019
1 parent
204b942
commit 9f860b3
Showing
3 changed files
with
87 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
.sliderArea{ | ||
height: 32px; | ||
border-color: brown; | ||
background-color: greenyellow; | ||
} | ||
.sliderValue{ | ||
text-align: center; | ||
width: 48px; | ||
height: 32px; | ||
background-color: var(--vscode-editor-background); | ||
color: white; | ||
border:0; | ||
margin-right: 15px; | ||
vertical-align: middle; | ||
|
||
|
||
} | ||
|
||
.slider{ | ||
-webkit-appearance: none; | ||
background-color: #cccccc; | ||
color: var(--vscode-textLink-activeForeground); | ||
vertical-align: middle; | ||
height: 1px; | ||
|
||
} | ||
.slider::-webkit-slider-thumb{ | ||
color: yellow; | ||
} | ||
.slider::-ms-track{ | ||
color: var(--vscode-textLink-activeForeground); | ||
} | ||
.slider:focus{ | ||
border: var(--focusBorder) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
// Copyright (c) Microsoft Corporation. | ||
// Licensed under the MIT license. | ||
|
||
import * as React from "react"; | ||
import "./InputSlider.css" | ||
|
||
|
||
interface ISliderProps{ | ||
min:number; | ||
max: number; | ||
min_label: string; | ||
max_label: string; | ||
title: string; | ||
step:number; | ||
} | ||
|
||
|
||
|
||
class InputSlider extends React.Component<ISliderProps,any,any>{ | ||
constructor(props: ISliderProps){ | ||
super(props); | ||
this.state = { | ||
value:0 | ||
}; | ||
|
||
this.handleOnChange = this.handleOnChange.bind(this); | ||
} | ||
|
||
|
||
render(){ | ||
return ( | ||
<div className="sliderArea"> | ||
<input className="sliderValue" value={this.state.value}/> | ||
<input type="range" className="slider" aria-valuemin={this.props.min} aria-valuemax={this.props.max} step={this.props.step} title={this.props.title} onChange={this.handleOnChange} aria-valuenow={this.state.value}/> | ||
|
||
</div> | ||
) | ||
} | ||
|
||
private handleOnChange(event: React.ChangeEvent<HTMLInputElement>){ | ||
const inputElement = event.target | ||
const newValue = inputElement? inputElement.value:0; | ||
this.setState({value:newValue}); | ||
|
||
} | ||
|
||
} | ||
|
||
export default InputSlider; | ||
|