Skip to content

Commit

Permalink
deploy
Browse files Browse the repository at this point in the history
  • Loading branch information
itaak committed Jul 27, 2024
1 parent 11420aa commit 118722a
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/components/atoms/Smile.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,24 @@
const gammaRange = 50;
// Définir le point de repos pour beta et gamma
const restBeta = 30;
const restBeta = 15;
const restGamma = 0;
let x = baseX;
let y = baseY;
let lastGamma = 0;
$: {
// Obtenir les valeurs d'orientation
const beta = $deviceOrientation.beta ?? 0;
const gamma = $deviceOrientation.gamma ?? 0;
let gamma = $deviceOrientation.gamma ?? 0;
// Si le changement dans 'gamma' est trop grand, ignorer la nouvelle valeur
if (Math.abs(lastGamma - gamma) > 90) {
gamma = lastGamma;
} else {
lastGamma = gamma;
}
// Normaliser beta et gamma autour des valeurs de repos
const normalizedBeta = (beta - restBeta) / (betaRange / 2);
Expand Down

0 comments on commit 118722a

Please sign in to comment.