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
export const Collection = styled('div')(({ theme }) => ({ | |
display: 'grid', | |
gridGap: 12, | |
gridTemplateColumns: '1fr', | |
paddingBottom: 8, | |
borderBottom: '4px double grey', | |
'& > div:not(:first-child)': { | |
position: 'relative', |
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
if ( 'AmbientLightSensor' in window ) { | |
const sensor = new AmbientLightSensor(); | |
sensor.onreading = () => { | |
if ( sensor.illuminance < 20) { | |
element.style.setProperty('--bg', 'black’); | |
} else { | |
element.style.setProperty('--bg', 'blue’); | |
} | |
}; | |
sensor.start(); |
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
componentDidMount() { | |
this.detectInViewport() | |
addListener('scroll', this.detectInViewport) | |
addListener('resize', this.detectInViewport) | |
} | |
detectInViewport = () => { | |
const { top, bottom, height } = this.innerRef.getBoundingClientRect() | |
// Calculate if on screen and distance from the viewport... | |
this.setState({ inViewport: viewportPosition, viewportHeight, distanceFromViewport }) |
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
## Inspiration | |
### SWISS Design | |
1. https://www.designspiration.net/save/534385462519/ | |
2. Google Swiss Design | |
## Useful Links |
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
<h1 data-text="Hello">Hello</h1> |