Giter Site home page Giter Site logo

imananoosheh / github-contributions-widget Goto Github PK

View Code? Open in Web Editor NEW
3.0 1.0 1.0 244 KB

This widget allows you to display a GitHub-like contribution calendar on your website, showcasing a user's activity over the past year. It also shows where you have gone beyond!

Home Page: https://anoosheh.info/github-contributions-widget/

License: MIT License

JavaScript 86.54% HTML 2.07% Dockerfile 3.12% Shell 8.27%

github-contributions-widget's Introduction

GitHub Contribution Calendar Widget

Welcome to the GitHub Contribution Calendar Widget! This widget allows you to display a GitHub-like contribution calendar on your website, showcasing a user's activity over the past year. It also shows where you have gone beyond!

Demo Screenshot

Demo Screenshot Image

Frontend Usage (github_calendar_widget.js)

To include the GitHub Contribution Calendar Widget on your webpage, follow these steps:

  1. Include the Script:

    Add the following script tag to the <head> section of your HTML file. This will include the GitHub Contribution Calendar Widget script hosted on jsDelivr.

    <script type="module" defer src="https://cdn.jsdelivr.net/gh/imananoosheh/github-contributions-fetch@latest/github_calendar_widget.js"></script>
  2. Create a Container:

    Add a container <div> in the body of your HTML to hold the calendar. Provide an id for the container and specify the GitHub username using the username attribute:

    <div id="calendar-component" username="<your-github-username>"></div>
  3. Customization (Optional):

    You can customize the appearance of the calendar by adding optional attributes to the container <div>. For example, to set the theme color, use the theme-color attribute:

    <div id="calendar-component" username="<your-github-username>" theme-color="#4285f4"></div>

    Available attributes:

    • theme-color: The main color of the calendar.
    • background-color: The background color of the calendar.

Server Deployment (OPTIONAL - for curious developers!)

If you want to deploy the backend server on your own server, follow these steps:

  1. Configure Environment Variables:

    Create a .env file in the project root and set your GitHub access token:

    GITHUB_ACCESS_TOKEN=your-github-access-token
    SERVER_PORT=3003
    STATIC_DIR=/usr/src/app/public/
  2. Run install script

    By running the install.sh a docker image will be built and run based on the latest version of GitHub Calendar Widget

    ./install.sh
  3. API Endpoint:

    Your API endpoint will be accessible at http://your-server-domain-or-ip/github_calendar/:username. Make sure to update your GitHub widget script with this URL.


Now, you can deploy the backend server on your own server to provide the necessary data. Happy coding!

github-contributions-widget's People

Contributors

imananoosheh avatar

Stargazers

hirohata avatar Masoud Sadeghi avatar  avatar

Watchers

 avatar

Forkers

pydeb

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.