Skip to content

Commit

Permalink
slider
Browse files Browse the repository at this point in the history
  • Loading branch information
tarutin committed Dec 3, 2022
1 parent 2600707 commit 2881f8c
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions app/renderer.js
Original file line number Diff line number Diff line change
Expand Up @@ -444,14 +444,15 @@ function sliderRecalc()
{
let el = $('.slider input')
let format = clock.formatTime(el.value * 60 * 1000, true)
let is24H = clock.isTwentyFourHour() == 'on' ? true : false

$('.slider .now').innerText = format.time
$('.slider .from').style.opacity = el.value < 200 ? 0 : 0.3
$('.slider .to').style.opacity = el.value > 1080 ? 0 : 0.3
$('.slider .from').style.opacity = el.value < (is24H ? 200 : 250) ? 0 : 0.3
$('.slider .to').style.opacity = el.value > (is24H ? 1080 : 950) ? 0 : 0.3
updateTime()

let left = el.offsetWidth * (el.value - el.min) / (el.max - el.min)
let ampm_offset = clock.isTwentyFourHour() == 'on' ? 23 : 38
let ampm_offset = is24H ? 23 : 38
left = el.value < 1260 ? left + 25 : left - ampm_offset
$('.slider .now').style.left = `${left}px`
}
Expand Down

0 comments on commit 2881f8c

Please sign in to comment.