Fix input centering and smooth clock hand
This commit is contained in:
parent
60b331369b
commit
95891013d1
6
clock.js
6
clock.js
@ -89,9 +89,9 @@
|
|||||||
function updateClock() {
|
function updateClock() {
|
||||||
const now = new Date();
|
const now = new Date();
|
||||||
const cob = toCobiets(now);
|
const cob = toCobiets(now);
|
||||||
const xf = (cob % COBIE_UNITS.quantic) / COBIE_UNITS.quantic;
|
const xf = cob / COBIE_UNITS.quantic;
|
||||||
const qf = (cob % COBIE_UNITS.chronon) / COBIE_UNITS.chronon;
|
const qf = cob / COBIE_UNITS.chronon;
|
||||||
const cf = (cob % COBIE_UNITS.eonstrip) / COBIE_UNITS.eonstrip;
|
const cf = cob / COBIE_UNITS.eonstrip;
|
||||||
document.getElementById('handXeno').style.transform = `rotate(${xf * 360}deg)`;
|
document.getElementById('handXeno').style.transform = `rotate(${xf * 360}deg)`;
|
||||||
document.getElementById('handQuantic').style.transform = `rotate(${qf * 360}deg)`;
|
document.getElementById('handQuantic').style.transform = `rotate(${qf * 360}deg)`;
|
||||||
document.getElementById('handChronon').style.transform = `rotate(${cf * 360}deg)`;
|
document.getElementById('handChronon').style.transform = `rotate(${cf * 360}deg)`;
|
||||||
|
|||||||
@ -949,10 +949,11 @@ function enterEdit() {
|
|||||||
input.style.border = 'none';
|
input.style.border = 'none';
|
||||||
input.style.color = 'inherit';
|
input.style.color = 'inherit';
|
||||||
input.style.textAlign = 'center';
|
input.style.textAlign = 'center';
|
||||||
input.style.width = '12ch';
|
input.style.width = '100%';
|
||||||
|
input.style.boxSizing = 'border-box';
|
||||||
// keep the input visually centered like the original span
|
// keep the input visually centered like the original span
|
||||||
input.style.display = 'block';
|
input.style.display = 'block';
|
||||||
input.style.margin = '0 auto';
|
input.style.margin = '10px 0';
|
||||||
span.replaceWith(input);
|
span.replaceWith(input);
|
||||||
input.focus();
|
input.focus();
|
||||||
input.setSelectionRange(1, val.length);
|
input.setSelectionRange(1, val.length);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user