Skip to content

Commit 20d9242

Browse files
committed
code-panel: tweak top margin, add hammerjs stopPropagation
1 parent 789d1d3 commit 20d9242

File tree

6 files changed

+49
-16
lines changed

6 files changed

+49
-16
lines changed

app/build/mojs-curve-editor.js

Lines changed: 29 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ return /******/ (function(modules) { // webpackBootstrap
7575
/******/ }
7676
/******/
7777
/******/ var hotApplyOnUpdate = true;
78-
/******/ var hotCurrentHash = "3074fd175cc069076662"; // eslint-disable-line no-unused-vars
78+
/******/ var hotCurrentHash = "86cbade4ccbde34b0320"; // eslint-disable-line no-unused-vars
7979
/******/ var hotCurrentModuleData = {};
8080
/******/ var hotCurrentParents = []; // eslint-disable-line no-unused-vars
8181
/******/
@@ -9951,8 +9951,30 @@ return /******/ (function(modules) { // webpackBootstrap
99519951
/* WEBPACK VAR INJECTION */(function(riot) {
99529952

99539953
riot.tag2('code-panel', '<div class="{this.CLASSES[\'code-panel__input-wrap\']}"> <input class="{this.CLASSES[\'code-panel__input-field\']}" type="text" readonly="readonly" value="M0,100 C0,100 12.0486221,-124.260309 24,99.7583642 C28.9933624,142.723104"> </div>', '', 'class="{this.CLASSES[\'code-panel\']}"', function(opts) {
9954-
this.CLASSES = __webpack_require__(115);
9955-
__webpack_require__(116);
9954+
'use strict';
9955+
9956+
var _this = this;
9957+
9958+
var _hammerjs = __webpack_require__(105);
9959+
9960+
var _hammerjs2 = _interopRequireDefault(_hammerjs);
9961+
9962+
var _propagatingHammerjs = __webpack_require__(106);
9963+
9964+
var _propagatingHammerjs2 = _interopRequireDefault(_propagatingHammerjs);
9965+
9966+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
9967+
9968+
this.CLASSES = __webpack_require__(115);
9969+
__webpack_require__(116);
9970+
9971+
this.on('mount', function () {
9972+
var hammertime = (0, _propagatingHammerjs2.default)(new _hammerjs2.default(_this.root)).on('pan', function (e) {
9973+
e.stopPropagation();
9974+
}).on('panend', function (e) {
9975+
e.stopPropagation();
9976+
});
9977+
});
99569978
});
99579979

99589980
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(2)))
@@ -9962,9 +9984,9 @@ return /******/ (function(modules) { // webpackBootstrap
99629984
/***/ function(module, exports) {
99639985

99649986
module.exports = {
9965-
"code-panel": "_code-panel_jgqhb_3",
9966-
"code-panel__input-wrap": "_code-panel__input-wrap_jgqhb_1",
9967-
"code-panel__input-field": "_code-panel__input-field_jgqhb_1"
9987+
"code-panel": "_code-panel_r7h38_3",
9988+
"code-panel__input-wrap": "_code-panel__input-wrap_r7h38_1",
9989+
"code-panel__input-field": "_code-panel__input-field_r7h38_1"
99689990
};
99699991

99709992
/***/ },
@@ -10002,7 +10024,7 @@ return /******/ (function(modules) { // webpackBootstrap
1000210024

1000310025

1000410026
// module
10005-
exports.push([module.id, "._code-panel_jgqhb_3{position:absolute;left:10px;right:10px;margin-top:-32px;border-radius:6px 6px 0 0;background:#3d1b3c;z-index:1}._code-panel__input-wrap_jgqhb_1{margin:5px 5px 4px;border-radius:2px;background:#3a083a;border:1px solid #b3a0b2;box-shadow:inset 3px 3px 0 rgba(0,0,0,.5)}._code-panel__input-field_jgqhb_1{display:block;background:transparent;color:#fff;font-size:9px;letter-spacing:.45px;line-height:21px;font-weight:100;padding:0 .3em 0 .8em;border:none;width:100%}._code-panel_jgqhb_3 ::-moz-selection,.code-panel ::-moz-selection{background:#ff512f}._code-panel_jgqhb_3 ::selection{background:#ff512f}", ""]);
10027+
exports.push([module.id, "._code-panel_r7h38_3{position:absolute;left:10px;right:10px;margin-top:-32px;border-radius:6px 6px 0 0;background:#3d1b3c;z-index:1}._code-panel__input-wrap_r7h38_1{margin:4px 5px 5px;border-radius:2px;background:#42103f;border:1px solid #9c829a;box-shadow:inset 2px 2px 0 rgba(0,0,0,.5)}._code-panel__input-field_r7h38_1{display:block;background:transparent;color:#fff;font-size:9px;letter-spacing:.45px;line-height:21px;font-weight:100;padding:0 .3em 0 .8em;border:none;width:100%;height:21px}._code-panel_r7h38_3 ::-moz-selection,.code-panel ::-moz-selection{background:#ff512f}._code-panel_r7h38_3 ::selection{background:#ff512f}", ""]);
1000610028

1000710029
// exports
1000810030

app/build/mojs-curve-editor.min.js

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

app/css/assets/colors.postcss.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11

22
$c-purple: #3A0839;
3-
$c-pastel-purple: #B3A0B2;
3+
$c-pastel-purple: #9C829A;
44
$c-orange: #FF512F;
55
$c-white : #FFFFFF;

app/css/blocks/code-panel.postcss.css

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,11 @@
1010
z-index: 1;
1111

1212
&__input-wrap {
13-
margin: calc( 5 * $PX ) calc( 5 * $PX ) calc( 4 * $PX ) calc( 5 * $PX );
13+
margin: calc( 4 * $PX ) calc( 5 * $PX ) calc( 5 * $PX );
1414
border-radius: calc( 2 * $PX );
15-
background: rgba( 58, 8, 58, 1 );
15+
background: #42103F;
1616
border: 1px solid $c-pastel-purple;
17-
box-shadow: inset calc( 3 * $PX ) calc( 3 * $PX ) 0 rgba(0,0,0,0.5);
17+
box-shadow: inset calc( 2 * $PX ) calc( 2 * $PX ) 0 rgba(0,0,0,0.5);
1818
}
1919

2020
&__input-field {
@@ -28,6 +28,7 @@
2828
padding: 0 0.3em 0 0.8em;
2929
border: none;
3030
width: 100%;
31+
height: calc( 21*$PX );
3132
}
3233
& ::selection {
3334
background: $c-orange;
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{"code-panel":"_code-panel_jgqhb_3","code-panel__input-wrap":"_code-panel__input-wrap_jgqhb_1","code-panel__input-field":"_code-panel__input-field_jgqhb_1"}
1+
{"code-panel":"_code-panel_r7h38_3","code-panel__input-wrap":"_code-panel__input-wrap_r7h38_1","code-panel__input-field":"_code-panel__input-field_r7h38_1"}

app/js/tags/code-panel.tag

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,19 @@
55
<input class={ this.CLASSES['code-panel__input-field'] } type="text" readonly="readonly" value="M0,100 C0,100 12.0486221,-124.260309 24,99.7583642 C28.9933624,142.723104" />
66
</div>
77

8-
<script>
8+
<script type="babel">
99
this.CLASSES = require('../../css/blocks/code-panel.postcss.css.json');
1010
require('../../css/blocks/code-panel');
11+
12+
import Hammer from 'hammerjs';
13+
import propagating from 'propagating-hammerjs';
14+
15+
this.on('mount', () => {
16+
var hammertime = propagating(new Hammer(this.root))
17+
.on('pan', (e) => { e.stopPropagation(); })
18+
.on('panend', (e) => { e.stopPropagation(); });
19+
});
20+
1121
</script>
1222

1323
</code-panel>

0 commit comments

Comments
 (0)