CoolClock Custom Skin

On https://premium.status301.net/coolclock-skins/ you can find an overview of the included preset skins and their parameters. Copy the code beside any one of these as a starting point to customize and create your own clock face.

If nothing fits your site, start with something relatively simple like:

outerBorder: { lineWidth: 8, radius: 90, color: "black", alpha: 1 },
hourHand:    { lineWidth: 8, startAt: 0, endAt: 60, color: "black", alpha: 1 },
minuteHand:  { lineWidth: 8, startAt: 0, endAt: 80, color: "black", alpha: 1 },
secondHand:  { lineWidth: 8, startAt: 80, endAt: 86, color: "red", alpha: 1 }

Widget

Set the widget skin to Custom and paste the chosen parameters in the “Custom skin parameters” field. Then save the widget and check the result on your site.

Next, you can start tweaking parameter values to see what happens. Do not forget to save your widget each time before checking out the resulting clock.

Shortcode

Create a shortcode with custom skin like this:
[coolclock skin="myCoolSkin"]
outerBorder: { lineWidth: 8, radius: 90, color: “black”, alpha: 1 },
hourHand: { lineWidth: 8, startAt: 0, endAt: 60, color: “black”, alpha: 1 },
minuteHand: { lineWidth: 8, startAt: 0, endAt: 80, color: “black”, alpha: 1 },
secondHand: { lineWidth: 8, startAt: 80, endAt: 86, color: “red”, alpha: 1 }
[/coolclock]

Note that you must add a skin=”…” parameter to the shortcode or else it will default to the Swiss Rail skin and it must be a unique name (whatever you want except any of the pre-set skins above) or the skin with that existing name will be used instead.

The result of the above example looks like:

Next, you can start tweaking the custom skin parameters. You can use the Preview button in the post/page editor to see your changes while tweaking but do not forget to Publish/Update your post/page once you are happy with the resulting clock face.

Skin elements and their parameters

The skin code is made up of elements and their parameters. Each element has the general parameters ans some have dedicated parameters. See the descriptions below.

General parameters

  • lineWidth – the width (or height, depending on the effect of other parameters) of the element in pixels.
  • startAt – start point of the element in percentage from the center (0) to the border (100); can be a negative value or larger than 100.
  • endAt – end point of the elementin percentage from the center (0) to the border (100); can be a negative value or larger than 100.
  • radius – shape element as a circle; value represents the elements radius in pixels. endAt will be ignored when radius is used.
  • color – the color code of (the border of) the element; can be a RGB hex value or HTML color name.
  • fillColor – the color of the center of the element if presented as a circle (with the radius parameter); can be a RGB hex value or HTML color name.
  • alpha – the transparency value of the element, must be between 0 (transparent) and 1 (opaque).

Available elements and special parameters

  • outerBorder – Draws a circle based on the radius as distance from center of the clock in percentage; does not have startAt or endAt parameters.
  • largeIndicator – Draws the 5 minute indicators.
  • smallIndicator – Draws the remaining minute indicators.
  • hourHand – Draws the element that moves according to the hours.
  • minuteHand – Draws element that moves according to the minutes.
  • secondHand – Draws element that moves according to the seconds.
  • secondDecoration – Draws a second element that moves according to the seconds. Can be used for decoration on the second hand.

Share your custom skin

Do you have any custom skins you want to share? Please use the comments below to paste your parameters and feel free to share a link to your site to show the live result!

Leave a Reply