Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Minecraft HOC Zoom Slider #10236

Merged
merged 1 commit into from
Oct 17, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 8 additions & 7 deletions pxtblocks/plugins/math/fieldSlider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,7 @@ export class FieldSlider extends Blockly.FieldNumber {

protected createSlider() {
const slider = document.createElement("input");
slider.setAttribute('class', 'blocklyFieldSlider');
slider.type = "range";
slider.min = this.getMin() + "";
slider.max = this.getMax() + "";
Expand Down Expand Up @@ -247,14 +248,14 @@ Blockly.Css.register(`
margin-left: 10px;
}

input[type=range] {
input[type=range].blocklyFieldSlider {
-webkit-appearance: none;
width: 100%;
}
input[type=range]:focus {
input[type=range].blocklyFieldSlider:focus {
outline: none;
}
input[type=range]::-webkit-slider-runnable-track {
input[type=range].blocklyFieldSlider::-webkit-slider-runnable-track {
-webkit-appearance: none;
margin: 8px;
height: 22px;
Expand All @@ -264,7 +265,7 @@ input[type=range]::-webkit-slider-runnable-track {
margin-bottom: 20px;
background: var(--blocklyFieldSliderBackgroundColor);
}
input[type=range]::-webkit-slider-thumb {
input[type=range].blocklyFieldSlider::-webkit-slider-thumb {
-webkit-appearance: none;
width: 26px;
height: 26px;
Expand All @@ -276,7 +277,7 @@ input[type=range]::-webkit-slider-thumb {
box-shadow: 0 0 0 4px rgba(0, 0, 0, 0.15);
cursor: pointer;
}
input[type=range]::-moz-range-track {
input[type=range].blocklyFieldSlider::-moz-range-track {
margin: 8px;
height: 22px;
width: 95%;
Expand All @@ -285,7 +286,7 @@ input[type=range]::-moz-range-track {
margin-bottom: 20px;
background: #547AB2;
}
input[type=range]::-moz-range-thumb {
input[type=range].blocklyFieldSlider::-moz-range-thumb {
width: 26px;
height: 26px;
margin-top: -1px;
Expand All @@ -296,4 +297,4 @@ input[type=range]::-moz-range-thumb {
box-shadow: 0 0 0 4px rgba(0, 0, 0, 0.15);
cursor: pointer;
}
`)
`)