mirror of
https://github.com/JannisX11/blockbench.git
synced 2024-11-27 04:21:46 +08:00
Rename gimbal controls to orbit gizmo
Add dialog to copy share link from Combine 32 and 64 bit installer again
This commit is contained in:
parent
9945e113d4
commit
28295711b5
@ -19,11 +19,9 @@ jobs:
|
||||
os: osx
|
||||
osx_image: "xcode11.3"
|
||||
script:
|
||||
- electron-builder -w --x64 --publish=onTagOrDraft
|
||||
- node ./scripts/rename_ia32.js
|
||||
- electron-builder -w --ia32 --publish=onTagOrDraft
|
||||
- electron-builder -w --x64 --ia32 --publish=onTagOrDraft
|
||||
- node ./scripts/rename_portable.js
|
||||
- electron-builder --windows portable --x64 --publish=onTagOrDraft
|
||||
- electron-builder --windows portable --ia32 --publish=onTagOrDraft
|
||||
|
||||
- name: "Linux"
|
||||
os: linux
|
||||
|
@ -659,7 +659,7 @@
|
||||
}
|
||||
|
||||
/* Preview */
|
||||
.gimbal_controls {
|
||||
.orbit_gizmo {
|
||||
position: absolute;
|
||||
border-radius: 50%;
|
||||
width: 80px;
|
||||
@ -669,22 +669,22 @@
|
||||
opacity: 0.6;
|
||||
overflow: hidden;
|
||||
}
|
||||
.gimbal_controls:hover, .gimbal_controls.mouse_active {
|
||||
.orbit_gizmo:hover, .orbit_gizmo.mouse_active {
|
||||
background-color: #00000040;
|
||||
opacity: 1;
|
||||
}
|
||||
.gimbal_controls > svg {
|
||||
.orbit_gizmo > svg {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
display: block;
|
||||
pointer-events: none;
|
||||
filter: brightness(0.7);
|
||||
}
|
||||
.gimbal_controls > svg path {
|
||||
.orbit_gizmo > svg path {
|
||||
stroke-width: 2px;
|
||||
fill: none;
|
||||
}
|
||||
.gimbal_controls_side {
|
||||
.orbit_gizmo_side {
|
||||
color: var(--color-accent_text);
|
||||
position: absolute;
|
||||
width: 16px;
|
||||
@ -697,26 +697,26 @@
|
||||
line-height: 16px;
|
||||
font-family: var(--font-code);
|
||||
}
|
||||
.gimbal_controls.mouse_active .gimbal_controls_side {
|
||||
.orbit_gizmo.mouse_active .orbit_gizmo_side {
|
||||
pointer-events: none;
|
||||
}
|
||||
.gimbal_controls_side[axis="x"], .gimbal_controls > svg path[axis="x"] {
|
||||
.orbit_gizmo_side[axis="x"], .orbit_gizmo > svg path[axis="x"] {
|
||||
background-color: var(--color-axis-x);
|
||||
stroke: var(--color-axis-x);
|
||||
}
|
||||
.gimbal_controls_side[axis="y"], .gimbal_controls > svg path[axis="y"] {
|
||||
.orbit_gizmo_side[axis="y"], .orbit_gizmo > svg path[axis="y"] {
|
||||
background-color: var(--color-axis-y);
|
||||
stroke: var(--color-axis-y);
|
||||
}
|
||||
.gimbal_controls_side[axis="z"], .gimbal_controls > svg path[axis="z"] {
|
||||
.orbit_gizmo_side[axis="z"], .orbit_gizmo > svg path[axis="z"] {
|
||||
background-color: var(--color-axis-z);
|
||||
stroke: var(--color-axis-z);
|
||||
}
|
||||
.gimbal_controls_side.background {
|
||||
.orbit_gizmo_side.background {
|
||||
z-index: 0;
|
||||
filter: brightness(0.7);
|
||||
}
|
||||
.gimbal_controls:not(.mouse_active) .gimbal_controls_side:hover {
|
||||
.orbit_gizmo:not(.mouse_active) .orbit_gizmo_side:hover {
|
||||
background-color: var(--color-bright_ui) !important;
|
||||
filter: brightness(1);
|
||||
}
|
32
js/io/io.js
32
js/io/io.js
@ -559,7 +559,7 @@ BARS.defineActions(function() {
|
||||
'2d': tl('dates.days', [2]),
|
||||
'1w': tl('dates.week', [1]),
|
||||
}},
|
||||
info: {type: 'info', text: 'The model will be stored on the Blockbench servers during the duration specified above. [Learn how your data is protected](https://blockbench.net/blockbench-model-sharing-service/)'}
|
||||
info: {type: 'info', text: 'The model will be stored on the Blockbench servers for the duration specified above. [Learn more](https://blockbench.net/blockbench-model-sharing-service/)'}
|
||||
},
|
||||
buttons: ['generic.share', 'dialog.cancel'],
|
||||
onConfirm: function(formResult) {
|
||||
@ -577,15 +577,27 @@ BARS.defineActions(function() {
|
||||
success: function(response) {
|
||||
let link = `https://blckbn.ch/${response.id}`
|
||||
|
||||
if (isApp || navigator.clipboard) {
|
||||
Clipbench.setText(link);
|
||||
Blockbench.showQuickMessage('dialog.share_model.copied_to_clipboard');
|
||||
} else {
|
||||
Blockbench.showMessageBox({
|
||||
title: 'dialog.share_model.title',
|
||||
message: `[${link}](${link})`,
|
||||
})
|
||||
}
|
||||
let link_dialog = new Dialog({
|
||||
id: 'share_model_link',
|
||||
title: 'dialog.share_model.title',
|
||||
form: {
|
||||
link: {type: 'text', value: link}
|
||||
},
|
||||
buttons: ['action.copy', 'dialog.close'],
|
||||
onConfirm() {
|
||||
link_dialog.hide();
|
||||
if (isApp || navigator.clipboard) {
|
||||
Clipbench.setText(link);
|
||||
Blockbench.showQuickMessage('dialog.share_model.copied_to_clipboard');
|
||||
} else {
|
||||
Blockbench.showMessageBox({
|
||||
title: 'dialog.share_model.title',
|
||||
message: `[${link}](${link})`,
|
||||
})
|
||||
}
|
||||
}
|
||||
}).show();
|
||||
|
||||
},
|
||||
error: function(response) {
|
||||
Blockbench.showQuickMessage('dialog.share_model.failed', 1500)
|
||||
|
@ -197,8 +197,8 @@ class Preview {
|
||||
this.controls.target.fromArray(DefaultCameraPresets[0].target);
|
||||
|
||||
if (!Blockbench.isMobile) {
|
||||
this.gimbal_controls = new GimbalControls(this);
|
||||
this.node.append(this.gimbal_controls.node);
|
||||
this.orbit_gizmo = new OrbitGizmo(this);
|
||||
this.node.append(this.orbit_gizmo.node);
|
||||
}
|
||||
|
||||
//Keybinds
|
||||
@ -1240,12 +1240,12 @@ function openQuadView() {
|
||||
}
|
||||
|
||||
|
||||
class GimbalControls {
|
||||
class OrbitGizmo {
|
||||
constructor(preview, options = {}) {
|
||||
let scope = this;
|
||||
this.preview = preview;
|
||||
this.node = document.createElement('div');
|
||||
this.node.classList.add('gimbal_controls');
|
||||
this.node.classList.add('orbit_gizmo');
|
||||
|
||||
let svg = document.createElementNS('http://www.w3.org/2000/svg', 'svg');
|
||||
this.node.append(svg);
|
||||
@ -1270,7 +1270,7 @@ class GimbalControls {
|
||||
for (let key in this.sides) {
|
||||
let side = this.sides[key];
|
||||
side.node = document.createElement('div');
|
||||
side.node.classList.add('gimbal_controls_side');
|
||||
side.node.classList.add('orbit_gizmo_side');
|
||||
side.node.setAttribute('axis', side.axis);
|
||||
side.node.title = tl(`direction.${key}`);
|
||||
if (side.label) side.node.innerText = side.label;
|
||||
|
Loading…
Reference in New Issue
Block a user