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

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

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