Skip to content

Commit c57add7

Browse files
feat(transition): add color transition
1 parent a6be71e commit c57add7

File tree

8 files changed

+31
-69
lines changed

8 files changed

+31
-69
lines changed

CHANGELOG.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
## [1.11.4](https://github.com/vault-developer/event-loop-explorer/compare/v1.11.3...v1.11.4) (2025-01-19)
22

3-
43
### Bug Fixes
54

6-
* fix selected lines ([ed63143](https://github.com/vault-developer/event-loop-explorer/commit/ed63143be5a6f25670e2c04805f940cea9c78bbb))
5+
- fix selected lines ([ed63143](https://github.com/vault-developer/event-loop-explorer/commit/ed63143be5a6f25670e2c04805f940cea9c78bbb))
76

87
## [1.11.3](https://github.com/vault-developer/event-loop-explorer/compare/v1.11.2...v1.11.3) (2025-01-14)
98

src/emotion.d.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ declare module '@emotion/react' {
77
breakpoints: {
88
desktop: number;
99
};
10+
colorTransition: string;
1011
widths: {
1112
eventLoopRadius: number;
1213
eventLoopDiameter: number;

src/pages/home/Home.styled.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,9 @@ export const BaseLayoutElement = styled.div(
6161
({ theme }) => css`
6262
border: 1px solid ${theme.custom.colors.onContainer.dim};
6363
background: ${theme.custom.colors.container};
64+
transition:
65+
background-color ${theme.custom.colorTransition},
66+
border-color ${theme.custom.colorTransition};
6467
margin: 0;
6568
padding: 10px;
6669
`

src/pages/home/sections/Configurator/Editor/Editor.styled.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,24 +7,29 @@ export const EditorWrapper = styled.div(
77
88
.ace_layer.ace_gutter-layer {
99
background: ${theme.custom.colors.container};
10+
transition: all ${theme.custom.colorTransition};
1011
}
1112
1213
.ace_gutter {
1314
background: ${theme.custom.colors.onContainer.dim};
15+
transition: all ${theme.custom.colorTransition};
1416
}
1517
1618
.selected_lines {
1719
position: absolute;
1820
background: ${theme.custom.colors.tertiary.normal};
21+
transition: all ${theme.custom.colorTransition};
1922
opacity: 0.3;
2023
}
2124
2225
.ace_gutter-active-line {
2326
background: ${theme.custom.colors.onContainer.dim};
27+
transition: all ${theme.custom.colorTransition};
2428
}
2529
2630
.ace_content {
2731
background: ${theme.custom.colors.container};
32+
transition: all ${theme.custom.colorTransition};
2833
}
2934
`
3035
);

src/pages/home/sections/EventLoop/Wheel/Wheel.styled.ts

Lines changed: 6 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -10,71 +10,12 @@ export const CircleContainer = styled.div(
1010
`
1111
);
1212

13-
export const CircleInner = styled.div(
13+
export const SVGContainer = styled.svg(
1414
({ theme }) => css`
15-
position: absolute;
16-
top: ${theme.custom.widths.eventLoopWheelWidth}px;
17-
left: ${theme.custom.widths.eventLoopWheelWidth}px;
18-
right: ${theme.custom.widths.eventLoopWheelWidth}px;
19-
bottom: ${theme.custom.widths.eventLoopWheelWidth}px;
20-
background: ${theme.custom.colors.container};
21-
border-radius: 50%;
22-
`
23-
);
24-
25-
export const CircleOuter = styled.div(
26-
({ theme }) => css`
27-
position: absolute;
28-
top: 0;
29-
left: 0;
30-
right: 0;
31-
bottom: 0;
32-
background: ${theme.custom.colors.onContainer.dim};
33-
border-radius: 50%;
15+
path,
16+
text,
17+
circle {
18+
transition: all ${theme.custom.colorTransition};
19+
}
3420
`
3521
);
36-
37-
export const Sector = styled.div<{
38-
background: string;
39-
degree: number;
40-
enabled: boolean;
41-
}>(({ theme, background, degree, enabled }) => {
42-
const saturation = {
43-
light: 2,
44-
dark: 1.3,
45-
}[theme.custom.mode];
46-
const brightness = {
47-
light: {
48-
enabled: 1.4,
49-
disabled: 1,
50-
},
51-
dark: {
52-
enabled: 1,
53-
disabled: 0.8,
54-
},
55-
}[theme.custom.mode];
56-
return css`
57-
height: ${theme.custom.widths.eventLoopRadius}px;
58-
width: ${theme.custom.widths.eventLoopDiameter}px;
59-
overflow: hidden;
60-
position: absolute;
61-
transform-origin: 50% 100%;
62-
transform: rotate(${degree}deg);
63-
64-
&:before {
65-
height: inherit;
66-
width: inherit;
67-
position: absolute;
68-
content: '';
69-
border-radius: ${theme.custom.widths.eventLoopRadius}px
70-
${theme.custom.widths.eventLoopRadius}px 0 0;
71-
background-color: ${background};
72-
filter: saturate(${saturation})
73-
brightness(${enabled ? brightness.enabled : brightness.disabled});
74-
opacity: ${enabled ? 1 : 0.3};
75-
transform-origin: 50% 100%;
76-
transform: rotate(160deg);
77-
left: 0;
78-
}
79-
`;
80-
});

src/pages/home/sections/EventLoop/Wheel/Wheel.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ function Wheel() {
6565

6666
return (
6767
<Styled.CircleContainer>
68-
<svg
68+
<Styled.SVGContainer
6969
id={WHEEL_ID}
7070
xmlns="http://www.w3.org/2000/svg"
7171
viewBox="-100 -100 200 200"
@@ -219,7 +219,7 @@ function Wheel() {
219219
>
220220
T<title>Task</title>
221221
</text>
222-
</svg>
222+
</Styled.SVGContainer>
223223
</Styled.CircleContainer>
224224
);
225225
}

src/providers/StylesProvider.utils.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ export const getGlobalStyles = ({ theme }: { theme: Theme }) => css`
55
font-family: Inter, system-ui, Avenir, Helvetica, Arial, sans-serif;
66
color: ${theme.custom.colors.onBackground};
77
background-color: ${theme.custom.colors.background};
8+
transition: all ${theme.custom.colorTransition};
89
height: 100%;
910
}
1011
@@ -26,6 +27,7 @@ export const getGlobalStyles = ({ theme }: { theme: Theme }) => css`
2627
2728
a {
2829
color: ${theme.custom.colors.onBackground};
30+
transition: all ${theme.custom.colorTransition};
2931
}
3032
3133
body {

src/theme/theme.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,15 @@ export const getMuiTheme = (cs: ColorsSystem) =>
2020
fontSize: '14',
2121
color: cs.colors.onContainer.contrast,
2222
backgroundColor: cs.colors.onContainer.dim,
23+
transition: 'all 1s ease',
2324
},
2425
},
2526
},
2627
MuiMenu: {
2728
styleOverrides: {
2829
list: {
2930
backgroundColor: cs.colors.onContainer.dim,
31+
transition: 'all 1s ease',
3032
},
3133
},
3234
},
@@ -36,6 +38,14 @@ export const getMuiTheme = (cs: ColorsSystem) =>
3638
'&.Mui-focused .MuiOutlinedInput-notchedOutline': {
3739
borderColor: cs.colors.onContainer.normal,
3840
},
41+
transition: 'all 1s ease',
42+
},
43+
},
44+
},
45+
MuiButton: {
46+
styleOverrides: {
47+
root: {
48+
transition: 'all 1s ease',
3949
},
4050
},
4151
},
@@ -60,6 +70,7 @@ export const getTheme = (cs: ColorsSystem): Theme => {
6070
breakpoints: {
6171
desktop: 768,
6272
},
73+
colorTransition: '1s ease',
6374
widths: {
6475
eventLoopRadius: 150,
6576
eventLoopDiameter: 300,

0 commit comments

Comments
 (0)