Skip to content

feat: add URL param to sync animation to ringtone#64

Open
WofWca wants to merge 2 commits intomainfrom
wofwca/add-animation-bpm-url-param
Open

feat: add URL param to sync animation to ringtone#64
WofWca wants to merge 2 commits intomainfrom
wofwca/add-animation-bpm-url-param

Conversation

@WofWca
Copy link
Member

@WofWca WofWca commented Oct 11, 2025

This commit does not change the default behavior.

(turn up the volume):

2025-10-11-nWhAMtiQgv.mp4

This commit does not change the default behavior.
Comment on lines +10 to +14
:root {
--ring-animation-period: 0.8;
/* Default value, can be overridden in JS. */
--ringtone-bpm: calc(60 / var(--ring-animation-period));
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not sure variables are supported in default webview in Android 5 🤔 this needs to be tested in old devices

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Has the app been tested on old devices at all? Because RTCPeerConnection has been introduced only in 2017 without a webkit wendor prefix. For CSS variables, it's 2016.

https://developer.mozilla.org/en-US/docs/Web/API/RTCPeerConnection

https://developer.mozilla.org/en-US/docs/Web/CSS/--*

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have pushed a fallback in case the browser doesn't support animations, taking the approach from this question: https://stackoverflow.com/questions/66770777/does-css-var-fallback-work-in-unsupported-browsers

@nicodh
Copy link
Member

nicodh commented Jan 28, 2026

Do I understand this right: the idea is that the frequency of the ringtone can be passed, to align the pulse of the animation with the frequency of the ringtone?

@WofWca
Copy link
Member Author

WofWca commented Jan 28, 2026

Yes, basically. By frequency I mean "BPM".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants