Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/sambernhardt/ipad-cursor

A web implementation of the new iPadOS cursor in React ⚪️
https://github.com/sambernhardt/ipad-cursor

cursor greensock ipados next nextjs react reactjs

Last synced: 5 days ago
JSON representation

A web implementation of the new iPadOS cursor in React ⚪️

Awesome Lists containing this project

README

        

`git clone https://github.com/sambernhardt/ipad-cursor.git`

`npm i`

`npm run start`

![Preview](https://github.com/sambernhardt/ipad-cursor/blob/master/public/preview.gif)

# Basic usage

## Add the CursorProvider to a page
```javascript
// app.js

import App from 'next/app';
import CursorProvider from '../cursor/Provider';

export default class MyApp extends App {
render () {
const { Component, pageProps } = this.props;

return (



)
}
}
```

## Then wrap your components with the `WithHover` function
```javascript
// Component.js
import WithHover from '../cursor/WithHover';

const Component = () =>

;

export default WithHover(, 'block');
```

### Caveats:
- To move the contents of the hovered component, the component must have a display type of `inline-block` or `block`. CSS transforms don't work on inline elements.