Files
rubic-cube/src/composables/useSettings.js
Grzegorz Kucmierz 3261aea81d
All checks were successful
Deploy to Production / deploy (push) Successful in 10s
chore: remove projections toggle and bump to 0.1.0
2026-02-22 21:11:42 +00:00

26 lines
587 B
JavaScript

import { ref } from 'vue';
let initialCubeTranslucent = false;
try {
const stored = localStorage.getItem('cubeTranslucent');
if (stored !== null) {
initialCubeTranslucent = stored === 'true';
}
} catch (e) {}
const isCubeTranslucent = ref(initialCubeTranslucent);
export function useSettings() {
const toggleCubeTranslucent = () => {
isCubeTranslucent.value = !isCubeTranslucent.value;
try {
localStorage.setItem('cubeTranslucent', String(isCubeTranslucent.value));
} catch (e) {}
};
return {
isCubeTranslucent,
toggleCubeTranslucent
};
}