diff --git a/docs/_extensions b/docs/_extensions new file mode 120000 index 0000000..36f4c91 --- /dev/null +++ b/docs/_extensions @@ -0,0 +1 @@ +../quarto/_extensions/ \ No newline at end of file diff --git a/docs/quarto-example.qmd b/docs/quarto-example.qmd new file mode 100644 index 0000000..cef6269 --- /dev/null +++ b/docs/quarto-example.qmd @@ -0,0 +1,358 @@ +--- +title: "{quarto-countdown}" +author: "Garrick Aden-Buie and James Joseph Balamuta" +date: today +format: revealjs +countdown: + color_border : "#d33682" + color_text : "#d33682" + color_running_background : "#2aa198" + color_running_text : "#073642" + color_finished_background: "#dc322f" + color_finished_text : "#fdf6e3" +--- + + +[quarto]: https://quarto.org/ +[revealjs]: https://quarto.org/docs/presentations/revealjs/ +[html]: https://quarto.org/docs/output-formats/html-basics.html +[countdown]: https://github.com/gadenbuie/countdown + +## Hey look, it's a timer! + +:::{=html} +
+::: + +{{< countdown minutes = 0 seconds = 42 top = "26%" right = "40%" play_sound="true" >}} + + +### How to use your new countdown timer + +:::{.r-fit-text} +Click or Space on the timer to **start** or **stop** it. + +Double click or Esc anytime to **reset** it. + +Use the **+** and **−** buttons or ↑ ↓ to **bump** the timer **up** or **down**. +::: + +## Easily add a timer to your slides! + +First, install `countdown` from [GitHub][countdown] + +```sh +quarto add gadenbuie/countdown/quarto +``` + +:::{.fragment} +Then in your [HTML][html] Document or [RevealJS][revealjs] slides made with [Quarto][quarto] add + +```markdown +{{{< countdown minutes=0 seconds=42 >}}} +``` + +or + +```markdown +{{{< countdown 0:42 >}}} +``` +::: + +## What's so cool about a timer? + +:::: {.columns .r-fit-text} + +::: {.column width="40%"} +If your slides support your teaching materials, on-screen timers are a great way to bracket group activities. + +Put your prompt on the screen and ask the group: + +> _Take 4 minutes to discuss with your partner_ + +Then click on your timer to keep everyone on track! +::: + +::: {.column .fragment .center width="60%"} +I learned this from [@StatGarrett](https://twitter.com/StatGarrett)'s +rad `rstudio::conf` workshop! + +![](img/teach-tidyverse-timer.png){style="border:3px solid #002b36;border-radius:10px;"} + +Here's an example from his +[Master the Tidyverse materials](https://github.com/rstudio-education/master-the-tidyverse/). + +::: + +:::: + +## `countdown` has style {.countdown-has-style} + +::: {.center} +{{{< countdown >}}} +::: + +:::: {.columns .r-fit-text} + +::: {.column width="40%"} +### Each Timer + +Settings of individual timers + +- _`minutes`_ +- _`seconds`_ +- `play_sound` +- `top` +- `right` +- `bottom` +- `left` +- `update_every` +- `warn_when` +- [`font_size`]{.subtle} +- [`margin`]{.subtle} +- [`padding`]{.subtle} + +:::{.footnote} +Faded arguments inherit from global styles ➡ +::: + +::: + +::: {.column width="60%"} +### countdown_style() + +Style all timers at once + +- `font_size` +- `margin` +- `padding` +- `box_shadow` +- `border_width` +- `border_radius` +- `line_height` +- `color` options for + - `_background`, `_border`, `_text` + - and for `running`, `finished`, `warning` +::: + +:::: + +## The first-time timer + +Here's how I created the first timer and set this presentation's timer styles. + +````markdown +--- +title: My presentation +countdown: # Set timer theme to match solarized colors + color_border : "#d33682" + color_text : "#d33682" + color_running_background : "#2aa198" + color_running_text : "#073642" + color_finished_background: "#dc322f" + color_finished_text : "#fdf6e3" +--- + +{{{< countdown minutes=0 seconds=42 play_sound="true" >}}} +```` + +## + +If you customize your timer's styles,The default is bottom, right.
+``` +{{< countdown minutes=0 seconds=7 bottom=0 >}} + +```{=html} +This timer is top, right.
+``` + +{{< countdown minutes=0 seconds=13 top=0 >}} + +```{=html} +This timer is bottom, left.
+``` + +{{< countdown minutes=0 seconds=21 left=0 >}} + +::: {.center .big} +👆🏼 +👈🏼 Go ahead, click them! 👉🏼 +::: +:::: + +## Start Immediately + +{{< countdown start_immediately="true" >}} + +Inside **revealjs** slides, when `start_immediately="true"`, +the timer will start when you land on the slide. + +When used with other web pages, +the timer starts as soon as it's visible. + +## Customize your timers + +`top`/`bottom` and `left`/`right` cancel each other out unless you specify both. + +You can also override the global timer `font_size`, `padding`, and `margin`. + +{{< countdown minutes=1 seconds=30 left=0 right=0 padding="50px" margin="5%" font_size="6em" >}} + +## Keep Calm {.center .top} + +```{=html} + +``` + +### and + +### Countdown + +TODO: Figure out how to fix countdown as heading 1. + +Avoid countdown panic with a timer+``` + +Modify the `background`, `text` and `border` colors of the warning state using the `color_warning_...` arguments. + +## Behind the scenes + +:::: {.r-fit-text} + +Behind the scenes, `countdown` is a little wrapper around +a very small amount of HTML and CSS and bit more of Javascript. + +Each countdown timer element looks something like this: + +````html +{{< countdown 3:30 >}} +```` + +TODO: Figure out how to ensure HTML is retained from shortcode injection. + +:::{.fragment} + +Once the timer is activated, `