GithubHelp home page GithubHelp logo

seanysean / lichess-widgets Goto Github PK

View Code? Open in Web Editor NEW
3.0 2.0 1.0 75 KB

A little project of mine

Home Page: https://seanysean.github.io/lichess-widgets/

HTML 13.65% CSS 34.87% JavaScript 51.48%
lichess lichess-widgets json lichess-api js javascript css

lichess-widgets's Introduction

Screen shot of one possible look

Lichess widgets bitHound Overall Score

Originally made to practice using JSON.

Usage

#1 Simply add these lines of code to the <head> of your HTML document:

<link href="https://seanysean.github.io/lichess-widgets/widget.css" type="text/css" rel="stylesheet">
<script src="https://seanysean.github.io/lichess-widgets/widget.js"></script>
<!--It's probably wise to host your own copies of this code. You'll be able to change it,
    but more importantly you'll be able to keep the widget in case something happens
    to either of the links.-->

#2 Find the place in the <body> of your code where you want the widget. Change the following code to your liking, then add it to where you want.

<script>
  lichess_widget("large","seanysean","light","classical");
  // Change the second parameter (seanysean) to a username of your choice.
</script>

You can try it out here.

Features

  1. You can add multiple widgets to one page.
<script>
  lichess_widget("large","chess-network","dark","atomic");
  lichess_widget("large","seanysean","light","classical");
</script>
  1. You can make your widget small, or large.
lichess_widget("large","seanysean","light","classical"); 
//Change the first parameter (large) to small, if disired.
  1. Light or dark theme. Simply change the third parameter to "light" or "dark":
lichess_widget("large","seanysean","dark","classical"); 
  1. Display your rating of choice.
 lichess_widget("large","seanysean","light","classical");
 // Change "classical" to "none" if you don't want to display any ratings,
 // chess960, blitz, kingOfTheHill, crazyhouse, threeCheck, antichess, bullet,
 // correspondence, horde, puzzle, atomic, racingKings, or ultraBullet to get 
 // the rating of that particular rating.*/

You can experiment here.

Bugs

If you notice any bugs, please report them in the issues section.

To Do

  • Deal with closed accounts.
  • Custom rating choice.
  • Slightly more modern look.
  • Make "small" smaller.
  • Enjoy :)

Credits

I learned how to use JSON at this MDN tutorial.
Somewhat inspired by rubenwardy's lichess widgets.
Icons by Font Awesome hosted by w3schools.
Font "Lato" from Google Fonts.
Obviously needed, lichess.org's API.

lichess-widgets's People

Contributors

seanysean avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

arbitre125

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.