Commit d2697192 authored by Curtis Adam's avatar Curtis Adam

Extend the card Visuals config to set the card navigation scale for 3D mode

parent d2aa9be3
......@@ -44,6 +44,24 @@ export let AspectRatio = class AspectRatio {
}
}
static scale3DCardNavigationWidth () {
if ((Route.isPresentation() || Route.isPresentationTranscript()) && config.scale3DCardNavigationWidth.includes(0)) {
return true;
}
if ((Route.isDemo() || Route.isMakingOf()) && config.scale3DCardNavigationWidth.includes(1)) {
return true;
}
if (Route.isBox() && config.scale3DCardNavigationWidth.includes(2)) {
return true;
}
if (Route.isMemo() && config.scale3DCardNavigationWidth.includes(3)) {
return true;
}
if (Route.isEditCard() && config.scale3DCardNavigationWidth.includes(4)) {
return true;
}
}
static getDefault () {
if (Route.isPresentation() || Route.isPresentationTranscript() || Route.isCardset()) {
if (NavigatorCheck.isIOS()) {
......
......@@ -207,14 +207,16 @@ export let CardVisuals = class CardVisuals {
$('#contentEditor').css('height', $('.scene').height() - $('#editorButtonGroup').height());
adjustNavigation = false;
}
if (adjustNavigation) {
let leftMargin = ($(window).width() - config.cubeMaxNavigationWidth) / 2;
if (leftMargin < 0) {
leftMargin = 0;
} else {
leftMargin -= parseInt($('.cardNavigation').parent().css('padding-left'));
if (AspectRatio.scale3DCardNavigationWidth()) {
if (adjustNavigation) {
let leftMargin = ($(window).width() - flashcard.width()) / 2;
if (leftMargin < 0) {
leftMargin = 0;
} else {
leftMargin -= parseInt($('.cardNavigation').parent().css('padding-left'));
}
$('.cardNavigation').attr('style', 'max-width: ' + flashcard.width() + 'px !important; margin-left: ' + leftMargin + 'px !important;');
}
$('.cardNavigation').attr('style', 'max-width: ' + config.cubeMaxNavigationWidth + 'px !important; margin-left: ' + leftMargin + 'px !important;');
}
}
......
......@@ -16,7 +16,7 @@ let aspectRatios = ['fill', 'din', '5:3', '16:9', '16:10', '4:3'];
//2: Leitner
//3: Wozniak
//4: Editor-Fullscreen
let defaultAspectRatio = ['fill', '16:10', 'din', 'din', 'din'];
let defaultAspectRatio = ['fill', '4:3', 'din', 'din', 'din'];
let defaultAspectRatioTablet = ['fill', '4:3', 'fill', 'fill', 'fill'];
//Scale the width of the top card navigation to match the card width
......@@ -25,12 +25,14 @@ let defaultAspectRatioTablet = ['fill', '4:3', 'fill', 'fill', 'fill'];
//2: Leitner
//3: Wozniak
//4: Editor-Fullscreen
let scaleCardNavigationWidth = [];
let scaleCardNavigationWidth = [0, 1, 2, 3, 4];
let scale3DCardNavigationWidth = [0, 1, 2, 3, 4];
module.exports = {
aspectRatioEnabled,
aspectRatios,
defaultAspectRatio,
scaleCardNavigationWidth,
defaultAspectRatioTablet
defaultAspectRatioTablet,
scale3DCardNavigationWidth
};
......@@ -50,7 +50,6 @@ let enabled3DModeByDefault = [1, 2, 3, 4, 5];
let got3DMode = [1, 2, 3, 4, 5];
let cubeTransitionTime = 1.5;
let cubeMaxNavigationWidth = 1200;
module.exports = {
defaultFontSize,
......@@ -61,6 +60,5 @@ module.exports = {
fixedSidebarPosition,
enabled3DModeByDefault,
got3DMode,
cubeTransitionTime,
cubeMaxNavigationWidth
cubeTransitionTime
};
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment