-
Notifications
You must be signed in to change notification settings - Fork 21
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
Showing
10 changed files
with
223 additions
and
49 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
Copyright 2018 Hugo Zapata | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
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,17 @@ | ||
# [WIP] React Rotary Knob | ||
|
||
[Demo](https://github.io/hugozap/react-rotary-knob/storybook) | ||
|
||
(Work in progress, please come back in a few days) | ||
|
||
|
||
Precise rotary knob for React | ||
|
||
## Features | ||
|
||
- Drag away from knob to increase precision. | ||
- Skinnable with SVG | ||
|
||
### TODO | ||
|
||
* Mobile touch events |
Binary file not shown.
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,20 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<meta charset="utf-8"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1"> | ||
<meta content="IE=edge" http-equiv="X-UA-Compatible" /> | ||
<base target="_parent"> | ||
<script> | ||
if (window.parent !== window) { | ||
window.__REACT_DEVTOOLS_GLOBAL_HOOK__ = window.parent.__REACT_DEVTOOLS_GLOBAL_HOOK__; | ||
} | ||
</script> | ||
<title>Storybook</title> | ||
|
||
</head> | ||
<body> | ||
<div id="root"></div> | ||
<div id="error-display"></div> | ||
<script type="text/javascript" src="static/preview.a39257acbe7841c5219b.bundle.js"></script></body> | ||
</html> |
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,44 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<meta charset="utf-8"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1"> | ||
<meta name="storybook-version" content="3.3.13"> | ||
<meta content="IE=edge" http-equiv="X-UA-Compatible" /> | ||
<title>Storybook</title> | ||
<style> | ||
/* | ||
When resizing panels, the drag event breaks if the cursor | ||
moves over the iframe. Add the 'dragging' class to the body | ||
at drag start and remove it when the drag ends. | ||
*/ | ||
.dragging iframe { | ||
pointer-events: none; | ||
} | ||
|
||
/* Styling the fuzzy search box placeholders */ | ||
.searchBox::-webkit-input-placeholder { /* Chrome/Opera/Safari */ | ||
color: #ddd; | ||
font-size: 16px; | ||
} | ||
|
||
.searchBox::-moz-placeholder { /* Firefox 19+ */ | ||
color: #ddd; | ||
font-size: 16px; | ||
} | ||
|
||
.searchBox:focus{ | ||
border-color: #EEE !important; | ||
} | ||
|
||
.btn:hover{ | ||
background-color: #eee | ||
} | ||
</style> | ||
|
||
|
||
</head> | ||
<body style="margin: 0;"> | ||
<div id="root"></div> | ||
<script type="text/javascript" src="static/manager.203683b1e4aa1432ca87.bundle.js"></script></body> | ||
</html> |
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
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
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,103 @@ | ||
export default { | ||
knobX: 83.5, | ||
knobY: 83.5, | ||
svg:` | ||
<svg width="208px" height="208px" viewBox="0 0 208 208" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> | ||
<!-- Generator: Sketch 47.1 (45422) - http://www.bohemiancoding.com/sketch --> | ||
<desc>Created with Sketch.</desc> | ||
<defs> | ||
<linearGradient x1="50%" y1="50%" x2="50%" y2="100%" id="linearGradient-1"> | ||
<stop stop-color="#FFFFFF" stop-opacity="0.5" offset="0%"></stop> | ||
<stop stop-color="#000000" stop-opacity="0.5" offset="100%"></stop> | ||
</linearGradient> | ||
<circle id="path-2" cx="100" cy="100" r="100"></circle> | ||
<filter x="-3.5%" y="-3.0%" width="107.0%" height="107.0%" filterUnits="objectBoundingBox" id="filter-3"> | ||
<feMorphology radius="0.5" operator="dilate" in="SourceAlpha" result="shadowSpreadOuter1"></feMorphology> | ||
<feOffset dx="0" dy="1" in="shadowSpreadOuter1" result="shadowOffsetOuter1"></feOffset> | ||
<feGaussianBlur stdDeviation="2" in="shadowOffsetOuter1" result="shadowBlurOuter1"></feGaussianBlur> | ||
<feComposite in="shadowBlurOuter1" in2="SourceAlpha" operator="out" result="shadowBlurOuter1"></feComposite> | ||
<feColorMatrix values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.5 0" type="matrix" in="shadowBlurOuter1"></feColorMatrix> | ||
</filter> | ||
<circle id="path-4" cx="100" cy="100" r="88"></circle> | ||
<filter x="-4.0%" y="-3.4%" width="108.0%" height="108.0%" filterUnits="objectBoundingBox" id="filter-5"> | ||
<feMorphology radius="0.5" operator="dilate" in="SourceAlpha" result="shadowSpreadOuter1"></feMorphology> | ||
<feOffset dx="0" dy="1" in="shadowSpreadOuter1" result="shadowOffsetOuter1"></feOffset> | ||
<feGaussianBlur stdDeviation="2" in="shadowOffsetOuter1" result="shadowBlurOuter1"></feGaussianBlur> | ||
<feComposite in="shadowBlurOuter1" in2="SourceAlpha" operator="out" result="shadowBlurOuter1"></feComposite> | ||
<feColorMatrix values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.5 0" type="matrix" in="shadowBlurOuter1"></feColorMatrix> | ||
</filter> | ||
<linearGradient x1="50%" y1="0%" x2="50%" y2="100%" id="linearGradient-6"> | ||
<stop stop-color="#EEEEEE" offset="0%"></stop> | ||
<stop stop-color="#EDEDED" offset="50.0553592%"></stop> | ||
<stop stop-color="#D8D8D8" offset="100%"></stop> | ||
</linearGradient> | ||
<circle id="path-7" cx="83.5" cy="83.5" r="83.5"></circle> | ||
<filter x="-4.2%" y="-3.6%" width="108.4%" height="108.4%" filterUnits="objectBoundingBox" id="filter-8"> | ||
<feMorphology radius="0.5" operator="dilate" in="SourceAlpha" result="shadowSpreadOuter1"></feMorphology> | ||
<feOffset dx="0" dy="1" in="shadowSpreadOuter1" result="shadowOffsetOuter1"></feOffset> | ||
<feGaussianBlur stdDeviation="2" in="shadowOffsetOuter1" result="shadowBlurOuter1"></feGaussianBlur> | ||
<feComposite in="shadowBlurOuter1" in2="SourceAlpha" operator="out" result="shadowBlurOuter1"></feComposite> | ||
<feColorMatrix values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.5 0" type="matrix" in="shadowBlurOuter1"></feColorMatrix> | ||
</filter> | ||
<circle id="path-9" cx="84" cy="11" r="5"></circle> | ||
<filter x="-25.0%" y="-25.0%" width="150.0%" height="150.0%" filterUnits="objectBoundingBox" id="filter-10"> | ||
<feGaussianBlur stdDeviation="1.5" in="SourceAlpha" result="shadowBlurInner1"></feGaussianBlur> | ||
<feOffset dx="0" dy="1" in="shadowBlurInner1" result="shadowOffsetInner1"></feOffset> | ||
<feComposite in="shadowOffsetInner1" in2="SourceAlpha" operator="arithmetic" k2="-1" k3="1" result="shadowInnerInner1"></feComposite> | ||
<feColorMatrix values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.5 0" type="matrix" in="shadowInnerInner1"></feColorMatrix> | ||
</filter> | ||
<circle id="path-11" cx="36" cy="36" r="36"></circle> | ||
<filter x="-3.5%" y="-3.5%" width="106.9%" height="106.9%" filterUnits="objectBoundingBox" id="filter-12"> | ||
<feGaussianBlur stdDeviation="1.5" in="SourceAlpha" result="shadowBlurInner1"></feGaussianBlur> | ||
<feOffset dx="0" dy="1" in="shadowBlurInner1" result="shadowOffsetInner1"></feOffset> | ||
<feComposite in="shadowOffsetInner1" in2="SourceAlpha" operator="arithmetic" k2="-1" k3="1" result="shadowInnerInner1"></feComposite> | ||
<feColorMatrix values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.5 0" type="matrix" in="shadowInnerInner1"></feColorMatrix> | ||
</filter> | ||
<text id="text-13" font-family="Helvetica" font-size="20" font-weight="normal" fill="#F5A623"> | ||
<tspan x="19.3154297" y="41">100</tspan> | ||
</text> | ||
<filter x="-17.6%" y="-25.0%" width="135.3%" height="150.0%" filterUnits="objectBoundingBox" id="filter-14"> | ||
<feOffset dx="0" dy="0" in="SourceAlpha" result="shadowOffsetOuter1"></feOffset> | ||
<feGaussianBlur stdDeviation="2" in="shadowOffsetOuter1" result="shadowBlurOuter1"></feGaussianBlur> | ||
<feColorMatrix values="0 0 0 0 0.960784314 0 0 0 0 0.650980392 0 0 0 0 0.137254902 0 0 0 1 0" type="matrix" in="shadowBlurOuter1"></feColorMatrix> | ||
</filter> | ||
</defs> | ||
<g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd"> | ||
<g id="Group-3-Copy" transform="translate(4.000000, 3.000000)"> | ||
<g id="container"> | ||
<g id="Oval-2"> | ||
<use fill="black" fill-opacity="1" filter="url(#filter-3)" xlink:href="#path-2"></use> | ||
<use stroke="#979797" stroke-width="1" fill="url(#linearGradient-1)" fill-rule="evenodd" xlink:href="#path-2"></use> | ||
</g> | ||
<g id="Oval-2"> | ||
<use fill="black" fill-opacity="1" filter="url(#filter-5)" xlink:href="#path-4"></use> | ||
<use stroke="#4A4A4A" stroke-width="1" fill="#4A4A4A" fill-rule="evenodd" xlink:href="#path-4"></use> | ||
</g> | ||
<g id="knob" transform="translate(17.000000, 17.000000)"> | ||
<g id="Oval-2"> | ||
<use fill="black" fill-opacity="1" filter="url(#filter-8)" xlink:href="#path-7"></use> | ||
<use stroke="#979797" stroke-width="1" fill="url(#linearGradient-6)" fill-rule="evenodd" xlink:href="#path-7"></use> | ||
</g> | ||
<g id="Oval-3"> | ||
<use fill="#AAA8A8" fill-rule="evenodd" xlink:href="#path-9"></use> | ||
<use fill="black" fill-opacity="1" filter="url(#filter-10)" xlink:href="#path-9"></use> | ||
<use stroke="#757171" stroke-width="1" xlink:href="#path-9"></use> | ||
</g> | ||
</g> | ||
<g id="label" transform="translate(65.000000, 65.000000)"> | ||
<g id="Oval"> | ||
<use fill="#3D3D3D" fill-rule="evenodd" xlink:href="#path-11"></use> | ||
<use fill="black" fill-opacity="1" filter="url(#filter-12)" xlink:href="#path-11"></use> | ||
<use stroke="#454545" stroke-width="1" xlink:href="#path-11"></use> | ||
</g> | ||
<g id="100" fill-opacity="1" fill="#F5A623"> | ||
<use filter="url(#filter-14)" xlink:href="#text-13"></use> | ||
<use xlink:href="#text-13"></use> | ||
</g> | ||
</g> | ||
</g> | ||
</g> | ||
</g> | ||
</svg> | ||
` | ||
} |