R/theming.R

Defines functions sidebarFooter complianceLinks surveyLink renderIcon copyrightInfo psu_logo psu_eberly_logo logo_colors showPalette

Documented in complianceLinks copyrightInfo logo_colors psu_eberly_logo psu_logo renderIcon showPalette sidebarFooter surveyLink

#'theming
#'
#' Contains a set of commonly used assets for app design
#' @name theming
NULL

#' boastPalette
#'
#' Based on the Wong Color Blind Set
#' @seealso \href{https://www.nature.com/articles/nmeth.1618}{https://www.nature.com/articles/nmeth.1618}
#' @seealso \href{https://davidmathlogic.com/colorblind/#%23D81B60-%231E88E5-%23FFC107-%23004D40}{https://davidmathlogic.com/colorblind/#%23D81B60-%231E88E5-%23FFC107-%23004D40}
#'
#' @return A palette
#'
#' @examples
#' showPalette(boastPalette)
#'
#' @export
boastPalette <- c(
  "#0072B2",
  "#D55E00",
  "#009E73",
  "#AA4499",
  "#56B4E9",
  "#E69F00",
  "#CC79A7",
  "#000000",
  "#999999"
)

#' psuPalette
#'
#' Based on Penn State's three official color palettes.
#' @seealso \href{https://brand.psu.edu/design-essentials.html#color}{https://brand.psu.edu/}
#'
#' @return A palette
#'
#' @examples
#' showPalette(psuPalette)
#'
#' @export
psuPalette <- c(
  "#1E407C",
  "#BC204B",
  "#3EA39E",
  "#E98300",
  "#999999",
  "#AC8DCE",
  "#F2665E",
  "#99CC00"
)

#' showPalette
#' 
#' Used to quickly visualize what color options are available in a given palette.
#' 
#' @return A pie chart of palette colors.
#'
#' @examples
#' showPalette()
#' showPalette(psuPalette)
#' showPalette(psuPalette[2])
#' 
#' @export
showPalette <- function(palette = boastPalette){
  name <- deparse(substitute(palette))
  wedgeLabels <- c()
  for (i in 1:length(palette)) {
    wedgeLabels[i] <- paste(
      paste0(name, "[", i, "]"),
      palette[i],
      sep = "\n"
    )
  }
  graphics::pie(
    x = rep(1, length(palette)),
    labels = wedgeLabels,
    col = palette,
    main = paste("The", name),
    radius = 1
  )
}

#' PennState Logo Colors
#' 
#' @param style Logo style \code{[default, reversed, grayscale]}
#' 
#' @seealso \href{http://visualidentity.psu.edu/}{http://visualidentity.psu.edu/}
#' 
#' @return list
logo_colors <- function(style = "default") {
  colors <- list()
  
  if (style == "default") {
    colors <- list(
      "primary" = "#065094",
      "secondary" = "#96BEE6",
      "font" = "#065094"
    )  
  } else if (style == "rev" || style == "reversed") {
    colors <- list(
      "primary" = "#065094",
      "secondary" = "#96BEE6",
      "font" = "#FFFFFF"
    )
  } else if (style == "black" || style == "greyscale" || style == "grayscale") {
    colors <- list(
      "primary" = "#000000",
      "secondary" = "#A7A9AC",
      "font" = "#000000"
    )
  }
  
  return(colors)
}

