Skip to content

Commit

Permalink
Updated design of toggle area overlay
Browse files Browse the repository at this point in the history
Signed-off-by: Philipp <p.koenig@blockbyte.de>
  • Loading branch information
Philipp committed Mar 5, 2019
1 parent eb816c0 commit f115ddc
Show file tree
Hide file tree
Showing 16 changed files with 180 additions and 82 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"concat": "^1.0.3",
"create-file": "^1.0.1",
"del": "^4.0.0",
"eslint": "^5.15.0",
"eslint": "^5.15.1",
"fs-extra": "^7.0.1",
"glob-concat": "^1.0.1",
"html-minifier": "^3.5.21",
Expand Down
3 changes: 3 additions & 0 deletions src/_locales/de/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -638,6 +638,9 @@
"settings_toggle_area_height_desc": {
"message": "Du kannst die H\u00f6he des Bereichts verringern, so dass die Sidebar nur ge\u00f6ffnet wird, wenn der Mauszeiger in diesen Bereich des Browserrands bewegt wird."
},
"settings_toggle_area_drag_desc": {
"message": "Ziehen zum Bewegen"
},
"settings_keyboard_shortcut_button": {
"message": "Tastenkombination einrichten"
},
Expand Down
3 changes: 3 additions & 0 deletions src/_locales/en/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -641,6 +641,9 @@
"settings_toggle_area_height_desc": {
"message": "You can reduce the height of the area, so the sidebar will only open when you move your cursor into that location of the edge of your browser window."
},
"settings_toggle_area_drag_desc": {
"message": "Drag to move"
},
"settings_keyboard_shortcut_button": {
"message": "Set keyboard shortcut"
},
Expand Down
2 changes: 1 addition & 1 deletion src/css/onboarding.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/css/onboarding.css.map

Large diffs are not rendered by default.

114 changes: 77 additions & 37 deletions src/css/settings.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/css/settings.css.map

Large diffs are not rendered by default.

7 changes: 5 additions & 2 deletions src/html/settings.html
Original file line number Diff line number Diff line change
Expand Up @@ -684,12 +684,15 @@ <h2></h2>

<div class="modal toggleAreaModal">
<h2 data-i18n="settings_toggle_area"></h2>
<div class="preview"></div>
<div class="preview">
<div></div>
<span data-i18n="settings_toggle_area_drag_desc"></span>
</div>
<div class="formElement" data-type="range" data-name="toggleArea_width" data-min="1" data-max="50" data-unit="px" data-i18n="settings_toggle_area_width"></div>
<div class="formElement" data-type="range" data-name="toggleArea_widthWindowed" data-min="1" data-max="100" data-unit="px" data-i18n="settings_toggle_area_width_windowed"></div>
<div class="formElement" data-type="range" data-name="toggleArea_height" data-min="5" data-max="100" data-unit="%" data-i18n="settings_toggle_area_height"></div>
<div class="hidden">
<div class="formElement" data-type="range" data-name="toggleArea_top" data-min="0" data-max="100" data-unit="%"></div>
<div class="formElement" data-type="range" data-name="toggleArea_top" data-min="0" data-step="0.1" data-max="100" data-unit="%"></div>
</div>
<p class="buttons">
<a class="button save" data-i18n="settings_save"></a>
Expand Down
File renamed without changes
Binary file added src/img/settings/mockup-left.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/img/settings/mockup-middle.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/img/settings/mockup-right.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 5 additions & 4 deletions src/js/settings/sidebar.js
Original file line number Diff line number Diff line change
Expand Up @@ -159,10 +159,11 @@
*/
const initToggleAreaEvents = async () => {
const modal = s.elm.body.children("div." + $.cl.settings.toggleArea.modal);
const preview = modal.children("div." + $.cl.settings.toggleArea.preview);
const previewWrapper = modal.children("div." + $.cl.settings.toggleArea.preview);
const preview = previewWrapper.children("div");

$([s.elm.range.toggleArea_width, s.elm.range.toggleArea_height, s.elm.range.toggleArea_top]).on("change input", (e) => {
const minWidth = 14;
const minWidth = 19;

const val = {
width: +s.elm.range.toggleArea_width[0].value,
Expand All @@ -184,8 +185,8 @@
s.elm.range.toggleArea_top.trigger("change");
}
} else {
previewWrapper.css("width", (minWidth + val.width) + "px");
preview.css({
width: (minWidth + val.width) + "px",
height: (val.height) + "%",
top: val.top + "%"
});
Expand Down Expand Up @@ -244,7 +245,7 @@
}).on("mousemove", (e) => { // drag move
if (preview.hasClass($.cl.settings.toggleArea.dragging) && e.which === 1) {
const pos = preview.data("pos");
s.elm.range.toggleArea_top[0].value = ((pos.start + e.pageY - pos.y) / modal[0].offsetHeight) * 100;
s.elm.range.toggleArea_top[0].value = ((pos.start + e.pageY - pos.y) / previewWrapper[0].offsetHeight) * 100;
s.elm.range.toggleArea_top.trigger("change");
}
}, {passive: true});
Expand Down
2 changes: 1 addition & 1 deletion src/scss/include/settings/_infos.scss
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ body > section#wrapper {
h3 {
display: inline-block;
font-size: 120%;
font-weight: 400;
font-weight: $__fontWeightMedium;
line-height: 150%;
padding: 5px 0;
margin: 20px 0 0 0;
Expand Down
Loading

0 comments on commit f115ddc

Please sign in to comment.