• Browser
  • Mail
  • News
  • Community
  • About
Register Login
HomeBlogsForumThemesContributeSocial

Vivaldi

  • Browser
  • Mail
  • News
  • Community
  • About

Navigation

    • Home
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups

    We will be doing maintenance work on Vivaldi Translate on the 11th of May starting at 03:00 (UTC) (see the time in your time zone).
    Some downtime and service disruptions may be experienced.
    Thanks in advance for your patience.

    1. Home
    2. Desktop
    3. Customizations & Extensions
    4. Modifications
    5. Moon Phase

    Moon Phase

    Modifications
    javascript modding
    8
    74
    7.7k
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • stardepp
      S
      stardepp Translator Ambassador @luetage
      last edited by

      @luetage I just decided today to switch from History Clock to History Moon and I am very happy with the result. @luetage thanks for your effort 👍🔥🍀

      Window-stgru 09-10-2021  17_19_54.jpg

      vivaldifeatures.gif

      🍀 Work spaces changed my work flow🍀Search Engine Collection🍀My Themes🍀Windows11 24H2🍀Motorola Edge 60 Fusion * Android 15🍀

      luetage
      L
      1 Reply Last reply
      Reply Quote 1
      • luetage
        L
        luetage Supporters Soprano @stardepp
        last edited by

        @stardepp I find it interesting the icon looks so large in your case, this is how it looks on my install:

        Screenshot from 2021-10-09 18-39-15.png

        github ◊ vfm

        stardepp
        S
        1 Reply Last reply
        Reply Quote 0
        • stardepp
          S
          stardepp Translator Ambassador @luetage
          last edited by

          @luetage This is probably because @nomadic made my buttons thinner:

          Window-stgru 09-10-2021  18_41_13.jpg

          🍀 Work spaces changed my work flow🍀Search Engine Collection🍀My Themes🍀Windows11 24H2🍀Motorola Edge 60 Fusion * Android 15🍀

          luetage
          L
          2 Replies Last reply
          Reply Quote 0
          • luetage
            L
            luetage Supporters Soprano @stardepp
            last edited by luetage

            @stardepp This code influences urlbar buttons, which makes sense, since these are thick and the panel buttons are already thin by default. Some other code you are running is influencing the size of the history button perhaps. Can’t really tell. Try to load the mod without any other mods running and see what happens.

            github ◊ vfm

            1 Reply Last reply Reply Quote 0
            • luetage
              L
              luetage Supporters Soprano @stardepp
              last edited by

              @stardepp Anyway, I updated the code to bring back the svg declaration, which should potentially stop other code messing with it.

              github ◊ vfm

              1 Reply Last reply Reply Quote 1
              • J
                jocktmpltmea
                last edited by jocktmpltmea

                This post is deleted!
                1 Reply Last reply Reply Quote 0
                • luetage
                  L
                  luetage Supporters Soprano
                  last edited by

                  I updated OP to bring this mod up to speed and enhance it with the new custom buttons feature. What this means is that it’s possible to load/move the history button in any toolbar and it will consistently show the moon phase. It’s native now. 2 SVG files have to be created to feed the button editor, code is available from OP, but you might as well load all 3 files from Github.

                  github ◊ vfm

                  1 Reply Last reply Reply Quote 3
                  • V
                    valiowk @luetage
                    last edited by

                    @luetage said in Project History Moon:

                    @valiowk We could calculate it anew whenever the mutationobserver triggers, but this happens frequently, basically whenever you open/close the history panel, that’s why I avoided it; percentage changes only about 3 times a day after all. You can trigger a new calculation by removing the history button from the panel and adding it again and this can be done with right‐click menu. Or even simpler: move all tabs to a new window. Or do it automatically by exchanging the observer function with following code:

                        let moonwatch = (mutations, phase) => {
                            mutations.forEach(mutation => {
                                if (mutation.attributeName === 'class') {
                                    const lc = moon.phase();
                                    historymoon(lc.phase);
                                    document.querySelector('.panelbtn.history').title = `History \n${lc.name} Moon ${lc.progress}`;
                                }
                            })
                        }
                    

                    You provided me with this code for the old version to recalculate the percentage and moon if the history panel is opened/closed. Would it be possible to provide an updated version for the new code? Thanks!

                    luetage
                    L
                    1 Reply Last reply
                    Reply Quote 0
                    • luetage
                      L
                      luetage Supporters Soprano @valiowk
                      last edited by

                      @valiowk The posted version doesn’t contain a mutation observer anymore, so this will not work. But the new Vivaldi icon setup apparently has other problems I’m not sure how to tackle yet. Maybe a new version will mod all history buttons whenever one of them shows up. I have a version in development which does just that, but it doesn’t work reliably. Strange things are going on.

                      github ◊ vfm

                      1 Reply Last reply Reply Quote 0
                      • luetage
                        L
                        luetage Supporters Soprano
                        last edited by luetage

                        @valiowk So, I updated OP. All history button instances in the UI, including toolbar editor, settings and startpage, will be updated as soon as another instance is added. This should suffice.

                        github ◊ vfm

                        1 Reply Last reply Reply Quote 1
                        • luetage
                          L
                          luetage Supporters Soprano
                          last edited by

                          New version! First post has been updated. I renamed the mod and from now on it will load as a native command chain button. Please tell me whether you have any problems with implementing it.

                          github ◊ vfm

                          1 Reply Last reply Reply Quote 3
                          • luetage
                            L
                            luetage Supporters Soprano
                            last edited by luetage

                            I made a few more improvements to the mod. One addition is the display of the age (days since last new moon) in the title.

                            e40458a0-0ae4-417b-8003-53598cb1764c-image.png

                            The second change is the ability to set the latitude in the mod, which tries to approximate how the moon might look in the sky at your location, by rotating the icon. This would be incredibly complicated to do exact, because we observe changes in the moon’s orientation while the earth is rotating (moon rise — moon set) and this is dependent on many other factors, but it gets us in the ballpark. Wikipedia provides a nice example graphic of moon phases by latitude for anyone who wants to check this out ☛ https://en.wikipedia.org/wiki/Lunar_phase#/media/File:Moon_phases_by_latitude.svg

                            Both the Javascript file and the SVG file for the command chain button have to be updated to the latest version (2024.6.2)

                            github ◊ vfm

                            1 Reply Last reply Reply Quote 2
                            Loading More Posts
                            • Oldest to Newest
                            • Newest to Oldest
                            • Most Votes
                            Reply
                            • Reply as topic
                            Log in to reply
                            • 1
                            • 2
                            • 3
                            • 4
                            • 4 / 4
                            • First post
                              Last post

                            Looks like your connection to Vivaldi Forum was lost, please wait while we try to reconnect.

                            Copyright © Vivaldi Technologies™ — All rights reserved. Privacy Policy | Code of conduct | Terms of use | Vivaldi Status