Коммит 0d9b44ec создал по автору avathar's avatar avathar
Просмотр файлов

#174 вынес цвета в константы

владелец e00639c0
...@@ -7,6 +7,7 @@ import { ...@@ -7,6 +7,7 @@ import {
DragObjectDepth, DragObjectDepth,
FONT_SMALL, FONT_SMALL,
FONT_LARGE, FONT_LARGE,
COLOR_DRAG_STROKE,
} from '../kanbans/Const'; } from '../kanbans/Const';
import { ItemType } from 'src/types/kanban_types'; import { ItemType } from 'src/types/kanban_types';
import { EventBus, Events } from 'src/boot/eventBus'; import { EventBus, Events } from 'src/boot/eventBus';
...@@ -124,7 +125,7 @@ const SetDraggable = (item: ItemType): void => { ...@@ -124,7 +125,7 @@ const SetDraggable = (item: ItemType): void => {
const OnItemDragStart = function (this): void { const OnItemDragStart = function (this): void {
this.setDepth(DragObjectDepth); this.setDepth(DragObjectDepth);
this.getElement('background').setStrokeStyle(3, 0xff0000); this.getElement('background').setStrokeStyle(3, COLOR_DRAG_STROKE);
}; };
const OnItemDragEnd = function (this): void { const OnItemDragEnd = function (this): void {
......
// Color // Color
export const COLOR_LIGHT = 0x7b5e57; export const COLOR_LIGHT = 0x7b_5e_57;
export const COLOR_PRIMARY = 0x4e342e; export const COLOR_PRIMARY = 0x4e_34_2e;
export const COLOR_DARK = 0x260e04; export const COLOR_DARK = 0x26_0e_04;
export const COLOR_DRAG_STROKE = 0xff0000;
export const COLOR_BLACK = 0x000000;
export const COLOR_WHITE = 0xffffff;
// Depth // Depth
export const DragObjectDepth = 1000; export const DragObjectDepth = 1000;
......
...@@ -5,6 +5,7 @@ import { ...@@ -5,6 +5,7 @@ import {
COLOR_DARK, COLOR_DARK,
FONT_SMALL, FONT_SMALL,
FONT_LARGE, FONT_LARGE,
COLOR_DRAG_STROKE,
} from './Const'; } from './Const';
import { DefaultDepth, DragObjectDepth } from './Const'; import { DefaultDepth, DragObjectDepth } from './Const';
import CreateItemsBox from '../cards/CreateItemsBox'; import CreateItemsBox from '../cards/CreateItemsBox';
...@@ -168,7 +169,7 @@ const SetDraggable = (panel: any) => { ...@@ -168,7 +169,7 @@ const SetDraggable = (panel: any) => {
const OnPanelDragStart = function (this: any) { const OnPanelDragStart = function (this: any) {
this.setDepth(DragObjectDepth); this.setDepth(DragObjectDepth);
this.getElement('background').setStrokeStyle(3, 0xff0000); this.getElement('background').setStrokeStyle(3, COLOR_DRAG_STROKE);
}; };
const OnPanelDragEnd = function (this: any) { const OnPanelDragEnd = function (this: any) {
......
import { EndlessCanvas } from '../spaces-2d/EndlessCanvas'; import { EndlessCanvas } from '../spaces-2d/EndlessCanvas';
import { FONT_SMALL } from './Const'; import { COLOR_BLACK, FONT_SMALL } from './Const';
const CreateModalLabel = (scene: EndlessCanvas, text: string) => { const CreateModalLabel = (scene: EndlessCanvas, text: string) => {
const normalBackground = scene.rexUI.add.roundRectangle( const normalBackground = scene.rexUI.add.roundRectangle(
...@@ -8,10 +8,10 @@ const CreateModalLabel = (scene: EndlessCanvas, text: string) => { ...@@ -8,10 +8,10 @@ const CreateModalLabel = (scene: EndlessCanvas, text: string) => {
0, 0,
0, 0,
10, 10,
0xffffff, COLOR_BLACK,
0.0, 0.0,
); );
normalBackground.setStrokeStyle(2, 0x000000); // Чёрная обводка normalBackground.setStrokeStyle(2, COLOR_BLACK); // Чёрная обводка
const hoverBackground = scene.rexUI.add.roundRectangle( const hoverBackground = scene.rexUI.add.roundRectangle(
0, 0,
...@@ -19,17 +19,17 @@ const CreateModalLabel = (scene: EndlessCanvas, text: string) => { ...@@ -19,17 +19,17 @@ const CreateModalLabel = (scene: EndlessCanvas, text: string) => {
0, 0,
0, 0,
10, 10,
0xffffff, COLOR_BLACK,
0.0, 0.0,
); );
hoverBackground.setStrokeStyle(2, 0x000000); // Чёрная обводка hoverBackground.setStrokeStyle(2, COLOR_BLACK); // Чёрная обводка
const label = scene.rexUI.add const label = scene.rexUI.add
.label({ .label({
background: normalBackground, background: normalBackground,
text: scene.add.text(0, 0, text, { text: scene.add.text(0, 0, text, {
fontSize: FONT_SMALL, fontSize: FONT_SMALL,
color: '#000000', // Чёрный текст color: COLOR_BLACK.toString(), // Чёрный текст
}), }),
align: 'center', align: 'center',
space: { space: {
......
import { EndlessCanvas } from '../spaces-2d/EndlessCanvas'; import { EndlessCanvas } from '../spaces-2d/EndlessCanvas';
import { COLOR_BLACK, COLOR_WHITE } from './Const';
import { import {
COLOR_LIGHT, COLOR_LIGHT,
COLOR_PRIMARY, COLOR_PRIMARY,
...@@ -35,7 +36,7 @@ const CreateRequestModal = ( ...@@ -35,7 +36,7 @@ const CreateRequestModal = (
text: { text: {
background: { background: {
stroke: 'black', stroke: COLOR_BLACK,
}, },
style: { style: {
...@@ -44,10 +45,10 @@ const CreateRequestModal = ( ...@@ -44,10 +45,10 @@ const CreateRequestModal = (
backgroundBottomY: 1, backgroundBottomY: 1,
backgroundHeight: 20, backgroundHeight: 20,
cursor: { cursor: {
color: 'black', color: COLOR_BLACK,
backgroundColor: 'white', backgroundColor: COLOR_WHITE,
}, },
color: '#ffffff', color: COLOR_WHITE,
}, },
}, },
...@@ -95,13 +96,13 @@ const CreateRequestModal = ( ...@@ -95,13 +96,13 @@ const CreateRequestModal = (
const dialog = scene.rexUI.add const dialog = scene.rexUI.add
.dialog({ .dialog({
background: scene.rexUI.add background: scene.rexUI.add
.roundRectangle(0, 0, 0, 0, 20, 0xffffff) .roundRectangle(0, 0, 0, 0, 20, COLOR_WHITE)
.setStrokeStyle(2, 0x00_00_00), .setStrokeStyle(2, COLOR_BLACK),
title: scene.rexUI.add.label({ title: scene.rexUI.add.label({
text: scene.add.text(0, 0, titleText, { text: scene.add.text(0, 0, titleText, {
fontSize: FONT_LARGE, fontSize: FONT_LARGE,
color: '#000000', color: COLOR_BLACK.toString(),
}), }),
space: { space: {
left: 20, // Увеличены отступы left: 20, // Увеличены отступы
...@@ -135,7 +136,7 @@ const CreateRequestModal = ( ...@@ -135,7 +136,7 @@ const CreateRequestModal = (
}, },
}) })
.on('button.over', function (button, groupName, index, pointer, event) { .on('button.over', function (button, groupName, index, pointer, event) {
button.getElement('background').setStrokeStyle(1, 0xffffff); button.getElement('background').setStrokeStyle(1, COLOR_BLACK);
}) })
.on('button.out', function (button, groupName, index, pointer, event) { .on('button.out', function (button, groupName, index, pointer, event) {
button.getElement('background').setStrokeStyle(); button.getElement('background').setStrokeStyle();
......
import { COLOR_BLACK, COLOR_WHITE } from '../kanbans/Const';
import { EndlessCanvas } from './EndlessCanvas'; import { EndlessCanvas } from './EndlessCanvas';
export default (scene: EndlessCanvas) => { export default (scene: EndlessCanvas) => {
...@@ -7,9 +8,9 @@ export default (scene: EndlessCanvas) => { ...@@ -7,9 +8,9 @@ export default (scene: EndlessCanvas) => {
const height = scene.cameras.main.displayHeight * 10; const height = scene.cameras.main.displayHeight * 10;
const cellWidth = 100; const cellWidth = 100;
const cellHeight = 100; const cellHeight = 100;
const fillColor = 0x000000; const fillColor = COLOR_BLACK;
const fillAlpha = 0.1; const fillAlpha = 0.1;
const outlineFillColor = 0x000000; const outlineFillColor = COLOR_BLACK;
const outlineFillAlpha = 0.1; const outlineFillAlpha = 0.1;
const grid = scene.add.grid( const grid = scene.add.grid(
......
Поддерживает Markdown
0% или .
You are about to add 0 people to the discussion. Proceed with caution.
Сначала завершите редактирование этого сообщения!
Пожалуйста, зарегистрируйтесь или чтобы прокомментировать