Skip to content

Commit 56ebc5b

Browse files
authored
fix(autofix): New star decoration (#81192)
Make the stars on the start screen more like snowfall rather than a trail. Before: <img width="753" alt="Screenshot 2024-11-14 at 9 02 36 AM" src="https://github.com/user-attachments/assets/d6cce369-a16c-41ee-860e-d965015688f9"> After: <img width="668" alt="Screenshot 2024-11-22 at 10 02 32 AM" src="https://github.com/user-attachments/assets/8badc3e9-24f1-4689-a69c-cb03904bc13d">
1 parent 43d7c41 commit 56ebc5b

File tree

1 file changed

+32
-14
lines changed

1 file changed

+32
-14
lines changed

static/app/views/issueDetails/streamline/solutionsHubDrawer.tsx

Lines changed: 32 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,24 @@ interface AutofixStartBoxProps {
3939
function AutofixStartBox({onSend, groupId}: AutofixStartBoxProps) {
4040
const [message, setMessage] = useState('');
4141

42+
const stars = [
43+
{size: 10, left: 20, top: 5, rotation: 30, opacity: 0.15},
44+
{size: 12, left: 50, top: 8, rotation: 45, opacity: 0.2},
45+
{size: 10, left: 80, top: 12, rotation: 15, opacity: 0.2},
46+
{size: 14, left: 15, top: 20, rotation: 60, opacity: 0.3},
47+
{size: 16, left: 45, top: 25, rotation: 30, opacity: 0.35},
48+
{size: 14, left: 75, top: 22, rotation: 45, opacity: 0.3},
49+
{size: 18, left: 25, top: 35, rotation: 20, opacity: 0.4},
50+
{size: 20, left: 60, top: 38, rotation: 50, opacity: 0.45},
51+
{size: 18, left: 85, top: 42, rotation: 35, opacity: 0.4},
52+
{size: 22, left: 15, top: 55, rotation: 25, opacity: 0.5},
53+
{size: 24, left: 40, top: 58, rotation: 40, opacity: 0.55},
54+
{size: 22, left: 70, top: 52, rotation: 30, opacity: 0.5},
55+
{size: 26, left: 30, top: 70, rotation: 35, opacity: 0.65},
56+
{size: 28, left: 50, top: 75, rotation: 45, opacity: 0.7},
57+
{size: 26, left: 80, top: 72, rotation: 25, opacity: 0.7},
58+
];
59+
4260
const handleSubmit = (e: React.FormEvent) => {
4361
e.preventDefault();
4462
onSend(message);
@@ -47,13 +65,18 @@ function AutofixStartBox({onSend, groupId}: AutofixStartBoxProps) {
4765
return (
4866
<StartBox>
4967
<StarTrail>
50-
{[...Array(8)].map((_, i) => (
68+
{stars.map((star, i) => (
5169
<TrailStar
5270
key={i}
5371
src={starImage}
54-
index={i}
55-
size={14 + i * 2}
56-
offset={(i % 2) * 50 - 15}
72+
style={{
73+
left: `${star.left}%`,
74+
top: `${star.top}%`,
75+
width: `${star.size}px`,
76+
height: `${star.size}px`,
77+
opacity: star.opacity,
78+
transform: `rotate(${star.rotation}deg)`,
79+
}}
5780
/>
5881
))}
5982
</StarTrail>
@@ -389,26 +412,21 @@ const ResourcesHeader = styled('div')`
389412
`;
390413

391414
const StarTrail = styled('div')`
392-
height: 400px;
415+
height: 450px;
393416
width: 100%;
394-
display: flex;
395-
justify-content: center;
396417
position: absolute;
397-
bottom: 7rem;
418+
bottom: 5rem;
398419
left: 0;
399420
right: 0;
400421
z-index: -1;
401422
pointer-events: none;
423+
overflow: hidden;
402424
`;
403425

404-
const TrailStar = styled('img')<{index: number; offset: number; size: number}>`
426+
const TrailStar = styled('img')`
405427
position: absolute;
406-
width: ${p => p.size}px;
407-
height: ${p => p.size}px;
408-
top: ${p => p.index * 50}px;
409-
transform: translateX(${p => p.offset}px) rotate(${p => p.index * 40}deg);
410-
opacity: ${p => Math.min(1, 0.2 + p.index * 0.1)};
411428
filter: sepia(1) saturate(3) hue-rotate(290deg);
429+
transition: all 0.2s ease-in-out;
412430
`;
413431

414432
const HeaderContainer = styled('div')`

0 commit comments

Comments
 (0)