All Projects → DaWoody → Astrology-JS

DaWoody / Astrology-JS

Licence: other
An open source javascript project to create a class for easy distribution and access to astrological information in web-applications/web-pages

Programming Languages

javascript
184084 projects - #8 most used programming language
HTML
75241 projects

Projects that are alternatives of or similar to Astrology-JS

kerykeion
Kerykeion is a python library for astrology. It can generate SVG charts and extract all data about a birthchart, a composite chart and a transit chart.
Stars: ✭ 72 (+84.62%)
Mutual labels:  zodiac-sign, astrology
emoji-clock
🕟 Generate the emoji clock face, moon phase 🌗 , or zodiac sign ♉ 🐶 for a given time
Stars: ✭ 12 (-69.23%)
Mutual labels:  zodiac-sign
EKAstrologyCalc
Astrology Calculator calculates moon's rise/set times, moon Age, moon phases and Zodiac Sign for location and time
Stars: ✭ 31 (-20.51%)
Mutual labels:  zodiac-sign
HoroscopeDrawer
JavaScript-Library to draw celestial charts in SVG-Format.
Stars: ✭ 51 (+30.77%)
Mutual labels:  astrology
astrale
React Native mobile application. Find out what the future holds for you in this astrology app, available for Android. Powered with Python, MongoDB and PHP.
Stars: ✭ 100 (+156.41%)
Mutual labels:  astrology
astrology-api
Astrology API Rest
Stars: ✭ 35 (-10.26%)
Mutual labels:  astrology
horoscope
Open source horoscope generation engine
Stars: ✭ 18 (-53.85%)
Mutual labels:  astrology

Astrology

An open source javascript project to simply getting general astrological information within web-applications

npm version Download

Version Information


Check out the version information page for more information.

License


This software is distributed as Open Source software following the GNU General Public License, version 3 (GPL-3.0)

Description


This project is aimed to be an open source project to design a simple javascript class that could be used to generate general astrological information to individuals based on birth date information and such. The idea is that the class could be instantiated and used in a general web-project and then accessed through a set of different public methods that add data, do calculations and present information back to the user. Currently the class is meant to load some general information data about the different zodiac signs from a json resource. The default settings is to load the data from a json-files to get the specific date information for each zodiac signs aswell as a more detailed description about what a specific zodiac sign entails. The source for the json data could be altered through providing a connectionObject to the constructor method as explained below.

How to use the Astrology class


Within the web-pages/applications you would like to use the class, you should include the script, within the <head>..</head> section or preferably within the last section of the <body>..</body> section, such as for instance

...
<script src="../js/astrology.js"></script>
</body>
</html>

Then within an actual javascript file, (could be within a jquery statement aswell), the class should be instantiated with an optional connectionObject parameter being passed to the constructor like:

var astrology = new Astrology();

or..

var connectionObject = {
     dateDataUrl: url_to_where_to_fetch_the_date_data,
     descriptionDataUrl: url_to_where_to_fetch_the_description_data
 }

var astrology = new Astrology(connectionObject);

When interacting with the class there are three methods that saves the date needed to find out the zodiac sign. First there is the method addDay(dayNumber) that takes in a number between 1-31 as a valid day number in a month, and then there is addMonth(monthNameOrMonthNumber) which takes in a string with a valid month-name such as for example january, february etc... or a valid month-number string ranging from 1-12, such as 1, 12 or 01, 07 for instance. Then there is also a method called addFullDateString(dateString) which takes in a date string in the format YYYY-MM-DD. This is naturally supported as the output from the native html5-method <input type="date"> , which in turn is supported by most modern browsers, except Internet Explorer. Read more here.

astrology.addDay(dayNumber);

astrology.addMonth(monthNameOrMonthNumber);

astrology.addFullDateString(dateString)

To actually get the zodiac sign or the zodiac sign description from an astrology object, the methods fetchZodiacSign and fetchZodiacSignDescription both fetches different strings that could be used within the DOM-structure or as the user see fit. The fetchZodiacSignDescription method returns a description and the fetchZodiacSign returns the zodiac name, both in the format of a string. They are called upon such as:

astrology.fetchZodiacSign();
astrology.fetchZodiacSignDescription();

To get a more hands on example on how to implement the class and use it within an actual web-application check out the Html implementation code example

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].