change(player): make cursor icon bigger

This commit is contained in:
nick-delirium 2023-04-27 12:40:25 +02:00
parent 9602c301ba
commit 1d9c8f4b93
3 changed files with 12 additions and 5 deletions

View file

@ -1,11 +1,11 @@
.cursor {
display: block;
position: absolute;
width: 27px;
height: 45px;
width: 36px;
height: 60px;
background-image: url("data:image/svg+xml,%3C%3Fxml version='1.0' encoding='UTF-8'%3F%3E%3Csvg enable-background='new 0 0 28 28' version='1.1' viewBox='0 0 28 28' xml:space='preserve' xmlns='http://www.w3.org/2000/svg'%3E%3Cpolygon points='8.2 20.9 8.2 4.9 19.8 16.5 13 16.5 12.6 16.6' fill='%23fff'/%3E%3Cpolygon points='17.3 21.6 13.7 23.1 9 12 12.7 10.5' fill='%23fff'/%3E%3Crect transform='matrix(.9221 -.3871 .3871 .9221 -5.7605 6.5909)' x='12.5' y='13.6' width='2' height='8'/%3E%3Cpolygon points='9.2 7.3 9.2 18.5 12.2 15.6 12.6 15.5 17.4 15.5'/%3E%3C/svg%3E");
background-repeat: no-repeat;
transition: top .125s linear, left .125s linear;
transition: top .15s ease-out, left .15s ease-out;
pointer-events: none;
user-select: none;

View file

@ -2,7 +2,7 @@
* Inspired by Bryan C (@bryjch at codepen)
* */
const LINE_DURATION = 3;
const LINE_DURATION = 3.5;
const LINE_WIDTH_START = 5;
export default class MouseTrail {

View file

@ -94,6 +94,13 @@ export interface MouseHandlerOptions {
* default 10_000
* */
maxOptimiseTries?: number
/**
* how many ticks to wait before capturing mouse position
* (can affect performance)
* 1 tick = 30ms
* default 7
* */
trackingOffset?: number
}
export default function (app: App, options?: MouseHandlerOptions): void {
@ -236,5 +243,5 @@ export default function (app: App, options?: MouseHandlerOptions): void {
})
patchDocument(document, true)
app.ticker.attach(sendMouseMove, 10)
app.ticker.attach(sendMouseMove, options?.trackingOffset || 7)
}