+ Reply to Thread
Page 2 of 2 FirstFirst 12
Results 11 to 18 of 18

Thread: Use font awesome in dark/light mode

  1. #11
    I Rudi,

    Would you please take a look at this. Is it still unclear?

    Thank you

  2. #12
    Master
    Join Date
    Apr 2021
    Location
    USA
    Posts
    261
    I'm interested in changing the nav icon, too. So I can follow this instruction of Rudi for it?

  3. #13
    Flynax developer Rudi's Avatar
    Join Date
    Dec 2014
    Location
    Planet Earth
    Posts
    3,174
    Hello Wei,

    You need to replace <span class="icon fa-regular fa-heart"> with <i class="fa-heart fa-regular"></i> in tpl file and it should work

    Again, to check this I need to see it live

  4. #14
    Quote Originally Posted by Tim Copper View Post
    I'm interested in changing the nav icon, too. So I can follow this instruction of Rudi for it?
    Yes, I'm still trying to figure it out.

    Quote Originally Posted by Rudi View Post
    Hello Wei,

    You need to replace <span class="icon fa-regular fa-heart"> with <i class="fa-heart fa-regular"></i> in tpl file and it should work

    Again, to check this I need to see it live
    Hi Rudi,

    I wish I could show it to you on live website, unfortunately I'm working on localhost machine. I have change code in navigation.tpl to:
    {if !$noFavIcon}
    <span id="fav_{$listing_data.ID}" class="favorite add" title="{$lang.add_to_favorites}"><span class="fa-heart fa-regular"></span></span>
    {/if}
    And in lib.js I add 3 lines in 3 different places in bold below:

    $(this).removeClass('add').addClass('remove');
    $(this).find('i').removeClass('fa-regular').addClass('fa-solid');
    $(this).attr('title', lang['remove_from_favorites']).find('span.link').text(lang['remove_from_favorites']);
    $(this).removeClass('remove').addClass('add');
    $(this).find('i').removeClass('fa-solid').addClass('fa-regular');
    $(this).attr('title', lang['add_to_favorites']).find('span.link').text(lang['add_to_favorites']);
    $(this).removeClass('add').addClass('remove');
    $(this).find('i').removeClass('fa-regular').addClass('fa-solid');
    $(this).attr('title', lang['remove_from_favorites']).find('span.link').text(lang['remove_from_favorites']);
    When I click on the icon:

    Screen Shot 2023-09-14 at 7.44.45 PM.png

    Only class="favorite add" change to class="favorite remove" and vise versa. The class below (class="fa-heart fa-regular") remain unchanged no matter what.
    Last edited by Wei Hong; September 14, 2023 at 12:56 PM.

  5. #15
    Flynax developer Rudi's Avatar
    Join Date
    Dec 2014
    Location
    Planet Earth
    Posts
    3,174
    You need to do exactly the same as mentioned in my previous post

    Anyway, I need to see the live site to tell you anything

  6. #16
    Quote Originally Posted by Rudi View Post
    You need to do exactly the same as mentioned in my previous post

    Anyway, I need to see the live site to tell you anything
    Hi Rudi, I'm 100% sure I did exactly as you mentioned, it's not that complicated adding a line or two in the file, as I have been explaining with details above, also tried many variant for the past few days. I'm very sad that it's not working out. It seems that this problem is too complicated to solve then. Thank you for your time though.
    Last edited by Wei Hong; September 15, 2023 at 04:37 AM.

  7. #17
    Flynax developer Rudi's Avatar
    Join Date
    Dec 2014
    Location
    Planet Earth
    Posts
    3,174
    Ok, but I didn't see that you replaced <span class="icon fa-regular fa-heart"> with <i class="fa-heart fa-regular"></i>

  8. #18
    You are totally right how careless of me, I did not see the <i> and <span>, it works now. Thank you so much Rudi

+ Reply to Thread