GeezerVison is showing github.com — fix: modernize and reenable the colour slider field (#42) · SnoopyMod/scratch-blocks@4f97982
File tree
Expand file treeCollapse file tree
Open diff view settings
Expand file treeCollapse file tree
Open diff view settings
Collapse file
Copy file name to clipboardExpand all lines: blocks_common/colour.js +3-8Lines changed: 3 additions & 8 deletions | Original file line number | Diff line number | Diff line change |
|---|
|
22 | 22 | * @fileoverview Colour blocks for Blockly. |
23 | 23 | |
24 | 24 | */ |
25 | | -'use strict'; |
26 | | - |
27 | | -goog.provide('Blockly.Blocks.colour'); |
28 | | - |
29 | | -goog.require('Blockly.Blocks'); |
30 | | - |
31 | | -goog.require('Blockly.constants'); |
| 25 | +import * as Blockly from 'blockly'; |
| 26 | +import * as Constants from '../src/constants.js'; |
32 | 27 |
|
33 | 28 | /** |
34 | 29 | * Pick a random colour. |
@@ -54,7 +49,7 @@ Blockly.Blocks['colour_picker'] = { |
54 | 49 | "colour": randomColour() |
55 | 50 | } |
56 | 51 | ], |
57 | | - "outputShape": Blockly.OUTPUT_SHAPE_ROUND, |
| 52 | + "outputShape": Constants.OUTPUT_SHAPE_ROUND, |
58 | 53 | "output": "Colour" |
59 | 54 | }); |
60 | 55 | } |
|
Collapse file
Copy file name to clipboardExpand all lines: core/css.js +34Lines changed: 34 additions & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -881,6 +881,10 @@ const styles = ` |
881 | 881 | cursor: pointer; |
882 | 882 | } |
883 | 883 |
|
| 884 | + .scratchColourPicker { |
| 885 | + width: min-content; |
| 886 | + } |
| 887 | +
|
884 | 888 | .scratchColourPickerLabel { |
885 | 889 | font-family: "Helvetica Neue", Helvetica, sans-serif; |
886 | 890 | font-size: 0.65rem; |
@@ -896,6 +900,36 @@ const styles = ` |
896 | 900 | margin-left: 10px; |
897 | 901 | } |
898 | 902 |
|
| 903 | + .scratchColourSlider { |
| 904 | + appearance: none; |
| 905 | + margin: 8px; |
| 906 | + height: 22px; |
| 907 | + width: 150px; |
| 908 | + position: relative; |
| 909 | + outline: none; |
| 910 | + border-radius: 11px; |
| 911 | + margin-bottom: 20px; |
| 912 | + } |
| 913 | +
|
| 914 | + /* Combining this and the -moz equivalent below with a comma break the webkit version */ |
| 915 | + .scratchColourSlider::-webkit-slider-thumb { |
| 916 | + appearance: none; |
| 917 | + background-color: #fff; |
| 918 | + height: 26px; |
| 919 | + width: 26px; |
| 920 | + border-radius: 100%; |
| 921 | + box-shadow: 0 0 0 4px rgba(0, 0, 0, 0.15); |
| 922 | + } |
| 923 | +
|
| 924 | + .scratchColourSlider::-moz-range-thumb { |
| 925 | + appearance: none; |
| 926 | + background-color: #fff; |
| 927 | + height: 26px; |
| 928 | + width: 26px; |
| 929 | + border-radius: 100%; |
| 930 | + box-shadow: 0 0 0 4px rgba(0, 0, 0, 0.15); |
| 931 | + } |
| 932 | +
|
899 | 933 | .scratchMatrixButtonDiv { |
900 | 934 | width: 50%; |
901 | 935 | text-align: center; |
|