mirror of
https://github.com/Boof2015/astra-mobile.git
synced 2026-08-21 13:09:46 +02:00
update miniplayer curve
This commit is contained in:
@@ -50,12 +50,15 @@ export function MiniPlayer() {
|
|||||||
dbMax={-20}
|
dbMax={-20}
|
||||||
width={pillWidth}
|
width={pillWidth}
|
||||||
height={PILL_HEIGHT}
|
height={PILL_HEIGHT}
|
||||||
lineWidth={1.5}
|
lineWidth={1.25}
|
||||||
fillOpacity={0.75}
|
lineOpacity={0.38}
|
||||||
|
fillOpacity={0.3}
|
||||||
glow
|
glow
|
||||||
|
glowOpacity={0.06}
|
||||||
/>
|
/>
|
||||||
</View>
|
</View>
|
||||||
)}
|
)}
|
||||||
|
{scopeActive && pillWidth > 0 && <View pointerEvents="none" style={styles.spectrumVeil} />}
|
||||||
|
|
||||||
<View style={styles.row}>
|
<View style={styles.row}>
|
||||||
<View style={styles.art}>
|
<View style={styles.art}>
|
||||||
@@ -114,6 +117,14 @@ const styles = StyleSheet.create({
|
|||||||
right: 0,
|
right: 0,
|
||||||
bottom: 0,
|
bottom: 0,
|
||||||
},
|
},
|
||||||
|
spectrumVeil: {
|
||||||
|
position: 'absolute',
|
||||||
|
top: 0,
|
||||||
|
left: 0,
|
||||||
|
right: 0,
|
||||||
|
bottom: 0,
|
||||||
|
backgroundColor: 'rgba(8, 10, 15, 0.24)',
|
||||||
|
},
|
||||||
row: {
|
row: {
|
||||||
flexDirection: 'row',
|
flexDirection: 'row',
|
||||||
alignItems: 'center',
|
alignItems: 'center',
|
||||||
|
|||||||
@@ -29,8 +29,10 @@ interface SpectrumCurveProps {
|
|||||||
tiltDbPerOctave?: number;
|
tiltDbPerOctave?: number;
|
||||||
color?: string;
|
color?: string;
|
||||||
lineWidth?: number;
|
lineWidth?: number;
|
||||||
|
lineOpacity?: number;
|
||||||
fillOpacity?: number;
|
fillOpacity?: number;
|
||||||
glow?: boolean;
|
glow?: boolean;
|
||||||
|
glowOpacity?: number;
|
||||||
edgeFade?: boolean;
|
edgeFade?: boolean;
|
||||||
edgeFadeColor?: string;
|
edgeFadeColor?: string;
|
||||||
edgeFadeWidth?: number;
|
edgeFadeWidth?: number;
|
||||||
@@ -145,8 +147,10 @@ function buildPicture(
|
|||||||
height: number,
|
height: number,
|
||||||
color: string,
|
color: string,
|
||||||
lineWidth: number,
|
lineWidth: number,
|
||||||
|
lineOpacity: number,
|
||||||
fillOpacity: number,
|
fillOpacity: number,
|
||||||
glow: boolean,
|
glow: boolean,
|
||||||
|
glowOpacity: number,
|
||||||
edgeFade: boolean,
|
edgeFade: boolean,
|
||||||
edgeFadeColor: string,
|
edgeFadeColor: string,
|
||||||
edgeFadeWidth: number
|
edgeFadeWidth: number
|
||||||
@@ -158,9 +162,9 @@ function buildPicture(
|
|||||||
if (values.length >= 2 && width > 0 && height > 0) {
|
if (values.length >= 2 && width > 0 && height > 0) {
|
||||||
canvas.drawPath(fill, makeFillPaint(color, height, fillOpacity));
|
canvas.drawPath(fill, makeFillPaint(color, height, fillOpacity));
|
||||||
if (glow) {
|
if (glow) {
|
||||||
canvas.drawPath(line, makeStrokePaint(color, lineWidth * 3, 0.18));
|
canvas.drawPath(line, makeStrokePaint(color, lineWidth * 3, glowOpacity));
|
||||||
}
|
}
|
||||||
canvas.drawPath(line, makeStrokePaint(color, lineWidth));
|
canvas.drawPath(line, makeStrokePaint(color, lineWidth, lineOpacity));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (edgeFade && width > 0 && height > 0 && edgeFadeWidth > 0) {
|
if (edgeFade && width > 0 && height > 0 && edgeFadeWidth > 0) {
|
||||||
@@ -296,8 +300,10 @@ export function SpectrumCurve({
|
|||||||
tiltDbPerOctave = TILT_DB_PER_OCT,
|
tiltDbPerOctave = TILT_DB_PER_OCT,
|
||||||
color = colors.accent,
|
color = colors.accent,
|
||||||
lineWidth = 2,
|
lineWidth = 2,
|
||||||
|
lineOpacity = 1,
|
||||||
fillOpacity = 1,
|
fillOpacity = 1,
|
||||||
glow = false,
|
glow = false,
|
||||||
|
glowOpacity = 0.18,
|
||||||
edgeFade = false,
|
edgeFade = false,
|
||||||
edgeFadeColor = colors.bgPrimary,
|
edgeFadeColor = colors.bgPrimary,
|
||||||
edgeFadeWidth = 28,
|
edgeFadeWidth = 28,
|
||||||
@@ -317,13 +323,28 @@ export function SpectrumCurve({
|
|||||||
Math.max(1, height),
|
Math.max(1, height),
|
||||||
color,
|
color,
|
||||||
lineWidth,
|
lineWidth,
|
||||||
|
lineOpacity,
|
||||||
fillOpacity,
|
fillOpacity,
|
||||||
glow,
|
glow,
|
||||||
|
glowOpacity,
|
||||||
edgeFade,
|
edgeFade,
|
||||||
edgeFadeColor,
|
edgeFadeColor,
|
||||||
edgeFadeWidth
|
edgeFadeWidth
|
||||||
),
|
),
|
||||||
[color, edgeFade, edgeFadeColor, edgeFadeWidth, fillOpacity, glow, height, lineWidth, staticValues, width]
|
[
|
||||||
|
color,
|
||||||
|
edgeFade,
|
||||||
|
edgeFadeColor,
|
||||||
|
edgeFadeWidth,
|
||||||
|
fillOpacity,
|
||||||
|
glow,
|
||||||
|
glowOpacity,
|
||||||
|
height,
|
||||||
|
lineOpacity,
|
||||||
|
lineWidth,
|
||||||
|
staticValues,
|
||||||
|
width,
|
||||||
|
]
|
||||||
);
|
);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
@@ -350,8 +371,10 @@ export function SpectrumCurve({
|
|||||||
height,
|
height,
|
||||||
color,
|
color,
|
||||||
lineWidth,
|
lineWidth,
|
||||||
|
lineOpacity,
|
||||||
fillOpacity,
|
fillOpacity,
|
||||||
glow,
|
glow,
|
||||||
|
glowOpacity,
|
||||||
edgeFade,
|
edgeFade,
|
||||||
edgeFadeColor,
|
edgeFadeColor,
|
||||||
edgeFadeWidth
|
edgeFadeWidth
|
||||||
@@ -397,7 +420,9 @@ export function SpectrumCurve({
|
|||||||
fillOpacity,
|
fillOpacity,
|
||||||
frameMs,
|
frameMs,
|
||||||
glow,
|
glow,
|
||||||
|
glowOpacity,
|
||||||
height,
|
height,
|
||||||
|
lineOpacity,
|
||||||
lineWidth,
|
lineWidth,
|
||||||
resolvedPointCount,
|
resolvedPointCount,
|
||||||
tiltDbPerOctave,
|
tiltDbPerOctave,
|
||||||
|
|||||||
Reference in New Issue
Block a user