Post your HTML/CSS support questions w/ screenshot here

Discussion in 'Jailbreaks and iOS Hacks' started by map1978, Dec 10, 2010.

  1. map1978 macrumors 68020

    map1978

    Joined:
    Feb 9, 2006
    Location:
    Jacksonville, FL
    #1
    Hi everyone

    The Post Your Screenshot thread is getting way to cluttered with support HTML and CSS file questions.

    I thought this might be a nice way to clean up the other thread and now we can have 2 separate threads.

    I hope this gets used often, because we all can help each other with problems we might be having. :D

    I am more than willing to help members with questions they might have and hope others will do the same
     
  2. twisted-pixel macrumors 6502a

    twisted-pixel

    Joined:
    Sep 13, 2009
    Location:
    San Jose, CA
    #2
    this is just the kind of help I need!!!!

    here's my issue.I have a theme that is using two bits of javscript to perform tasks

    task 1 rotate the wallpaper
    task 2 falling snow effect

    I've copied the two fields below (wallpaper.htm) and snow.js

    the bit highlighted in red below is my problem..I think...

    if I include this..then the wallpapers change perfectly...but the snow flakes don't work. if I remove this bit, then the snow works perfectly, but the wallpaper changes from image, to nothing, then image, then nothing (it should be image to image to image etc)

    so, this is my wallpaper.htm file

    <script src="Snow.js" type="text/javascript" charset="utf-8"></script>
    <style>

    img {
    position: absolute;
    width: 320px;
    height: 480px;
    }


    img.fade-out {
    -webkit-transition-property: opacity;
    -webkit-transition-duration: 1s;
    opacity: 0;
    }

    img.fade-in {
    opacity: 1;
    }
    </style>
    </head>
    <body>
    <img id="img1" class="fade-in">
    <img id="img2" class="fade-out">
    <script>


    // Displays each image once in random order before
    // randomizing the list again.
    // Just add the image's filename to the list to add an image,
    // and change interval to control the cycle speed.

    var interval = 10; // Seconds between change (must be > duration)
    var imageDir = ""; // The path containing the images
    var duration = 1; // The transition's duration in seconds
    // Must match -webkit-transition-duration above
    var images = [ // List of image filenames
    "xmas0.jpg",
    "xmas1.jpg",
    "xmas2.jpg",
    "xmas3.jpg",
    "xmas4.jpg",
    "xmas5.jpg",
    "xmas6.jpg",
    "xmas7.jpg",
    ];

    //// You shouldn't need to change anything below ////

    var index = 0;
    var imageCount = images.length;

    var randomize = function(){
    return Math.round(5 - 10 * Math.random());
    };

    var fade = function(){
    img1.style.zIndex = 1;
    img2.style.zIndex = 2;
    img1.className = "fade-in";
    img2.className = "fade-out";

    index = (index + 1) % imageCount;
    if(!index){
    images.sort(randomize);
    }

    var tmp = img1;
    img1 = img2;
    img2 = tmp;

    setTimeout(function(){img1.src = imageDir + images[index];}, duration * 1000);
    setTimeout(fade, interval * 1000);
    };

    images.sort(randomize);
    img1.src = imageDir + images[index];
    fade();
    </script>

    <div id="snowContainer"></div>



    and this is the snow.js file

    var NUMBER_OF_SNOWFLAKES = 25;

    function init()
    {
    /* Get a reference to the element that will contain the flakes */
    var container = document.getElementById('flakeContainer');
    /* Fill the empty container with new snow */
    for (var i = 0; i < NUMBER_OF_SNOWFLAKES ; i++)
    {
    container.appendChild(createAflake());
    }
    }

    function randomInteger(low, high)
    {
    return low + Math.floor(Math.random() * (high - low));
    }


    function randomFloat(low, high)
    {
    return low + Math.random() * (high - low);
    }


    function pixelValue(value)
    {
    return value + 'px';
    }

    function durationValue(value)
    {
    return value + 's';
    }

    function createAflake()
    {
    /* Start by creating a wrapper div, and an empty img element */
    var flakeDiv = document.createElement('div');
    var image = document.createElement('img');

    /* Randomly choose a flake image and assign it to the newly created element */
    image.src = 'snow.gif';

    /* Position the flake at a random location within the screen */
    flakeDiv.style.top = pixelValue(randomInteger(-150, -50));
    flakeDiv.style.left = pixelValue(randomInteger(0, 500));

    /* Randomly choose a spin animation */
    var spinAnimationName = (Math.random() < 0.5) ? 'clockwiseSpin' : 'counterclockwiseSpinAndFlip';

    /* Set the -webkit-animation-name property with these values */
    leafDiv.style.webkitAnimationName = 'fade, drop';
    image.style.webkitAnimationName = spinAnimationName;

    /* Figure out a random duration for the fade and drop animations */
    var fadeAndDropDuration = durationValue(randomFloat(5, 11));

    /* Figure out another random duration for the spin animation */
    var spinDuration = durationValue(randomFloat(4, 8));
    /* Set the -webkit-animation-duration property with these values */
    flakeDiv.style.webkitAnimationDuration = fadeAndDropDuration + ', ' + fadeAndDropDuration;
    image.style.webkitAnimationDuration = spinDuration;

    /* Add the created image to the div */
    flakeDiv.appendChild(image);

    /* Return this div so it can be added to the document */
    return flakeDiv;
    }

    window.addEventListener('load', init, false);



    so..it looks like something to do with img container being used in two places?? I'm not a javascript guru..or even a semi guru..and am completely stuck. it may be that this will never work, but thanks for any pointers
     
  3. murdercitydevil macrumors 68000

    murdercitydevil

    Joined:
    Feb 23, 2010
    Location:
    california
    #3
    I got a question that no one can seem to answer - how do you make the calendar widget display monday as the first day of the week instead of sunday? If anyone actually wants to try and do this, I will upload the code, but I don't want to swamp the thread with it if no one cares.
     
  4. ulbador, Dec 17, 2010
    Last edited: Dec 17, 2010

    ulbador macrumors 68000

    ulbador

    Joined:
    Feb 11, 2010
    #4
    The problem is you are applying CSS to all images. The rotating wallpaper needs that style. The snowflakes do not.

    Whatever you do, remove this block:

    Just put the style directly on the original img tags, which is honestly the best method since nothing else in the file modifies those CSS properties:

    Code:
    <img id="img1" class="fade-in" style="height:480px;width:320px;position:absolute;">
    <img id="img2" class="fade-out" style="height:480px;width:320px;position:absolute;">
    
    One of those two should work.


    I could probably help you with this if you either post the code or PM it
     
  5. TypeMRT macrumors 6502

    Joined:
    Sep 7, 2007
    #5
    My thoughts exactly. From what I've found out it seems to be related to the Region Format (Settings, General, International). Others have switched to UK or Ireland but it changes the phone number format too. I think finding that configuration file is the key.
    Try changing the region format and then editing the array in the configME.js to have Mon first. That way Wed is #3 in the array instead of #4 and so on.
     
  6. ulbador, Dec 17, 2010
    Last edited: Dec 17, 2010

    ulbador macrumors 68000

    ulbador

    Joined:
    Feb 11, 2010
    #6
    A few quick lines changed! Just had to change around the date array and do some subtracting on the day number to get it to spit out of the proper day on the right day. It might have a problem with either Sunday or Monday... not sure which...

    Here is the updated Wallpaper.html. Seems to work perfect, but as always, YMMV
     

    Attached Files:

  7. WiiDSmoker macrumors 65816

    WiiDSmoker

    Joined:
    Sep 15, 2009
    Location:
    Hermitage, TN
    #7
    Is there a way for the calendar/weather widget to only show up on the first page (homescreen) and not all the other pages?
     
  8. Claude626, Dec 17, 2010
    Last edited: Dec 17, 2010

    Claude626 macrumors 6502

    Joined:
    Jun 21, 2010
    #8
    Actually, in-line CSS is a very nasty approach to doing clean CSS.

    The most elegant solution to his problem is to modify that img CSS block. I notice in his code that img1 and img2 has the class names "fade-in" and "fade-out"... Thus, all he has to do is modify his red highlighted CSS chunk to look like this:
    Code:
    [COLOR="Red"]img.fade-in, img.fade-out[/COLOR] {
    position: absolute;
    width: 320px;
    height: 480px;
    }
    OR

    Code:
    [COLOR="Red"]img#img1, img#img2[/COLOR] {
    position: absolute;
    width: 320px;
    height: 480px;
    }
    Pick one.
     
  9. murdercitydevil macrumors 68000

    murdercitydevil

    Joined:
    Feb 23, 2010
    Location:
    california
    #9
    I will try this out, thanks very much!
     
  10. murdercitydevil macrumors 68000

    murdercitydevil

    Joined:
    Feb 23, 2010
    Location:
    california
    #10
    I tried your Wallpaper.html but it varies too much from mine for me to try and merge the two. Here is the widget that I'm working with, so if you could take a look at this one, that would be amazing. http://forums.macrumors.com/showthread.php?t=1057158&highlight=
     
  11. ulbador macrumors 68000

    ulbador

    Joined:
    Feb 11, 2010
    #11
    Can you zip it and and PM me the folder from /var/stash/Themes.SOMERANDOMCRAP ? I'm sure it's something similar.
     
  12. murdercitydevil macrumors 68000

    murdercitydevil

    Joined:
    Feb 23, 2010
    Location:
    california
    #12
    The download link is in that thread, it's a widget that I put together myself. It's a LS widget with just the calendar and time. Everything necessary is in the zip from that thread

    http://dl.dropbox.com/u/6912935/SimpleCalendar.theme.zip
     
  13. ulbador macrumors 68000

    ulbador

    Joined:
    Feb 11, 2010
    #13
  14. Fantasigraphic macrumors 65816

    Joined:
    Mar 25, 2009
    Location:
    TN
    #14
    Wirelessly posted (Mozilla/5.0 (iPhone; U; CPU iPhone OS 4_1 like Mac OS X; en-us) AppleWebKit/532.9 (KHTML, like Gecko) Version/4.0.5 Mobile/8B117 Safari/6531.22.7)

    I think I've answered this on either another thread/forum.

    Go into the calendar/calendersb.js file and change SMTWTFS to MTWTFSS

    save and reboot
     
  15. ulbador, Dec 19, 2010
    Last edited: Dec 19, 2010

    ulbador macrumors 68000

    ulbador

    Joined:
    Feb 11, 2010
    #15
    That isn't enough. You also have to modify the day number variable or else the day will be one off. JavaScript defaults to a Sunday based start date, ie Sunday == 0. You have to subtract 1 from the day number and then roll it around back to 6 if it drops below 0 to have it be a Monday based week.
     
  16. murdercitydevil, Dec 19, 2010
    Last edited: Dec 20, 2010

    murdercitydevil macrumors 68000

    murdercitydevil

    Joined:
    Feb 23, 2010
    Location:
    california
    #16
    Thanks man I really appreciate it

    EDIT: I can confirm that (so far) it works perfectly. Thank you so much for your help.
     
  17. map1978 thread starter macrumors 68020

    map1978

    Joined:
    Feb 9, 2006
    Location:
    Jacksonville, FL
  18. NWI73 macrumors 6502a

    Joined:
    Jun 22, 2010
    #18
    Per LEXS latest lockscreen theme, I loaded it and I have a couple issues. 1.) I am seeing 24 hour clock and can't find what I need to modify to get 12 hour clock. 2.) My lock screen has the stock clock sitting on top of the theme - how do I get rid of that? Use coding or use the cydia application? If it's in coding, what do I need to change? Or modify in lockinfo?

    I'm also missing the notifications bar with phone, sms, calendar, etc. Looks like the coding is present but it's not showing up.
     
  19. Big D 51 macrumors 6502a

    Big D 51

    Joined:
    Jan 15, 2011
    Location:
    Mobile, AL
    #19
    Is this possible?

    photo-1.png

    Is there anyway, for an example, you have a new text that you can click on the text icon to reply quickly after entering the passcode? Or click mail to open mail after typing in passcode? Same with other notifications.

    This way the person can't read any of your messages by the preview but a quick access to respond.
     
  20. NWI73 macrumors 6502a

    Joined:
    Jun 22, 2010
    #20
    And this annoying ad is stuck on my home screen
     

    Attached Files:

  21. map1978 thread starter macrumors 68020

    map1978

    Joined:
    Feb 9, 2006
    Location:
    Jacksonville, FL
    #21
    This happens when i open the weather channel app

    I have to double tap the home button and actually close it out

    It goes away right after that
     
  22. map1978 thread starter macrumors 68020

    map1978

    Joined:
    Feb 9, 2006
    Location:
    Jacksonville, FL
    #22
    Download lockscreen clock hide in cydia...this will help u out

    Not on my comp, but there is code in the HTML file that can change the clock to 12 hour format

    Hopefully someone can post it and help you out
     
  23. NWI73 macrumors 6502a

    Joined:
    Jun 22, 2010
    #23
    Got most of this figured out. All i'm missing is the notification bar with phone, sms, email, etc. Then the 12 hour coding problem. I have scoured the coding and nothing seems obvious.
     
  24. dgamer84 macrumors regular

    Joined:
    Jan 5, 2011
    #24
    What do you guys use to hide the page dots? There are two in Cydia one is a theme and the other is a tweak.
     
  25. mjfan82 macrumors regular

    Joined:
    Aug 3, 2010
    #25
    i used the tweak and it works perfect
     

Share This Page