#' PennState Eberly College of Science Logo
#'
#' @param style Logo style \code{[default, reversed, grayscale]}
#'
#' @return html
#'
#' @section Example:
#'   \figure{PSU_SCI_RGB_2C.png}{options: width=250 alt="Default"}
#' @seealso \href{http://visualidentity.psu.edu/}{http://visualidentity.psu.edu/}
#' @export
 <- function(style = "default"){

  colors <- logo_colors(style)

  logo <- HTML(
    paste0('<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="33 33 400 87">
      <style>
        svg .hoverfill {
          fill: #000000;
          fill-opacity: 0;
        }
        svg .hoverfill:hover {
          fill: #96BEE6;
          fill-opacity: 0.1;
        }
      </style>
      <title>
        The Pennsylvania State University - Eberly College of Science
      </title>
      <path fill="', colors$font ,'" d="M413.8 89.4c0-1.6-.6-4-3.5-4-2.5 0-3.6 2.3-3.8 4h7.3zm-9.6 1.5c0-4.1 2.4-7.4 6.4-7.4 4.5 0 5.6 3.9 5.6 6.4 0 .5-.1.9-.1 1.2h-9.6c.1 3.4 2.2 4.7 4.7 4.7 1.8 0 2.9-.3 3.8-.7l.4 1.8c-.9.4-2.4.9-4.5.9-4.2 0-6.7-2.7-6.7-6.9zM398.9 95.9c1.4 0 2.3-.4 3.1-.7l.4 1.9c-.6.3-2.1.8-3.9.8-4.1 0-6.8-2.8-6.8-7s2.9-7.3 7.4-7.3c1.5 0 2.8.4 3.4.7l-.6 1.9c-.6-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.1 2.3h-2.1c.1-.9.1-2.3.1-3.5V77.5h2.4v8.6zM127.3 86.6h7.4v2h-7.4v6.9h8.3v2.1h-10.7V78.5h10.3v2.1h-7.9z"></path>
      <path fill="', colors$secondary ,'" d="M91.7 78.4c-.1-.2-2.3-4-2.4-4.3-.2-.3-.3-.6-.3-.9 0-.4.2-.6.6-.9.3-.2.6-.4.9-.5 1.1-.6 1.4-1.3 1.4-2 0-.3 0-.6-.1-1 .1.3.4 1 .4 1.2.2.7.6 1.6.6 2.8 0 1.2-.1 1.5-.4 2.7-.4 1.5-.6 2-.7 2.9z"></path>
      <path fill="', colors$primary ,'" d="M86.4 55.3c1-1.3 2.3-2.9 2.8-2.9.2 0 .4.2.7.7.2.3.3.9.3 1.4 0 1.7-.6 3-1.5 4.3-.5-.5-1.3-1.3-2.6-2-.1 0-.3-.1-.3-.4-.1-.2.2-.5.6-1.1z"></path>
      <path fill="#FFFFFF" d="M87 90.3c0 .7-1.1 2.3-3.2 2.8-.3.1-1 .2-3.9.2-4.4 0-5.2-1.1-5.2-2 0-1.4 6.3-2.4 8.8-2.4 2.4.1 3.5.8 3.5 1.4z"></path>
      <path fill="', colors$primary ,'" d="M84.3 83.3c0-.6.5-1.5.5-2.3 0-1-1.2-1.3-2.1-1.4-1.5-.2-2.2-.2-2.5-.4-.1-.1-.1-.1-.1-.2 0-.3.3-.6.6-1.1.1-.1.2-.2.2-.3.1-.1.2-.1.3-.2.1-.1.2-.1.3-.2.6-.3 1.2-.4 1.7-.5.9-.1 1.8-.2 3-.2 1.3 0 2.4.2 2.9.3 1.2.2 1.4.7 1.4 1.3v.6c0 .6-.5.9-1.3 1-.2 0-.5.1-.6.1-.6.1-1.3.2-1.6 1-.6 1.6-1.6 2.9-2.3 2.9-.2-.1-.4-.2-.4-.4z"></path>
      <path fill="#FFFFFF" d="M81.2 77.3c-.1.1-.2.1-.3.2.2 0 .3-.1.3-.2z"></path>
      <path fill="', colors$secondary ,'" d="M79 102.1c.8-.9 1.5-1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.2 0 2.8-.3 3.6-1.9 5.6-.4.5-1 1.3-1.4 1.8-1.2 1.5-1.8 2.4-1.7 4.1.2 4.6.9 7.9 1.2 9.7.1 4.2 1.2 6.3 8.3 12 4.6 3.6 9.5 6.8 14.3 9.6 3.3-2 6.2-3.8 8.4-5.4-.3-1.8-.6-3.1-.4-5.5.1-1.1.6-3 .6-3.8 0 .4.2 1.8 1 3.5 1.1 2.1 2.7 2.4 3.2 2.5 12.6-9.4 23.1-21.8 23.1-39.4V41.7c-2.7-.7-15.4-5.6-35.6-5.6zM33.7 40c8-3 20.2-6.8 39-6.8 18.9 0 31.9 4.1 39 6.8v27.8c0 26.5-22.6 41.8-39 51.4-17.2-10.2-39-25.1-39-51.4V40z"></path>
      <a xlink:href="http://www.psu.edu" target="_blank" tabindex="0">
        <path class="hoverfill" d="M111.6 40v27.8c0 26.5-22.6 41.8-39 51.4-17.2-10.2-39-25.1-39-51.4V40c8-3 20.2-6.8 39-6.8 19 .1 32 4.2 39 6.8zM83.8 93.1c2.1-.5 3.2-2.1 3.2-2.8 0-.6-1.1-1.3-3.4-1.3-2.5 0-8.8 1-8.8 2.4 0 .9.8 2 5.2 2 2.8 0 3.5-.2 3.8-.3z"></path>
      </a>
      <a xlink:href="http://www.psu.edu" target="_blank" tabindex="0">
        <path class="hoverfill" d="M118 36h305v36H118z"></path>
      </a>
      <a xlink:href="http://www.science.psu.edu" target="_blank" tabindex="0">
        <path class="hoverfill" d="M118 71h305v37H118z"></path>
      </a>
    </svg>'
    )
  )

  return(logo)
}

