Project

General

Profile

Need help with sequential animations and client side only code and custom widgets.

Added by Jerry Z almost 7 years ago

So I'm still trying to get a grasp of wt with the available documentation, but some things I'm struggling with is how to do things that are client side logic (java script) but still make use of signals and slot on the c side. Also if I want to do a custom animation where I have one animation chained after another, like a div stretching vertically before expanding out horizontally or have 2 animations go off at the same time. Also if I have a bunch of .css files for the CSS styling, what's the most direct way to apply it to a Wwidget? Lastly how to I account for mobile vs desktop clients?

TLDR:

  1. How do I create a widget with custom java scrpt that makes use of signals and slots?
  2. How do I chain animations in sequence(outside of relying on javascript)?
  3. How do I detect and adjust for different browser sizes (desktop, mobile)?
  4. (I may have missed the doc for this) how do I check if the browser supports javascript?

Replies (2)

RE: Need help with sequential animations and client side only code and custom widgets. - Added by Jerry Z almost 7 years ago

TLDR +1:

  1. With the fewest lines of code, how do I load a css file onto a Wwidget?

RE: Need help with sequential animations and client side only code and custom widgets. - Added by Wim Dumon almost 7 years ago

1. we have an example demonstrating the basics, see examples/javascript

  1. I'm not familiar with this topic. Wt's standard API doesn't support it, but it may be possible through css and/or javascript.
  2. WEnvironment screenWidth() and screenHeight() gives you the screen size. Whether you want to use this, or full adaptive design a la bootstrap (my preference), or the user agent to detect mobile browsers, is up to you.
  3. WEnvironment::javaScript()
  4. wApp~~useStylesheet (...); widget~~>addStyleClass(...);

Wim.

    (1-2/2)