Fröhling

Niels Fröhling about [X]HTML, JS and technical tidbits

  • Home
  • About
21. August 2010

jQuery’s animate is short-thought

Ethatron in Uncategorized

Currently I’m experimenting with jQuery (always being told prototype.js is evil). In my project I have to make quite some complex animations and I tried to detect if I can map them to the animate() syntax. Uh, and all hell broke loose. Here is my 24h experience:

  1. You can’t animate regular DOM properties, like image width/height, which is much more smooth than styles.
  2. It does not hold custom states, nor allows you to animate a virtual property ‘counter’ out of that you could folk all kinds of changes in the step-function. You HAVE TO animate a real css-style. Thus you fall back to your own timers and loose the easing-framework. Found it. But not optimal …
  3. You can not hold any states, if you stop an animation you will loose the information about the position of the animation between [0.0,1.0], and any other. You have to track that via the step-function and calculation through the ‘now’ time-stamp, OR you calculate the position directly on the modified CSS-value.
  4. Each modified style enters the effects-queue as a seperate function, or expressed differently: each property given to animate to change becomes an entire seperate animation!
  5. animate’s step function is called per step per property! Simultanious animation of multiple values becomes together with 4) almost impossible! A simple zoom function (width+height on content, left+top on parent relative to childs size-change) requires you to write approx. 50 lines!
  6. You can’t pause/resume animations (no states), you have to recalculate the position (see 3), recalculate how much time is missing and restart the animation.
  7. width/height animations force overflow hidden and display block. In 2010 I’d like to animate overflow visible and display inline-block too! Maybe even tables-cols if you don’t mind …
  8. You can’t define proxy-animations like “font-size = height / 10″, normally I’d say it should be possible to reference any animateable attribute/style.
  9. You can’t because of that also forget about the “font-size += delta-height” type.
  10. All calculations are done in floating point, as no browser supports sub-pixel accuracy you’l have horrible shift while zooming an image for example. The “zoom” effect anyway should be integral part of animate. Either way [left,left+width] are on a pixel-precision grid, if left becomes round down, left+width has to be round up (for zooming that is), of course trying to acount for this leads to headbanging on the keybord, because the animations are all seperate … and the step function is called per property …

Grr. Such a small function and so much issues.

1 Kommentar
12. April 2010

movntq alignment

Ethatron in Uncategorized

Uh, sometimes you don’t know what’s in the mind of intel guys.

They state in their documentation that the movntq-op (taken over from MMXExt) has to take place on 16-byte aligned memory. What??? Either it’s a copy & paste error, it’s probably suppose to mean 8-byte aligned memory, or you got a command which can’t be executed.

Besides, no op on MMX / 3DNow need alignment, so I think it’s even entirely wong … either way. Nice work intel.

Kein Kommentar
30. July 2008

Alistapart takes the next survey

Ethatron in Uncategorized

The Survey, 2008 Alistapart started the next survey 2008. The last years result contained a wealth of information sketching the landscape of web-related business, and as such unique and very successfull with over 33.000 participants. You are again invited to participate this year, it’s anonymous.

1 Kommentar
14. July 2008

X86 follows opportunist logic, instead of academic

Ethatron in Uncategorized

Ei, once in a while you ask yourself about the (in)sanity of the X86-architecture. Well everybody knows, the ops offered by MMX upto SSE58942 are actually choosen by dicing 42 out of 255 possible once. Well I just don’t go too deep into emotional depression here. Just my list of missing and missguided ops:

  • pmulbw
  • pmulsdq
  • pmulhd/pmulld
  • paddsd/psubsd/paddusd/psubusd
  • pmaddbw
  • pmadddq
  • pmaddubw/pmadduwd/pmaddudq
  • psadwd (horizontal add of shorts)
  • psaddq (horizontal add of longs)
  • packusdw (hell this is so obvious)
  • packssqd (psubq + pshuflw + pshufhw + pshufd + paddd but with saturation)
  • packusqd (pshuflw + pshufhw + pshufd but with saturation)
  • pnot (pcmpeq + pxor)
  • pneg (pcmpeq + pxor + psub)
  • pshufsw/pshufslw/pshufhw (equivalent to shufps for shorts, taking from src and dst)
  • pshufsd (equivalent to shufps, taking from src and dst, all the other equivalents are there like pand/andps, but this one not???)
  • pshufsq (equivalent to shufpd, taking from src and dst, all the other equivalents are there like pand/andpd, but this one not???)
  • pcmpeqq/pcmpgtq (all the other qwords ops are there and this one not???)
  • movld/movhd (equivalent to movlps/movhps, all the other equivalents are there like movdqa/movaps, but this one not???)
  • movlq/movhq (equivalent to movlpd/movhpd, all the other equivalents are there like movdqa/movapd, but this one not???)

How strange this appears to be the result of the work of highly educated people. Ei, …

I feel sort of pervert at the same moment I get excited finding out that I actually can use the haddps to horizontal add integers upto a sum of 2^23. Ei, …

Kein Kommentar

Tags

  • Algorithms Assembler bash C++ Homemade Javascript MMX Optimization Rants TYPO3

Categories

    • Applications
      • TYPO3
    • TidBits
      • Algorithms
      • Approximations
      • Equivalence
      • Fixes
      • Javascript
      • Optimizations
      • Scripts
    • Uncategorized

Meta

    • Log in
    • Entries RSS
    • Comments RSS
    • WordPress.org

Recent Posts

    • jQuery’s animate is short-thought
    • movntq alignment
    • OP-equivalent series (pavgd)
    • OP-equivalent series (psubq)
    • OP-equivalent series (paddq)

 

  • September 2010
    M T W T F S S
    « Aug    
     12345
    6789101112
    13141516171819
    20212223242526
    27282930  

Archives

    • August 2010
    • April 2010
    • February 2010
    • January 2010
    • July 2009
    • February 2009
    • December 2008
    • November 2008
    • August 2008
    • July 2008
    • May 2008
© 2010 Wired by Fröhling
Design von Dezzain Studio
Übersetzt von Htwo
Nature Pictures | Bamboo Blinds