Liking cljdoc? Tell your friends :D
Mostly clj/s.
Exceptions indicated.

dk.simongray.play-nice.media.captions

Captions in the style that the user prefers, as the CSS of ::cue, from a map of the settings that the FCC's rule for caption displays names.

A page can't read the system's own caption settings, so you keep the user's style and the functions turn it into CSS:

(css {:font-scale 1.5 :color :yellow :edge :drop-shadow})
;; => "video::cue{color:rgba(255,255,0,1);font-size:150%;
;;     text-shadow:2px 2px 3px rgba(0,0,0,1)}"

The style is a map of these keys, each optional, which leaves the browser's own setting:

  • :font-scale, the size as a share of the browser's own, from 0.5 to 2 as the rule asks, e.g. 1.5
  • :font, one of fonts
  • :color and :background-color, one of colors, or a hex code, e.g. "#ffcc00"
  • :opacity and :background-opacity, from 0 to 1, e.g. 0.5 for semi-transparent
  • :edge, one of edges, and :edge-color, black by default

Chrome 153 on macOS kept its own background behind the text, and its own letters for :small-capitals, whatever the page asked for, but applied the rest. Everything but style! runs on the JVM too, e.g. to write the CSS into a page on the server.

Captions in the style that the user prefers, as the CSS of ::cue, from a
map of the settings that the FCC's rule for caption displays names.

A page can't read the system's own caption settings, so you keep the
user's style and the functions turn it into CSS:

    (css {:font-scale 1.5 :color :yellow :edge :drop-shadow})
    ;; => "video::cue{color:rgba(255,255,0,1);font-size:150%;
    ;;     text-shadow:2px 2px 3px rgba(0,0,0,1)}"

The style is a map of these keys, each optional, which leaves the
browser's own setting:

- :font-scale, the size as a share of the browser's own, from 0.5 to 2
  as the rule asks, e.g. 1.5
- :font, one of fonts
- :color and :background-color, one of colors, or a hex code, e.g.
  "#ffcc00"
- :opacity and :background-opacity, from 0 to 1, e.g. 0.5 for
  semi-transparent
- :edge, one of edges, and :edge-color, black by default

Chrome 153 on macOS kept its own background behind the text, and its own
letters for :small-capitals, whatever the page asked for, but applied the
rest. Everything but style! runs on the JVM too, e.g. to write the CSS
into a page on the server.
raw docstring

colorsclj/s

The colours of the text and the background that a user may choose from, as RGB.

The colours of the text and the background that a user may choose
from, as RGB.
raw docstring

cssclj/s

(css style)
(css style selector)

The CSS of the caption style for the videos that the selector chooses, by default every video, e.g. "video::cue{font-size:150%}".

The size is a percentage of the browser's own, since a page's vh is the page's viewport, not the video's, in every engine.

The CSS of the caption `style` for the videos that the `selector`
chooses, by default every video, e.g. "video::cue{font-size:150%}".

The size is a percentage of the browser's own, since a page's vh is the
page's viewport, not the video's, in every engine.
raw docstring

declarationsclj/s

(declarations {:keys [font-scale font color opacity background-color
                      background-opacity edge edge-color]
               :as style})

The CSS declarations of the caption style, a map of the keys above, as pairs of property and value, e.g. [["font-size" "150%"]].

The CSS declarations of the caption `style`, a map of the keys above, as
pairs of property and value, e.g. [["font-size" "150%"]].
raw docstring

edgesclj/s

The edges of the letters that a user may choose from, as functions of the colour of the edge to a CSS text-shadow.

The edges of the letters that a user may choose from, as functions of
the colour of the edge to a CSS text-shadow.
raw docstring

fontsclj/s

The font styles that a user may choose from, as CSS font families, of which :default keeps the browser's own.

The font styles that a user may choose from, as CSS font families, of
which :default keeps the browser's own.
raw docstring

rgbaclj/s

(rgba color opacity)

The CSS colour of color, one of colors or a hex code, e.g. "#ffcc00" or "#fc0", at the opacity, from 0 to 1, e.g. "rgba(255,204,0,1)".

The CSS colour of `color`, one of colors or a hex code, e.g. "#ffcc00"
or "#fc0", at the `opacity`, from 0 to 1, e.g. "rgba(255,204,0,1)".
raw docstring

style!cljs

(style! video style)

Style the captions of the video in the style, and return a function that removes the style again.

The call adds the CSS of css to the video's document, for this video alone. A later call for the same video replaces its style, and the earlier call's function then only removes that style's element.

Style the captions of the `video` in the `style`, and return a function
that removes the style again.

The call adds the CSS of css to the video's document, for this video
alone. A later call for the same video replaces its style, and the
earlier call's function then only removes that style's element.
raw docstring

cljdoc builds & hosts documentation for Clojure/Script libraries

Keyboard shortcuts
Ctrl+kJump to recent docs
←Move to previous article
→Move to next article
Ctrl+/Jump to the search field
× close