-
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
86 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
import React from 'react'; | ||
import { StyleSheet } from 'react-native'; | ||
import { useDerivedValue, useSharedValue } from 'react-native-reanimated'; | ||
import { vec, Rect, Canvas, RadialGradient } from '@shopify/react-native-skia'; | ||
|
||
const BGGradient = () => { | ||
const canvasSize = useSharedValue({ width: 0, height: 0 }); | ||
|
||
const gradientRadius = useDerivedValue(() => canvasSize.value.width); | ||
const gradientC = useDerivedValue(() => vec(canvasSize.value.width / 2, 0)); | ||
|
||
return ( | ||
<Canvas style={styles.canvas} onSize={canvasSize}> | ||
<Rect | ||
x={0} | ||
y={0} | ||
width={canvasSize.value.width} | ||
height={canvasSize.value.height} | ||
> | ||
<RadialGradient | ||
c={gradientC} | ||
r={gradientRadius} | ||
colors={['#333', '#222']} | ||
/> | ||
</Rect> | ||
</Canvas> | ||
); | ||
}; | ||
|
||
export default BGGradient; | ||
|
||
const styles = StyleSheet.create({ | ||
canvas: { | ||
position: 'absolute', | ||
top: 0, | ||
left: 0, | ||
right: 0, | ||
bottom: 0, | ||
}, | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
40 changes: 32 additions & 8 deletions
40
apps/common-app/src/examples/DrumMachine/NotesHighlight.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters