Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@codersrank/education

Package Overview
Dependencies
Maintainers
5
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@codersrank/education

Codersrank Education Widget

  • 0.9.12
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
220
increased by7.84%
Maintainers
5
Weekly downloads
 
Created
Source

Codersrank Education Widget

Codersrank Education Widget is a web component that allows you easily integrate education information from your CodersRank profile to your personal website:

Install from NPM

Widget script available through NPM:

npm i @codersrank/education --save

After installation you need to import and register web component:

import CodersrankEducation from '@codersrank/education';

// register web component as <codersrank-education> element
window.customElements.define('codersrank-education', CodersrankEducation);

Install from CDN

Widget can also be downloaded or linked directly from CDN:

<!-- replace x.x.x with actual version -->
<script src="https://unpkg.com/@codersrank/education@x.x.x/codersrank-education.min.js"></script>

In this case it is not required to register web component, it is already registered as <codersrank-education> element.

Usage

As it is a web component the usage is pretty simple, just add widget HTML tag with your CodersRank username

<codersrank-education username="YOUR_USERNAME"></codersrank-education>

Widget Attributes

Widget supports following properties as HTML element attributes:

NameTypeDefaultDescription
usernamestringYour CodersRank username
max-itemsnumberLimit number of education and certificates items to display
gridbooleanfalseEnables grid layout. Number of columns is configurable with --grid-columns CSS variable
educationbooleantrueDefines whether to show education section
certificatesbooleantrueDefines whether to show certificates section
certificates-linkbooleantrueDefines whether to show certificate link
certificates-linkstringSee certificationCertificate link text
education-section-titlestring``Education section title
certificates-section-titlestring``Certificates section title
brandingbooleantrueDisplays "Powered by CodersRank" link

For example:

<codersrank-education
  username="YOUR_USERNAME"
  certificates="false"
></codersrank-education>

Styling

It is possible to customize widget colors with CSS Custom Properties (CSS Variables) by setting them directly on the widget element with style attribute or in CSS.

There are following CSS Custom Properties are available:

PropertyValue
--preloader-color#72a0a8
--item-spacing1em
--item-border-radius0px
--item-bordernone
--item-padding0px
--item-bg-colortransparent
--grid-columns1
--title-font-size1.15em
--title-font-weightbold
--title-text-colorinherit
--title-opacity1
--details-text-colorinherit
--details-opacity1
--details-font-sizeinherit
--details-font-weightinherit
--date-text-colorinherit
--date-opacity0.55
--date-font-sizeinherit
--date-font-weightinherit
--description-font-sizeinherit
--description-font-weightinherit
--description-text-colorinherit
--description-opacity1
--section-title-text-colorinherit
--section-title-opacity1
--section-title-font-size1.5em
--section-title-font-weightbold
--certificate-link-font-size0.85em
--certificate-link-font-weightinherit
--certificate-link-opacity1
--certificate-link-text-color#72a0a8
--certificate-link-text-decorationnone
--certificate-link-text-transformuppercase
--certificate-link-hover-text-decorationunderline
--certificate-link-hover-text-color-
--certificate-link-active-text-color-
--certificate-link-active-text-decoration-
--branding-text-colorinherit

For example, to change education (and certificate) item title color to purple and font-size to 20px, add this to CSS stylesheet:

codersrank-education {
  --title-text-color: purple;
  --title-font-size: 20px;
}

Use As Image

It is also possible to insert Education widget as an image. It is useful in places where you can't integrate web component, or for example on your GitHub profile README.md page.

Image URL is the following:

https://cr-ss-service.azurewebsites.net/api/ScreenShot?widget=education&username=YOUR_USERNAME

It accepts all widget attributes as query string parameters, plus one extra parameter:

NameTypeDefaultDescription
widthnumber800Width of widget element (generated image). Note that generated image has @2x pixel density, so the PNG image will be actually generated in @2x size from the one specified here
stylestringstyle attribute value (here you can specify all CSS variables)

For example:

<img
  src="https://cr-ss-service.azurewebsites.net/api/ScreenShot?widget=education&username=YOUR_USERNAME&max-items=2&certificates=false&style=--item-bg-color:%23f00;--item-border-radius:10px"
/>

Note that you need to URL Encode some of the characters, for example # should be %23 and #ff0 color should be specified as %23ff0 in query.

Contribution

Yes please! See the contributing guidelines for details.

Licence

This project is licensed under the terms of the MIT license.

Keywords

FAQs

Package last updated on 28 Dec 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc