-
Notifications
You must be signed in to change notification settings - Fork 33
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
create notification component #317
Comments
Hi Kieran. Here you meant that other elements (not scenes?) can interact with the notifications component using setAttribute or sendMessage ? |
Yes this means to say that other entities, components, or js code from the editor may need to interact with this notification component |
What types of messages to make for notifications by default? It should be only one info type or more? There is success, error by default or could be customized types. |
I think for now success (green) and error (red) is ok. In my experience sometimes there is also warning (yellow) and information (blue) but I would vote to wait to do those until another time when it's actually needed. |
I did not understand a little how interaction should take place through setAttribute. I did it this way now: |
I noticed one peculiarity of using setAttribute. If it is called with the same data, then the update function of the component is not called. That is, the same message cannot be sent several times. It can be done using the component method |
PR: #319 |
@Algorush this is great! I just reviewed the PR with some requested updates |
closed with #319 |
this component enables other components and the 3dstreet editor to send messages to the user about different activities in the application such as save or load status
it is probably easiest to use an off-the-shelf solution, I have researched this one that seems to do the job and has a reasonable license: https://github.com/caroso1222/notyf/
This component could have some settings that reflect the notyf object such as position, duration, etc.
This component would expected to be loaded only once at the scene level. Other scenes would interact with this component by either setAttribute to set property values on the component, and/or by calling a method such as AFRAME.scenes[0].components['notification'].sendMessage('yo');
installation options
https://github.com/caroso1222/notyf/blob/master/recipes/global.md
https://github.com/caroso1222/notyf/blob/master/src/notyf.scss
can be added to https://github.com/3DStreet/3dstreet/blob/main/src/viewer-styles.css with a comment indicating where it came from and what it does
(A future version of this component could include notification for VR / immersive model, especially useful when modifying scenes in VR and wanting confirmation of save event.)
The text was updated successfully, but these errors were encountered: