# What is the rate the avatar opacity drops in chat?

A couple of values for the `opacity` CSS rule I got were,

``````0.805639
0.803278
0.800917
``````

The difference between them is `0.002361` but since 1 = visible and 0 = fully transparent (hidden) I tried `1 / 0.002361` to see how many times the `opacity` value will be changed before the avatar is invisible (my timings seems to place it 10 second intervals).
The result I got was `423.54934349851757729775518847946` which to me seems like a weird number, unless the person who coded it just slammed their palm into the number pad and added some zeros to the front.

I'm curious what the rate the `opacity` drops in chat for avatars on the right side of chat? If the rate is -0.002361 every 10 seconds how was 0.002361 chosen as it doesn't seem to fit neatly going from 1 to 0

The relevant code is:

``````function r(e, t) {
if (!CHAT.IS_MOBILE) {
var s = secondsSince(t),
n = 1 - 0.85 * Math.max(Math.min(s / 3600, 1), 0);
e.css({
'opacity': n
})
}
}
``````

(Lines 6495 - 6503 of master-chat.js as prettified by Firefox)

In other words: the opacity fades linearly from 100% to 15% over the course of one hour, then stays at that value until the user actually leaves the chat.

Your observation that the opacity changes by 0.002361 over the course of ten seconds is accurate (0.85 / 3600 = 0.00023611111...), but you might want to subtract the difference between two consecutive values at each step rather than add its inverse. (Better yet, use the same formula StackExchange does, since repeated addition / subtraction can accumulate round-off errors)