• Stars
    star
    102
  • Rank 335,584 (Top 7 %)
  • Language
    JavaScript
  • License
    Other
  • Created about 12 years ago
  • Updated about 10 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

draw the moon in the correct phase for today

๐ŸŒ‘ ๐ŸŒ’ ๐ŸŒ“ ๐ŸŒ” ๐ŸŒ• ๐ŸŒ– ๐ŸŒ— ๐ŸŒ˜ ๐ŸŒ‘

This HTML page and javascript draw an svg picture of the moon that tries to match the current actual phase of the moon. Also uses unicode emoji moons in the <title> element. A new svg will be calculated every day; but there are only 8 emoji moons.

Phase of the moon

Ben Daglish

"A little while ago the task of calculating lunar phases came to mind. After investigating the various algorithms out there, I collected together this little bunch, (mainly wrapped inside complete 'show all the phases for a year' programs), and hacked them about a bit to work nicely with Javascript . They are presented here for your edification, delight and ripping off."

This javascript was modified into a function that returns a number between 0 and 1 representing how far through the lunar cycle we are. 0 and 1 are both new moons, 0.5 is the full moon.

Moon Rise and Moon Set

Keith Burnett

This is a translation of a set of routines from Montenbruck and Pfleger's Astonomy on the Computer 2nd english ed - see chapter 3.8 the sunset progrm

Background image of stars

ยฉ StarFields [1] 1998 - 2012. All Rights Reserved. You are very welcome to use my background images on your website or blog free of charge. All other uses, please contact StarFields [2] for permission.

Julian date

SVG

uses the A command in <path> http://www.w3.org/TR/SVG/paths.html#PathDataEllipticalArcCommands

<svg width="98%" height="98%" xmlns="http://www.w3.org/2000/svg" version="1.1">
      <svg id="moon" viewBox="0 0 200 200">
            <!-- black background of moon is path class="moonback" -->
            <path class="moonback" d="m100,0 a20,20 0 1,1 0,150 a20,20 0 1,1 0,-150"></path>
            <path class="moon" d="m100,0 a0.40078440694886197,20 0 1,1 0,150 a20,20 0 1,1 0,-150"></path>
            <!--                             ^                       ^                  ^
               this cycles between 0 and 20 -+                       |                  |
                            4 times a month                          +------------------+
                                                                     |
                                                                     these arc-sweep options cycle
                                                                     1,0 --  0,0 --  1,1 -- 0,0 
            -->
      </svg>
</svg>

Logic notes

Here is where I was figuring out the logic of the program https://gist.github.com/3680124#file_phase_notes.txt

jsfiddle

More Repositories

1

pdftrick

.pdf โ‡’popplerโ‡’ .ps โ‡’ghostscriptโ‡’ .pdf
Python
13
star
2

ead-test-col

EAD Noun-Obscured Specimen Collection: A Collection of XML Specimen for Testing
7
star
3

ead_basic_xslt

generic XSLT for EAD
XSLT
6
star
4

md5s3stash

content addressable storage in AWS S3
Python
6
star
5

aws-as

deploy archives managment application on AWS
Shell
5
star
6

collengine

collection engine: digital object description tool designed to run on google app engine
Python
4
star
7

twincat

script to download tomcat and set up two โ€– CATALINA_BASEs, leaving them ready to start running
Shell
4
star
8

xtf-dsc

XTF used by Digital Special Collections / now on bitbucket (could not get hg-git to work with new hg)
Java
4
star
9

snac2

Java
3
star
10

greeker.py

a greeker that scrambles nouns in an XML document's text nodes to produce a specimen for layout testing
Python
3
star
11

loc-xmlcatalog

xmlcatalog for .xsd and .dtd hosted at www.loc.gov/standards
2
star
12

snac-related-widget

Related Names Widget for SNAC
JavaScript
2
star
13

voro-djsite

django code for voro
JavaScript
2
star
14

ead_tag_use.py

generate report on tag use from a corpus of EAD files
Python
2
star
15

ucldc_collection_registry

JavaScript
1
star
16

spinning

spinning out of control
1
star
17

xsltscroll

attempt at literate programming in xslt
1
star
18

snac-docs

documentation for CDL SNAC code
1
star
19

tingletech.github.com

JavaScript
1
star
20

jena-fuseki

Mirror of Apache Jena - Fuseki (Incubating)
Java
1
star
21

localstars

use localstorage to "star" your favorite pages
JavaScript
1
star
22

fixity_checker

Yet another fixity checking daemon. Fixity, or forget it.
Python
1
star
23

rexster-tomcat

rexster, inside tomcat
Java
1
star
24

vocab_search

search controlled vocabularies for URLs to "link" into descriptive records
Groovy
1
star
25

rexster-kibbles

An Extension Library for Rexster
Java
1
star
26

jena-joseki

tomcat in pom.xml; SNAC config; Mirror of Apache Jena - Joseki (Incubating)
Java
1
star
27

liBrain

"more like this" content syndication powered by DPLA
JavaScript
1
star
28

voro

DSC Ingest system
Perl
1
star