Skip to content

Commit 082a55a

Browse files
committed
mobile view
1 parent c8ea678 commit 082a55a

File tree

6 files changed

+43
-10
lines changed

6 files changed

+43
-10
lines changed

dist/index.html

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,9 @@
2525
.main a:hover img {opacity: 0.5}
2626
.wf-active .main {opacity: 1}
2727
.author {font-size: 24px}
28+
@media only screen and (max-width: 640px) {
29+
.main {font-size: 32px}
30+
}
2831
</style>
2932
</head>
3033
<body>

dist/js/cj-color-chunk-2.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/js/hoc/scrollable.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ class Scrollable extends Component {
2727
const { target } = e;
2828
const { scrollTop } = target;
2929

30-
let handleY = ( ( scrollTop / this.containerHeight ) * this.handleHeight );
30+
const handleY = ( ( scrollTop / this.containerHeight ) * this.handleHeight );
3131
this.handleY = Math.max( 0, Math.min( this.handleDif, handleY ) );
3232

3333
window.cancelAnimationFrame( this.requestAnime );

src/js/module/editor.js

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1288,13 +1288,15 @@ class Editor extends Component {
12881288
return (
12891289
<EditorContext.Provider value={ this.state }>
12901290
<Container>
1291-
<Header showHidePreview={ this.showHidePreview } />
1292-
<Controls className={ className } />
1293-
<Footer
1294-
clearLayers={ editorValue.length > 1 }
1295-
onClearGradient={ this.onClearGradient }
1296-
/>
12971291
{ colorMode !== 'single' && <SidePanels /> }
1292+
<div className={ `${ namespace }-container-inner` }>
1293+
<Header showHidePreview={ this.showHidePreview } />
1294+
<Controls className={ className } />
1295+
<Footer
1296+
clearLayers={ editorValue.length > 1 }
1297+
onClearGradient={ this.onClearGradient }
1298+
/>
1299+
</div>
12981300
</Container>
12991301
</EditorContext.Provider>
13001302
);

src/js/module/editor/controls/color-controls/color-palette.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ class ColorPalette extends Component {
156156
height,
157157
} = this.props;
158158

159-
let x = ( ( pointX * 100 ) * 0.01 ) * width;
159+
const x = ( ( pointX * 100 ) * 0.01 ) * width;
160160
const y = ( ( 100 - pointY ) * 0.01 ) * height;
161161

162162
this.points = { x, y };

src/scss/editor.scss

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -316,10 +316,12 @@ $disabled-opacity: 0.5;
316316
opacity: 0;
317317
position: absolute;
318318
border-radius: $widget-border-radius;
319-
box-shadow: $widget-box-shadow;
320319
transition: $initial-transition;
321320
transition-property: opacity, visibility;
322321
pointer-events: none;
322+
&-inner {
323+
box-shadow: $widget-box-shadow;
324+
}
323325
}
324326

325327
&-container-drag {
@@ -2139,3 +2141,29 @@ $disabled-opacity: 0.5;
21392141
}
21402142
}
21412143
}
2144+
2145+
@media only screen and (max-width: 1360px) {
2146+
.#{$namespace} {
2147+
overflow-y: scroll;
2148+
&-controls {
2149+
height: auto !important;
2150+
padding-left: 20px;
2151+
padding-right: 20px;
2152+
&-inner {
2153+
display: block;
2154+
}
2155+
}
2156+
&-panel {
2157+
margin: 40px auto 0 auto;
2158+
&:first-child {margin-top: 10px}
2159+
}
2160+
&-sidepanels {
2161+
position: static;
2162+
display: block;
2163+
margin: 0 auto;
2164+
}
2165+
&-bg-active + .#{$namespace}-container {
2166+
display: none;
2167+
}
2168+
}
2169+
}

0 commit comments

Comments
 (0)