#' PennState Logo
#'
#' @param style Logo style \code{[default, reversed, grayscale]}
#'
#' @return html
#'
#' @section Example:
#'   \figure{PS_HOR_RGB_2C.png}{options: width=250 alt="Default"}
#' @seealso \href{http://visualidentity.psu.edu/}{http://visualidentity.psu.edu/}
#' @export
 <- function(style = "default"){
  
  colors <- logo_colors(style)
  
  logo <- HTML(
    paste0('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 259.48 81.66">
        <defs><style>.cls-1{fill:#fff}</style></defs>
        <title>
          The Pennsylvania State University
        </title>
        
        <path fill="#FFFFFF" d="M37 81.66C20.64 71.92 0 57.78 0 32.8V6.43C7.55 3.57 19.21 0 37 0c18 0 30.35 3.89 37 6.43V32.8C74 58 52.57 72.5 37 81.66z"/>
        <path fill="', colors$primary ,'" d="M48.14 47.5c0-.56.46-1.43.46-2.2s-1.13-1.22-2-1.34c-1.85-.26-2.47-.17-2.47-.58s.25-.58.59-1.06A3.49 3.49 0 0147 41.25a19.22 19.22 0 012.87-.25 16.18 16.18 0 012.77.27c1.13.2 1.31.67 1.31 1.2V43c0 .54-.44.82-1.23 1l-.61.12c-.57.12-1.28.23-1.53 1-.54 1.55-1.48 2.77-2.18 2.74-.13-.04-.26-.13-.26-.36zm1.63-25c-.07 0-.31-.13-.31-.37s.2-.55.6-1.09c.93-1.24 2.2-2.77 2.67-2.77.23 0 .37.16.65.69a3.13 3.13 0 01.31 1.35 6.92 6.92 0 01-1.45 4.12 12.16 12.16 0 00-2.47-1.98zm-27.19 3.03c.42 0 .74-.28 1.36-1 1.41-1.56 2.77-1.77 2.77-2.43a1.81 1.81 0 00-.39-.9 58 58 0 01-3-5.3c-.32-.62-.74-1-1.07-1-.51 0-1.06.6-1.38 1.12a4.85 4.85 0 00-.87 2.3 16.23 16.23 0 00.75 4.52c.46 1.43 1.19 2.69 1.83 2.69zm16.9 5.41a2.82 2.82 0 00-3-2.38 3.66 3.66 0 00-3.31 2.26 3.42 3.42 0 002.41 2.1c.22.07.43.07.43.26s-.27.39-.85.39a4.17 4.17 0 01-3.41-1.39 13.24 13.24 0 01-1.71.28c-.56 0-.81-.36-.81-.86a2.51 2.51 0 01.28-1.07l.3-.6a5.49 5.49 0 012.4-2.76l1-.57a4.88 4.88 0 012.79-.69h.83a3.6 3.6 0 012.63.89c1.21 1 1.88 1.57 1.88 2.32a3.37 3.37 0 01-.72 2.37 3 3 0 01-2 1.26c-.15 0-.2-.09-.2-.17s.13-.17.26-.28a3.11 3.11 0 00.8-1.36zm8.13 25.94a15.15 15.15 0 01-3.71.23c-4.2 0-4.91-1-4.91-1.85 0-1.37 6-2.33 8.39-2.33s3.28.73 3.28 1.29-1.03 2.17-3.05 2.66zM23.38 69.17A132 132 0 0037 78.33c0-4.11-.09-6.54 2.69-9.45L43 65.41c.79-.82 1.43-1.43 1.81-1.43s.38.14.38.5a8.42 8.42 0 001 3.33 4.17 4.17 0 003.07 2.38c11.93-9 21.9-20.73 21.9-37.45V8.38c-2.94-1-15-5.63-34.2-5.63S5.75 7.38 2.8 8.38v24.36A38.63 38.63 0 007.91 52.1c.31-3.39 2.6-5 2.6-8.32 0-2.32-.66-3.78-.66-5.73 0-3.51 4.75-10.73 7.21-13.68.07-.08.23-.29.43-.29a.5.5 0 01.41.29c.25.38.36.58.63.58s.37-.15.37-.39a20.66 20.66 0 01-.7-5.62c0-2.79.64-3.38 2.38-5.08a3.86 3.86 0 012.21-1.25c1 0 1.54.61 2.18 1.26 1.07 1.09 2.57 3 2.81 3.33a.34.34 0 00.28.16c.49 0 .91-.15 3.06-.15A51.38 51.38 0 0144 18.82a21.93 21.93 0 002.3.86c.2 0 .22-.13.22-.23s-.42-.52-.42-.79a.46.46 0 01.29-.38c2.26-1.22 4.2-2.14 6-2.14 1 0 1.54.89 2 1.77a6 6 0 01.7 2.56 7.89 7.89 0 01-1.64 4.88c.35.36.84.9 1.14 1.26A4 4 0 0155.67 29a8.06 8.06 0 01-.29 1.43c0 .21-.23.63-.59.62s-.42-.36-.43-.68v-.24a3.67 3.67 0 00-3.09-3.58H51a3.11 3.11 0 00-2.42 1 2.32 2.32 0 00-.75 1.7 4.78 4.78 0 00.67 1.69c.23.45.81 1.53 1.12 2.08a1.14 1.14 0 001 .65c1 0 1.83-.13 1.83-.42 0-.08-.05-.15-.18-.15H52c-1.28 0-2-1.62-2.59-3.09a2.7 2.7 0 012-1 2 2 0 012.1 2 3 3 0 01-.27 1.22.53.53 0 00-.07.23c0 .17.21.21.56.29l.5.12a1.48 1.48 0 01.94.88l.42 1.15a8 8 0 01.55 2.64 7.77 7.77 0 01-.38 2.58 14.61 14.61 0 00-.63 2.79 4.57 4.57 0 01.21.46 5.59 5.59 0 01.5 2.21v.75a5.62 5.62 0 01-1.21 3.42c-.48.66-1.18 1.59-1.58 2.1a1.35 1.35 0 01-1 .54 2.58 2.58 0 01-.63-.12l-1-.25A2 2 0 0149 50.45l-.21-.53c-.21-.52-.32-.86-.65-.86s-.47.16-.71.52a3.9 3.9 0 01-2.81 2.12c-.53.13-1.59.35-2.18.48a20.2 20.2 0 01-3.44.62h-.6a4.65 4.65 0 01-3.63-2.09c-2.11-2.51-1.89-2.87-2-6.27 0-.38-.14-.85-.53-.85s-.51.72-.64 1.74c-.15 1.2-.43 2.45-1 2.45a4 4 0 01-1.32-.27l-3.68-1.23c-1.36-.45-2.67-.81-3.2-2l-.94-2.18c-.16-.39-.28-.59-.53-.59s-.45.43-.49.77-.14 1.28-.19 1.83a7.69 7.69 0 01-1.68 4.7c-.46.6-.9 1.22-1.4 1.89a7.94 7.94 0 00-1.65 5.51v1.65c.08 3.96 1.1 5.92 7.86 11.31z"/>
        <path fill="', colors$secondary ,'" d="M55.17 33.7l.42 1.15a8 8 0 01.55 2.64 7.77 7.77 0 01-.38 2.58 14.61 14.61 0 00-.63 2.79c-.11-.23-2.17-3.78-2.32-4.07a1.81 1.81 0 01-.29-.9c0-.36.15-.58.59-.86.26-.16.61-.36.84-.48a2 2 0 001.31-1.93 5.85 5.85 0 00-.09-.92zm-9 5.68a2.56 2.56 0 01.2.83 1.21 1.21 0 01-.42 1c-.18.15-.38.32-.55.49a1.89 1.89 0 00-.73.6c-.34.48-.59.78-.59 1.06a.24.24 0 00.09.2 1.45 1.45 0 01-.57-1.18c0-.38.12-.57.12-.92a2.76 2.76 0 00-.13-.76c-.57-1.91-1.53-4.18-2.13-5.72s-1.07-2.44-1.75-2.44c-.38 0-.72.19-1.12.19a3 3 0 002-1.26 3.37 3.37 0 00.72-2.37 1.55 1.55 0 00-.43-1 11.38 11.38 0 012 3.24c1.28 2.74 2.39 5.72 3.33 8.04zM15.51 57.81v-1.65a7.94 7.94 0 011.65-5.51c.5-.67.94-1.29 1.4-1.89a7.69 7.69 0 001.68-4.7c.05-.55.14-1.44.19-1.83s.12-.77.49-.77.37.2.53.59l.94 2.18c.53 1.21 1.84 1.57 3.2 2l3.68 1.23a4 4 0 001.32.27c.59 0 .87-1.25 1-2.45.13-1 .28-1.74.64-1.74s.52.47.53.85c.13 3.4-.09 3.76 2 6.27a4.65 4.65 0 003.63 2.09 1.71 1.71 0 01-1-1.78v-1.2a4.72 4.72 0 01.37-1.94c.15-.33.31-.93.47-1.29a2 2 0 00.14-1.22 7.09 7.09 0 00-.52-2c-.19-.57-.44-1.4-.69-2.08-.76-2.13-1.07-2.63-3.62-3l-5.14-.72c-2.86-.41-5.1-.54-6.26-2.46-1.4-2.3-1.25-5.06-2.59-5.06-.64 0-1 .71-1 1.75s.42 2.85.42 5.92c0 2.65-.25 3.38-1.8 5.34-.4.5-.94 1.25-1.28 1.68-1.15 1.44-1.66 2.26-1.59 3.94a56.83 56.83 0 001.21 9.18zM44.67 68c.09-1.07.56-2.84.56-3.56 0-.36-.12-.5-.38-.5s-1 .61-1.81 1.43l-3.34 3.51c-2.78 2.91-2.65 5.34-2.69 9.45 3.09-1.86 5.92-3.66 8-5.09a16.28 16.28 0 01-.34-5.24z"/>
        <path fill="', colors$font ,'" d="M246.88 33.53h12.6c-.06-6.48-3.18-10.2-8.58-10.2S242 27 242 32.7c0 2.16.71 9.2 9.75 9.2a16.52 16.52 0 006.5-1.08v-3.36a13.56 13.56 0 01-5.42 1.06c-3.53 0-5.83-2.03-5.95-4.99zm-17.83-6.61h2.45V37c0 3 2.18 4.92 5.7 4.92a15.75 15.75 0 003.8-.53v-3.11a11.06 11.06 0 01-2 .24c-2.18 0-3-.94-3-3.36v-8.24h4.84v-3.17H236v-3.88h-4.5v3.88h-2.45zm-13.54.16a10 10 0 013-.57c2.65 0 3.83 1.12 3.83 3.63v1.05h-2.35c-5.95 0-9.1 1.95-9.1 5.63 0 3.09 2.31 5.08 5.88 5.08a6.66 6.66 0 005.82-2.9h.13l.14 2.47h5.51v-3.16h-1.87v-8c0-4.6-2.72-6.94-8.1-6.94a15 15 0 00-6.69 1.8v4.32h3.8zm-18.19-.16h2.46V37c0 3 2.18 4.92 5.69 4.92a15.86 15.86 0 003.81-.53v-3.11a11.66 11.66 0 01-2 .24c-2.18 0-3-.94-3-3.36v-8.24h4.84v-3.17h-4.84v-3.88h-4.49v3.88h-2.46zm-15.06 10.67v-3.08H178v6.09a23.84 23.84 0 008.07 1.3c6 0 9.32-2.67 9.32-7.52s-3.62-6.28-7-7.18l-2.39-.63c-2-.49-3-1.55-3-3.13s1.27-3.06 4.12-3.06a8.94 8.94 0 013 .62v2.91h4.22v-5.48a21.64 21.64 0 00-7.38-1.22c-5.73 0-8.89 2.38-8.89 6.71 0 3.87 1.8 5.93 6.21 7.12l2.07.57c2.89.78 4.07 1.83 4.07 3.62 0 2-1.41 3.08-4 3.08a18.46 18.46 0 01-4.16-.72zm-66.37-4.06h12.6c-.05-6.48-3.17-10.2-8.57-10.2S111 27 111 32.7c0 2.16.7 9.2 9.75 9.2a16.56 16.56 0 006.5-1.08v-3.36a13.57 13.57 0 01-5.43 1.06c-3.5 0-5.82-2.03-5.93-4.99zm27.27 8h8.53v-3.22h-2.07v-7.94c0-4.28-2.68-7-6.83-7a6.49 6.49 0 00-5.68 2.79H137l-.14-2.37h-6.3v3.17h2.36v11.35h-2v3.18h8.54v-3.18h-2.06V31.2c0-2.59 1.41-4.07 3.85-4.07s3.88 1.48 3.88 4.07v7.11h-2zm-52.94 0h9.47v-3.22h-2.38v-6.16h3.85c5.46 0 8.72-2.72 8.72-7.26s-3.26-7.26-8.72-7.26H90.22v3.17h2.39v17.51h-2.39zm128-2.76c-2.09 0-2.84-1.27-2.84-2.36 0-1.8 1.61-2.56 5.37-2.56h1.53V34c-.05 3.24-2.15 4.73-4.11 4.73zm28.66-8.17c.17-2.58 1.66-4.26 3.9-4.26 2.41 0 3.85 1.53 3.85 4.09v.17zm-131 0c.21-2.68 1.65-4.26 3.9-4.26 2.41 0 3.84 1.53 3.84 4.09v.17zM100.64 29h-3.33v-8.2h3.26c2.73 0 4.42 1.57 4.42 4.09S103.33 29 100.64 29zm65.67 12.52h8.54v-3.21h-2.08v-7.94c0-4.28-2.68-7-6.82-7a6.53 6.53 0 00-5.69 2.79h-.11l-.15-2.41h-6.3v3.17h2.35v11.39h-2v3.18h8.53v-3.18h-2.07V31.2c0-2.59 1.4-4.07 3.85-4.07s3.87 1.48 3.87 4.07v7.11h-2z"/>
        <a xlink:href="http://psu.edu" target="_blank" tabindex="0">
          <rect style="fill:transparent;" width="259.5" height="81.7"/>
        </a>
      </svg>'
    )
  )
  
  return(logo)
}

#' Creative Commons CC BY-NC-SA 4.0 Logo
#'
#' Renders licensing info as HTML.
#'
#' @details
#' # License Details
#'     Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International
#' ## Attribution
#'     You must give appropriate credit, provide a link to the license, and indicate if changes were made.
#'     You may do so in any reasonable manner, but not in any way that suggests the licensor endorses you or your use.
#' ## NonCommercial
#'     You may not use the material for commercial purposes.
#' ## ShareAlike
#'     If you remix, transform, or build upon the material, you must distribute your contributions under the same license as the original.
#' ## No additional restrictions
#'     You may not apply legal terms or technological measures that legally restrict others from doing anything the license permits.
#'
#' @return html
#'
#' @section Example:
#'   \figure{CC-BY-NC-SA-4.0.png}{options: width=250 alt="Default"}
#' @seealso \href{https://creativecommons.org/licenses/by-nc-sa/4.0/}{https://creativecommons.org/licenses/by-nc-sa/4.0/}
#' @export
copyrightInfo <- function() {
  license <- HTML(
    '<div id="licensing">
      <h2>Licensing</h2>
      <p>Except where otherwise noted, content on this app is licensed under <a href="https://creativecommons.org/licenses/by-nc-sa/4.0/" target="_blank">CC BY-NC-SA 4.0</a>.</p>
      <svg id="cc-by-nc-sa-4-license" class="license" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 298 68">
        <title>Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License</title>
        <circle fill="transparent" cx="35.1" cy="34.19" r="28.84" shape-rendering="geometricPrecision"/>
          <path fill="currentColor" d="M34.75,2.19a31.21,31.21,0,0,1,22.86,9.37,30.78,30.78,0,0,1,6.86,10.31,32.65,32.65,0,0,1,2.34,12.32A32.67,32.67,0,0,1,64.5,46.5a29.26,29.26,0,0,1-6.83,10.14A32.85,32.85,0,0,1,47,63.73a31.82,31.82,0,0,1-12.28,2.46,31.16,31.16,0,0,1-12.15-2.43,32.26,32.26,0,0,1-10.4-7,32,32,0,0,1-7-10.37A31.95,31.95,0,0,1,5.24,22,32.09,32.09,0,0,1,12.3,11.5,30.22,30.22,0,0,1,34.75,2.19ZM34.87,8a24.79,24.79,0,0,0-18.46,7.66,27.54,27.54,0,0,0-5.8,8.6,25.35,25.35,0,0,0,0,19.88,26.65,26.65,0,0,0,5.8,8.52,26.38,26.38,0,0,0,8.52,5.71,25.51,25.51,0,0,0,9.94,2,25.86,25.86,0,0,0,10-2,27.76,27.76,0,0,0,8.72-5.78A24.57,24.57,0,0,0,61,34.19,26.42,26.42,0,0,0,59.1,24.13a25.67,25.67,0,0,0-5.66-8.46A25.31,25.31,0,0,0,34.87,8Zm-.4,20.92L30.18,31.1a4.49,4.49,0,0,0-1.68-2,3.82,3.82,0,0,0-1.86-.57q-4.29,0-4.29,5.66a7,7,0,0,0,1.09,4.11,3.66,3.66,0,0,0,3.2,1.55,4,4,0,0,0,3.94-2.75l3.94,2a9.38,9.38,0,0,1-8.4,5,9.32,9.32,0,0,1-6.91-2.63,9.89,9.89,0,0,1-2.63-7.31,9.88,9.88,0,0,1,2.66-7.26A9,9,0,0,1,26,24.25C29.92,24.25,32.75,25.79,34.47,28.88Zm18.46,0L48.7,31.1a4.45,4.45,0,0,0-1.69-2,3.9,3.9,0,0,0-1.91-.57q-4.29,0-4.29,5.66A7,7,0,0,0,41.9,38.3a3.65,3.65,0,0,0,3.2,1.55A4,4,0,0,0,49,37.1l4,2a9.81,9.81,0,0,1-3.54,3.69,9.22,9.22,0,0,1-4.86,1.34A9.28,9.28,0,0,1,37.7,41.5a9.91,9.91,0,0,1-2.6-7.31,9.87,9.87,0,0,1,2.65-7.26,9,9,0,0,1,6.72-2.68Q50.41,24.25,52.93,28.88Z"/>
        <circle fill="transparent" cx="110.95" cy="34.49" r="28.28" shape-rendering="geometricPrecision"/>
          <path fill="currentColor" d="M110.76,2.19a30.92,30.92,0,0,1,22.74,9.25,31,31,0,0,1,9.31,22.75q0,13.49-9.14,22.45a31.61,31.61,0,0,1-22.91,9.55,31,31,0,0,1-22.52-9.43,30.83,30.83,0,0,1-9.43-22.57,31.38,31.38,0,0,1,9.43-22.74A30.62,30.62,0,0,1,110.76,2.19ZM110.87,8a24.9,24.9,0,0,0-18.46,7.66,25.73,25.73,0,0,0-7.83,18.57,25.16,25.16,0,0,0,7.77,18.4,25.3,25.3,0,0,0,18.52,7.77,25.7,25.7,0,0,0,18.63-7.83A24.36,24.36,0,0,0,137,34.19a25.25,25.25,0,0,0-7.66-18.57A25.18,25.18,0,0,0,110.87,8Zm8.57,18.28V39.33h-3.65V54.87h-10V39.33h-3.65V26.24a2,2,0,0,1,2-2h13.15a2,2,0,0,1,1.42.6A1.92,1.92,0,0,1,119.44,26.24ZM106.35,18q0-4.52,4.46-4.52c3,0,4.46,1.51,4.46,4.52s-1.49,4.45-4.46,4.45S106.35,21,106.35,18Z"/>
        <circle fill="transparent" cx="186.78" cy="34.42" r="29.47" shape-rendering="geometricPrecision"/>
          <path fill="currentColor" d="M186.75,2.19a30.93,30.93,0,0,1,22.75,9.25,30.84,30.84,0,0,1,9.31,22.75q0,13.49-9.14,22.46a31.64,31.64,0,0,1-22.92,9.54,30.73,30.73,0,0,1-22.51-9.49,30.74,30.74,0,0,1-9.43-22.51,31.41,31.41,0,0,1,9.43-22.75A30.65,30.65,0,0,1,186.75,2.19ZM162,25.56a25.2,25.2,0,0,0-1.43,8.63,25.16,25.16,0,0,0,7.77,18.4,26.09,26.09,0,0,0,37.15-.12,23.58,23.58,0,0,0,4.4-5.6L197.84,41.5a8.22,8.22,0,0,1-3.06,4.94,10.48,10.48,0,0,1-5.74,2.2v4.92h-3.72V48.64a14.8,14.8,0,0,1-9.71-3.82l4.4-4.46a10.22,10.22,0,0,0,7.14,2.91,5.12,5.12,0,0,0,2.83-.74,2.68,2.68,0,0,0,1.18-2.46,2.44,2.44,0,0,0-.86-1.94l-3.09-1.32-3.77-1.71-5.08-2.23ZM186.87,7.9a24.8,24.8,0,0,0-18.46,7.72,29.74,29.74,0,0,0-3.54,4.28l12.23,5.49a7.46,7.46,0,0,1,3-4,10.14,10.14,0,0,1,5.2-1.69V14.76H189v4.91a14.24,14.24,0,0,1,8,3l-4.17,4.29a9.43,9.43,0,0,0-5.49-1.88,6,6,0,0,0-2.65.57,2,2,0,0,0-1.17,1.94,1.37,1.37,0,0,0,.28.8l4.06,1.83,2.8,1.26,5.14,2.28,16.4,7.32a29.85,29.85,0,0,0,.8-6.86,25,25,0,0,0-7.66-18.57A25,25,0,0,0,186.87,7.9Z"/>
        <circle fill="transparent" cx="262.26" cy="34.32" r="29.1" shape-rendering="geometricPrecision"/>
          <path fill="currentColor" d="M262.76,2.19A30.93,30.93,0,0,1,285.5,11.5a30.76,30.76,0,0,1,9.31,22.69,30.49,30.49,0,0,1-9.14,22.51,31.58,31.58,0,0,1-22.91,9.49,31,31,0,0,1-22.52-9.43,30.83,30.83,0,0,1-9.43-22.57,31.34,31.34,0,0,1,9.43-22.69A30.68,30.68,0,0,1,262.76,2.19ZM262.87,8a24.83,24.83,0,0,0-18.46,7.71,25.57,25.57,0,0,0-7.83,18.52,25,25,0,0,0,7.77,18.4,25.3,25.3,0,0,0,18.52,7.77,25.7,25.7,0,0,0,18.63-7.83A24.49,24.49,0,0,0,289,34.19a25,25,0,0,0-7.66-18.52A25,25,0,0,0,262.87,8ZM248.58,29.67a14.26,14.26,0,0,1,4.75-9.11,14,14,0,0,1,9.31-3.23q7.55,0,12,4.86a17.69,17.69,0,0,1,4.46,12.45,17.15,17.15,0,0,1-4.63,12.26,15.79,15.79,0,0,1-12,4.89,14.24,14.24,0,0,1-9.37-3.26,13.87,13.87,0,0,1-4.75-9.26h8.06q.29,5.83,7,5.83a6.35,6.35,0,0,0,5.43-2.91,13.26,13.26,0,0,0,2.06-7.77q0-5.1-1.89-7.75A6.23,6.23,0,0,0,263.61,24q-6.39,0-7.2,5.65h2.35L252.41,36l-6.34-6.34Z"/>
        <a xlink:href="https://creativecommons.org/licenses/by-nc-sa/4.0/" target="_blank" tabindex="0">
          <rect fill="transparent" width="298" height="68"/>
        </a>
      </svg>
    </div>'
  )

  return(license)
}

#' Icons for Apps
#'
#' @param icon Icon style \code{[default, correct, incorrect, partial]}
#' @param width Icon width (in pixels)
#' @param html FALSE to render as shinyUI or TRUE to return html markup \code{[FALSE, TRUE]}
#'
#' @return <shiny.render.function> or html
#'
#' @examples
#' renderIcon("correct")
#' renderIcon("incorrect", width = 25, html = TRUE)
#'
#' @export
renderIcon <- function(icon = "default", width = 36, html = FALSE){

  # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
  # NOTE:                                                                                       #
  #   If we start getting a ton of icons it would be best to use this approach:                 #
  #   @link{https://github.com/rstudio/fontawesome/blob/master/tools/generate_fa_sysdata.R}     #
  # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #

  markup <- ""

  if (icon == "correct") {
     markup <- img(src = "icons/correct.png", alt = "Success, you are correct", width = width)
  } else if(icon == "incorrect") {
    markup <- img(src = "icons/incorrect.png", alt = "Sorry, you are incorrect; please check the feedback", width = width)
  } else if(icon == "partial") {
    markup <- img(src = "icons/partial.png", alt = "You're partially correct; please check the feedback", width = width)
  } else {
    # default
  }

  if (!html) {
    renderUI(markup)
  } else {
    return(markup)
  }
}

#' surveyLink
#' 
#' @param name Short Name for survey reference
#' @param markup Return link as markup or plain-text
#' 
#' @return UI Element or Text
#' 
#' @examples
#' surveyLink()
#' surveyLink(name = "App_Name")
#' surveyLink(markup = FALSE)
#' 
#' @export
surveyLink <- function(name = NA, markup = TRUE) {
  appName <- ""
  
  if(is.na(name)) {
    # Try to get the name from the meta file
    appName <- getAppTitle(case = "snake")
  } else {
    appName <- name  
  }
  
  link <- paste0("https://pennstate.qualtrics.com/jfe/form/SV_7TLIkFtJEJ7fEPz?appName=", htmltools::urlEncodePath(appName))
  
  if(markup) {
    link <- tags$a(id = "surveyLink", target = "_blank", icon(name = "comments", class = "fa-solid"), href = link)  
  }
  
  return(link)
}

#' complianceLinks
#' 
#' @return UI Element
#' 
#' @examples
#' complianceLinks()
#' 
#' @export
complianceLinks <- function() {
  markup <- tags$ul(class = "legal-links list-inline small",
    tags$li(tags$a(href = "mailto:boast-project@psu.edu", "Contact")),
    tags$li(tags$a(target = "_blank", href = "https://www.psu.edu/web-privacy-statement/", "Privacy")),
    tags$li(tags$a(target = "_blank", href = "https://www.psu.edu/accessibilitystatement/", "Accessibility")),
  )
}

#' sidebarFooter
#' 
#' @return UI Element
#' 
#' @examples
#' sidebarFooter()
#' 
#' @export
sidebarFooter <- function() {
  footer <- tags$div(class = "sidebar-footer",
    ("reversed"),
    complianceLinks()
  )
  
  return(footer)
}
EducationShinyAppTeam/boastUtils documentation built on June 5, 2024, 5:41 a.m.