Skip to content
ClockCrest
Language: EN

Widgets Studio

Pick a template, set the place and the look, and copy the code. The preview is the real widget and changes as you edit.

Live preview

Embed code

Template

Browse all 30 designs

Place and language

What to show
Size

Colours
Font and frame
Save and share

    Saved configurations stay in this browser only. Nothing is uploaded: the link and the file contain the settings themselves.

    Where the time comes from

    An embedded widget shows the time of the visitor’s own device, converted to the chosen zone with the IANA time zone database built into the browser (Intl), so daylight saving changes happen on the right day without an update.

    A widget cannot ask a server for the time: its page is served with connect-src 'none', which forbids every network request. If the visitor’s clock is wrong, the widget is wrong by the same amount. The preview on this page is the same code, but it runs on ClockCrest and therefore uses our server-synchronised clock.

    Script loader and Web Component

    Both use one small file, https://clockcrest.com/widget.js. It only creates an <iframe> that points at the widget page: it loads no other code, sends nothing, stores nothing and reads only the attributes you wrote on the element.

    On a site with a Content Security Policy, allow https://clockcrest.com in script-src and in frame-src. No inline script and no unsafe-inline style is needed. The file is served with Cache-Control: public, max-age=0, must-revalidate: browsers keep it but check it is current, so fixes reach every site at once.

    The plain iframe needs no script at all and is the safest choice wherever HTML is filtered.

    Every option is in the address

    The studio only builds a URL. template picks the design; tz (IANA name) or city sets the place; label, lang (en, ar, fr, es), theme (auto, light, dark) and format (12, 24) set the wording; seconds, date, weekday, abbr, offset, flag and by are 0/1 switches.

    Colours are six-digit hex values without the #: bg, fg, accent, and g1/g2/ga for a gradient. font, scale, radius, border, shadow and transparent set the frame. Anything the widget does not recognise is ignored, and numbers are clamped to a safe range.

    The first ClockCrest widget addresses — /embed/clock/?tz=…&label=… and /embed/countdown/?to=…&title=… — keep working exactly as before.

    Calendars, timers and the other widgets

    Besides clocks, the studio builds a calendar (twenty designs), a stopwatch, a timer, a world clock table, prayer times, a list of public holidays, a time zone converter and a sunrise & sunset card. Each has its own page under /embed/ — /embed/calendar/, /embed/stopwatch/, /embed/timer/, /embed/worldclock/, /embed/prayer/, /embed/holidays/, /embed/converter/, /embed/sun/ — and its own element in widget.js, such as <clockcrest-calendar>.

    Their extra options: week (mon, sun, sat) sets the first day of the week; country is the two-letter code of the country whose holidays are shown; method (mwl, umm-al-qura, egyptian, karachi, isna) and asr (standard, hanafi) choose how prayer times are calculated; dur is the timer length in seconds; n is how many holidays the list shows.

    Public holidays come from the Nager.Date data that the rest of ClockCrest uses (2025 to 2028). They are shipped with the widget as a script, one small file per country, because a widget may not make network requests. Prayer times and sun times are astronomical calculations for the coordinates of the city, not a mosque’s or an observatory’s published timetable. The Hijri calendars use Umm al-Qura as the browser implements it. The stopwatch and timer keep nothing: reloading the page starts them again, and the timer has no sound.

    Limits worth knowing

    Sunrise and sunset are computed for the city’s coordinates with the NOAA solar equations (about ±2 minutes below 72° latitude). The Islamic clock shows the Umm al-Qura calendar as the browser implements it; a local moon sighting can differ by a day. The city scene is a generated illustration, not a picture of the place. The business dashboard assumes a Monday-to-Friday week and knows no public holidays.