Snow Fall Widget slows iPod...how to speed up?

Discussion in 'iOS Themes and Customization' started by SilentWalker, Aug 1, 2009.

  1. SilentWalker

    SilentWalker Retired Moderator

    Joined:
    Jul 26, 2009
    Messages:
    1,323
    Likes Received:
    10
    Device:
    2G iPod touch
    Hey all. So I just d/l'ed the Snow Fall Widget from Cydia and I must say I really love it. However, as expected, and as mentioned in at least one other thread, it causes much lag. Instead of removing it, I would like to fiddle with the CSS and HTML files that it is based on and see if I can configure it so that it needs to perform less processes so that it is lighter, and therefore runs faster.

    I took a look at the code...and I think it's the CSS that's commented, but still I understand neither of the languages (I have almost no exposure to programming). So I need your help guys...please

    Please Register or Log in to view images

    .

    Btw the license permits me to modify and redistribute the files in the Snow Fall Widget, so I am not violating any agreements, incase someone asks.

    So, so far I figured out that if I cut down the amount of snowflakes involved from 32/33 to around 15 (because a lot of them look alike), it should greatly help with speed (the number of random integers need to be generated is now half). But now, how do I implement this in the code? Can someone guide me? (I'll post the code when I go on my computer; I'm on my iPod now).

    Secondly how can I get the widget to stop running when I launch an application (making sure it ignores those that run in the background, like mail and safari).

    Finally, just a change to the original function, how can I gt it to run when my device is locked? But only when the display is showing; I don't want it to run when my iPod is asleep, it'll drain the battery.

    Thanks guys, I hope you help me. It'll be he first bit of coding a mod for my iPod I ever did...and I really want to!
  2. geekgrrl

    geekgrrl Member

    Joined:
    Oct 14, 2008
    Messages:
    954
    Likes Received:
    13
    Device:
    5G iPod touch
    Faster, generally means using a language code that runs faster, and sometimes syntax helps.

    This will be fun.

    I will be eagerly "lurking" to see replies to your request.
  3. Bubalooshi

    Bubalooshi Active Member

    Joined:
    May 22, 2008
    Messages:
    2,432
    Likes Received:
    0
    Device:
    iPhone 3GS (Black)
    I'm not entirely sure about this, but maybe it's because the iPod touch doesn't have enough RAM?

    Keep fiddling around with it and let us know what happens.

    Please Register or Log in to view images

  4. SilentWalker

    SilentWalker Retired Moderator

    Joined:
    Jul 26, 2009
    Messages:
    1,323
    Likes Received:
    10
    Device:
    2G iPod touch
    I am too...but no help yet

    I am just as eager, probably even more than you all as this is my first project. Sadly, I looked at the three files and understood almost nothing (they are in jss, CSS, and HTML btw).

    However I removed all the comments that came before the actual code like the info, but not the comments within the code itself. I also removed the unnecessary spaces and "enters" between lines. After these two steps, the file sizes were reduced slightly, and I think halved with the HTML file; and I did notice the lag was SLIGHTLY reduced...but no susbtantial progress.

    Now I need you guys. Please help me with the code. We are very eager to see the results. So far I know we can: delete the flakes the look alike, reconfigure the code based on the # of remaining flakes, and this can double the speed and cut down on size DEPENDING ON THE ALGORITHM USED.

    I don't know if anyone is up to reprogramming it with a faster language, as suggested above...I know it may be a hassle.

    Also, I am sure it always runs, even when another app is launched, as I have a transparent statusbar and I can still see the flakes falling when Safari is open.

    So....replies?
  5. SilentWalker

    SilentWalker Retired Moderator

    Joined:
    Jul 26, 2009
    Messages:
    1,323
    Likes Received:
    10
    Device:
    2G iPod touch
    Okay so so far, I have learnt the basic of HTML formatting and I have now started CSS, just for this project

    Please Register or Log in to view images

    . I am using the tutorials at W3Schools - http://www.w3schools.com/ - it's really good.

    As for the widget itself, it cannot run on IE or Firefox, so you must install Safari (Mac users would already have it).

    Copy the entire "Snow Fall Widget.theme" folder to your computer to do the editing, and testing using Safari. The only thing is you won't be able to test the lag difference unless you put it on your iPod; I still have to do that. It looks really good, but in the HTML file you must change the background colour to see the flakes, preferably to black (use the code [style="background-color:black"] without the square brackets.

    So here is the full code for the Widget.html file so you can view it in Safari -
    HTML:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
    
    <html>
    	 <body 
         <head>
    	 <title>Snow Flake</title>
    	       <base href="Private/" />
    	       <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    	       <meta name="viewport" content="width=device-width, user-scalable=no" />
    	       <link href="includes/snowFlakes.css" rel="stylesheet" type="text/css" media="screen" charset="utf-8" />
    	       <script src="includes/snowFlakes.js" type="text/javascript" charset="utf-8"></script>
         </head>	    
         <body margin="0" topmargin="0" leftmargin="0" scroll="no" style="background-color:black" >
    		<div id="flakeContainer"></div>
         </body>
    </html>
    
    <!-- remove style=background colour -->
    I have also cut the number of images from 32 to 22, and you don't really notice the difference in the flakes. I am still to try it on my iPod and see if it runs any faster. I have not yet made any real changes as I am still trying to learn CSS and Javascript.

Share This Page