-
Notifications
You must be signed in to change notification settings - Fork 16
Expand file tree
/
Copy pathRibbon.jsx
More file actions
71 lines (59 loc) · 1.66 KB
/
Ribbon.jsx
File metadata and controls
71 lines (59 loc) · 1.66 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
/**
* Beta Warning Ribbon (Enhanced visibility)
* Updated to be more eye-catching with a subtle flash and bolder text
* so users clearly notice the beta status (Issue #90).
*/
import React from "react";
import styled, { keyframes } from "styled-components";
const ribbonDrop = keyframes`
0% { transform: translateY(-100%); }
100% { transform: translateY(0); }
`;
/* Slight flashing effect (brightness pulse) */
const flash = keyframes`
0% { filter: brightness(1); }
50% { filter: brightness(1.25); }
100% { filter: brightness(1); }
`;
const RibbonWrap = styled.div`
overflow: hidden;
${({ onClick }) => (onClick ? "cursor: pointer;" : "")}
`;
const RibbonDrop = styled.div`
animation: ${ribbonDrop} 0.7s ease forwards;
`;
const RibbonContentWrapper = styled.div`
background: linear-gradient(
90deg,
#0a84ff 0%,
#1d4ed8 50%,
#2563eb 100%
);
padding: 1rem 0;
text-align: center;
/* soft blue glow */
box-shadow: 0 4px 18px rgba(30, 100, 255, 0.35);
backdrop-filter: blur(6px);
/* FLASH effect added here */
animation: ${flash} 2s ease-in-out infinite;
`;
const RibbonContent = styled.div`
color: white;
font-size: 18px;
font-weight: 900; /* MUCH bolder */
letter-spacing: 0.02em;
font-family: -apple-system, BlinkMacSystemFont, sans-serif;
text-shadow: 0 1px 4px rgba(0,0,0,0.4); /* clearer visibility */
`;
function Ribbon({ children, onClick, ...props }) {
return (
<RibbonWrap onClick={onClick} {...props}>
<RibbonDrop>
<RibbonContentWrapper>
<RibbonContent>{children}</RibbonContent>
</RibbonContentWrapper>
</RibbonDrop>
</RibbonWrap>
);
}
export default Ribbon;