Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Plugin API to get window width and event which is triggered when it changes #352

Open
HideBa opened this issue Oct 12, 2022 · 0 comments
Open
Assignees
Labels

Comments

@HideBa
Copy link
Member

HideBa commented Oct 12, 2022

Leader

User story

Plug-in developers want to change the style of their plug-ins or turn them on and off according to the window width, etc. Re:Earth extends the Plug-in API to provide an API for obtaining the current window width. It also provides a function to register an event to be notified when the window width changes, so that plug-ins can detect changes in window width.

Requirements

Expose following Plugin APIs

  • window width
    • When this API is called, Re:Earth will return the value of window.innerWidth. For more extensible API, plz give your idea for example supporting window.innerHeight, window.outerWidth, etc.
    • when window.onresize is called, this Plugin API event reearth.on('resize', () => {}) will be triggered as window size is resized.
    • return isMobile

Examples

Testing list

  • [ ]
@HideBa HideBa added the PBL label Oct 12, 2022
pyshx pushed a commit that referenced this issue Apr 17, 2023
* feat: add reearth favicon

* fix styles in main timeline component

* fix scale styles

* update scale time size

* make publishedTheme optional

* fix minimizing/extending

* Timeline defaults to opened
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants