Skip to content

Commit

Permalink
feat: update theme color (#30)
Browse files Browse the repository at this point in the history
  • Loading branch information
yuyutaotao authored Aug 2, 2024
1 parent 2799ffe commit db46783
Show file tree
Hide file tree
Showing 8 changed files with 27 additions and 36 deletions.
16 changes: 6 additions & 10 deletions packages/visualizer/src/component/common.less
Original file line number Diff line number Diff line change
@@ -1,18 +1,14 @@
@main-blue: #06B1AB;
@sub-blue: #A3D6D2;
@main-text: #3b3b3b;

@main-orange: #F9483E;

@side-bg: #f7f7f7;
@title-bg: #DDDDDD;
@border-color: #CCCCCC;
@side-bg: #F8F8F8;
@title-bg: @side-bg;
@border-color: #E5E5E5;
@heavy-border-color: #888;

@selected-bg: @main-blue;
@selected-text: #ffffff;
@hover-bg: @sub-blue;
@hover-text: #333;

@selected-bg: #bfc4da80;
@hover-bg: #dcdcdc80;

@weak-text: #777;
@weak-bg: #F3F3F3;
Expand Down
5 changes: 2 additions & 3 deletions packages/visualizer/src/component/detail-panel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -98,11 +98,10 @@ const DetailPanel = (): JSX.Element => {
theme={{
components: {
Segmented: {
itemSelectedBg: '#D7D7D7',
itemSelectedBg: '#bfc4da50',
itemSelectedColor: '#000000',
// itemHoverColor: '#ffffff',
// itemHoverBg: '#A3D6D2', // @sub-blue
/* 这里是你的组件 token */
// itemHoverBg: '#A3D6D2',
},
},
}}
Expand Down
1 change: 0 additions & 1 deletion packages/visualizer/src/component/detail-side.less
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
line-height: 1.5;

.meta-key {
font-weight: bold;
width:100px;
text-align: right;
padding-right: 16px;
Expand Down
1 change: 0 additions & 1 deletion packages/visualizer/src/component/panel-title.less
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,5 @@
background: @title-bg;
border-top: 1px solid @border-color;
border-bottom: 1px solid @border-color;
// box-shadow: 1px 1px 5px @border-color;
margin-top: -1px;
}
12 changes: 2 additions & 10 deletions packages/visualizer/src/component/sidebar.less
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,7 @@

.side-sub-title {
padding: 0 @side-horizontal-padding;
font-weight: bold;
// margin-top: @side-vertical-spacing;
// color: @strong-text;
margin-bottom: 6px;
}

.side-item {
Expand All @@ -66,17 +64,11 @@

&:hover {
background: @hover-bg;
color: @hover-text;
}

&.selected
{
background: @selected-bg;
color: @selected-text;

.status-text {
color: @selected-text;
}
}

.side-item-content {
Expand All @@ -103,7 +95,7 @@
}

.status-icon-success {
color: rgb(58, 119, 58);
color:#2B8243;
}

.status-icon-fail {
Expand Down
2 changes: 1 addition & 1 deletion packages/visualizer/src/component/sidebar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ const Sidebar = (props: { hideLogo?: boolean; logoAction?: () => void }): JSX.El
<div className="task-list">{sideList}</div>
<div className="side-seperator side-seperator-line side-seperator-space-up" />
<div className="task-meta-section">
<div className="task-meta">use Command + ⬆︎ / ⬇︎ to switch</div>
<div className="task-meta">switch: Command + Up / Down</div>
</div>
</div>
<div className="bottom-controls">
Expand Down
22 changes: 14 additions & 8 deletions packages/visualizer/src/component/timeline.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -66,17 +66,18 @@ const TimelineWidget = (props: {

const sizeRatio = 2;

const titleBg = 0xdddddd; // @title-bg
const sideBg = 0xf7f7f7; // @side-bg
const titleBg = 0xf8f8f8; // @title-bg
const sideBg = 0xffffff;
const gridTextColor = 0;
const shotBorderColor = 0x777777;
const gridLineColor = 0xcccccc; // @border-color
const gridHighlightColor = 0x06b1ab; // @main-blue
const gridLineColor = 0xe5e5e5; // @border-color
const gridHighlightColor = 0xbfc4da; // @selected-bg
const highlightMaskAlpha = 0.6;
const timeContentFontSize = 20;
const commonPadding = 12;
const timeTextTop = commonPadding;
const timeTitleBottom = timeTextTop * 2 + timeContentFontSize;
const highlightMaskAlpha = 0.6;
const hoverMaskColor = 0xdcdcdc; // @hover-bg
const hoverMaskAlpha = 0.3;

const closestScreenshotItemOnXY = (x: number, _y: number) => {
Expand Down Expand Up @@ -174,6 +175,11 @@ const TimelineWidget = (props: {
titleBgSection.drawRect(0, 0, canvasWidth, timeTitleBottom);
titleBgSection.endFill();
gridsContainer.addChild(titleBgSection);
const titleBottomBorder = new PIXI.Graphics();
titleBottomBorder.beginFill(gridLineColor);
titleBottomBorder.drawRect(0, timeTitleBottom, canvasWidth, sizeRatio);
titleBottomBorder.endFill();
gridsContainer.addChild(titleBottomBorder);

const gridHeight = canvasHeight;
for (let i = 1; i <= gridCount; i++) {
Expand Down Expand Up @@ -252,7 +258,7 @@ const TimelineWidget = (props: {
) => {
highlightMaskContainer.removeChildren();

const mask = (start: number | undefined, end: number | undefined, alpha: number) => {
const mask = (start: number | undefined, end: number | undefined, color: number, alpha: number) => {
if (typeof start === 'undefined' || typeof end === 'undefined' || end === 0) {
return;
}
Expand Down Expand Up @@ -280,8 +286,8 @@ const TimelineWidget = (props: {
highlightMaskContainer.addChild(mask);
};

mask(start, end, highlightMaskAlpha);
mask(hoverStart, hoverEnd, hoverMaskAlpha);
mask(start, end, gridHighlightColor, highlightMaskAlpha);
mask(hoverStart, hoverEnd, hoverMaskColor, hoverMaskAlpha);
};
highlightMaskUpdater(props.highlightMask?.startMs, props.highlightMask?.endMs, 0, 0);
containerUpdaterRef.current = highlightMaskUpdater;
Expand Down
4 changes: 2 additions & 2 deletions packages/visualizer/src/index.less
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ footer.mt-8{
display: flex;
flex-direction: column;
height: 100%;
color: #000;
color: @main-text;
font-family: -apple-system,BlinkMacSystemFont,"Segoe UI","Noto Sans",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji";
font-size: 14px;
border-top: 1px solid @border-color;
Expand All @@ -70,7 +70,7 @@ footer.mt-8{
flex-direction: row;
flex-grow: 1;
overflow: hidden;
background: @side-bg;
background: #FFF;
}

&.uploader-wrapper {
Expand Down

0 comments on commit db46783

Please sign in to comment.