Compare commits
32 Commits
Author | SHA1 | Date | |
---|---|---|---|
72ec2d617e | |||
4d9ae63831 | |||
3eab21cff1 | |||
5a37385d14 | |||
9fa412ff6f | |||
3f7fbb70ba | |||
20189a709b | |||
111b321722 | |||
b8fe8f9294 | |||
7b478c4c38 | |||
a68e1a611d | |||
b3b2944b46 | |||
c809ee4fdf | |||
8e67e69602 | |||
0b508e37b1 | |||
e1a3aca9f8 | |||
bbe93ae9a2 | |||
6fd18b4f4c | |||
b511537348 | |||
749ba6b984 | |||
e571bec213 | |||
1ad90eda81 | |||
0c604498d3 | |||
a8ec408f96 | |||
40fe1b4616 | |||
e52da19925 | |||
d558f70118 | |||
8fca50e907 | |||
8c4abe979b | |||
d4fa9dab1b | |||
955b67b6b8 | |||
739be09ac9 |
BIN
docs/favicon.ico
Before Width: | Height: | Size: 15 KiB After Width: | Height: | Size: 15 KiB |
@ -1,3 +1,3 @@
|
||||
{
|
||||
"appref": "v0.5.31"
|
||||
"appref": "v0.5.46"
|
||||
}
|
||||
|
BIN
docs/static/icons/favicon.ico
vendored
Before Width: | Height: | Size: 15 KiB After Width: | Height: | Size: 15 KiB |
BIN
docs/static/mb/device/usb-generic.jpg
vendored
Before Width: | Height: | Size: 66 KiB After Width: | Height: | Size: 68 KiB |
BIN
docs/static/mb/device/usb-mac.jpg
vendored
Before Width: | Height: | Size: 65 KiB After Width: | Height: | Size: 159 KiB |
BIN
docs/static/mb/device/usb-osx-dnd.png
vendored
Before Width: | Height: | Size: 36 KiB After Width: | Height: | Size: 50 KiB |
BIN
docs/static/mb/device/usb-thin.jpg
vendored
Before Width: | Height: | Size: 41 KiB After Width: | Height: | Size: 67 KiB |
@ -1,54 +1,173 @@
|
||||
/*basic.showString("RGB")
|
||||
basic.setLedColor(Colors.Blue)
|
||||
basic.pause(500)
|
||||
basic.setLedColor(Colors.Red)
|
||||
basic.pause(500)
|
||||
basic.setLedColor(Colors.Green)
|
||||
basic.pause(500)
|
||||
basic.setLedColor(Colors.Violet)
|
||||
basic.pause(500)
|
||||
basic.showString("RGB");
|
||||
basic.setLedColor(Colors.Blue);
|
||||
basic.pause(500);
|
||||
basic.setLedColor(Colors.Red);
|
||||
basic.pause(500);
|
||||
basic.setLedColor(Colors.Green);
|
||||
basic.pause(500);
|
||||
basic.setLedColor(Colors.Violet);
|
||||
basic.pause(500);
|
||||
basic.setLedColor(0);
|
||||
basic.showString("Gesten")
|
||||
basic.showString("Gesten");
|
||||
input.onGesture(Gesture.Shake, () => {
|
||||
basic.showString("S")
|
||||
})
|
||||
});
|
||||
input.onGesture(Gesture.LogoUp, () => {
|
||||
basic.showString("U")
|
||||
})
|
||||
});
|
||||
input.onGesture(Gesture.LogoDown, () => {
|
||||
basic.showString("D")
|
||||
})
|
||||
});
|
||||
input.onGesture(Gesture.ScreenUp, () => {
|
||||
basic.showString("+")
|
||||
})
|
||||
});
|
||||
input.onGesture(Gesture.TiltRight, () => {
|
||||
basic.showString("R")
|
||||
})
|
||||
});
|
||||
input.onGesture(Gesture.FreeFall, () => {
|
||||
basic.showString("F")
|
||||
})
|
||||
});
|
||||
input.onGesture(Gesture.ScreenDown, () => {
|
||||
basic.showString("-")
|
||||
})
|
||||
});
|
||||
input.onGesture(Gesture.TiltLeft, () => {
|
||||
basic.showString("L")
|
||||
})
|
||||
});
|
||||
input.onGesture(Gesture.ThreeG, () => {
|
||||
basic.showString("3")
|
||||
})
|
||||
});
|
||||
input.onGesture(Gesture.SixG, () => {
|
||||
basic.showString("6")
|
||||
})
|
||||
*/
|
||||
});
|
||||
input.onPinPressed(TouchPin.P0, () => {
|
||||
basic.showNumber(0)
|
||||
})
|
||||
});
|
||||
input.onPinPressed(TouchPin.P1, () => {
|
||||
basic.showNumber(1)
|
||||
})
|
||||
});
|
||||
input.onPinPressed(TouchPin.P2, () => {
|
||||
basic.showNumber(2)
|
||||
})
|
||||
});
|
||||
input.onPinPressed(TouchPin.P3, () => {
|
||||
basic.showNumber(3)
|
||||
})
|
||||
});
|
||||
|
||||
basic.showString("Sound");
|
||||
music.setTempo(150);
|
||||
let whole = music.beat(BeatFraction.Whole);
|
||||
function note(n: Note, l: BeatFraction): number[] {
|
||||
return [music.noteFrequency(n), music.beat(l)];
|
||||
}
|
||||
|
||||
function getNoteName(frequency: number): string {
|
||||
switch (frequency) {
|
||||
case 262:
|
||||
return "C";
|
||||
case 277:
|
||||
return "CSharp";
|
||||
case 294:
|
||||
return "D";
|
||||
case 311:
|
||||
return "Eb";
|
||||
case 330:
|
||||
return "E";
|
||||
case 349:
|
||||
return "F";
|
||||
case 370:
|
||||
return "FSharp";
|
||||
case 392:
|
||||
return "G";
|
||||
case 415:
|
||||
return "GSharp";
|
||||
case 440:
|
||||
return "A";
|
||||
case 466:
|
||||
return "Bb";
|
||||
case 494:
|
||||
return "B";
|
||||
case 131:
|
||||
return "C3";
|
||||
case 139:
|
||||
return "CSharp3";
|
||||
case 147:
|
||||
return "D3";
|
||||
case 156:
|
||||
return "Eb3";
|
||||
case 165:
|
||||
return "E3";
|
||||
case 175:
|
||||
return "F3";
|
||||
case 185:
|
||||
return "FSharp3";
|
||||
case 196:
|
||||
return "G3";
|
||||
case 208:
|
||||
return "GSharp3";
|
||||
case 220:
|
||||
return "A3";
|
||||
case 233:
|
||||
return "Bb3";
|
||||
case 247:
|
||||
return "B3";
|
||||
case 523:
|
||||
return "C5";
|
||||
case 555:
|
||||
return "CSharp5";
|
||||
case 587:
|
||||
return "D5";
|
||||
case 622:
|
||||
return "Eb5";
|
||||
case 659:
|
||||
return "E5";
|
||||
case 698:
|
||||
return "F5";
|
||||
case 740:
|
||||
return "FSharp5";
|
||||
case 784:
|
||||
return "G5";
|
||||
case 831:
|
||||
return "GSharp5";
|
||||
case 880:
|
||||
return "A5";
|
||||
case 932:
|
||||
return "Bb5";
|
||||
case 989:
|
||||
return "B5";
|
||||
default:
|
||||
return "?";
|
||||
}
|
||||
}
|
||||
|
||||
var notes = [
|
||||
note(Note.E, BeatFraction.Quarter), note(Note.E, BeatFraction.Quarter), note(Note.F, BeatFraction.Quarter),
|
||||
note(Note.G, BeatFraction.Quarter), note(Note.G, BeatFraction.Quarter), note(Note.F, BeatFraction.Quarter),
|
||||
note(Note.E, BeatFraction.Quarter), note(Note.D, BeatFraction.Quarter), note(Note.C, BeatFraction.Quarter),
|
||||
note(Note.C, BeatFraction.Quarter), note(Note.D, BeatFraction.Quarter), note(Note.E, BeatFraction.Quarter),
|
||||
note(Note.E, BeatFraction.Quarter + BeatFraction.Eighth),
|
||||
note(Note.D, BeatFraction.Eighth), note(Note.D, BeatFraction.Half),
|
||||
note(Note.E, BeatFraction.Quarter), note(Note.E, BeatFraction.Quarter), note(Note.F, BeatFraction.Quarter),
|
||||
note(Note.G, BeatFraction.Quarter), note(Note.G, BeatFraction.Quarter), note(Note.F, BeatFraction.Quarter),
|
||||
note(Note.E, BeatFraction.Quarter), note(Note.D, BeatFraction.Quarter), note(Note.C, BeatFraction.Quarter),
|
||||
note(Note.C, BeatFraction.Quarter), note(Note.D, BeatFraction.Quarter), note(Note.E, BeatFraction.Quarter),
|
||||
note(Note.D, BeatFraction.Quarter + BeatFraction.Eighth),
|
||||
note(Note.C, BeatFraction.Eighth), note(Note.C, BeatFraction.Half),
|
||||
note(Note.D, BeatFraction.Quarter), note(Note.D, BeatFraction.Quarter), note(Note.E, BeatFraction.Quarter),
|
||||
note(Note.C, BeatFraction.Quarter), note(Note.D, BeatFraction.Quarter),
|
||||
note(Note.E, BeatFraction.Eighth), note(Note.F, BeatFraction.Eighth),
|
||||
note(Note.E, BeatFraction.Quarter), note(Note.C, BeatFraction.Quarter), note(Note.D, BeatFraction.Quarter),
|
||||
note(Note.E, BeatFraction.Eighth), note(Note.F, BeatFraction.Eighth),
|
||||
note(Note.E, BeatFraction.Quarter), note(Note.D, BeatFraction.Quarter), note(Note.C, BeatFraction.Quarter),
|
||||
note(Note.D, BeatFraction.Quarter), note(Note.G3, BeatFraction.Quarter), note(Note.E, BeatFraction.Half),
|
||||
note(Note.E, BeatFraction.Quarter), note(Note.F, BeatFraction.Quarter), note(Note.G, BeatFraction.Quarter),
|
||||
note(Note.G, BeatFraction.Quarter), note(Note.F, BeatFraction.Quarter), note(Note.E, BeatFraction.Quarter),
|
||||
note(Note.E, BeatFraction.Eighth), note(Note.F, BeatFraction.Eighth),
|
||||
note(Note.C, BeatFraction.Quarter), note(Note.C, BeatFraction.Quarter), note(Note.D, BeatFraction.Quarter),
|
||||
note(Note.E, BeatFraction.Quarter), note(Note.D, BeatFraction.Quarter + BeatFraction.Eighth),
|
||||
note(Note.C, BeatFraction.Eighth), note(Note.C, BeatFraction.Half)
|
||||
];
|
||||
|
||||
for (var t = 0; t < notes.length; t++) {
|
||||
music.playTone(notes[t][0], notes[t][1]);
|
||||
basic.showString(getNoteName(notes[t][0]));
|
||||
music.rest(whole - notes[t][1]);
|
||||
}
|
@ -4,7 +4,7 @@
|
||||
/**
|
||||
* Provides access to basic micro:bit functionality.
|
||||
*/
|
||||
//% color=#0078D7 weight=100
|
||||
//% color=#54C9C9 weight=100
|
||||
namespace basic {
|
||||
/**
|
||||
* Sets the color on the build-in LED. Set to 0 to turn off.
|
||||
|
@ -34,7 +34,7 @@ enum Colors {
|
||||
/**
|
||||
* Provides access to basic micro:bit functionality.
|
||||
*/
|
||||
//% color=#0078D7 weight=100
|
||||
//% color=#54C9C9 weight=100
|
||||
namespace basic {
|
||||
/**
|
||||
* Converts the color name to a number
|
||||
|
@ -1,7 +1,7 @@
|
||||
/**
|
||||
* Runtime and event utilities.
|
||||
*/
|
||||
//% weight=1 color="#333333"
|
||||
//% weight=1 color="#42495F"
|
||||
//% advanced=true
|
||||
namespace control {
|
||||
|
||||
|
@ -108,7 +108,7 @@ enum class Gesture {
|
||||
SixG = MICROBIT_ACCELEROMETER_EVT_6G
|
||||
};
|
||||
|
||||
//% color=300 weight=99
|
||||
//% color=#C90072 weight=99
|
||||
namespace input {
|
||||
/**
|
||||
* Do something when a button (``A``, ``B`` or both ``A+B``) is pressed
|
||||
|
@ -1,7 +1,7 @@
|
||||
/**
|
||||
* Events and data from sensors
|
||||
*/
|
||||
//% color=#B4009E weight=99
|
||||
//% color=#C90072 weight=99
|
||||
namespace input {
|
||||
/**
|
||||
* Attaches code to run when the screen is facing up.
|
||||
|
@ -8,7 +8,7 @@ enum class DisplayMode_ {
|
||||
// TODO DISPLAY_MODE_BLACK_AND_WHITE_LIGHT_SENSE
|
||||
};
|
||||
|
||||
//% color=3 weight=35
|
||||
//% color=#8169E6 weight=35
|
||||
namespace led {
|
||||
|
||||
/**
|
||||
|
@ -1,7 +1,7 @@
|
||||
/**
|
||||
* Control of the LED screen.
|
||||
*/
|
||||
//% color=#5C2D91 weight=97
|
||||
//% color=#8169E6 weight=97
|
||||
namespace led {
|
||||
|
||||
// what's the current high value
|
||||
|
@ -3,7 +3,7 @@
|
||||
/**
|
||||
* Blocks to control the onboard motors
|
||||
*/
|
||||
//% weight=30
|
||||
//% color=#008272 weight=30
|
||||
namespace motors {
|
||||
/**
|
||||
* Controls the power sent to a single motor
|
||||
|
28
libs/core/music.cpp
Normal file
@ -0,0 +1,28 @@
|
||||
#include "ksbit.h"
|
||||
|
||||
namespace music {
|
||||
/**
|
||||
* Plays a tone through ``speaker`` for the given duration.
|
||||
* @param frequency pitch of the tone to play in Hertz (Hz)
|
||||
* @param ms tone duration in milliseconds (ms)
|
||||
*/
|
||||
//% help=music/play-tone weight=90
|
||||
//% blockId=device_play_note block="play|tone %note=device_note|for %duration=device_beat" icon="\uf025" blockGap=8
|
||||
//% parts="speaker" async
|
||||
void playTone(int freqency, int ms) {
|
||||
uBit.soundmotor.Sound_On(freqency);
|
||||
if(ms > 0) uBit.sleep(ms);
|
||||
uBit.soundmotor.Sound_Off();
|
||||
}
|
||||
|
||||
/**
|
||||
* Plays a tone through ``speaker``.
|
||||
* @param frequency pitch of the tone to play in Hertz (Hz)
|
||||
*/
|
||||
//% help=music/ring-tone weight=80
|
||||
//% blockId=device_ring block="ring tone (Hz)|%note=device_note" icon="\uf025" blockGap=8
|
||||
//% parts="speaker"
|
||||
void ringTone(int frequency) {
|
||||
playTone(frequency, 0);
|
||||
}
|
||||
}
|
@ -125,34 +125,34 @@ enum BeatFraction {
|
||||
/**
|
||||
* Generation of music tones through pin ``P0``.
|
||||
*/
|
||||
//% color=#D83B01 weight=98
|
||||
//% color=#DF4600 weight=98
|
||||
namespace music {
|
||||
let beatsPerMinute: number = 120;
|
||||
|
||||
/**
|
||||
* Plays a tone through pin ``P0`` for the given duration.
|
||||
* @param frequency pitch of the tone to play in Hertz (Hz)
|
||||
* @param ms tone duration in milliseconds (ms)
|
||||
*/
|
||||
//% help=music/play-tone weight=90
|
||||
//% blockId=device_play_note block="play|tone %note=device_note|for %duration=device_beat" icon="\uf025" blockGap=8
|
||||
//% parts="speaker"
|
||||
export function playTone(frequency: number, ms: number): void {
|
||||
pins.analogSetPitchPin(AnalogPin.P0);
|
||||
pins.analogPitch(frequency, ms);
|
||||
}
|
||||
|
||||
/**
|
||||
* Plays a tone through pin ``P0``.
|
||||
* @param frequency pitch of the tone to play in Hertz (Hz)
|
||||
*/
|
||||
//% help=music/ring-tone weight=80
|
||||
//% blockId=device_ring block="ring tone (Hz)|%note=device_note" icon="\uf025" blockGap=8
|
||||
//% parts="speaker"
|
||||
export function ringTone(frequency: number): void {
|
||||
pins.analogSetPitchPin(AnalogPin.P0);
|
||||
pins.analogPitch(frequency, 0);
|
||||
}
|
||||
// /**
|
||||
// * Plays a tone through pin ``P0`` for the given duration.
|
||||
// * @param frequency pitch of the tone to play in Hertz (Hz)
|
||||
// * @param ms tone duration in milliseconds (ms)
|
||||
// */
|
||||
// //% help=music/play-tone weight=90
|
||||
// //% blockId=device_play_note block="play|tone %note=device_note|for %duration=device_beat" icon="\uf025" blockGap=8
|
||||
// //% parts="speaker"
|
||||
// export function playTone(frequency: number, ms: number): void {
|
||||
// pins.analogSetPitchPin(AnalogPin.P0);
|
||||
// pins.analogPitch(frequency, ms);
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * Plays a tone through pin ``P0``.
|
||||
// * @param frequency pitch of the tone to play in Hertz (Hz)
|
||||
// */
|
||||
// //% help=music/ring-tone weight=80
|
||||
// //% blockId=device_ring block="ring tone (Hz)|%note=device_note" icon="\uf025" blockGap=8
|
||||
// //% parts="speaker"
|
||||
// export function ringTone(frequency: number): void {
|
||||
// pins.analogSetPitchPin(AnalogPin.P0);
|
||||
// pins.analogPitch(frequency, 0);
|
||||
// }
|
||||
|
||||
/**
|
||||
* Rests (plays nothing) for a specified time through pin ``P0``.
|
||||
|
@ -23,6 +23,7 @@
|
||||
"led.cpp",
|
||||
"led.ts",
|
||||
"motors.cpp",
|
||||
"music.cpp",
|
||||
"music.ts",
|
||||
"pins.cpp",
|
||||
"pins.ts",
|
||||
|
29
libs/core/shims.d.ts
vendored
@ -126,7 +126,7 @@ declare interface Image {
|
||||
/**
|
||||
* Provides access to basic micro:bit functionality.
|
||||
*/
|
||||
//% color=#0078D7 weight=100
|
||||
//% color=#54C9C9 weight=100
|
||||
declare namespace basic {
|
||||
|
||||
/**
|
||||
@ -218,7 +218,7 @@ declare namespace basic {
|
||||
|
||||
|
||||
|
||||
//% color=300 weight=99
|
||||
//% color=#C90072 weight=99
|
||||
declare namespace input {
|
||||
|
||||
/**
|
||||
@ -432,7 +432,7 @@ declare namespace control {
|
||||
|
||||
|
||||
|
||||
//% color=3 weight=35
|
||||
//% color=#8169E6 weight=35
|
||||
declare namespace led {
|
||||
|
||||
/**
|
||||
@ -513,7 +513,7 @@ declare namespace led {
|
||||
/**
|
||||
* Blocks to control the onboard motors
|
||||
*/
|
||||
//% weight=30
|
||||
//% color=#008272 weight=30
|
||||
declare namespace motors {
|
||||
|
||||
/**
|
||||
@ -524,6 +524,27 @@ declare namespace motors {
|
||||
//% parts=dcmotor shim=motors::motorOn
|
||||
function motorOn(power: number): void;
|
||||
}
|
||||
declare namespace music {
|
||||
|
||||
/**
|
||||
* Plays a tone through ``speaker`` for the given duration.
|
||||
* @param frequency pitch of the tone to play in Hertz (Hz)
|
||||
* @param ms tone duration in milliseconds (ms)
|
||||
*/
|
||||
//% help=music/play-tone weight=90
|
||||
//% blockId=device_play_note block="play|tone %note=device_note|for %duration=device_beat" icon="\uf025" blockGap=8
|
||||
//% parts="speaker" async shim=music::playTone
|
||||
function playTone(freqency: number, ms: number): void;
|
||||
|
||||
/**
|
||||
* Plays a tone through ``speaker``.
|
||||
* @param frequency pitch of the tone to play in Hertz (Hz)
|
||||
*/
|
||||
//% help=music/ring-tone weight=80
|
||||
//% blockId=device_ring block="ring tone (Hz)|%note=device_note" icon="\uf025" blockGap=8
|
||||
//% parts="speaker" shim=music::ringTone
|
||||
function ringTone(frequency: number): void;
|
||||
}
|
||||
declare namespace pins {
|
||||
|
||||
/**
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "pxt-calliope",
|
||||
"version": "0.5.37",
|
||||
"version": "0.5.49",
|
||||
"description": "calliope target for PXT",
|
||||
"keywords": [
|
||||
"JavaScript",
|
||||
@ -30,7 +30,7 @@
|
||||
"typescript": "^1.8.7"
|
||||
},
|
||||
"dependencies": {
|
||||
"pxt-core": "0.5.11",
|
||||
"pxt-core": "0.5.27",
|
||||
"less": "^2.6.0",
|
||||
"semantic-ui-less": "^2.2.4"
|
||||
}
|
||||
|
@ -219,8 +219,6 @@
|
||||
},
|
||||
"appTheme": {
|
||||
"accentColor": "#249899",
|
||||
"downloadClass": "orange",
|
||||
"invertedMenu": true,
|
||||
"defaultLocale": "de",
|
||||
"logoUrl": "https://calliope.cc/about",
|
||||
"logo": "./static/Calliopeminieditor.svg",
|
||||
@ -350,6 +348,9 @@
|
||||
"browser": "*",
|
||||
"path": "/static/mb/device/usb-windows-sendto.jpg"
|
||||
}
|
||||
]
|
||||
],
|
||||
"invertedMenu": true,
|
||||
"invertedToolbox": true,
|
||||
"blocklyOptions": { }
|
||||
}
|
||||
}
|
||||
|
@ -14,6 +14,7 @@ namespace pxsim {
|
||||
radioState: RadioState;
|
||||
neopixelState: NeoPixelState;
|
||||
rgbLedState: number;
|
||||
speakerState: SpeakerState;
|
||||
|
||||
constructor() {
|
||||
super()
|
||||
@ -59,6 +60,7 @@ namespace pxsim {
|
||||
this.builtinParts["lightsensor"] = this.lightSensorState = new LightSensorState();
|
||||
this.builtinParts["compass"] = this.compassState = new CompassState();
|
||||
this.builtinParts["neopixel"] = this.neopixelState = new NeoPixelState();
|
||||
this.builtinParts["speaker"] = this.speakerState = new SpeakerState();
|
||||
|
||||
this.builtinVisuals["buttonpair"] = () => new visuals.ButtonPairView();
|
||||
this.builtinVisuals["ledmatrix"] = () => new visuals.LedMatrixView();
|
||||
|
29
sim/state/music.ts
Normal file
@ -0,0 +1,29 @@
|
||||
namespace pxsim {
|
||||
export class SpeakerState {
|
||||
frequency: number;
|
||||
ms: number;
|
||||
}
|
||||
|
||||
}
|
||||
namespace pxsim.music {
|
||||
|
||||
export function playTone(frequency: number, ms: number) {
|
||||
const b = board();
|
||||
b.speakerState.frequency = frequency;
|
||||
b.speakerState.ms = ms;
|
||||
|
||||
runtime.queueDisplayUpdate();
|
||||
let cb = getResume();
|
||||
AudioContextManager.tone(frequency, 1);
|
||||
if (ms <= 0) cb();
|
||||
else {
|
||||
setTimeout(() => {
|
||||
AudioContextManager.stop();
|
||||
b.speakerState.frequency = 0;
|
||||
b.speakerState.ms = 0;
|
||||
runtime.queueDisplayUpdate();
|
||||
cb()
|
||||
}, ms);
|
||||
}
|
||||
}
|
||||
}
|
@ -1349,6 +1349,7 @@ namespace pxsim.visuals {
|
||||
this.updateButtonAB();
|
||||
this.updateGestures();
|
||||
this.updateRgbLed();
|
||||
this.updateSpeaker();
|
||||
|
||||
if (!runtime || runtime.dead) svg.addClass(this.element, "grayscale");
|
||||
else svg.removeClass(this.element, "grayscale");
|
||||
@ -1371,6 +1372,15 @@ namespace pxsim.visuals {
|
||||
}
|
||||
}
|
||||
|
||||
private updateSpeaker() {
|
||||
let state = this.board;
|
||||
if (state.speakerState.frequency) {
|
||||
|
||||
} else {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
private updateGestures() {
|
||||
let state = this.board;
|
||||
if (state.accelerometerState.useShake && !this.shakeButton) {
|
||||
|
@ -1,3 +1,13 @@
|
||||
/*******************************
|
||||
User Variable Overrides
|
||||
*******************************/
|
||||
|
||||
@invertedBackground: #525A67;
|
||||
@dropdownMenuDistance: 0px;
|
||||
|
||||
/*******************************
|
||||
PXT Theme Overrides
|
||||
*******************************/
|
||||
|
||||
@mainMenuHeight: 5rem;
|
||||
@mainMenuMinHeight: (@itemVerticalPadding * 2) + 2em;
|
@ -1,3 +1,15 @@
|
||||
/*******************************
|
||||
Site Overrides
|
||||
*******************************/
|
||||
|
||||
.ui.inverted.input input {
|
||||
background:#424852;
|
||||
border-radius: 20px;
|
||||
border: 0px !important;
|
||||
padding: 0.2em !important;
|
||||
padding-left: 0.6em !important;
|
||||
}
|
||||
|
||||
.rtl .ui.inverted.input input {
|
||||
padding-right: 0.6em !important;
|
||||
}
|
@ -1,5 +1,3 @@
|
||||
/*******************************
|
||||
Site Overrides
|
||||
*******************************/
|
||||
|
||||
@importGoogleFonts: false;
|
||||
|
@ -1,19 +1,38 @@
|
||||
/*******************************
|
||||
User Global Variables
|
||||
*******************************/
|
||||
@importGoogleFonts: false;
|
||||
|
||||
@importGoogleFonts: true;
|
||||
|
||||
@fontName : 'Roboto Mono';
|
||||
|
||||
@emSize : 14px;
|
||||
@fontSize : 13px;
|
||||
|
||||
/*-------------------
|
||||
Site Colors
|
||||
--------------------*/
|
||||
|
||||
@primaryColor: #3CB5B5;
|
||||
@secondaryColor: #43C9C9;
|
||||
|
||||
@red:#E81123;
|
||||
@orange:#D78C01;
|
||||
@yellow:#EEDA47;
|
||||
@orange:#DF4600;
|
||||
@yellow:#F4C918;
|
||||
@green:#3FC863;
|
||||
@teal:#008272;
|
||||
@blue:#0078D7;
|
||||
@violet:#CF0071;
|
||||
@purple:#8073E5;
|
||||
@blue:#54C9C9;
|
||||
@violet:#C90072;
|
||||
@purple:#8169E6;
|
||||
@pink:#E2008C;
|
||||
@brown:#6B5B4C;
|
||||
@grey:#515B67;
|
||||
@grey:#42495F;
|
||||
|
||||
@pageBackground : #FDFDFA;
|
||||
|
||||
|
||||
/*******************************
|
||||
PXT Overrides
|
||||
*******************************/
|
||||
|
||||
@blocklyToolboxColor: #F6F4E6;
|
||||
|
101
theme/style.less
@ -1,2 +1,103 @@
|
||||
/* Import all components */
|
||||
@import 'semantic';
|
||||
@import 'themes/default/globals/site.variables';
|
||||
@import 'themes/pxt/globals/site.variables';
|
||||
@import 'site/globals/site.variables';
|
||||
|
||||
/* Reference import */
|
||||
@import (reference) "semantic.less";
|
||||
|
||||
.openproject {
|
||||
background: #4ECC60 !important;
|
||||
}
|
||||
|
||||
.blocks-menuitem, .javascript-menuitem {
|
||||
background: #738791 !important;
|
||||
}
|
||||
|
||||
.help-dropdown-menuitem, .more-dropdown-menuitem {
|
||||
background: #424955 !important;
|
||||
margin-right:0px !important;
|
||||
}
|
||||
|
||||
.play-button {
|
||||
&:extend(.ui all);
|
||||
&:extend(.button all);
|
||||
&:extend(.blue all);
|
||||
}
|
||||
|
||||
.download-button {
|
||||
&:extend(.ui all);
|
||||
&:extend(.button all);
|
||||
&:extend(.yellow all);
|
||||
}
|
||||
|
||||
/*******************************
|
||||
Blockly
|
||||
*******************************/
|
||||
|
||||
.blocklyTreeRow {
|
||||
border-radius:5px;
|
||||
}
|
||||
|
||||
/* This removes any padding at the top of the toolbox */
|
||||
.blocklyTreeRoot {
|
||||
padding: 0px !important;
|
||||
}
|
||||
|
||||
/* Blockly Text */
|
||||
.blocklyTreeLabel {
|
||||
font-family: @pageFont !important;
|
||||
}
|
||||
|
||||
.blocklyTreeLabel {
|
||||
font-size:1rem !important;
|
||||
}
|
||||
|
||||
.blocklyFlyoutBackground {
|
||||
fill: @grey;
|
||||
}
|
||||
|
||||
.blocklyToolboxDiv {
|
||||
/*left:30px !important;*/
|
||||
padding:7px;
|
||||
}
|
||||
|
||||
|
||||
/* Mobile */
|
||||
@media only screen and (max-width: @largestMobileScreen) {
|
||||
.blocklyTreeLabel {
|
||||
font-size: 0.5rem !important;
|
||||
}
|
||||
}
|
||||
|
||||
/* Tablet */
|
||||
@media only screen and (min-width: @tabletBreakpoint) and (max-width: @largestTabletScreen) {
|
||||
|
||||
}
|
||||
|
||||
/* Small Monitor */
|
||||
@media only screen and (min-width: @computerBreakpoint) and (max-width: @largestSmallMonitor) {
|
||||
.blocklyTreeRow {
|
||||
width: 230px;
|
||||
}
|
||||
}
|
||||
|
||||
/* Large Monitor */
|
||||
@media only screen and (min-width: @largeMonitorBreakpoint) {
|
||||
.blocklyTreeRow {
|
||||
width: 230px;
|
||||
}
|
||||
}
|
||||
|
||||
/*******************************
|
||||
Menu Bar
|
||||
*******************************/
|
||||
|
||||
#menubar {
|
||||
height: 5rem;
|
||||
}
|
||||
|
||||
#fileNameInput {
|
||||
width: 350px;
|
||||
}
|
@ -91,7 +91,4 @@
|
||||
|
||||
@fontPath : 'fonts';
|
||||
|
||||
@headerFont : 'Segoe UI', 'Helvetica Neue', Arial, Helvetica, sans-serif;
|
||||
@pageFont : 'Segoe UI', 'Helvetica Neue', Arial, Helvetica, sans-serif;
|
||||
|
||||
/* End Config */
|
||||
|