├── vignettes ├── .gitignore ├── callbacks.Rmd ├── pagePiling.Rmd ├── multiScroll.Rmd └── fullPage.Rmd ├── LICENSE ├── fullPage.gif ├── .gitignore ├── docs ├── favicon.ico ├── favicon-16x16.png ├── favicon-32x32.png ├── apple-touch-icon.png ├── apple-touch-icon-60x60.png ├── apple-touch-icon-76x76.png ├── apple-touch-icon-120x120.png ├── apple-touch-icon-152x152.png ├── apple-touch-icon-180x180.png ├── pkgdown.yml ├── link.svg ├── docsearch.js ├── pkgdown.js ├── pkgdown.css ├── LICENSE-text.html ├── articles │ ├── index.html │ └── callbacks.html ├── authors.html ├── news │ └── index.html ├── index.html └── reference │ ├── sides.html │ ├── theme.html │ ├── container.html │ └── mp.html ├── revdep └── checks.rds ├── pkgdown ├── favicon │ ├── favicon.ico │ ├── favicon-16x16.png │ ├── favicon-32x32.png │ ├── apple-touch-icon.png │ ├── apple-touch-icon-120x120.png │ ├── apple-touch-icon-152x152.png │ ├── apple-touch-icon-180x180.png │ ├── apple-touch-icon-60x60.png │ └── apple-touch-icon-76x76.png └── _pkgdown.yml ├── .travis.yml ├── CRAN-RELEASE ├── demo ├── 00Index ├── appGallery.R ├── multiPage.R ├── pagePiling.R └── fullPage.R ├── NEWS.md ├── .Rbuildignore ├── R ├── zzz.R ├── fullTheme.R ├── fullContainer.R ├── multiSides.R ├── fullGrid.R ├── utils.R ├── fullPlot.R ├── pagePiling.R ├── fullButton.R └── multiPage.R ├── cran-comments.md ├── fullPage.Rproj ├── DESCRIPTION ├── man ├── theme.Rd ├── sides.Rd ├── container.Rd ├── mp.Rd ├── fullGrid.Rd ├── fp.Rd ├── fullPlot.Rd ├── button.Rd ├── pagePiling.Rd └── multiPage.Rd ├── inst ├── css │ ├── styles.css │ ├── jquery.multiscroll.min.css │ ├── jquery.pagepiling.min.css │ └── jquery.fullpage.min.css ├── jquery-3.2.1 │ └── jquery.easing.min.js └── js │ ├── jquery.pagepiling.min.js │ └── jquery.multiscroll.min.js ├── NAMESPACE ├── index.Rmd └── README.md /vignettes/.gitignore: -------------------------------------------------------------------------------- 1 | *.html 2 | *.R 3 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | YEAR: 2017 2 | COPYRIGHT HOLDER: John Coene 3 | -------------------------------------------------------------------------------- /fullPage.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RinteRface/fullPage/HEAD/fullPage.gif -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | inst/doc 2 | .Rproj.user 3 | .Rhistory 4 | .RData 5 | .vscode 6 | test.R 7 | -------------------------------------------------------------------------------- /docs/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RinteRface/fullPage/HEAD/docs/favicon.ico -------------------------------------------------------------------------------- /revdep/checks.rds: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RinteRface/fullPage/HEAD/revdep/checks.rds -------------------------------------------------------------------------------- /docs/favicon-16x16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RinteRface/fullPage/HEAD/docs/favicon-16x16.png -------------------------------------------------------------------------------- /docs/favicon-32x32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RinteRface/fullPage/HEAD/docs/favicon-32x32.png -------------------------------------------------------------------------------- /docs/apple-touch-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RinteRface/fullPage/HEAD/docs/apple-touch-icon.png -------------------------------------------------------------------------------- /pkgdown/favicon/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RinteRface/fullPage/HEAD/pkgdown/favicon/favicon.ico -------------------------------------------------------------------------------- /docs/apple-touch-icon-60x60.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RinteRface/fullPage/HEAD/docs/apple-touch-icon-60x60.png -------------------------------------------------------------------------------- /docs/apple-touch-icon-76x76.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RinteRface/fullPage/HEAD/docs/apple-touch-icon-76x76.png -------------------------------------------------------------------------------- /docs/apple-touch-icon-120x120.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RinteRface/fullPage/HEAD/docs/apple-touch-icon-120x120.png -------------------------------------------------------------------------------- /docs/apple-touch-icon-152x152.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RinteRface/fullPage/HEAD/docs/apple-touch-icon-152x152.png -------------------------------------------------------------------------------- /docs/apple-touch-icon-180x180.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RinteRface/fullPage/HEAD/docs/apple-touch-icon-180x180.png -------------------------------------------------------------------------------- /pkgdown/favicon/favicon-16x16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RinteRface/fullPage/HEAD/pkgdown/favicon/favicon-16x16.png -------------------------------------------------------------------------------- /pkgdown/favicon/favicon-32x32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RinteRface/fullPage/HEAD/pkgdown/favicon/favicon-32x32.png -------------------------------------------------------------------------------- /pkgdown/favicon/apple-touch-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RinteRface/fullPage/HEAD/pkgdown/favicon/apple-touch-icon.png -------------------------------------------------------------------------------- /pkgdown/favicon/apple-touch-icon-120x120.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RinteRface/fullPage/HEAD/pkgdown/favicon/apple-touch-icon-120x120.png -------------------------------------------------------------------------------- /pkgdown/favicon/apple-touch-icon-152x152.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RinteRface/fullPage/HEAD/pkgdown/favicon/apple-touch-icon-152x152.png -------------------------------------------------------------------------------- /pkgdown/favicon/apple-touch-icon-180x180.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RinteRface/fullPage/HEAD/pkgdown/favicon/apple-touch-icon-180x180.png -------------------------------------------------------------------------------- /pkgdown/favicon/apple-touch-icon-60x60.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RinteRface/fullPage/HEAD/pkgdown/favicon/apple-touch-icon-60x60.png -------------------------------------------------------------------------------- /pkgdown/favicon/apple-touch-icon-76x76.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RinteRface/fullPage/HEAD/pkgdown/favicon/apple-touch-icon-76x76.png -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | # R for travis: see documentation at https://docs.travis-ci.com/user/languages/r 2 | 3 | language: R 4 | sudo: false 5 | cache: packages 6 | -------------------------------------------------------------------------------- /CRAN-RELEASE: -------------------------------------------------------------------------------- 1 | This package was submitted to CRAN on 2020-03-14. 2 | Once it is accepted, delete this file and tag the release (commit 30fe8b0be9). 3 | -------------------------------------------------------------------------------- /demo/00Index: -------------------------------------------------------------------------------- 1 | appGallery embed multiple Shiny Apps with fullPage 2 | fullPage FullPage.js for Shiny. 3 | pagePiling pagePiling.js for Shiny. 4 | multiPage multiScroll.js for Shiny. 5 | -------------------------------------------------------------------------------- /NEWS.md: -------------------------------------------------------------------------------- 1 | # fullPage 0.1.1 2 | 3 | - Fix callbacks [#11](https://github.com/RinteRface/fullPage/issues/11) 4 | - Bump roxygen2 5 | 6 | # fullPage 0.0.1 7 | 8 | * Initial version 9 | 10 | -------------------------------------------------------------------------------- /.Rbuildignore: -------------------------------------------------------------------------------- 1 | ^CRAN-RELEASE$ 2 | ^.*\.Rproj$ 3 | ^\.Rproj\.user$ 4 | ^\.travis\.yml$ 5 | ^CONDUCT\.md$ 6 | ^cran-comments\.md$ 7 | ^revdep$ 8 | ^fullPage\.gif$ 9 | pkgdown 10 | docs 11 | index.Rmd 12 | ^\.vscode$ 13 | test.R 14 | -------------------------------------------------------------------------------- /docs/pkgdown.yml: -------------------------------------------------------------------------------- 1 | pandoc: 1.19.2.4 2 | pkgdown: 1.3.0 3 | pkgdown_sha: 42971af1df065ab4e804ce3ee741192468c8bbd4 4 | articles: 5 | callbacks: callbacks.html 6 | fullPage: fullPage.html 7 | multiScroll: multiScroll.html 8 | pagePiling: pagePiling.html 9 | 10 | -------------------------------------------------------------------------------- /R/zzz.R: -------------------------------------------------------------------------------- 1 | .onLoad <- function(libname, pkgname) { 2 | shiny::addResourcePath( 3 | "fp-css", 4 | system.file("css", package = "fullPage") 5 | ) 6 | shiny::addResourcePath( 7 | "fp-jquery", 8 | system.file("jquery-3.2.1", package = "fullPage") 9 | ) 10 | shiny::addResourcePath( 11 | "fp-js", 12 | system.file("js", package = "fullPage") 13 | ) 14 | } -------------------------------------------------------------------------------- /cran-comments.md: -------------------------------------------------------------------------------- 1 | ## Test environments 2 | * local OS X install, R 3.4.2 3 | * ubuntu 12.04 (on travis-ci), R 3.4.2 4 | * win-builder (devel and release) 5 | 6 | ## R CMD check results 7 | 8 | 0 errors | 0 warnings | 1 note 9 | 10 | * This is a new release. 11 | 12 | ## Reverse dependencies 13 | 14 | This is a new release, so there are no reverse dependencies. 15 | 16 | --- 17 | -------------------------------------------------------------------------------- /fullPage.Rproj: -------------------------------------------------------------------------------- 1 | Version: 1.0 2 | 3 | RestoreWorkspace: No 4 | SaveWorkspace: No 5 | AlwaysSaveHistory: Default 6 | 7 | EnableCodeIndexing: Yes 8 | UseSpacesForTab: Yes 9 | NumSpacesForTab: 2 10 | Encoding: UTF-8 11 | 12 | RnwWeave: Sweave 13 | LaTeX: pdfLaTeX 14 | 15 | AutoAppendNewline: Yes 16 | StripTrailingWhitespace: Yes 17 | 18 | BuildType: Package 19 | PackageUseDevtools: Yes 20 | PackageInstallArgs: --no-multiarch --with-keep.source 21 | PackageRoxygenize: rd,collate,namespace 22 | -------------------------------------------------------------------------------- /docs/link.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 8 | 12 | 13 | -------------------------------------------------------------------------------- /DESCRIPTION: -------------------------------------------------------------------------------- 1 | Package: fullPage 2 | Title: Three Families of Functions for Three Different Single Page 'Shiny' Apps 3 | Version: 0.1.1 4 | Authors@R: c( 5 | person("John", "Coene", email = "jcoenep@gmail.com", role = c("aut", "cre")), 6 | person(family = "RinteRface", role = "cph"), 7 | person(family = "jQuery Foundation", role = "cph"), 8 | person("CJ", family = "Patoilo", role = "cph"), 9 | person("Alvaro", "Trigo", role = "cph")) 10 | Description: Includes functions to build three full scrolling single page applications with 'Shiny'. 11 | License: MIT + file LICENSE 12 | Date: 2020-03-14 13 | Encoding: UTF-8 14 | LazyData: true 15 | Imports: shiny, jsonlite 16 | RoxygenNote: 7.1.1 17 | URL: https://github.com/RinteRface/fullPage 18 | BugReports: https://github.com/RinteRface/fullPage/issues 19 | Suggests: 20 | testthat, 21 | knitr, 22 | rmarkdown, 23 | htmltools 24 | VignetteBuilder: knitr 25 | -------------------------------------------------------------------------------- /man/theme.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/fullTheme.R 3 | \name{fullTheme} 4 | \alias{fullTheme} 5 | \alias{multiTheme} 6 | \alias{pageTheme} 7 | \title{Set theme} 8 | \usage{ 9 | fullTheme(theme) 10 | 11 | multiTheme(theme) 12 | 13 | pageTheme(theme) 14 | } 15 | \arguments{ 16 | \item{theme}{theme, see details.} 17 | } 18 | \description{ 19 | Set a theme. 20 | } 21 | \details{ 22 | Valid \code{theme}: 23 | \itemize{ 24 | \item{\code{aqua}} 25 | \item{\code{black}} 26 | \item{\code{blue}} 27 | \item{\code{dark2}} 28 | \item{\code{fuchsia}} 29 | \item{\code{gray}} 30 | \item{\code{green}} 31 | \item{\code{lime}} 32 | \item{\code{maroon}} 33 | \item{\code{navy}} 34 | \item{\code{olive}} 35 | \item{\code{orange}} 36 | \item{\code{purple}} 37 | \item{\code{red}} 38 | \item{\code{silver}} 39 | \item{\code{teal}} 40 | \item{\code{yellow}} 41 | } 42 | } 43 | \author{ 44 | John Coene, \email{jcoenep@gmail.com} 45 | } 46 | -------------------------------------------------------------------------------- /R/fullTheme.R: -------------------------------------------------------------------------------- 1 | #' Set theme 2 | #' 3 | #' Set a theme. 4 | #' 5 | #' @param theme theme, see details. 6 | #' 7 | #' @details 8 | #' Valid \code{theme}: 9 | #' \itemize{ 10 | #' \item{\code{aqua}} 11 | #' \item{\code{black}} 12 | #' \item{\code{blue}} 13 | #' \item{\code{dark2}} 14 | #' \item{\code{fuchsia}} 15 | #' \item{\code{gray}} 16 | #' \item{\code{green}} 17 | #' \item{\code{lime}} 18 | #' \item{\code{maroon}} 19 | #' \item{\code{navy}} 20 | #' \item{\code{olive}} 21 | #' \item{\code{orange}} 22 | #' \item{\code{purple}} 23 | #' \item{\code{red}} 24 | #' \item{\code{silver}} 25 | #' \item{\code{teal}} 26 | #' \item{\code{yellow}} 27 | #' } 28 | #' 29 | #' @author John Coene, \email{jcoenep@@gmail.com} 30 | #' 31 | #' @rdname theme 32 | #' @export 33 | fullTheme <- function(theme){ 34 | .Deprecated("shinytheme", "shinythemes") 35 | } 36 | 37 | #' @rdname theme 38 | #' @export 39 | multiTheme <- fullTheme 40 | 41 | #' @rdname theme 42 | #' @export 43 | pageTheme <- fullTheme 44 | -------------------------------------------------------------------------------- /inst/css/styles.css: -------------------------------------------------------------------------------- 1 | #tocMenu li { 2 | display:inline-block; 3 | margin: 10px; 4 | color: #000; 5 | background:#fff; 6 | background: rgba(255,255,255, 0.5); 7 | -webkit-border-radius: 4px; 8 | border-radius: 4px; 9 | } 10 | #tocMenu li.active{ 11 | background:#666; 12 | background: rgba(0,0,0, 0.5); 13 | color: #fff; 14 | } 15 | #tocMenu li a{ 16 | text-decoration:none; 17 | color: #000; 18 | } 19 | #tocMenu li.active a:hover{ 20 | color: #000; 21 | } 22 | #tocMenu li:hover{ 23 | background: rgba(255,255,255, 0.8); 24 | } 25 | #tocMenu li a, 26 | #tocMenu li.active a{ 27 | padding: 9px 18px; 28 | display:block; 29 | } 30 | #tocMenu li.active a{ 31 | color: #fff; 32 | } 33 | #tocMenu{ 34 | text-align: left; 35 | position:fixed; 36 | top:0; 37 | left:0; 38 | height: 40px; 39 | z-index: 70; 40 | width: 100%; 41 | padding: 0; 42 | margin:0; 43 | } 44 | .in{ 45 | position: absolute; 46 | top: 200px; 47 | left: 0; 48 | width: 100%; 49 | } 50 | .wrapper{ 51 | position: relative; 52 | width: 100%; /* for IE 6 */ 53 | } 54 | -------------------------------------------------------------------------------- /NAMESPACE: -------------------------------------------------------------------------------- 1 | # Generated by roxygen2: do not edit by hand 2 | 3 | export(fullButton) 4 | export(fullButtonCustom) 5 | export(fullButtonDown) 6 | export(fullButtonLeft) 7 | export(fullButtonRight) 8 | export(fullButtonTo) 9 | export(fullButtonUp) 10 | export(fullColumn) 11 | export(fullContainer) 12 | export(fullPage) 13 | export(fullRow) 14 | export(fullSection) 15 | export(fullSectionImage) 16 | export(fullSectionPlot) 17 | export(fullSlide) 18 | export(fullSlideImage) 19 | export(fullSlidePlot) 20 | export(fullTheme) 21 | export(multiButton) 22 | export(multiButtonDown) 23 | export(multiButtonTo) 24 | export(multiButtonUp) 25 | export(multiColumn) 26 | export(multiContainer) 27 | export(multiLeft) 28 | export(multiPage) 29 | export(multiRight) 30 | export(multiRow) 31 | export(multiSection) 32 | export(multiSectionImage) 33 | export(multiSectionPlot) 34 | export(multiTheme) 35 | export(pageButton) 36 | export(pageButtonDown) 37 | export(pageButtonTo) 38 | export(pageButtonUp) 39 | export(pageColumn) 40 | export(pageContainer) 41 | export(pagePiling) 42 | export(pageRow) 43 | export(pageSection) 44 | export(pageSectionImage) 45 | export(pageSectionPlot) 46 | export(pageTheme) 47 | -------------------------------------------------------------------------------- /pkgdown/_pkgdown.yml: -------------------------------------------------------------------------------- 1 | template: 2 | params: 3 | bootswatch: united 4 | 5 | navbar: 6 | title: "fullPage" 7 | left: 8 | - icon: fa-home 9 | href: index.html 10 | - icon: fa-balance-scale 11 | href: LICENSE.html 12 | - icon: fa-newspaper-o 13 | href: news/index.html 14 | - icon: fa-code 15 | href: "reference/" 16 | - text: "fullPage" 17 | href: "articles/fullPage.html" 18 | - text: "pagePiling" 19 | href: "articles/pagePiling.html" 20 | - text: "multiScroll" 21 | href: "articles/multiScroll.html" 22 | right: 23 | - text: Callbacks 24 | href: "articles/callbacks.html" 25 | - icon: fa-github fa-lg 26 | href: https://github.com/RinteRface/fullPage 27 | 28 | reference: 29 | - title: "Fullpage" 30 | desc: "Create a fullpage shiny app." 31 | contents: 32 | - starts_with("full") 33 | - title: "Multiscroll" 34 | desc: "Create a multiscroll shiny app." 35 | contents: 36 | - starts_with("multi") 37 | - title: "Pagepiling" 38 | desc: "Create a pagepile shiny app." 39 | contents: 40 | - starts_with("page") 41 | 42 | authors: 43 | John Coene: 44 | href: http://john-coene.com 45 | RinteRFace: 46 | href: http://rinterface.com 47 | -------------------------------------------------------------------------------- /man/sides.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/multiSides.R 3 | \name{multiLeft} 4 | \alias{multiLeft} 5 | \alias{multiRight} 6 | \title{Create multi sections} 7 | \usage{ 8 | multiLeft(..., align = NULL) 9 | 10 | multiRight(..., align = NULL) 11 | } 12 | \arguments{ 13 | \item{...}{any element.} 14 | 15 | \item{align}{text alignment passed to \code{CSS}, takes \code{left}, \code{right} or \code{center}.} 16 | } 17 | \description{ 18 | Create multi page sides; left and right. 19 | } 20 | \details{ 21 | Only use one of each in \code{\link{multiPage}}. 22 | } 23 | \examples{ 24 | if(interactive()){ 25 | library(shiny) 26 | 27 | ui <- multiPage( 28 | multiLeft( 29 | multiSection( 30 | align = "right", 31 | h1("Left") 32 | ), 33 | multiSection( 34 | align = "center", 35 | h1("Left Again") 36 | ) 37 | ), 38 | multiRight( 39 | multiSection( 40 | align = "left", 41 | h1("Right") 42 | ), 43 | multiSection( 44 | align = "center", 45 | h1("Right again") 46 | ) 47 | ) 48 | ) 49 | 50 | server <- function(input, output){} 51 | 52 | shinyApp(ui, server) 53 | } 54 | } 55 | \author{ 56 | John Coene, \email{jcoenep@gmail.com} 57 | } 58 | -------------------------------------------------------------------------------- /vignettes/callbacks.Rmd: -------------------------------------------------------------------------------- 1 | --- 2 | title: "Callbacks" 3 | author: "John Coene" 4 | date: "`r Sys.Date()`" 5 | output: rmarkdown::html_vignette 6 | vignette: > 7 | %\VignetteIndexEntry{Callbacks} 8 | %\VignetteEngine{knitr::rmarkdown} 9 | %\VignetteEncoding{UTF-8} 10 | --- 11 | 12 | ```{r setup, include = FALSE} 13 | knitr::opts_chunk$set( 14 | collapse = TRUE, 15 | comment = "#>" 16 | ) 17 | ``` 18 | 19 | Callbacks let you pick up on events, i.e.: which slide is currently being viewed. For instance, it comes in handy to display animations at the right moment! Below are the callbacks available to each family of functions: 20 | 21 | **fullPage** 22 | 23 | - `input$fp_origin`: origin slide 24 | - `input$fp_destination`: destination slide 25 | - `input$fp_direction`: scroll direction 26 | 27 | **pagePiling & multiScroll** 28 | 29 | - `input$fp_anchor`: slide anchor 30 | - `input$fp_index`: slide index 31 | 32 | Demo: 33 | 34 | ```r 35 | library(shiny) 36 | library(fullPage) 37 | 38 | ui <- fullPage( 39 | fullSection( 40 | menu = "first", 41 | center = TRUE, 42 | h1("Callbacks") 43 | ), 44 | fullSection( 45 | menu = "second", 46 | center = TRUE, 47 | h3("Slide"), 48 | verbatimTextOutput("slide") 49 | ) 50 | ) 51 | 52 | server <- function(input, output){ 53 | 54 | output$slide <- renderPrint({ 55 | input$fp_origin # returns menu 56 | }) 57 | 58 | } 59 | 60 | shinyApp(ui, server) 61 | ``` 62 | -------------------------------------------------------------------------------- /man/container.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/fullContainer.R 3 | \name{fullContainer} 4 | \alias{fullContainer} 5 | \alias{pageContainer} 6 | \alias{multiContainer} 7 | \title{Add containers} 8 | \usage{ 9 | fullContainer(..., class = "") 10 | 11 | pageContainer(..., class = "") 12 | 13 | multiContainer(..., class = "") 14 | } 15 | \arguments{ 16 | \item{...}{any element.} 17 | 18 | \item{class}{Class of element.} 19 | } 20 | \description{ 21 | Add a container. 22 | } 23 | \details{ 24 | Pass within your grid, sections or slides. 25 | } 26 | \examples{ 27 | if(interactive()){ 28 | library(shiny) 29 | 30 | ui <- fullPage( 31 | center = TRUE, 32 | fullSection( 33 | h1("Containers") 34 | ), 35 | fullSection( 36 | h1("Without container"), 37 | plotOutput("plot1") 38 | ), 39 | fullSection( 40 | fullContainer( 41 | h1("With container"), 42 | plotOutput("plot2"), 43 | pre( 44 | code( 45 | "fullContainer()" 46 | ) 47 | ) 48 | ) 49 | ) 50 | ) 51 | 52 | server <- function(input, output){ 53 | output$plot1 <- renderPlot({ 54 | plot(mtcars$wt, mtcars$mpg) 55 | }) 56 | 57 | output$plot2 <- renderPlot({ 58 | plot(mtcars$wt, mtcars$mpg) 59 | }) 60 | } 61 | 62 | shinyApp(ui, server) 63 | } 64 | 65 | } 66 | \author{ 67 | John Coene, \email{jcoenep@gmail.com} 68 | } 69 | -------------------------------------------------------------------------------- /demo/appGallery.R: -------------------------------------------------------------------------------- 1 | library(shiny) 2 | library(fullPage) 3 | library(rvest) 4 | library(htmltools) 5 | library(purrr) 6 | library(httr) 7 | library(parallel) 8 | 9 | base_url <- "https://shiny.rstudio.com/" 10 | 11 | shinyapps_url <- "https://gallery.shinyapps.io/" 12 | 13 | # get all apps 14 | apps <- read_html(paste0(base_url, "gallery/")) %>% 15 | html_nodes(css = ".gallery-app-item") %>% 16 | html_children() %>% 17 | html_nodes(css = "a") %>% 18 | html_attr("href") 19 | 20 | # only recover the app name 21 | appNames <- map(apps, gsub, pattern = "/gallery/", replacement = "") 22 | appNames <- map(appNames, gsub, pattern = ".html", replacement = "") 23 | 24 | # build urls 25 | urls <- lapply(seq_along(apps), FUN = function(i) { 26 | paste0(shinyapps_url, appNames[[i]]) 27 | }) 28 | 29 | # test for 404 error or other tp select only good urls (do it in parallel) 30 | # since httr::GET is very slow 31 | test_url <- mclapply(urls, GET, mc.cores = detectCores()) 32 | good_url_index <- unlist( 33 | lapply(seq_along(test_url), FUN = function(i) { 34 | if (test_url[[i]]$status_code == 200) i else NULL 35 | }) 36 | ) 37 | good_urls <- urls[good_url_index] 38 | 39 | 40 | # unleash the daemon 41 | ui <- fullPage( 42 | lapply( 43 | X = seq_along(good_urls), 44 | FUN = function(i) { 45 | fullSection( 46 | menu = i, 47 | tags$iframe(src = good_urls[[i]], width = "100%", height = "100%") 48 | ) 49 | } 50 | ) 51 | ) 52 | 53 | server <- function(input, output){} 54 | 55 | shinyApp(ui, server) 56 | -------------------------------------------------------------------------------- /R/fullContainer.R: -------------------------------------------------------------------------------- 1 | #' Add containers 2 | #' 3 | #' Add a container. 4 | #' 5 | #' @param ... any element. 6 | #' @param class Class of element. 7 | #' 8 | #' @details Pass within your grid, sections or slides. 9 | #' 10 | #' @examples 11 | #' if(interactive()){ 12 | #' library(shiny) 13 | #' 14 | #' ui <- fullPage( 15 | #' center = TRUE, 16 | #' fullSection( 17 | #' h1("Containers") 18 | #' ), 19 | #' fullSection( 20 | #' h1("Without container"), 21 | #' plotOutput("plot1") 22 | #' ), 23 | #' fullSection( 24 | #' fullContainer( 25 | #' h1("With container"), 26 | #' plotOutput("plot2"), 27 | #' pre( 28 | #' code( 29 | #' "fullContainer()" 30 | #' ) 31 | #' ) 32 | #' ) 33 | #' ) 34 | #' ) 35 | #' 36 | #' server <- function(input, output){ 37 | #' output$plot1 <- renderPlot({ 38 | #' plot(mtcars$wt, mtcars$mpg) 39 | #' }) 40 | #' 41 | #' output$plot2 <- renderPlot({ 42 | #' plot(mtcars$wt, mtcars$mpg) 43 | #' }) 44 | #' } 45 | #' 46 | #' shinyApp(ui, server) 47 | #' } 48 | #' 49 | #' @author John Coene, \email{jcoenep@@gmail.com} 50 | #' 51 | #' @rdname container 52 | #' @export 53 | fullContainer <- function(..., class = ""){ 54 | cl <- paste("container", class) 55 | shiny::tags$div( 56 | class = cl, 57 | ... 58 | ) 59 | } 60 | 61 | #' @rdname container 62 | #' @export 63 | pageContainer <- fullContainer 64 | 65 | #' @rdname container 66 | #' @export 67 | multiContainer <- fullContainer 68 | -------------------------------------------------------------------------------- /inst/css/jquery.multiscroll.min.css: -------------------------------------------------------------------------------- 1 | /*! 2 | * multiscroll.js 0.1.8 Beta 3 | * https://github.com/alvarotrigo/multiscroll.js 4 | * @license MIT licensed 5 | * 6 | * Copyright (C) 2016 alvarotrigo.com - A project by Alvaro Trigo 7 | */body,html{margin:0;padding:0;overflow:hidden;-webkit-tap-highlight-color:rgba(0,0,0,0)}.ms-section{position:relative;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.ms-section.ms-table{display:table;width:100%}.ms-tableCell{display:table-cell;vertical-align:middle;width:100%;height:100%}.ms-easing{-webkit-transition:all .7s ease-out;-moz-transition:all .7s ease-out;-o-transition:all .7s ease-out;transition:all .7s ease-out}#multiscroll-nav{position:fixed;z-index:100;margin-top:-32px;top:50%;opacity:1}#multiscroll-nav.right{right:17px}#multiscroll-nav.left{left:17px}#multiscroll-nav ul{margin:0;padding:0}#multiscroll-nav li{display:block;width:14px;height:13px;margin:7px;position:relative}#multiscroll-nav li a{display:block;position:relative;z-index:1;width:100%;height:100%;cursor:pointer;text-decoration:none}#multiscroll-nav li .active span{background:#333}#multiscroll-nav span{top:2px;left:2px;width:8px;height:8px;border:1px solid #000;background:rgba(0,0,0,0);-webkit-border-radius:50%;-moz-border-radius:50%;border-radius:50%;position:absolute;z-index:1}.multiscroll-tooltip{position:absolute;color:#fff;font-size:14px;font-family:arial,helvetica,sans-serif;top:-2px;white-space:nowrap;max-width:220px}.multiscroll-tooltip.right{right:20px}.multiscroll-tooltip.left{left:20px}.ms-responsive .ms-hide{display:none} 8 | /*# sourceMappingURL=jquery.multiscroll.min.css.map */ 9 | -------------------------------------------------------------------------------- /man/mp.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/multiPage.R 3 | \name{multiSection} 4 | \alias{multiSection} 5 | \alias{multiSectionImage} 6 | \title{Create multi sections} 7 | \usage{ 8 | multiSection(..., menu = NULL, align = "none") 9 | 10 | multiSectionImage(..., img, side, menu = NULL, align = "none") 11 | } 12 | \arguments{ 13 | \item{...}{any element.} 14 | 15 | \item{menu}{named vector of menu links.} 16 | 17 | \item{align}{text alignment, takes \code{left}, \code{right} or, \code{center}, defaults to \code{none}.} 18 | 19 | \item{img}{path to image.} 20 | 21 | \item{side}{image side.} 22 | } 23 | \description{ 24 | Create multi sections. 25 | } 26 | \examples{ 27 | if(interactive()){ 28 | library(shiny) 29 | 30 | options <- list( 31 | sectionsColor = c("#f3f3f3", "#d3d3d3", "#000") 32 | ) 33 | 34 | ui <- multiPage( 35 | opts = options, 36 | multiLeft( 37 | align = "right", 38 | multiSection( 39 | h1("multi") 40 | ), 41 | multiSection( 42 | h2("Section ") 43 | ), 44 | multiSection( 45 | h2("Image ") 46 | ) 47 | ), 48 | multiRight( 49 | align = "left", 50 | multiSection( 51 | h1("page()") 52 | ), 53 | multiSection( 54 | h2(" 2") 55 | ), 56 | multiSectionImage( 57 | img = "https://alvarotrigo.com/multiScroll/imgs/tiger.jpg", 58 | side = "right", 59 | h2("Background") 60 | ) 61 | ) 62 | ) 63 | 64 | server <- function(input, output){} 65 | 66 | shinyApp(ui, server) 67 | } 68 | 69 | } 70 | -------------------------------------------------------------------------------- /man/fullGrid.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/fullGrid.R 3 | \name{fullRow} 4 | \alias{fullRow} 5 | \alias{fullColumn} 6 | \alias{pageRow} 7 | \alias{pageColumn} 8 | \alias{multiRow} 9 | \alias{multiColumn} 10 | \title{Add grid elements} 11 | \usage{ 12 | fullRow(...) 13 | 14 | fullColumn(..., width = 6) 15 | 16 | pageRow(...) 17 | 18 | pageColumn(..., width = 6) 19 | 20 | multiRow(...) 21 | 22 | multiColumn(..., width = 6) 23 | } 24 | \arguments{ 25 | \item{...}{any element.} 26 | 27 | \item{width}{Width of column.} 28 | } 29 | \description{ 30 | Add rows and columns. 31 | } 32 | \details{ 33 | Wrap columns in row function, see examples. 34 | } 35 | \examples{ 36 | if(interactive()){ 37 | library(shiny) 38 | 39 | ui <- pagePiling( 40 | center = TRUE, 41 | sections.color = c("#f3f3f3", "#f4f4f4"), 42 | pageSection( 43 | h1("Grid") 44 | ), 45 | pageSection( 46 | h1("Columns"), 47 | pageRow( 48 | pageColumn( 49 | h2("First Column"), 50 | p("Resize your screen to see columns in action.") 51 | ), 52 | pageColumn( 53 | h2("Second Column"), 54 | numericInput("obs", "observations", value = 20) 55 | ), 56 | pageColumn( 57 | h2("Thirs Column"), 58 | plotOutput("plot") 59 | ) 60 | ) 61 | ) 62 | ) 63 | 64 | server <- function(input, output){ 65 | output$plot <- renderPlot({ 66 | par(bg = "#f4f4f4") 67 | hist(rnorm(input$obs, 10, 3)) 68 | }) 69 | } 70 | 71 | shinyApp(ui, server) 72 | } 73 | 74 | } 75 | \author{ 76 | John Coene, \email{jcoenep@gmail.com} 77 | } 78 | -------------------------------------------------------------------------------- /R/multiSides.R: -------------------------------------------------------------------------------- 1 | #' Create multi sections 2 | #' 3 | #' Create multi page sides; left and right. 4 | #' 5 | #' @param align text alignment passed to \code{CSS}, takes \code{left}, \code{right} or \code{center}. 6 | #' @param ... any element. 7 | #' 8 | #' @details Only use one of each in \code{\link{multiPage}}. 9 | #' 10 | #' @examples 11 | #' if(interactive()){ 12 | #' library(shiny) 13 | #' 14 | #' ui <- multiPage( 15 | #' multiLeft( 16 | #' multiSection( 17 | #' align = "right", 18 | #' h1("Left") 19 | #' ), 20 | #' multiSection( 21 | #' align = "center", 22 | #' h1("Left Again") 23 | #' ) 24 | #' ), 25 | #' multiRight( 26 | #' multiSection( 27 | #' align = "left", 28 | #' h1("Right") 29 | #' ), 30 | #' multiSection( 31 | #' align = "center", 32 | #' h1("Right again") 33 | #' ) 34 | #' ) 35 | #' ) 36 | #' 37 | #' server <- function(input, output){} 38 | #' 39 | #' shinyApp(ui, server) 40 | #' } 41 | #' @author John Coene, \email{jcoenep@@gmail.com} 42 | #' 43 | #' @rdname sides 44 | #' @export 45 | multiLeft <- function(..., align = NULL){ 46 | div <- shiny::tags$div( 47 | class = "ms-left", 48 | ... 49 | ) 50 | 51 | if(!is.null(align)) 52 | div <- shiny::tagAppendAttributes(div, style = paste0("text-align: ", align, ";")) 53 | 54 | div 55 | } 56 | 57 | #' @rdname sides 58 | #' @export 59 | multiRight <- function(..., align = NULL){ 60 | div <- shiny::tags$div( 61 | class = "ms-right", 62 | ... 63 | ) 64 | 65 | if(!is.null(align)) 66 | div <- shiny::tagAppendAttributes(div, style = paste0("text-align: ", align, ";")) 67 | 68 | div 69 | } 70 | -------------------------------------------------------------------------------- /index.Rmd: -------------------------------------------------------------------------------- 1 | # fullPage 2 | [![Travis build status](https://travis-ci.org/RinteRface/fullPage.svg?branch=master)](https://travis-ci.org/RinteRface/fullPage) [![CRAN status](https://www.r-pkg.org/badges/version/fullPage)](https://cran.r-project.org/package=fullPage) 3 | 4 | > Many of the amazing works of [Álvaro Trigo](https://alvarotrigo.com/) for Shiny! 5 | 6 | ```{r setup, include=FALSE} 7 | library(htmltools) 8 | ``` 9 | 10 | ```{r, echo=FALSE} 11 | p( 12 | tags$a( 13 | href = "https://shiny.john-coene.com/fullPage", 14 | target = "_blank", 15 | class = "btn btn-default", 16 | "fullPage demo" 17 | ), 18 | tags$a( 19 | href = "https://shiny.john-coene.com/pagePiling", 20 | target = "_blank", 21 | class = "btn btn-warning", 22 | "pagePiling demo" 23 | ), 24 | tags$a( 25 | href = "https://shiny.john-coene.com/multiScroll", 26 | target = "_blank", 27 | class = "btn btn-success", 28 | "multiScroll demo" 29 | ) 30 | ) 31 | ``` 32 | 33 | ## Installation 34 | 35 | Install the _stable_ version from CRAN: 36 | 37 | ```r 38 | install.packages("fullPage") 39 | ``` 40 | 41 | Install the _dev_ version from [Github](https://github.com/RinteRface/fullPage) with: 42 | 43 | ``` r 44 | # install.packages("remotes") 45 | remotes::install_github("RinteRface/fullPage") 46 | ``` 47 | 48 | ## Features 49 | 50 | * [fullPage.js](https://github.com/alvarotrigo/fullPage.js/) -- functions starting with `full`. 51 | * [pagePiling.js](https://github.com/alvarotrigo/pagePiling.js/) -- functions starting with `page`. 52 | * [multiScroll.js](https://github.com/alvarotrigo/multiscroll.js) -- functions starting with `multi`. 53 | 54 | All ships with: 55 | 56 | * [Milligram](https://milligram.io/) *grid, button, typography, and themes.* 57 | 58 | -------------------------------------------------------------------------------- /R/fullGrid.R: -------------------------------------------------------------------------------- 1 | #' Add grid elements 2 | #' 3 | #' Add rows and columns. 4 | #' 5 | #' @param ... any element. 6 | #' @param width Width of column. 7 | #' 8 | #' @details Wrap columns in row function, see examples. 9 | #' 10 | #' @examples 11 | #' if(interactive()){ 12 | #' library(shiny) 13 | #' 14 | #' ui <- pagePiling( 15 | #' center = TRUE, 16 | #' sections.color = c("#f3f3f3", "#f4f4f4"), 17 | #' pageSection( 18 | #' h1("Grid") 19 | #' ), 20 | #' pageSection( 21 | #' h1("Columns"), 22 | #' pageRow( 23 | #' pageColumn( 24 | #' h2("First Column"), 25 | #' p("Resize your screen to see columns in action.") 26 | #' ), 27 | #' pageColumn( 28 | #' h2("Second Column"), 29 | #' numericInput("obs", "observations", value = 20) 30 | #' ), 31 | #' pageColumn( 32 | #' h2("Thirs Column"), 33 | #' plotOutput("plot") 34 | #' ) 35 | #' ) 36 | #' ) 37 | #' ) 38 | #' 39 | #' server <- function(input, output){ 40 | #' output$plot <- renderPlot({ 41 | #' par(bg = "#f4f4f4") 42 | #' hist(rnorm(input$obs, 10, 3)) 43 | #' }) 44 | #' } 45 | #' 46 | #' shinyApp(ui, server) 47 | #' } 48 | #' 49 | #' @author John Coene, \email{jcoenep@@gmail.com} 50 | #' 51 | #' @rdname fullGrid 52 | #' @export 53 | fullRow <- function(...){ 54 | shiny::tags$div( 55 | class = "row", 56 | ... 57 | ) 58 | } 59 | 60 | #' @rdname fullGrid 61 | #' @export 62 | fullColumn <- function(..., width = 6){ 63 | shiny::tags$div( 64 | class = paste0("col-md-", width), 65 | ... 66 | ) 67 | } 68 | 69 | #' @rdname fullGrid 70 | #' @export 71 | pageRow <- fullRow 72 | 73 | #' @rdname fullGrid 74 | #' @export 75 | pageColumn <- fullColumn 76 | 77 | #' @rdname fullGrid 78 | #' @export 79 | multiRow <- fullRow 80 | 81 | #' @rdname fullGrid 82 | #' @export 83 | multiColumn <- fullColumn 84 | -------------------------------------------------------------------------------- /inst/css/jquery.pagepiling.min.css: -------------------------------------------------------------------------------- 1 | /*! 2 | * pagepiling.js 1.5.4 3 | * 4 | * https://github.com/alvarotrigo/pagePiling.js 5 | * @license MIT licensed 6 | * 7 | * Copyright (C) 2016 alvarotrigo.com - A project by Alvaro Trigo 8 | */body,html{overflow:hidden;margin:0;padding:0;-webkit-tap-highlight-color:rgba(0,0,0,0)}.pp-section{height:100%;position:absolute;width:100%}.pp-easing{-webkit-transition:all 1s cubic-bezier(.55,.085,0,.99);-moz-transition:all 1s cubic-bezier(.55,.085,0,.99);-o-transition:all 1s cubic-bezier(.55,.085,0,.99);transition:all 1s cubic-bezier(.55,.085,0,.99);-webkit-transition-timing-function:cubic-bezier(.55,.085,0,.99);-moz-transition-timing-function:cubic-bezier(.55,.085,0,.99);-o-transition-timing-function:cubic-bezier(.55,.085,0,.99);transition-timing-function:cubic-bezier(.55,.085,0,.99)}#pp-nav{position:fixed;z-index:100;margin-top:-32px;top:50%;opacity:1}#pp-nav.right{right:17px}#pp-nav.left{left:17px}.pp-section.pp-table{display:table}.pp-tableCell{display:table-cell;vertical-align:middle;width:100%;height:100%}.pp-slidesNav{position:absolute;z-index:4;left:50%;opacity:1}.pp-slidesNav.bottom{bottom:17px}.pp-slidesNav.top{top:17px}#pp-nav ul,.pp-slidesNav ul{margin:0;padding:0}#pp-nav li,.pp-slidesNav li{display:block;width:14px;height:13px;margin:7px;position:relative}.pp-slidesNav li{display:inline-block}#pp-nav li a,.pp-slidesNav li a{display:block;position:relative;z-index:1;width:100%;height:100%;cursor:pointer;text-decoration:none}#pp-nav li .active span,.pp-slidesNav .active span{background:#333}#pp-nav span,.pp-slidesNav span{top:2px;left:2px;width:8px;height:8px;border:1px solid #000;background:rgba(0,0,0,0);border-radius:50%;position:absolute;z-index:1}.pp-tooltip{position:absolute;top:-2px;color:#fff;font-size:14px;font-family:arial,helvetica,sans-serif;white-space:nowrap;max-width:220px}.pp-tooltip.right{right:20px}.pp-tooltip.left{left:20px}.pp-scrollable{overflow-y:scroll;height:100%} 9 | /*# sourceMappingURL=jquery.pagepiling.min.css.map */ 10 | -------------------------------------------------------------------------------- /vignettes/pagePiling.Rmd: -------------------------------------------------------------------------------- 1 | --- 2 | title: "pagePiling" 3 | author: "John Coene" 4 | date: "`r Sys.Date()`" 5 | output: rmarkdown::html_vignette 6 | vignette: > 7 | %\VignetteIndexEntry{pagePiling} 8 | %\VignetteEngine{knitr::rmarkdown} 9 | %\VignetteEncoding{UTF-8} 10 | --- 11 | 12 | ```{r setup, include = FALSE} 13 | knitr::opts_chunk$set( 14 | collapse = TRUE, 15 | comment = "#>" 16 | ) 17 | ``` 18 | 19 | You can run a local demo of fullPage with `demo("pagePiling", package = "fullPage")`. 20 | 21 | `fullPage` consists of section (`pageSection`), all the functions of relevant to pagePiling start in `page_`.Always initialise the page with `pagePiling`. 22 | 23 | The code looks like: 24 | 25 | ```r 26 | library(shiny) 27 | library(fullPage) 28 | 29 | options <- list( 30 | loopBottom = TRUE 31 | ) 32 | 33 | ui <- pagePiling( 34 | sections.color = c('#f2f2f2', '#2C3E50', '#39C'), 35 | opts = options, 36 | menu = c("Section 1" = "section1", 37 | "Piling" = "section2", 38 | "Plots" = "section3", 39 | "Layers" = "section4"), 40 | pageSection( 41 | center = TRUE, 42 | menu = "section1", 43 | h1("Page piling") 44 | ), 45 | pageSection( 46 | menu = "section2", 47 | center = TRUE, 48 | h1("Section 2") 49 | ), 50 | pageSectionPlot( 51 | "plot", 52 | center = TRUE, 53 | menu = "section3", 54 | h1("Plot background") 55 | ), 56 | pageSectionPlot( 57 | "plot2", 58 | center = TRUE, 59 | menu = "section4", 60 | pageContainer( 61 | h1("Layer anything"), 62 | sliderInput( 63 | "bins", 64 | "Data Points", 65 | min = 100, 66 | max = 500, 67 | step = 25, 68 | value = 200 69 | ) 70 | ) 71 | ) 72 | ) 73 | 74 | server <- function(input, output){ 75 | 76 | output$plot <- renderPlot({ 77 | par(bg = "grey60") 78 | plot(mtcars$wt, mtcars$mpg) 79 | }) 80 | 81 | output$plot2 <- renderPlot({ 82 | par(bg = "grey80") 83 | hist(rnorm(input$bins, 100, 250)) 84 | }) 85 | } 86 | 87 | shinyApp(ui, server) 88 | ``` -------------------------------------------------------------------------------- /man/fp.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/fullPage.R 3 | \name{fullSection} 4 | \alias{fullSection} 5 | \alias{fullSlide} 6 | \alias{fullSectionImage} 7 | \alias{fullSlideImage} 8 | \alias{pageSection} 9 | \alias{pageSectionImage} 10 | \title{Sections and Slides} 11 | \usage{ 12 | fullSection(..., menu = NULL, center = FALSE, class = "") 13 | 14 | fullSlide(..., menu = NULL, center = FALSE) 15 | 16 | fullSectionImage(..., img, menu = NULL, center = FALSE) 17 | 18 | fullSlideImage(..., img, menu = NULL, center = FALSE) 19 | 20 | pageSection(..., menu = NULL, center = FALSE, class = "") 21 | 22 | pageSectionImage(..., img, menu = NULL, center = FALSE) 23 | } 24 | \arguments{ 25 | \item{...}{any element.} 26 | 27 | \item{menu}{menu link.} 28 | 29 | \item{center}{whether to center text horizontally.} 30 | 31 | \item{class}{A CSS class.} 32 | 33 | \item{img}{path to image.} 34 | } 35 | \description{ 36 | Add sections and slides. 37 | } 38 | \details{ 39 | \code{fullSectionImage} and \code{fullSlideImage} do not work in RStudio viewer, open in browser. 40 | } 41 | \examples{ 42 | if(interactive()){ 43 | 44 | library(shiny) 45 | 46 | ui <- fullPage( 47 | center = TRUE, 48 | opts = list( 49 | sectionsColor = c("#f3f3f3", "#4BBFC3") 50 | ), 51 | fullSection(h1("First section"), center = TRUE), 52 | fullSection( 53 | menu = "captureThisSection" 54 | ), 55 | fullSection( 56 | fullSlide(h2("Slide 1")), 57 | fullSlideImage( 58 | img = paste0( 59 | "https://raw.githubusercontent.com/alvarotrigo/", 60 | "fullPage.js/master/examples/imgs/bg5.jpg"), 61 | h2("Image background") 62 | ) 63 | ), 64 | fullSectionImage( # will not show in viewer, open in browser 65 | img = paste0( 66 | "https://raw.githubusercontent.com/alvarotrigo/", 67 | "fullPage.js/master/examples/imgs/bg2.jpg"), 68 | h1("Image background") 69 | ) 70 | ) 71 | 72 | server <- function(input, output){ 73 | observeEvent(input$captureThisSectionInput, { 74 | print("Section # 2 loaded") 75 | }) 76 | } 77 | 78 | shinyApp(ui, server) 79 | } 80 | 81 | } 82 | \author{ 83 | John Coene, \email{jcoenep@gmail.com} 84 | } 85 | -------------------------------------------------------------------------------- /R/utils.R: -------------------------------------------------------------------------------- 1 | build_opts_fp <- function(opts = NULL){ 2 | 3 | opts <- jsonlite::toJSON(opts, auto_unbox = T) 4 | 5 | paste0(" 6 | var options = ", opts, "; 7 | $.extend(options, {'afterLoad': function(origin, destination, direction){ 8 | Shiny.setInputValue('fp_origin', origin, {priority: 'event'}); 9 | Shiny.setInputValue('fp_destination', destination, {priority: 'event'}); 10 | Shiny.setInputValue('fp_direction', direction, {priority: 'event'}); 11 | }}); 12 | $(document).on('shiny:connected', function(event) {$('#fp').fullpage(options);}); 13 | ") 14 | } 15 | 16 | build_opts_pp <- function(opts = NULL){ 17 | 18 | opts <- jsonlite::toJSON(opts, auto_unbox = T) 19 | 20 | paste0(" 21 | var options = ", opts, "; 22 | $.extend(options, {'afterLoad': function(anchorLink, index){ 23 | Shiny.setInputValue('fp_anchor', anchorLink, {priority: 'event'}); 24 | Shiny.setInputValue('fp_index', index, {priority: 'event'}); 25 | }}); 26 | $(document).on('shiny:connected', function(event) {$('#fp').pagepiling(options)}); 27 | ") 28 | } 29 | 30 | build_opts_mp <- function(opts = NULL){ 31 | opts <- jsonlite::toJSON(opts, auto_unbox = T) 32 | 33 | paste0(" 34 | var options = ", opts, "; 35 | $.extend(options, {'afterLoad': function(anchorLink, index){ 36 | $(document).on('shiny:connected', function(event) { 37 | Shiny.onInputChange('fp_anchor', anchorLink); 38 | Shiny.onInputChange('fp_index', index); 39 | }); 40 | }}); 41 | $(document).ready(function() {$('#fp').multiscroll(options);}); 42 | ") 43 | } 44 | 45 | 46 | build_section <- function(menu = NULL, center = FALSE, class, ...){ 47 | div <- shiny::tags$div( 48 | class = class, 49 | ... 50 | ) 51 | 52 | if(!is.null(menu)) 53 | div <- shiny::tagAppendAttributes(div, `data-anchor` = menu) 54 | 55 | if(isTRUE(center)) 56 | div <- shiny::tagAppendAttributes(div, style = "text-align: center;") 57 | 58 | div 59 | } 60 | 61 | rand <- function(){ 62 | rand_id <- paste0(tolower(sample(c(LETTERS, 1:9), 26 + 9)), collapse = "") 63 | paste0(sample(letters,1),rand_id) 64 | } 65 | -------------------------------------------------------------------------------- /docs/docsearch.js: -------------------------------------------------------------------------------- 1 | $(function() { 2 | 3 | // register a handler to move the focus to the search bar 4 | // upon pressing shift + "/" (i.e. "?") 5 | $(document).on('keydown', function(e) { 6 | if (e.shiftKey && e.keyCode == 191) { 7 | e.preventDefault(); 8 | $("#search-input").focus(); 9 | } 10 | }); 11 | 12 | $(document).ready(function() { 13 | // do keyword highlighting 14 | /* modified from https://jsfiddle.net/julmot/bL6bb5oo/ */ 15 | var mark = function() { 16 | 17 | var referrer = document.URL ; 18 | var paramKey = "q" ; 19 | 20 | if (referrer.indexOf("?") !== -1) { 21 | var qs = referrer.substr(referrer.indexOf('?') + 1); 22 | var qs_noanchor = qs.split('#')[0]; 23 | var qsa = qs_noanchor.split('&'); 24 | var keyword = ""; 25 | 26 | for (var i = 0; i < qsa.length; i++) { 27 | var currentParam = qsa[i].split('='); 28 | 29 | if (currentParam.length !== 2) { 30 | continue; 31 | } 32 | 33 | if (currentParam[0] == paramKey) { 34 | keyword = decodeURIComponent(currentParam[1].replace(/\+/g, "%20")); 35 | } 36 | } 37 | 38 | if (keyword !== "") { 39 | $(".contents").unmark({ 40 | done: function() { 41 | $(".contents").mark(keyword); 42 | } 43 | }); 44 | } 45 | } 46 | }; 47 | 48 | mark(); 49 | }); 50 | }); 51 | 52 | /* Search term highlighting ------------------------------*/ 53 | 54 | function matchedWords(hit) { 55 | var words = []; 56 | 57 | var hierarchy = hit._highlightResult.hierarchy; 58 | // loop to fetch from lvl0, lvl1, etc. 59 | for (var idx in hierarchy) { 60 | words = words.concat(hierarchy[idx].matchedWords); 61 | } 62 | 63 | var content = hit._highlightResult.content; 64 | if (content) { 65 | words = words.concat(content.matchedWords); 66 | } 67 | 68 | // return unique words 69 | var words_uniq = [...new Set(words)]; 70 | return words_uniq; 71 | } 72 | 73 | function updateHitURL(hit) { 74 | 75 | var words = matchedWords(hit); 76 | var url = ""; 77 | 78 | if (hit.anchor) { 79 | url = hit.url_without_anchor + '?q=' + escape(words.join(" ")) + '#' + hit.anchor; 80 | } else { 81 | url = hit.url + '?q=' + escape(words.join(" ")); 82 | } 83 | 84 | return url; 85 | } 86 | -------------------------------------------------------------------------------- /man/fullPlot.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/fullPlot.R 3 | \name{fullSectionPlot} 4 | \alias{fullSectionPlot} 5 | \alias{fullSlidePlot} 6 | \alias{pageSectionPlot} 7 | \alias{multiSectionPlot} 8 | \title{Use plot as background} 9 | \usage{ 10 | fullSectionPlot( 11 | outputId, 12 | ..., 13 | menu = NULL, 14 | center = FALSE, 15 | background = "rgba(255,255,255,0.5)" 16 | ) 17 | 18 | fullSlidePlot( 19 | outputId, 20 | ..., 21 | menu = NULL, 22 | center = FALSE, 23 | background = "rgba(255,255,255,0.5)" 24 | ) 25 | 26 | pageSectionPlot( 27 | outputId, 28 | ..., 29 | menu = NULL, 30 | center = FALSE, 31 | background = "rgba(255,255,255,0.5)" 32 | ) 33 | 34 | multiSectionPlot( 35 | outputId, 36 | ..., 37 | menu = NULL, 38 | center = FALSE, 39 | background = "rgba(255,255,255,0.5)" 40 | ) 41 | } 42 | \arguments{ 43 | \item{outputId}{id passed to \code{\link[shiny]{plotOutput}}.} 44 | 45 | \item{...}{any children element.} 46 | 47 | \item{menu}{menu link.} 48 | 49 | \item{center}{whether to center text horizontally.} 50 | 51 | \item{background}{sets background to overlaying shiny inputs, set to \code{NULL} to remove.} 52 | } 53 | \description{ 54 | Use a reactive plot as section or slide background. 55 | } 56 | \examples{ 57 | if(interactive()){ 58 | 59 | library(shiny) 60 | 61 | ui <- fullPage( 62 | opts = list(sectionsColor = c('#4BBFC3', '#7BAABE')), 63 | fullSection(h1("Full section plots"), center = TRUE), 64 | fullSectionPlot( 65 | "myPlot2", 66 | center = TRUE, 67 | fullContainer( 68 | h2("With a title") 69 | ) 70 | ), 71 | fullSectionPlot( 72 | "myPlot", 73 | center = TRUE, 74 | fullContainer( 75 | h3("Layer anything you want"), 76 | selectInput( 77 | "select", 78 | "Choose y", 79 | choices = c("mpg", "drat", "wt") 80 | ) 81 | ) 82 | ) 83 | ) 84 | 85 | server <- function(input, output){ 86 | 87 | output$myPlot <- renderPlot({ 88 | plot(1:nrow(mtcars), mtcars[[input$select]]) 89 | }) 90 | 91 | output$myPlot2 <- renderPlot({ 92 | plot(1:nrow(mtcars), mtcars[[input$select]]) 93 | }) 94 | 95 | } 96 | 97 | shinyApp(ui, server) 98 | } 99 | } 100 | \author{ 101 | John Coene, \email{jcoenep@gmail.com} 102 | } 103 | -------------------------------------------------------------------------------- /inst/jquery-3.2.1/jquery.easing.min.js: -------------------------------------------------------------------------------- 1 | (function(factory){if(typeof define==="function"&&define.amd){define(["jquery"],function($){return factory($)})}else if(typeof module==="object"&&typeof module.exports==="object"){exports=factory(require("jquery"))}else{factory(jQuery)}})(function($){$.easing.jswing=$.easing.swing;var pow=Math.pow,sqrt=Math.sqrt,sin=Math.sin,cos=Math.cos,PI=Math.PI,c1=1.70158,c2=c1*1.525,c3=c1+1,c4=2*PI/3,c5=2*PI/4.5;function bounceOut(x){var n1=7.5625,d1=2.75;if(x<1/d1){return n1*x*x}else if(x<2/d1){return n1*(x-=1.5/d1)*x+.75}else if(x<2.5/d1){return n1*(x-=2.25/d1)*x+.9375}else{return n1*(x-=2.625/d1)*x+.984375}}$.extend($.easing,{def:"easeOutQuad",swing:function(x){return $.easing[$.easing.def](x)},easeInQuad:function(x){return x*x},easeOutQuad:function(x){return 1-(1-x)*(1-x)},easeInOutQuad:function(x){return x<.5?2*x*x:1-pow(-2*x+2,2)/2},easeInCubic:function(x){return x*x*x},easeOutCubic:function(x){return 1-pow(1-x,3)},easeInOutCubic:function(x){return x<.5?4*x*x*x:1-pow(-2*x+2,3)/2},easeInQuart:function(x){return x*x*x*x},easeOutQuart:function(x){return 1-pow(1-x,4)},easeInOutQuart:function(x){return x<.5?8*x*x*x*x:1-pow(-2*x+2,4)/2},easeInQuint:function(x){return x*x*x*x*x},easeOutQuint:function(x){return 1-pow(1-x,5)},easeInOutQuint:function(x){return x<.5?16*x*x*x*x*x:1-pow(-2*x+2,5)/2},easeInSine:function(x){return 1-cos(x*PI/2)},easeOutSine:function(x){return sin(x*PI/2)},easeInOutSine:function(x){return-(cos(PI*x)-1)/2},easeInExpo:function(x){return x===0?0:pow(2,10*x-10)},easeOutExpo:function(x){return x===1?1:1-pow(2,-10*x)},easeInOutExpo:function(x){return x===0?0:x===1?1:x<.5?pow(2,20*x-10)/2:(2-pow(2,-20*x+10))/2},easeInCirc:function(x){return 1-sqrt(1-pow(x,2))},easeOutCirc:function(x){return sqrt(1-pow(x-1,2))},easeInOutCirc:function(x){return x<.5?(1-sqrt(1-pow(2*x,2)))/2:(sqrt(1-pow(-2*x+2,2))+1)/2},easeInElastic:function(x){return x===0?0:x===1?1:-pow(2,10*x-10)*sin((x*10-10.75)*c4)},easeOutElastic:function(x){return x===0?0:x===1?1:pow(2,-10*x)*sin((x*10-.75)*c4)+1},easeInOutElastic:function(x){return x===0?0:x===1?1:x<.5?-(pow(2,20*x-10)*sin((20*x-11.125)*c5))/2:pow(2,-20*x+10)*sin((20*x-11.125)*c5)/2+1},easeInBack:function(x){return c3*x*x*x-c1*x*x},easeOutBack:function(x){return 1+c3*pow(x-1,3)+c1*pow(x-1,2)},easeInOutBack:function(x){return x<.5?pow(2*x,2)*((c2+1)*2*x-c2)/2:(pow(2*x-2,2)*((c2+1)*(x*2-2)+c2)+2)/2},easeInBounce:function(x){return 1-bounceOut(1-x)},easeOutBounce:bounceOut,easeInOutBounce:function(x){return x<.5?(1-bounceOut(1-2*x))/2:(1+bounceOut(2*x-1))/2}})}); 2 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # fullPage 2 | [![Travis build status](https://travis-ci.org/RinteRface/fullPage.svg?branch=master)](https://travis-ci.org/RinteRface/fullPage) [![CRAN status](https://www.r-pkg.org/badges/version/fullPage)](https://cran.r-project.org/package=fullPage) 3 | 4 | > Many of the amazing works of [Álvaro Trigo](https://alvarotrigo.com/) for Shiny! 5 | 6 | * [Install](#installation) 7 | * [Demos](#demos) 8 | * [Features](#features) 9 | * [Website](http://fullpage.rinterface.com/) 10 | * [Examples](#demos) 11 | * [Callbacks](#callbacks) 12 | 13 | ![FullPage](fullPage.gif) 14 | 15 | ## Installation 16 | 17 | ``` r 18 | # install.packages("remotes") 19 | remotes::install_github("RinteRface/fullPage") 20 | ``` 21 | 22 | ## Features 23 | 24 | Includes the following frameworks: 25 | 26 | * [fullPage.js](https://github.com/alvarotrigo/fullPage.js/) -- functions starting with `full`. 27 | * [pagePiling.js](https://github.com/alvarotrigo/pagePiling.js/) -- functions starting with `page`. 28 | * [multiScroll.js](https://github.com/alvarotrigo/multiscroll.js) -- functions starting with `multi`. 29 | 30 | All ships with: 31 | 32 | * [Milligram](https://milligram.io/) *grid, button, typography, and themes.* 33 | 34 | ## Demos 35 | 36 | Online: 37 | 38 | * [fullPage.js](https://shiny.john-coene.com/fullPage) 39 | * [pagePiling.js](https://shiny.john-coene.com/pagePiling) 40 | * [multiScroll.js](https://shiny.john-coene.com/multiScroll) 41 | 42 | 43 | Locally: 44 | 45 | ```r 46 | demo("fullPage", package = "fullPage") 47 | demo("pagePiling", package = "fullPage") 48 | demo("multiPage", package = "fullPage") 49 | ``` 50 | 51 | ## Callbacks 52 | 53 | **fullPage** 54 | 55 | - `input$slide_origin`: origin slide 56 | - `input$slide_destination`: destination slide 57 | - `input$slide_direction`: scroll direction 58 | 59 | **pagePiling & multiScroll** 60 | 61 | - `input$slide_anchor`: slide anchor 62 | - `input$slide_index`: slide index 63 | 64 | ```r 65 | library(shiny) 66 | library(fullPage) 67 | 68 | ui <- fullPage( 69 | fullSection( 70 | menu = "first", 71 | center = TRUE, 72 | h1("Callbacks") 73 | ), 74 | fullSection( 75 | menu = "second", 76 | center = TRUE, 77 | h3("Slice"), 78 | verbatimTextOutput("slide") 79 | ) 80 | ) 81 | 82 | server <- function(input, output){ 83 | 84 | output$slide <- renderPrint({ 85 | input$slide_origin # returns menu 86 | }) 87 | 88 | } 89 | 90 | shinyApp(ui, server) 91 | ``` 92 | -------------------------------------------------------------------------------- /vignettes/multiScroll.Rmd: -------------------------------------------------------------------------------- 1 | --- 2 | title: "multiScroll" 3 | author: "John Coene" 4 | date: "`r Sys.Date()`" 5 | output: rmarkdown::html_vignette 6 | vignette: > 7 | %\VignetteIndexEntry{multiScroll} 8 | %\VignetteEngine{knitr::rmarkdown} 9 | %\VignetteEncoding{UTF-8} 10 | --- 11 | 12 | ```{r setup, include = FALSE} 13 | knitr::opts_chunk$set( 14 | collapse = TRUE, 15 | comment = "#>" 16 | ) 17 | ``` 18 | 19 | You can run a local demo of fullPage with `demo("multiScroll", package = "fullPage")`. 20 | 21 | `multiScroll` consists of section (`multiSection`), which consists of two "sides", right (`multiRight`) and left `multiLeft`, all the functions of relevant to multiScroll start in `multi_`. Always initialise the page with `multiPage`. 22 | 23 | The code looks like: 24 | 25 | ```r 26 | library(shiny) 27 | library(fullPage) 28 | 29 | options <- list( 30 | sectionsColor = c("#4BBFC3", "#7BAABE", "lightgray") 31 | ) 32 | 33 | ui <- multiPage( 34 | opts = options, 35 | menu = c("Multi Scroll" = "multiscroll", 36 | "Plots" = "plots", 37 | "Full Section plots" = "fullplots"), 38 | multiLeft( 39 | multiSection( 40 | center = TRUE, 41 | menu = "multiscroll", 42 | h1("Multiple") 43 | ), 44 | multiSection( 45 | menu = "plots", 46 | multiContainer( 47 | h1("Plot ->"), 48 | numericInput( 49 | "max", 50 | "Maximum", 51 | min = 50, 52 | max = 250, 53 | value = 10 54 | ) 55 | ) 56 | ), 57 | multiSectionPlot( 58 | menu = "fullplots", 59 | "fullPlot" 60 | ) 61 | ), 62 | multiRight( 63 | multiSection( 64 | center = TRUE, 65 | h1("scroll") 66 | ), 67 | multiSection( 68 | center = TRUE, 69 | plotOutput("plot") 70 | ), 71 | multiSection( 72 | multiContainer( 73 | center = TRUE, 74 | h1("<- Full Section plot"), 75 | sliderInput( 76 | "number", 77 | "Data points", 78 | min = 50, 79 | max = 250, 80 | value = 10 81 | ) 82 | ) 83 | ) 84 | ) 85 | ) 86 | 87 | server <- function(input, output){ 88 | 89 | output$plot <- renderPlot({ 90 | hist(rnorm(100, 20, input$max)) 91 | }) 92 | 93 | output$fullPlot <- renderPlot({ 94 | par(bg = "gray") 95 | hist(rnorm(input$number, 20, 250)) 96 | }) 97 | } 98 | 99 | shinyApp(ui, server) 100 | ``` -------------------------------------------------------------------------------- /demo/multiPage.R: -------------------------------------------------------------------------------- 1 | library(fullPage) 2 | library(shiny) 3 | 4 | options <- list( 5 | sectionsColor = c("#E0FFFA", "#CEFFF2", "#C0F9F0", "#90F9EA", "#000", "#394C54", "#E0FFFA") 6 | ) 7 | 8 | ui <- multiPage( 9 | opts = options, 10 | multiTheme('aqua'), 11 | menu = c( 12 | "multiPage" = "multipage", 13 | "Split" = "split", 14 | "Grid" = "grid", 15 | "Plots" = "plot", 16 | "Images" = "images", 17 | "Buttons" = "buttons", 18 | "Sisters" = "sisters" 19 | ), 20 | multiLeft( 21 | align = "right", 22 | multiSection( 23 | menu = "multipage", 24 | h1("multiScroll.js") 25 | ), 26 | multiSection( 27 | menu = "split", 28 | center = TRUE, 29 | h1("Split") 30 | ), 31 | multiSection( 32 | center = TRUE, 33 | menu = "grid", 34 | multiRow( 35 | multiColumn("First Column"), 36 | multiColumn("Second Column") 37 | ) 38 | ), 39 | multiSection( 40 | menu = "plot", 41 | center = TRUE, 42 | multiContainer( 43 | h1("Full Section Plot"), 44 | selectInput( 45 | "obs", 46 | "Select", 47 | c(10, 20 ,50 ,100 , 150) 48 | ) 49 | ) 50 | ), 51 | multiSection( 52 | menu = "images", 53 | h1("Image ") 54 | ), 55 | multiSection( 56 | menu = "buttons", 57 | center = TRUE, 58 | h1("Add buttons", style = "color: white;") 59 | ), 60 | multiSection( 61 | menu = "sisters", 62 | h1("More like this ->") 63 | ) 64 | ), 65 | multiRight( 66 | align = "left", 67 | multiSection( 68 | h1("-Shiny") 69 | ), 70 | multiSection( 71 | plotOutput("plot1") 72 | ), 73 | multiSection( 74 | h1("<- Grid") 75 | ), 76 | multiSectionPlot("plot2"), 77 | multiSectionImage( 78 | img = "https://alvarotrigo.com/multiScroll/imgs/tiger.jpg", 79 | side = "right", 80 | h1("Background") 81 | ), 82 | multiSection( 83 | center = TRUE, 84 | multiButtonDown("Next section", outline = TRUE) 85 | ), 86 | multiSection( 87 | center = TRUE, 88 | verbatimTextOutput("sistersDemo") 89 | ) 90 | ) 91 | ) 92 | 93 | server <- function(input, output){ 94 | output$plot1 <- renderPlot({ 95 | par(bg = "#CEFFF2") 96 | plot(mtcars$mpg, mtcars$wt) 97 | }) 98 | 99 | output$plot2 <- renderPlot({ 100 | par(bg = "#90F9EA") 101 | hist(rnorm(input$obs, 10, 5)) 102 | }) 103 | 104 | output$sistersDemo <- renderText({ 105 | '# See those 106 | demo("fullPage", package = "fullPage") 107 | demo("multiPage", package = "fullPage")' 108 | }) 109 | } 110 | 111 | shinyApp(ui, server) 112 | -------------------------------------------------------------------------------- /demo/pagePiling.R: -------------------------------------------------------------------------------- 1 | library(fullPage) 2 | library(shiny) 3 | 4 | ui <- pagePiling( 5 | center = TRUE, 6 | sections.color = c( 7 | "#4B97D2", 8 | "#FFE6F4", 9 | "#FFBDE1", 10 | "#FFBDE1", 11 | "#AEFFAC", 12 | "#C490F4", 13 | "#4B97D2" 14 | ), 15 | pageTheme("maroon"), 16 | menu = c( 17 | "Piling" = "intro", 18 | "Grid" = "grid", 19 | "Plots" = "backgrounds", 20 | "Images" = "image", 21 | "Themes" = "themes", 22 | "Buttons" = "buttons", 23 | "sisters" = "sisters" 24 | ), 25 | pageSection( 26 | menu = "intro", 27 | h1("pagePiling.js meets Shiny!", style = "color:#f3f3f3;") 28 | ), 29 | pageSection( 30 | menu = "grid", 31 | h1("Grid"), 32 | pageRow( 33 | pageColumn( 34 | h2("Columns"), 35 | p("plot on the right on larger screens"), 36 | p("And on below on mobile.") 37 | ), 38 | pageColumn( 39 | plotOutput("plot1") 40 | ) 41 | ) 42 | ), 43 | pageSectionPlot( 44 | "plot2", 45 | menu = "backgrounds", 46 | pageContainer( 47 | pageRow( 48 | pageColumn(), 49 | pageColumn( 50 | h1("Background Plot"), 51 | sliderInput( 52 | "slider", 53 | "Overlay input", 54 | min = 50, 55 | max = 250, 56 | value = 100 57 | ) 58 | ), 59 | pageColumn() 60 | ) 61 | ) 62 | ), 63 | pageSectionImage( # will not show in viewer, open in browser 64 | menu = "image", 65 | img = paste0( 66 | "https://raw.githubusercontent.com/alvarotrigo/", 67 | "fullPage.js/master/examples/imgs/bg2.jpg"), 68 | h1("Image background") 69 | ), 70 | pageSection( 71 | menu = "themes", 72 | pageContainer( 73 | h1("16 themes"), 74 | verbatimTextOutput("themes") 75 | ) 76 | ), 77 | pageSection( 78 | h1("Buttons", style = "color:#f3f3f3;"), 79 | pageButtonDown("Next Section") 80 | ), 81 | pageSection( 82 | menu = "sisters", 83 | pageContainer( 84 | h1("Sister functions", style = "color:#f3f3f3;"), 85 | verbatimTextOutput("sisters") 86 | ) 87 | ) 88 | ) 89 | 90 | server <- function(input, output){ 91 | 92 | output$plot1 <- renderPlot({ 93 | par(bg = "#FFE6F4") 94 | plot(mtcars$wt, mtcars$mpg) 95 | }) 96 | 97 | output$plot2 <- renderPlot({ 98 | par(bg = "#FFBDE1") 99 | hist(rnorm(input$slider, mean = 25, sd = 5)) 100 | }) 101 | 102 | output$plot3 <- renderPlot({ 103 | par(bg = "#FFADB2") 104 | plot(1:nrow(mtcars), mtcars$drat, type = "l") 105 | }) 106 | 107 | output$sisters <- renderText({ 108 | '# See those 109 | demo("fullPage", package = "fullPage") 110 | demo("multiPage", package = "fullPage")' 111 | }) 112 | 113 | output$themes <- renderText({ 114 | 'pageTheme()' 115 | }) 116 | } 117 | 118 | shinyApp(ui, server) 119 | -------------------------------------------------------------------------------- /man/button.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/fullButton.R 3 | \name{fullButton} 4 | \alias{fullButton} 5 | \alias{fullButtonTo} 6 | \alias{fullButtonUp} 7 | \alias{fullButtonDown} 8 | \alias{fullButtonRight} 9 | \alias{fullButtonLeft} 10 | \alias{fullButtonCustom} 11 | \alias{pageButton} 12 | \alias{multiButton} 13 | \alias{pageButtonUp} 14 | \alias{pageButtonDown} 15 | \alias{pageButtonTo} 16 | \alias{multiButtonUp} 17 | \alias{multiButtonDown} 18 | \alias{multiButtonTo} 19 | \title{Add buttons} 20 | \usage{ 21 | fullButton(..., outline = FALSE, clear = FALSE) 22 | 23 | fullButtonTo(..., section, slide = 0, outline = FALSE, clear = FALSE) 24 | 25 | fullButtonUp(..., outline = FALSE, clear = FALSE) 26 | 27 | fullButtonDown(..., outline = FALSE, clear = FALSE) 28 | 29 | fullButtonRight(..., outline = FALSE, clear = FALSE) 30 | 31 | fullButtonLeft(..., outline = FALSE, clear = FALSE) 32 | 33 | fullButtonCustom(..., fun, outline = FALSE, clear = FALSE) 34 | 35 | pageButton(..., outline = FALSE, clear = FALSE) 36 | 37 | multiButton(..., outline = FALSE, clear = FALSE) 38 | 39 | pageButtonUp(..., outline = FALSE, clear = FALSE) 40 | 41 | pageButtonDown(..., outline = FALSE, clear = FALSE) 42 | 43 | pageButtonTo(..., section, outline = FALSE, clear = FALSE) 44 | 45 | multiButtonUp(..., outline = FALSE, clear = FALSE) 46 | 47 | multiButtonDown(..., outline = FALSE, clear = FALSE) 48 | 49 | multiButtonTo(..., section, outline = FALSE, clear = FALSE) 50 | } 51 | \arguments{ 52 | \item{...}{any other element} 53 | 54 | \item{outline, clear}{set outline or clear button.} 55 | 56 | \item{section, slide}{target section and/or slide.} 57 | 58 | \item{fun}{Javascript function to pass to button.} 59 | } 60 | \description{ 61 | Add buttons to your \code{\link{fullPage}}, \code{\link{pagePiling}} and \code{\link{multiPage}}. 62 | } 63 | \details{ 64 | See example for \code{*Custom} button. 65 | } 66 | \examples{ 67 | library(shiny) 68 | 69 | if(interactive()){ 70 | 71 | ui <- fullPage( 72 | 73 | center = TRUE, 74 | 75 | fullSection( 76 | center = TRUE, 77 | h1("Buttons") 78 | ), 79 | fullSection( 80 | fullButton("Visit site", href = "https://john-coene.com") 81 | ), 82 | fullSection( 83 | fullButtonDown("Move Down", outline = TRUE) 84 | ), 85 | fullSection( 86 | fullButtonUp("Move up") 87 | ), 88 | fullSection( 89 | fullButtonTo("Move to first section", section = 1) 90 | ), 91 | fullSection( 92 | center = TRUE, 93 | fullSlide( 94 | fullButtonRight("Slide right", clear = TRUE) 95 | ), 96 | fullSlide( 97 | fullButtonLeft("Slide left", clear = TRUE) 98 | ) 99 | ), 100 | fullSection( 101 | p("Disables keyboard scrolling"), 102 | fullButtonCustom("Custom button", 103 | fun = "$.fn.fullpage.setKeyboardScrolling(false, 'down, right');") 104 | ) 105 | ) 106 | 107 | server <- function(input, output){} 108 | 109 | shinyApp(ui, server) 110 | } 111 | } 112 | \author{ 113 | John Coene, \email{jcoenep@gmail.com} 114 | } 115 | -------------------------------------------------------------------------------- /demo/fullPage.R: -------------------------------------------------------------------------------- 1 | library(shiny) 2 | library(fullPage) 3 | 4 | options <- list( 5 | sectionsColor = c( 6 | "#C3F3EC", 7 | "#FE9199", 8 | "#FFADB2", 9 | "#FFCAB1", 10 | "#C3F3EC", 11 | "#FFFFFF", 12 | "#FE9199", 13 | "#FFADB2" 14 | ) 15 | ) 16 | 17 | ui <- fullPage( 18 | center = TRUE, 19 | opts = options, 20 | menu = c( 21 | "FullPage" = "intro", 22 | "Slides" = "slides", 23 | "Grid" = "grid", 24 | "Plots bg" = "plotbg", 25 | "Slides bg" = "slidebg", 26 | "Images" = "images", 27 | "Buttons" = "buttons", 28 | "Sisters" = "sisters" 29 | ), 30 | fullSection( 31 | menu = "intro", 32 | h1("fullPage.js meets Shiny.") 33 | ), 34 | fullSection( 35 | menu = "slides", 36 | fullSlide( 37 | h1("Slide 1") 38 | ), 39 | fullSlide( 40 | h1("Slide 2") 41 | ) 42 | ), 43 | fullSection( 44 | menu = "grid", 45 | fullContainer( 46 | h1("Grid System"), 47 | fullRow( 48 | fullColumn( 49 | h2("Use Columns") 50 | ), 51 | fullColumn( 52 | plotOutput("plot1") 53 | ) 54 | ), 55 | p("from Miligram*") 56 | ) 57 | ), 58 | fullSectionPlot( 59 | "plot2", 60 | menu = "plotbg", 61 | fullContainer( 62 | h2("Background plots"), 63 | sliderInput( 64 | "input1", 65 | "Obs", 66 | min = 10, 67 | max = 500, 68 | step = 10, 69 | value = 250 70 | ) 71 | ) 72 | ), 73 | fullSection( 74 | menu = "slidebg", 75 | fullSlide( 76 | h2("Slide is here ->") 77 | ), 78 | fullSlidePlot( 79 | "plot3" 80 | ), 81 | fullSlideImage( 82 | img = paste0( 83 | "https://raw.githubusercontent.com/alvarotrigo/", 84 | "fullPage.js/master/examples/imgs/bg5.jpg"), 85 | h2("Image background") 86 | ) 87 | ), 88 | fullSectionImage( # will not show in viewer, open in browser 89 | menu = "images", 90 | img = paste0( 91 | "https://raw.githubusercontent.com/alvarotrigo/", 92 | "fullPage.js/master/examples/imgs/bg2.jpg"), 93 | h1("Image background") 94 | ), 95 | fullSection( 96 | menu = "buttons", 97 | fullContainer( 98 | h1("Include buttons"), 99 | fullButtonDown("Next Section", outline = TRUE) 100 | ) 101 | ), 102 | fullSection( 103 | menu = "sisters", 104 | fullContainer( 105 | h1("Sister functions"), 106 | verbatimTextOutput("sistersDemo") 107 | ) 108 | ) 109 | ) 110 | 111 | server <- function(input, output){ 112 | 113 | output$plot1 <- renderPlot({ 114 | par(bg = "#FFADB2") 115 | plot(mtcars$wt, mtcars$mpg) 116 | }) 117 | 118 | output$plot2 <- renderPlot({ 119 | par(bg = "#F3F3F3") 120 | hist(rnorm(input$input1, mean = 25, sd = 5)) 121 | }) 122 | 123 | output$plot3 <- renderPlot({ 124 | par(bg = "#FFADB2") 125 | plot(1:nrow(mtcars), mtcars$drat, type = "l") 126 | }) 127 | 128 | output$sistersDemo <- renderText({ 129 | '# See those 130 | demo("pagePiling", package = "fullPage") 131 | demo("multiPage", package = "fullPage")' 132 | }) 133 | } 134 | 135 | shinyApp(ui, server) 136 | -------------------------------------------------------------------------------- /inst/css/jquery.fullpage.min.css: -------------------------------------------------------------------------------- 1 | /*! 2 | * fullPage 2.9.5 3 | * https://github.com/alvarotrigo/fullPage.js 4 | * MIT licensed 5 | * 6 | * Copyright (C) 2013 alvarotrigo.com - A project by Alvaro Trigo 7 | */.fp-enabled body,html.fp-enabled{margin:0;padding:0;overflow:hidden;-webkit-tap-highlight-color:rgba(0,0,0,0)}.fp-section{position:relative;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.fp-slide{float:left}.fp-slide,.fp-slidesContainer{height:100%;display:block}.fp-slides{z-index:1;height:100%;overflow:hidden;position:relative;-webkit-transition:all .3s ease-out;transition:all .3s ease-out}.fp-section.fp-table,.fp-slide.fp-table{display:table;table-layout:fixed;width:100%}.fp-tableCell{display:table-cell;vertical-align:middle;width:100%;height:100%}.fp-slidesContainer{float:left;position:relative}.fp-controlArrow{-webkit-user-select:none;-moz-user-select:none;-khtml-user-select:none;-ms-user-select:none;position:absolute;z-index:4;top:50%;cursor:pointer;width:0;height:0;border-style:solid;margin-top:-38px;-webkit-transform:translate3d(0,0,0);-ms-transform:translate3d(0,0,0);transform:translate3d(0,0,0)}.fp-controlArrow.fp-prev{left:15px;width:0;border-width:38.5px 34px 38.5px 0;border-color:transparent #fff transparent transparent}.fp-controlArrow.fp-next{right:15px;border-width:38.5px 0 38.5px 34px;border-color:transparent transparent transparent #fff}.fp-scrollable{overflow:hidden;position:relative}.fp-scroller{overflow:hidden}.iScrollIndicator{border:0!important}.fp-notransition{-webkit-transition:none!important;transition:none!important}#fp-nav{position:fixed;z-index:100;margin-top:-32px;top:50%;opacity:1;-webkit-transform:translate3d(0,0,0)}#fp-nav.right{right:17px}#fp-nav.left{left:17px}.fp-slidesNav{position:absolute;z-index:4;opacity:1;-webkit-transform:translate3d(0,0,0);-ms-transform:translate3d(0,0,0);transform:translate3d(0,0,0);left:0!important;right:0;margin:0 auto!important}.fp-slidesNav.bottom{bottom:17px}.fp-slidesNav.top{top:17px}#fp-nav ul,.fp-slidesNav ul{margin:0;padding:0}#fp-nav ul li,.fp-slidesNav ul li{display:block;width:14px;height:13px;margin:7px;position:relative}.fp-slidesNav ul li{display:inline-block}#fp-nav ul li a,.fp-slidesNav ul li a{display:block;position:relative;z-index:1;width:100%;height:100%;cursor:pointer;text-decoration:none}#fp-nav ul li a.active span,#fp-nav ul li:hover a.active span,.fp-slidesNav ul li a.active span,.fp-slidesNav ul li:hover a.active span{height:12px;width:12px;margin:-6px 0 0 -6px;border-radius:100%}#fp-nav ul li a span,.fp-slidesNav ul li a span{border-radius:50%;position:absolute;z-index:1;height:4px;width:4px;border:0;background:#333;left:50%;top:50%;margin:-2px 0 0 -2px;-webkit-transition:all .1s ease-in-out;-moz-transition:all .1s ease-in-out;-o-transition:all .1s ease-in-out;transition:all .1s ease-in-out}#fp-nav ul li:hover a span,.fp-slidesNav ul li:hover a span{width:10px;height:10px;margin:-5px 0 0 -5px}#fp-nav ul li .fp-tooltip{position:absolute;top:-2px;color:#fff;font-size:14px;font-family:arial,helvetica,sans-serif;white-space:nowrap;max-width:220px;overflow:hidden;display:block;opacity:0;width:0;cursor:pointer}#fp-nav ul li:hover .fp-tooltip,#fp-nav.fp-show-active a.active+.fp-tooltip{-webkit-transition:opacity .2s ease-in;transition:opacity .2s ease-in;width:auto;opacity:1}#fp-nav ul li .fp-tooltip.right{right:20px}#fp-nav ul li .fp-tooltip.left{left:20px}.fp-auto-height .fp-slide,.fp-auto-height .fp-tableCell,.fp-auto-height.fp-section{height:auto!important}.fp-responsive .fp-auto-height-responsive .fp-slide,.fp-responsive .fp-auto-height-responsive .fp-tableCell,.fp-responsive .fp-auto-height-responsive.fp-section{height:auto!important} 8 | /*# sourceMappingURL=jquery.fullpage.min.css.map */ 9 | -------------------------------------------------------------------------------- /vignettes/fullPage.Rmd: -------------------------------------------------------------------------------- 1 | --- 2 | title: "fullPage" 3 | author: "John Coene" 4 | date: "`r Sys.Date()`" 5 | output: rmarkdown::html_vignette 6 | vignette: > 7 | %\VignetteIndexEntry{fullPage} 8 | %\VignetteEngine{knitr::rmarkdown} 9 | %\VignetteEncoding{UTF-8} 10 | --- 11 | 12 | ```{r setup, include = FALSE} 13 | knitr::opts_chunk$set( 14 | collapse = TRUE, 15 | comment = "#>" 16 | ) 17 | ``` 18 | 19 | You can run a local demo of fullPage with `demo("fullPage", package = "fullPage")`. 20 | 21 | `fullPage` consists of section (`fullSection`) which may include slides (`fullSlide`), all the functions of relevant to fullPage start in `full_`.Always initialise the page with `fullPage`. 22 | 23 | The code looks like: 24 | 25 | ```r 26 | library(shiny) 27 | library(fullPage) 28 | 29 | options <- list( 30 | sectionsColor = c('#f2f2f2', '#4BBFC3', '#7BAABE'), 31 | parallax = TRUE 32 | ) 33 | 34 | ui <- fullPage( 35 | menu = c("Full Page" = "link1", 36 | "Sections" = "link2", 37 | "Slides" = "section3", 38 | "backgrounds" = "section4", 39 | "Background Slides" = "section5"), 40 | opts = options, 41 | fullSection( 42 | center = TRUE, 43 | menu = "link1", 44 | tags$h1("fullPage.js meets Shiny") 45 | ), 46 | fullSection( 47 | menu = "link2", 48 | fullContainer( 49 | fullRow( 50 | fullColumn( 51 | h3("Column 1"), 52 | selectInput( 53 | "dd", 54 | "data points", 55 | choices = c(10, 20, 30) 56 | ) 57 | ), 58 | fullColumn( 59 | plotOutput("hist") 60 | ), 61 | fullColumn( 62 | plotOutput("plot") 63 | ) 64 | ) 65 | ) 66 | ), 67 | fullSection( 68 | menu = "section3", 69 | fullSlide( 70 | fullContainer( 71 | center = TRUE, 72 | h3("With container"), 73 | plotOutput("slideplot2"), 74 | shiny::verbatimTextOutput("containerCode") 75 | ) 76 | ), 77 | fullSlide( 78 | center = TRUE, 79 | h3("Without container"), 80 | plotOutput("slideplot1") 81 | ) 82 | ), 83 | fullSectionPlot( 84 | menu = "section4", 85 | center = TRUE, 86 | "fp", 87 | h3("Background plots"), 88 | fullContainer( 89 | sliderInput( 90 | "fpInput", 91 | label = "Input", 92 | min = 10, 93 | max = 100, 94 | value = 74 95 | ) 96 | ) 97 | ), 98 | fullSection( 99 | menu = "section5", 100 | fullSlidePlot( 101 | "slideSectionPlot1", 102 | center = TRUE, 103 | h1("Slide background plot") 104 | ), 105 | fullSlidePlot( 106 | "slideSectionPlot2" 107 | ) 108 | ) 109 | ) 110 | 111 | server <- function(input, output){ 112 | 113 | output$plot <- renderPlot({ 114 | hist(rnorm(input$dd, 1, 10)) 115 | }) 116 | 117 | output$hist <- renderPlot({ 118 | hist(rnorm(input$dd, 1, 10)) 119 | }) 120 | 121 | output$slideplot1 <- renderPlot({ 122 | plot(mtcars$mpg, mtcars$drat) 123 | }) 124 | 125 | output$slideplot2 <- renderPlot({ 126 | plot(mtcars$wt, mtcars$mpg) 127 | }) 128 | 129 | output$fp <- renderPlot({ 130 | par(bg="gray") 131 | hist(rnorm(input$fpInput, 1, 10)) 132 | }) 133 | 134 | output$containerCode <- renderText({ 135 | "fullSlide( 136 | fullContainer(...) 137 | )" 138 | }) 139 | 140 | output$slideSectionPlot1 <- renderPlot({ 141 | par(bg="gray") 142 | hist(rnorm(50, 1, 20)) 143 | }) 144 | 145 | output$slideSectionPlot2 <- renderPlot({ 146 | par(bg="gray") 147 | hist(rnorm(50, 1, 25)) 148 | }) 149 | } 150 | 151 | shinyApp(ui, server) 152 | ``` -------------------------------------------------------------------------------- /docs/pkgdown.js: -------------------------------------------------------------------------------- 1 | /* http://gregfranko.com/blog/jquery-best-practices/ */ 2 | (function($) { 3 | $(function() { 4 | 5 | $("#sidebar") 6 | .stick_in_parent({offset_top: 40}) 7 | .on('sticky_kit:bottom', function(e) { 8 | $(this).parent().css('position', 'static'); 9 | }) 10 | .on('sticky_kit:unbottom', function(e) { 11 | $(this).parent().css('position', 'relative'); 12 | }); 13 | 14 | $('body').scrollspy({ 15 | target: '#sidebar', 16 | offset: 60 17 | }); 18 | 19 | $('[data-toggle="tooltip"]').tooltip(); 20 | 21 | var cur_path = paths(location.pathname); 22 | var links = $("#navbar ul li a"); 23 | var max_length = -1; 24 | var pos = -1; 25 | for (var i = 0; i < links.length; i++) { 26 | if (links[i].getAttribute("href") === "#") 27 | continue; 28 | // Ignore external links 29 | if (links[i].host !== location.host) 30 | continue; 31 | 32 | var nav_path = paths(links[i].pathname); 33 | 34 | var length = prefix_length(nav_path, cur_path); 35 | if (length > max_length) { 36 | max_length = length; 37 | pos = i; 38 | } 39 | } 40 | 41 | // Add class to parent
  • , and enclosing
  • if in dropdown 42 | if (pos >= 0) { 43 | var menu_anchor = $(links[pos]); 44 | menu_anchor.parent().addClass("active"); 45 | menu_anchor.closest("li.dropdown").addClass("active"); 46 | } 47 | }); 48 | 49 | function paths(pathname) { 50 | var pieces = pathname.split("/"); 51 | pieces.shift(); // always starts with / 52 | 53 | var end = pieces[pieces.length - 1]; 54 | if (end === "index.html" || end === "") 55 | pieces.pop(); 56 | return(pieces); 57 | } 58 | 59 | // Returns -1 if not found 60 | function prefix_length(needle, haystack) { 61 | if (needle.length > haystack.length) 62 | return(-1); 63 | 64 | // Special case for length-0 haystack, since for loop won't run 65 | if (haystack.length === 0) { 66 | return(needle.length === 0 ? 0 : -1); 67 | } 68 | 69 | for (var i = 0; i < haystack.length; i++) { 70 | if (needle[i] != haystack[i]) 71 | return(i); 72 | } 73 | 74 | return(haystack.length); 75 | } 76 | 77 | /* Clipboard --------------------------*/ 78 | 79 | function changeTooltipMessage(element, msg) { 80 | var tooltipOriginalTitle=element.getAttribute('data-original-title'); 81 | element.setAttribute('data-original-title', msg); 82 | $(element).tooltip('show'); 83 | element.setAttribute('data-original-title', tooltipOriginalTitle); 84 | } 85 | 86 | if(ClipboardJS.isSupported()) { 87 | $(document).ready(function() { 88 | var copyButton = ""; 89 | 90 | $(".examples, div.sourceCode").addClass("hasCopyButton"); 91 | 92 | // Insert copy buttons: 93 | $(copyButton).prependTo(".hasCopyButton"); 94 | 95 | // Initialize tooltips: 96 | $('.btn-copy-ex').tooltip({container: 'body'}); 97 | 98 | // Initialize clipboard: 99 | var clipboardBtnCopies = new ClipboardJS('[data-clipboard-copy]', { 100 | text: function(trigger) { 101 | return trigger.parentNode.textContent; 102 | } 103 | }); 104 | 105 | clipboardBtnCopies.on('success', function(e) { 106 | changeTooltipMessage(e.trigger, 'Copied!'); 107 | e.clearSelection(); 108 | }); 109 | 110 | clipboardBtnCopies.on('error', function() { 111 | changeTooltipMessage(e.trigger,'Press Ctrl+C or Command+C to copy'); 112 | }); 113 | }); 114 | } 115 | })(window.jQuery || window.$) 116 | -------------------------------------------------------------------------------- /R/fullPlot.R: -------------------------------------------------------------------------------- 1 | #' Use plot as background 2 | #' 3 | #' Use a reactive plot as section or slide background. 4 | #' 5 | #' @param outputId id passed to \code{\link[shiny]{plotOutput}}. 6 | #' @param ... any children element. 7 | #' @param menu menu link. 8 | #' @param center whether to center text horizontally. 9 | #' @param background sets background to overlaying shiny inputs, set to \code{NULL} to remove. 10 | #' 11 | #' @examples 12 | #' if(interactive()){ 13 | #' 14 | #' library(shiny) 15 | #' 16 | #' ui <- fullPage( 17 | #' opts = list(sectionsColor = c('#4BBFC3', '#7BAABE')), 18 | #' fullSection(h1("Full section plots"), center = TRUE), 19 | #' fullSectionPlot( 20 | #' "myPlot2", 21 | #' center = TRUE, 22 | #' fullContainer( 23 | #' h2("With a title") 24 | #' ) 25 | #' ), 26 | #' fullSectionPlot( 27 | #' "myPlot", 28 | #' center = TRUE, 29 | #' fullContainer( 30 | #' h3("Layer anything you want"), 31 | #' selectInput( 32 | #' "select", 33 | #' "Choose y", 34 | #' choices = c("mpg", "drat", "wt") 35 | #' ) 36 | #' ) 37 | #' ) 38 | #' ) 39 | #' 40 | #' server <- function(input, output){ 41 | #' 42 | #' output$myPlot <- renderPlot({ 43 | #' plot(1:nrow(mtcars), mtcars[[input$select]]) 44 | #' }) 45 | #' 46 | #' output$myPlot2 <- renderPlot({ 47 | #' plot(1:nrow(mtcars), mtcars[[input$select]]) 48 | #' }) 49 | #' 50 | #' } 51 | #' 52 | #' shinyApp(ui, server) 53 | #' } 54 | #' @author John Coene, \email{jcoenep@@gmail.com} 55 | #' 56 | #' @rdname fullPlot 57 | #' @export 58 | fullSectionPlot <- function(outputId, ..., menu = NULL, center = FALSE, background = "rgba(255,255,255,0.5)"){ 59 | section <- fullSection( 60 | menu = menu, 61 | center = center, 62 | shiny::tags$div( 63 | class = "wrapper", 64 | shiny::plotOutput(outputId, height = "100vh"), 65 | shiny::tags$div( 66 | class = "in", 67 | ... 68 | ) 69 | ) 70 | ) 71 | 72 | if(!is.null(background)) 73 | css <- paste0(".in .shiny-input-container{background:", background,";}") 74 | 75 | shiny::tagList( 76 | shiny::singleton( 77 | shiny::tags$head( 78 | shiny::tags$style( 79 | css 80 | ) 81 | ) 82 | ), 83 | section 84 | ) 85 | } 86 | 87 | #' @rdname fullPlot 88 | #' @export 89 | fullSlidePlot <- function(outputId, ..., menu = NULL, center = FALSE, background = "rgba(255,255,255,0.5)"){ 90 | section <- fullSlide( 91 | menu = menu, 92 | center = center, 93 | shiny::tags$div( 94 | class = "wrapper", 95 | shiny::plotOutput(outputId, height = "100vh"), 96 | shiny::tags$div( 97 | class = "in", 98 | ... 99 | ) 100 | ) 101 | ) 102 | 103 | if(!is.null(background)) 104 | css <- paste0(".in .shiny-input-container{background:", background,";}") 105 | 106 | shiny::tagList( 107 | shiny::singleton( 108 | shiny::tags$head( 109 | shiny::tags$style( 110 | css 111 | ) 112 | ) 113 | ), 114 | section 115 | ) 116 | } 117 | 118 | #' @rdname fullPlot 119 | #' @export 120 | pageSectionPlot <- fullSectionPlot 121 | 122 | #' @rdname fullPlot 123 | #' @export 124 | multiSectionPlot <- function(outputId, ..., menu = NULL, center = FALSE, background = "rgba(255,255,255,0.5)"){ 125 | section <- multiSection( 126 | menu = menu, 127 | center = center, 128 | shiny::tags$div( 129 | class = "wrapper", 130 | shiny::plotOutput(outputId, height = "100vh"), 131 | shiny::tags$div( 132 | class = "in", 133 | ... 134 | ) 135 | ) 136 | ) 137 | 138 | if(!is.null(background)) 139 | css <- paste0(".in .shiny-input-container{background:", background,";}") 140 | 141 | shiny::tagList( 142 | shiny::singleton( 143 | shiny::tags$head( 144 | shiny::tags$style( 145 | css 146 | ) 147 | ) 148 | ), 149 | section 150 | ) 151 | } 152 | -------------------------------------------------------------------------------- /man/pagePiling.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/pagePiling.R 3 | \name{pagePiling} 4 | \alias{pagePiling} 5 | \title{Setup a page.} 6 | \usage{ 7 | pagePiling(..., sections.color, opts = list(), menu = NULL, center = FALSE) 8 | } 9 | \arguments{ 10 | \item{...}{any element.} 11 | 12 | \item{sections.color}{character vector, i.e.: \code{c("blue", "red")}} 13 | 14 | \item{opts}{list of options, see details.} 15 | 16 | \item{menu}{menu links as named vector.} 17 | 18 | \item{center}{horizontally center all sections.} 19 | } 20 | \description{ 21 | Create a full scrolling page. 22 | } 23 | \details{ 24 | \itemize{ 25 | \item{\code{direction} - takes \code{vertical} or \code{horizontal} - defines if the scroll is vertical or horizontal.} 26 | \item{\code{verticalCentered} - boolean.} 27 | \item{\code{scrollingSpeed} - scrolling transitions in milliseconds, numeric value i.e.: \code{700}.} 28 | \item{\code{easing} - character string - takes \code{swing} or \code{linear}.} 29 | \item{\code{loopBottom} - boolean - defines whether scrolling down in the last section should scroll to the first one or not.} 30 | \item{\code{loopTop} - boolean - defines whether scrolling up in the first section should scroll to the last one or not.} 31 | \item{\code{css3} - boolean - defines whether to use JavaScript or CSS3 transforms to scroll within sections. Useful to speed up the movement in tablet and mobile devices with browsers supporting CSS3. If this option is set to true and the browser doesn't support CSS3, a jQuery fallback will be used instead.} 32 | \item{\code{navigation} - boolean - if set, it will show a navigation bar made up of small circles.} 33 | \item{\code{touchSensitivity} - numeric value - defines a percentage of the browsers window width/height, and how far a swipe must measure for navigating to the next section.} 34 | \item{\code{keyboardScrolling} - boolean - defines if the content can be navigated using the keyboard.} 35 | \item{\code{animateAnchor} - boolean - defines whether the load of the site when given an anchor will scroll with animation to its destination or will directly load on the given section.} 36 | } 37 | } 38 | \examples{ 39 | if(interactive()){ 40 | # Run de demo 41 | demo("pagePiling", package = "fullPage") 42 | 43 | # Or 44 | library(shiny) 45 | 46 | options <- list( 47 | loopBottom = TRUE 48 | ) 49 | 50 | ui <- pagePiling( 51 | center = TRUE, 52 | sections.color = c('#f2f2f2', '#2C3E50', '#39C'), 53 | opts = options, 54 | menu = c("Section 1" = "section1", 55 | "Piling" = "section2", 56 | "Plots" = "section3", 57 | "Reactive" = "section4", 58 | "Images" = "images"), 59 | pageSection( 60 | menu = "section1", 61 | h1("Page piling") 62 | ), 63 | pageSection( 64 | menu = "section2", 65 | h1("Section 2") 66 | ), 67 | pageSectionPlot( 68 | "plot", 69 | menu = "section3", 70 | h1("Plot background") 71 | ), 72 | pageSectionPlot( 73 | "plot2", 74 | menu = "section4", 75 | pageContainer( 76 | h1("Reactive background"), 77 | sliderInput( 78 | "bins", 79 | "Data Points", 80 | min = 100, 81 | max = 500, 82 | step = 25, 83 | value = 200 84 | ) 85 | ) 86 | ), 87 | pageSectionImage( # will not show in viewer, open in browser 88 | menu = "image", 89 | img = paste0( 90 | "https://raw.githubusercontent.com/alvarotrigo/", 91 | "fullPage.js/master/examples/imgs/bg2.jpg"), 92 | h1("Image background") 93 | ) 94 | ) 95 | 96 | server <- function(input, output){ 97 | 98 | output$plot <- renderPlot({ 99 | par(bg = "grey60") 100 | plot(mtcars$wt, mtcars$mpg) 101 | }) 102 | 103 | output$plot2 <- renderPlot({ 104 | par(bg = "grey80") 105 | hist(rnorm(input$bins, 100, 250)) 106 | }) 107 | } 108 | 109 | shinyApp(ui, server) 110 | } 111 | 112 | } 113 | \seealso{ 114 | \href{Official documentation}{https://github.com/alvarotrigo/pagePiling.js/}. 115 | } 116 | \author{ 117 | John Coene, \email{jcoenep@gmail.com} 118 | } 119 | -------------------------------------------------------------------------------- /docs/pkgdown.css: -------------------------------------------------------------------------------- 1 | /* Sticky footer */ 2 | 3 | /** 4 | * Basic idea: https://philipwalton.github.io/solved-by-flexbox/demos/sticky-footer/ 5 | * Details: https://github.com/philipwalton/solved-by-flexbox/blob/master/assets/css/components/site.css 6 | * 7 | * .Site -> body > .container 8 | * .Site-content -> body > .container .row 9 | * .footer -> footer 10 | * 11 | * Key idea seems to be to ensure that .container and __all its parents__ 12 | * have height set to 100% 13 | * 14 | */ 15 | 16 | html, body { 17 | height: 100%; 18 | } 19 | 20 | body > .container { 21 | display: flex; 22 | height: 100%; 23 | flex-direction: column; 24 | 25 | padding-top: 60px; 26 | } 27 | 28 | body > .container .row { 29 | flex: 1 0 auto; 30 | } 31 | 32 | footer { 33 | margin-top: 45px; 34 | padding: 35px 0 36px; 35 | border-top: 1px solid #e5e5e5; 36 | color: #666; 37 | display: flex; 38 | flex-shrink: 0; 39 | } 40 | footer p { 41 | margin-bottom: 0; 42 | } 43 | footer div { 44 | flex: 1; 45 | } 46 | footer .pkgdown { 47 | text-align: right; 48 | } 49 | footer p { 50 | margin-bottom: 0; 51 | } 52 | 53 | img.icon { 54 | float: right; 55 | } 56 | 57 | img { 58 | max-width: 100%; 59 | } 60 | 61 | /* Fix bug in bootstrap (only seen in firefox) */ 62 | summary { 63 | display: list-item; 64 | } 65 | 66 | /* Typographic tweaking ---------------------------------*/ 67 | 68 | .contents .page-header { 69 | margin-top: calc(-60px + 1em); 70 | } 71 | 72 | /* Section anchors ---------------------------------*/ 73 | 74 | a.anchor { 75 | margin-left: -30px; 76 | display:inline-block; 77 | width: 30px; 78 | height: 30px; 79 | visibility: hidden; 80 | 81 | background-image: url(./link.svg); 82 | background-repeat: no-repeat; 83 | background-size: 20px 20px; 84 | background-position: center center; 85 | } 86 | 87 | .hasAnchor:hover a.anchor { 88 | visibility: visible; 89 | } 90 | 91 | @media (max-width: 767px) { 92 | .hasAnchor:hover a.anchor { 93 | visibility: hidden; 94 | } 95 | } 96 | 97 | 98 | /* Fixes for fixed navbar --------------------------*/ 99 | 100 | .contents h1, .contents h2, .contents h3, .contents h4 { 101 | padding-top: 60px; 102 | margin-top: -40px; 103 | } 104 | 105 | /* Static header placement on mobile devices */ 106 | @media (max-width: 767px) { 107 | .navbar-fixed-top { 108 | position: absolute; 109 | } 110 | .navbar { 111 | padding: 0; 112 | } 113 | } 114 | 115 | 116 | /* Sidebar --------------------------*/ 117 | 118 | #sidebar { 119 | margin-top: 30px; 120 | } 121 | #sidebar h2 { 122 | font-size: 1.5em; 123 | margin-top: 1em; 124 | } 125 | 126 | #sidebar h2:first-child { 127 | margin-top: 0; 128 | } 129 | 130 | #sidebar .list-unstyled li { 131 | margin-bottom: 0.5em; 132 | } 133 | 134 | .orcid { 135 | height: 16px; 136 | vertical-align: middle; 137 | } 138 | 139 | /* Reference index & topics ----------------------------------------------- */ 140 | 141 | .ref-index th {font-weight: normal;} 142 | 143 | .ref-index td {vertical-align: top;} 144 | .ref-index .icon {width: 40px;} 145 | .ref-index .alias {width: 40%;} 146 | .ref-index-icons .alias {width: calc(40% - 40px);} 147 | .ref-index .title {width: 60%;} 148 | 149 | .ref-arguments th {text-align: right; padding-right: 10px;} 150 | .ref-arguments th, .ref-arguments td {vertical-align: top;} 151 | .ref-arguments .name {width: 20%;} 152 | .ref-arguments .desc {width: 80%;} 153 | 154 | /* Nice scrolling for wide elements --------------------------------------- */ 155 | 156 | table { 157 | display: block; 158 | overflow: auto; 159 | } 160 | 161 | /* Syntax highlighting ---------------------------------------------------- */ 162 | 163 | pre { 164 | word-wrap: normal; 165 | word-break: normal; 166 | border: 1px solid #eee; 167 | } 168 | 169 | pre, code { 170 | background-color: #f8f8f8; 171 | color: #333; 172 | } 173 | 174 | pre code { 175 | overflow: auto; 176 | word-wrap: normal; 177 | white-space: pre; 178 | } 179 | 180 | pre .img { 181 | margin: 5px 0; 182 | } 183 | 184 | pre .img img { 185 | background-color: #fff; 186 | display: block; 187 | height: auto; 188 | } 189 | 190 | code a, pre a { 191 | color: #375f84; 192 | } 193 | 194 | a.sourceLine:hover { 195 | text-decoration: none; 196 | } 197 | 198 | .fl {color: #1514b5;} 199 | .fu {color: #000000;} /* function */ 200 | .ch,.st {color: #036a07;} /* string */ 201 | .kw {color: #264D66;} /* keyword */ 202 | .co {color: #888888;} /* comment */ 203 | 204 | .message { color: black; font-weight: bolder;} 205 | .error { color: orange; font-weight: bolder;} 206 | .warning { color: #6A0366; font-weight: bolder;} 207 | 208 | /* Clipboard --------------------------*/ 209 | 210 | .hasCopyButton { 211 | position: relative; 212 | } 213 | 214 | .btn-copy-ex { 215 | position: absolute; 216 | right: 0; 217 | top: 0; 218 | visibility: hidden; 219 | } 220 | 221 | .hasCopyButton:hover button.btn-copy-ex { 222 | visibility: visible; 223 | } 224 | 225 | /* mark.js ----------------------------*/ 226 | 227 | mark { 228 | background-color: rgba(255, 255, 51, 0.5); 229 | border-bottom: 2px solid rgba(255, 153, 51, 0.3); 230 | padding: 1px; 231 | } 232 | 233 | /* vertical spacing after htmlwidgets */ 234 | .html-widget { 235 | margin-bottom: 10px; 236 | } 237 | -------------------------------------------------------------------------------- /man/multiPage.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/multiPage.R 3 | \name{multiPage} 4 | \alias{multiPage} 5 | \title{Setup a page} 6 | \usage{ 7 | multiPage(..., opts = list(), menu = NULL) 8 | } 9 | \arguments{ 10 | \item{...}{any element.} 11 | 12 | \item{opts}{a list of options, see details.} 13 | 14 | \item{menu}{named vector of menu links.} 15 | } 16 | \description{ 17 | Create a full scrolling page. 18 | } 19 | \details{ 20 | use the \code{menu} parameter on one "side" (\code{\link{multiLeft}} or \code{\link{multiRight}}) only; 21 | No need to specify it twice, it would breaks things as it is a \code{CSS} id, see examples. 22 | 23 | Valid \code{opts}: 24 | \itemize{ 25 | \item{\code{verticalCentered} - boolean - vertically centering of the content within sections.} 26 | \item{\code{scrollingSpeed} - numeric - speed in milliseconds for the scrolling transitions.} 27 | \item{\code{easing} - character string, \href{jQuery UI}{http://jqueryui.com/} easing, i.e.: \code{easeInQuart}} 28 | \item{\code{sectionsColor} - character vector, i.e.: \code{c("blue", "red")}} 29 | \item{\code{navigation} - boolean - if set, it will show a navigation bar made up of small circles.} 30 | \item{\code{navigationPosition} - character string, takes \code{none}, \code{left}, or \code{right}} 31 | \item{\code{navigationColor} - character string, i.e.:"black"} 32 | \item{\code{navigationTooltips} - character vector, i.e.: \code{c("Tooltip 1", "Tooltip 2")}} 33 | \item{\code{loopBottom} - boolean - defines whether scrolling down in the last section should scroll to the first one or not.} 34 | \item{\code{loopTop} - boolean - defines whether scrolling up in the first section should scroll to the last one or not.} 35 | \item{\code{css3} - boolean - defines whether to use JavaScript or CSS3 transforms to scroll within sections. Useful to speed up the movement in tablet and mobile devices with browsers supporting CSS3. If this option is set to true and the browser doesn't support CSS3, a jQuery fallback will be used instead.} 36 | \item{\code{paddingTop} - defines the top padding for each section with a numerical value and its measure, i.e.: \code{5em}} 37 | \item{\code{paddingBottom} - defines the bottom padding for each section with a numerical value and its measure , i.e.: \code{10px}} 38 | \item{\code{keyboardScrolling} boolean - defines if the content can be navigated using the keyboard} 39 | \item{\code{touchSensitivity} - numeric - defines a percentage of the browsers window width/height, and how far a swipe must measure for navigating to the next section, i.e.: \code{5}} 40 | \item{\code{responsiveWidth} - a class \code{ms-responsive} is added to the body tag in case the user wants to use it for his own responsive CSS. For example, if set to 900, whenever the browser's width is less than 900 the plugin will scroll like a normal site.} 41 | \item{\code{responsiveHeight} - a class \code{ms-responsive} is added to the body tag in case the user wants to use it for his own responsive CSS. For example, if set to 900, whenever the browser's height is less than 900 the plugin will scroll like a normal site.} 42 | \item{\code{responsiveExpand} - boolean - when responsive mode is fired (by using the \code{responsiveWidth} or \code{responsiveHeight} options) it turns auto scrolling off and expands each left and right side into a full-width section placing one after another. Then the page can be scrolled normally. \href{Read more about how to use the Responsive Expand option.}{https://github.com/alvarotrigo/multiscroll.js/wiki/Responsive-Expand-Extension}} 43 | } 44 | } 45 | \examples{ 46 | if(interactive()){ 47 | # Run de demo 48 | demo("muliPage", package = "fullPage") 49 | 50 | # OR 51 | library(shiny) 52 | 53 | options <- list( 54 | sectionsColor = c("#4BBFC3", "#7BAABE", "#d3d3d3", "#000") 55 | ) 56 | 57 | ui <- multiPage( 58 | opts = options, 59 | menu = c("Multi Scroll" = "multiscroll", 60 | "Plots" = "plots", 61 | "Full Section plots" = "fullplots", 62 | "Images" = "images"), 63 | multiLeft( 64 | align = "right", 65 | multiSection( 66 | menu = "multiscroll", 67 | h1("Multi") 68 | ), 69 | multiSection( 70 | menu = "plots", 71 | multiContainer( 72 | h1("Plot ->"), 73 | numericInput( 74 | "max", 75 | "Maximum", 76 | min = 50, 77 | max = 250, 78 | value = 10 79 | ) 80 | ) 81 | ), 82 | multiSectionPlot( 83 | menu = "fullplots", 84 | "fullPlot" 85 | ), 86 | multiSection( 87 | menu = "images", 88 | h1("Image ") 89 | ) 90 | ), 91 | multiRight( 92 | align = "left", 93 | multiSection( 94 | h1("Page()") 95 | ), 96 | multiSection( 97 | plotOutput("plot") 98 | ), 99 | multiSection( 100 | multiContainer( 101 | h1("<- Full Section plot"), 102 | sliderInput( 103 | "number", 104 | "Data points", 105 | min = 50, 106 | max = 250, 107 | value = 10 108 | ) 109 | ) 110 | ), 111 | multiSectionImage( 112 | img = "https://alvarotrigo.com/multiScroll/imgs/tiger.jpg", 113 | side = "right", 114 | h1("Background") 115 | ) 116 | ) 117 | ) 118 | 119 | server <- function(input, output){ 120 | 121 | output$plot <- renderPlot({ 122 | par(bg = "#7BAABE") 123 | hist(rnorm(100, 20, input$max)) 124 | }) 125 | 126 | output$fullPlot <- renderPlot({ 127 | par(bg = "#d3d3d3") 128 | hist(rnorm(input$number, 20, 250)) 129 | }) 130 | } 131 | 132 | shinyApp(ui, server) 133 | } 134 | } 135 | \seealso{ 136 | \href{Official documentation}{https://github.com/alvarotrigo/multiscroll.js}. 137 | } 138 | \author{ 139 | John Coene, \email{jcoenep@gmail.com} 140 | } 141 | -------------------------------------------------------------------------------- /docs/LICENSE-text.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | License • fullPage 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 58 | 59 | 60 | 61 | 62 | 63 |
    64 |
    65 | 131 | 132 | 133 |
    134 | 135 |
    136 |
    137 | 140 | 141 |
    YEAR: 2017
    142 | COPYRIGHT HOLDER: John Coene
    143 | 
    144 | 145 |
    146 | 147 |
    148 | 149 | 150 |
    151 | 154 | 155 |
    156 |

    Site built with pkgdown 1.3.0.

    157 |
    158 |
    159 |
    160 | 161 | 162 | 163 | 164 | 165 | 166 | -------------------------------------------------------------------------------- /R/pagePiling.R: -------------------------------------------------------------------------------- 1 | #' Setup a page. 2 | #' 3 | #' Create a full scrolling page. 4 | #' 5 | #' @param ... any element. 6 | #' @param opts list of options, see details. 7 | #' @param sections.color character vector, i.e.: \code{c("blue", "red")} 8 | #' @param menu menu links as named vector. 9 | #' @param center horizontally center all sections. 10 | #' 11 | #' @details 12 | #' \itemize{ 13 | #' \item{\code{direction} - takes \code{vertical} or \code{horizontal} - defines if the scroll is vertical or horizontal.} 14 | #' \item{\code{verticalCentered} - boolean.} 15 | #' \item{\code{scrollingSpeed} - scrolling transitions in milliseconds, numeric value i.e.: \code{700}.} 16 | #' \item{\code{easing} - character string - takes \code{swing} or \code{linear}.} 17 | #' \item{\code{loopBottom} - boolean - defines whether scrolling down in the last section should scroll to the first one or not.} 18 | #' \item{\code{loopTop} - boolean - defines whether scrolling up in the first section should scroll to the last one or not.} 19 | #' \item{\code{css3} - boolean - defines whether to use JavaScript or CSS3 transforms to scroll within sections. Useful to speed up the movement in tablet and mobile devices with browsers supporting CSS3. If this option is set to true and the browser doesn't support CSS3, a jQuery fallback will be used instead.} 20 | #' \item{\code{navigation} - boolean - if set, it will show a navigation bar made up of small circles.} 21 | #' \item{\code{touchSensitivity} - numeric value - defines a percentage of the browsers window width/height, and how far a swipe must measure for navigating to the next section.} 22 | #' \item{\code{keyboardScrolling} - boolean - defines if the content can be navigated using the keyboard.} 23 | #' \item{\code{animateAnchor} - boolean - defines whether the load of the site when given an anchor will scroll with animation to its destination or will directly load on the given section.} 24 | #' } 25 | #' 26 | #' @examples 27 | #' if(interactive()){ 28 | #' # Run de demo 29 | #' demo("pagePiling", package = "fullPage") 30 | #' 31 | #' # Or 32 | #' library(shiny) 33 | #' 34 | #' options <- list( 35 | #' loopBottom = TRUE 36 | #' ) 37 | #' 38 | #' ui <- pagePiling( 39 | #' center = TRUE, 40 | #' sections.color = c('#f2f2f2', '#2C3E50', '#39C'), 41 | #' opts = options, 42 | #' menu = c("Section 1" = "section1", 43 | #' "Piling" = "section2", 44 | #' "Plots" = "section3", 45 | #' "Reactive" = "section4", 46 | #' "Images" = "images"), 47 | #' pageSection( 48 | #' menu = "section1", 49 | #' h1("Page piling") 50 | #' ), 51 | #' pageSection( 52 | #' menu = "section2", 53 | #' h1("Section 2") 54 | #' ), 55 | #' pageSectionPlot( 56 | #' "plot", 57 | #' menu = "section3", 58 | #' h1("Plot background") 59 | #' ), 60 | #' pageSectionPlot( 61 | #' "plot2", 62 | #' menu = "section4", 63 | #' pageContainer( 64 | #' h1("Reactive background"), 65 | #' sliderInput( 66 | #' "bins", 67 | #' "Data Points", 68 | #' min = 100, 69 | #' max = 500, 70 | #' step = 25, 71 | #' value = 200 72 | #' ) 73 | #' ) 74 | #' ), 75 | #' pageSectionImage( # will not show in viewer, open in browser 76 | #' menu = "image", 77 | #' img = paste0( 78 | #' "https://raw.githubusercontent.com/alvarotrigo/", 79 | #' "fullPage.js/master/examples/imgs/bg2.jpg"), 80 | #' h1("Image background") 81 | #' ) 82 | #' ) 83 | #' 84 | #' server <- function(input, output){ 85 | #' 86 | #' output$plot <- renderPlot({ 87 | #' par(bg = "grey60") 88 | #' plot(mtcars$wt, mtcars$mpg) 89 | #' }) 90 | #' 91 | #' output$plot2 <- renderPlot({ 92 | #' par(bg = "grey80") 93 | #' hist(rnorm(input$bins, 100, 250)) 94 | #' }) 95 | #' } 96 | #' 97 | #' shinyApp(ui, server) 98 | #' } 99 | #' 100 | #' @author John Coene, \email{jcoenep@@gmail.com} 101 | #' 102 | #' @seealso \href{Official documentation}{https://github.com/alvarotrigo/pagePiling.js/}. 103 | #' 104 | #' @export 105 | pagePiling <- function(..., sections.color, opts = list(), menu = NULL, center = FALSE){ 106 | 107 | if(missing(sections.color)) 108 | stop("must pass sections.color", call. = FALSE) 109 | 110 | # add anchors to JS 111 | opts <- append(opts, list(sectionsColor = sections.color)) 112 | 113 | # build menu 114 | if(!is.null(menu)){ 115 | 116 | # unordered list ot append to 117 | ul <- shiny::tags$ul( 118 | id = "tocMenu" 119 | ) 120 | 121 | # loop through items add list 122 | for(i in 1:length(menu)){ 123 | 124 | if(!length(names(menu))) 125 | stop("Menu must be a named vector", call. = FALSE) 126 | 127 | li <- shiny::tags$li( 128 | `data-menuanchor` = unname(menu[i]), 129 | shiny::tags$a( 130 | href = paste0("#", unname(menu[i])), 131 | names(menu)[i] 132 | ) 133 | ) 134 | 135 | # append to unordered list 136 | ul <- shiny::tagAppendChild(ul, li) 137 | } 138 | 139 | # add menu anchors 140 | opts$anchors <- unname(menu) 141 | opts$menu <- "#tocMenu" 142 | 143 | # build body 144 | body <- shiny::tags$body( 145 | ul, 146 | shiny::tags$div( 147 | id = "fp", 148 | ... 149 | ) 150 | ) 151 | } else { # no menu 152 | body <- shiny::tags$body( 153 | shiny::tags$div( 154 | id = "fp", 155 | ... 156 | ) 157 | ) 158 | } 159 | 160 | if(isTRUE(center)) 161 | body <- shiny::tagAppendAttributes(body, style = "text-align: center;") 162 | 163 | shiny::tags$html( 164 | shiny::tags$head( 165 | shiny::bootstrapLib(), 166 | shiny::includeCSS( 167 | system.file("css/styles.css", package = "fullPage") 168 | ), 169 | shiny::includeCSS( 170 | system.file("css/jquery.pagepiling.min.css", package = "fullPage") 171 | ), 172 | shiny::includeScript( 173 | system.file("js/jquery.pagepiling.min.js", package = "fullPage") 174 | ), 175 | shiny::tags$script( 176 | build_opts_pp(opts) 177 | ) 178 | ), 179 | body 180 | ) 181 | } 182 | -------------------------------------------------------------------------------- /docs/articles/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | Articles • fullPage 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 58 | 59 | 60 | 61 | 62 | 63 |
    64 |
    65 | 131 | 132 | 133 |
    134 | 135 |
    136 |
    137 | 140 | 141 |
    142 |

    All vignettes

    143 |

    144 | 145 | 151 |
    152 |
    153 |
    154 | 155 |
    156 | 159 | 160 |
    161 |

    Site built with pkgdown 1.3.0.

    162 |
    163 |
    164 |
    165 | 166 | 167 | 168 | 169 | 170 | 171 | -------------------------------------------------------------------------------- /docs/authors.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | Authors • fullPage 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 58 | 59 | 60 | 61 | 62 | 63 |
    64 |
    65 | 131 | 132 | 133 |
    134 | 135 |
    136 |
    137 | 140 | 141 |
      142 |
    • 143 |

      John Coene. Author, maintainer. 144 |

      145 |
    • 146 |
    • 147 |

      RinteRface. Copyright holder. 148 |

      149 |
    • 150 |
    • 151 |

      jQuery Foundation. Copyright holder. 152 |

      153 |
    • 154 |
    • 155 |

      CJ Patoilo. Copyright holder. 156 |

      157 |
    • 158 |
    • 159 |

      Alvaro Trigo. Copyright holder. 160 |

      161 |
    • 162 |
    163 | 164 |
    165 | 166 |
    167 | 168 | 169 |
    170 | 173 | 174 |
    175 |

    Site built with pkgdown 1.3.0.

    176 |
    177 |
    178 |
    179 | 180 | 181 | 182 | 183 | 184 | 185 | -------------------------------------------------------------------------------- /docs/news/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | Changelog • fullPage 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 58 | 59 | 60 | 61 | 62 | 63 |
    64 |
    65 | 131 | 132 | 133 |
    134 | 135 |
    136 |
    137 | 141 | 142 |
    143 |

    144 | fullPage 0.0.1

    145 |
      146 |
    • Initial version
    • 147 |
    148 |
    149 |
    150 | 151 | 159 | 160 |
    161 | 162 |
    163 | 166 | 167 |
    168 |

    Site built with pkgdown 1.3.0.

    169 |
    170 |
    171 |
    172 | 173 | 174 | 175 | 176 | 177 | 178 | -------------------------------------------------------------------------------- /docs/articles/callbacks.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | Callbacks • fullPage 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 26 | 27 | 28 |
    29 |
    96 | 97 | 98 | 99 |
    100 |
    101 | 111 | 112 | 113 | 114 |

    Callbacks let you pick up on events, i.e.: which slide is currently being viewed. For instance, it comes in handy to display animations at the right moment! Below are the callbacks available to each family of functions:

    115 |

    fullPage

    116 |
      117 |
    • 118 | input$fp_origin: origin slide
    • 119 |
    • 120 | input$fp_destination: destination slide
    • 121 |
    • 122 | input$fp_direction: scroll direction
    • 123 |
    124 |

    pagePiling & multiScroll

    125 |
      126 |
    • 127 | input$fp_anchor: slide anchor
    • 128 |
    • 129 | input$fp_index: slide index
    • 130 |
    131 |

    Demo:

    132 |
    library(shiny)
    133 | library(fullPage)
    134 | 
    135 | ui <- fullPage(
    136 |   fullSection(
    137 |     menu = "first",
    138 |     center = TRUE,
    139 |     h1("Callbacks")
    140 |   ),
    141 |   fullSection(
    142 |     menu = "second",
    143 |     center = TRUE,
    144 |     h3("Slide"),
    145 |     verbatimTextOutput("slide")
    146 |   )
    147 | )
    148 | 
    149 | server <- function(input, output){
    150 |   
    151 |   output$slide <- renderPrint({
    152 |     input$fp_origin # returns menu
    153 |   })
    154 |   
    155 | }
    156 | 
    157 | shinyApp(ui, server)
    158 |
    159 | 160 | 163 | 164 |
    165 | 166 | 167 |
    170 | 171 |
    172 |

    Site built with pkgdown 1.3.0.

    173 |
    174 |
    175 |
    176 | 177 | 178 | 179 | 180 | 181 | -------------------------------------------------------------------------------- /R/fullButton.R: -------------------------------------------------------------------------------- 1 | #' Add buttons 2 | #' 3 | #' Add buttons to your \code{\link{fullPage}}, \code{\link{pagePiling}} and \code{\link{multiPage}}. 4 | #' 5 | #' @param outline,clear set outline or clear button. 6 | #' @param ... any other element 7 | #' @param section,slide target section and/or slide. 8 | #' @param fun Javascript function to pass to button. 9 | #' 10 | #' @details See example for \code{*Custom} button. 11 | #' 12 | #' @examples 13 | #' library(shiny) 14 | #' 15 | #' if(interactive()){ 16 | #' 17 | #' ui <- fullPage( 18 | #' 19 | #' center = TRUE, 20 | #' 21 | #' fullSection( 22 | #' center = TRUE, 23 | #' h1("Buttons") 24 | #' ), 25 | #' fullSection( 26 | #' fullButton("Visit site", href = "https://john-coene.com") 27 | #' ), 28 | #' fullSection( 29 | #' fullButtonDown("Move Down", outline = TRUE) 30 | #' ), 31 | #' fullSection( 32 | #' fullButtonUp("Move up") 33 | #' ), 34 | #' fullSection( 35 | #' fullButtonTo("Move to first section", section = 1) 36 | #' ), 37 | #' fullSection( 38 | #' center = TRUE, 39 | #' fullSlide( 40 | #' fullButtonRight("Slide right", clear = TRUE) 41 | #' ), 42 | #' fullSlide( 43 | #' fullButtonLeft("Slide left", clear = TRUE) 44 | #' ) 45 | #' ), 46 | #' fullSection( 47 | #' p("Disables keyboard scrolling"), 48 | #' fullButtonCustom("Custom button", 49 | #' fun = "$.fn.fullpage.setKeyboardScrolling(false, 'down, right');") 50 | #' ) 51 | #' ) 52 | #' 53 | #' server <- function(input, output){} 54 | #' 55 | #' shinyApp(ui, server) 56 | #' } 57 | #' @author John Coene, \email{jcoenep@@gmail.com} 58 | #' 59 | #' @rdname button 60 | #' @export 61 | fullButton <- function(..., outline = FALSE, clear = FALSE){ 62 | 63 | if(isTRUE(clear) && isTRUE(outline)) 64 | stop("can online set outline or clear, not both", call. = FALSE) 65 | 66 | cl <- "button" 67 | if(isTRUE(outline)) cl <- paste(cl, "button-outline") 68 | if(isTRUE(clear)) cl <- paste(cl, "button-clear") 69 | 70 | shiny::tags$a( 71 | class = cl, 72 | ... 73 | ) 74 | } 75 | 76 | #' @rdname button 77 | #' @export 78 | fullButtonTo <- function(..., section, slide = 0, outline = FALSE, clear = FALSE){ 79 | 80 | if(missing(section)) 81 | stop("must pass section", call. = FALSE) 82 | 83 | id <- rand() 84 | 85 | button <- fullButton(..., id = id, outline = outline, clear = clear) 86 | 87 | if(!inherits(section, "numeric")) 88 | section <- paste0("'", section, "'") 89 | 90 | JS <- paste0("$(document).on('click', '#", id, "', function(){$.fn.fullpage.moveTo(", section, ", ", slide, ");});") 91 | 92 | shiny::tagList( 93 | shiny::tags$head( 94 | shiny::tags$script( 95 | JS 96 | ) 97 | ), 98 | button 99 | ) 100 | } 101 | 102 | #' @rdname button 103 | #' @export 104 | fullButtonUp <- function(..., outline = FALSE, clear = FALSE){ 105 | 106 | id <- rand() 107 | 108 | button <- fullButton(..., id = id, outline = outline, clear = clear) 109 | 110 | JS <- paste0("$(document).on('click', '#", id, "', function(){$.fn.fullpage.moveSectionUp();});") 111 | 112 | shiny::tagList( 113 | shiny::tags$head( 114 | shiny::tags$script( 115 | JS 116 | ) 117 | ), 118 | button 119 | ) 120 | } 121 | 122 | #' @rdname button 123 | #' @export 124 | fullButtonDown <- function(..., outline = FALSE, clear = FALSE){ 125 | 126 | id <- rand() 127 | 128 | button <- fullButton(..., id = id, outline = outline, clear = clear) 129 | 130 | JS <- paste0("$(document).on('click', '#", id, "', function(){$.fn.fullpage.moveSectionDown();});") 131 | 132 | shiny::tagList( 133 | shiny::tags$head( 134 | shiny::tags$script( 135 | JS 136 | ) 137 | ), 138 | button 139 | ) 140 | } 141 | 142 | #' @rdname button 143 | #' @export 144 | fullButtonRight <- function(..., outline = FALSE, clear = FALSE){ 145 | 146 | id <- rand() 147 | 148 | button <- fullButton(..., id = id, outline = outline, clear = clear) 149 | 150 | JS <- paste0("$(document).on('click', '#", id, "', function(){$.fn.fullpage.moveSlideRight();});") 151 | 152 | shiny::tagList( 153 | shiny::tags$head( 154 | shiny::tags$script( 155 | JS 156 | ) 157 | ), 158 | button 159 | ) 160 | } 161 | 162 | #' @rdname button 163 | #' @export 164 | fullButtonLeft <- function(..., outline = FALSE, clear = FALSE){ 165 | 166 | id <- rand() 167 | 168 | button <- fullButton(..., id = id, outline = outline, clear = clear) 169 | 170 | JS <- paste0("$(document).on('click', '#", id, "', function(){$.fn.fullpage.moveSlideLeft();});") 171 | 172 | shiny::tagList( 173 | shiny::tags$head( 174 | shiny::tags$script( 175 | JS 176 | ) 177 | ), 178 | button 179 | ) 180 | } 181 | 182 | #' @rdname button 183 | #' @export 184 | fullButtonCustom <- function(..., fun, outline = FALSE, clear = FALSE){ 185 | if(missing(fun)) 186 | stop("missing function") 187 | 188 | 189 | id <- rand() 190 | 191 | button <- fullButton(..., id = id, outline = outline, clear = clear) 192 | 193 | JS <- paste0("$(document).on('click', '#", id, "', function(){", fun, "});") 194 | 195 | shiny::tagList( 196 | shiny::tags$head( 197 | shiny::tags$script( 198 | JS 199 | ) 200 | ), 201 | button 202 | ) 203 | } 204 | 205 | #' @rdname button 206 | #' @export 207 | pageButton <- fullButton 208 | 209 | #' @rdname button 210 | #' @export 211 | multiButton <- fullButton 212 | 213 | #' @rdname button 214 | #' @export 215 | pageButtonUp <- function(..., outline = FALSE, clear = FALSE){ 216 | 217 | id <- rand() 218 | 219 | button <- fullButton(..., id = id, outline = outline, clear = clear) 220 | 221 | JS <- paste0("$(document).on('click', '#", id, "', function(){$.fn.pagepiling.moveSectionUp();});") 222 | 223 | shiny::tagList( 224 | shiny::tags$head( 225 | shiny::tags$script( 226 | JS 227 | ) 228 | ), 229 | button 230 | ) 231 | } 232 | 233 | #' @rdname button 234 | #' @export 235 | pageButtonDown <- function(..., outline = FALSE, clear = FALSE){ 236 | 237 | id <- rand() 238 | 239 | button <- fullButton(..., id = id, outline = outline, clear = clear) 240 | 241 | JS <- paste0("$(document).on('click', '#", id, "', function(){$.fn.pagepiling.moveSectionDown();});") 242 | 243 | shiny::tagList( 244 | shiny::tags$head( 245 | shiny::tags$script( 246 | JS 247 | ) 248 | ), 249 | button 250 | ) 251 | } 252 | 253 | #' @rdname button 254 | #' @export 255 | pageButtonTo <- function(..., section, outline = FALSE, clear = FALSE){ 256 | 257 | if(missing(section)) 258 | stop("must pass section", call. = FALSE) 259 | 260 | id <- rand() 261 | 262 | button <- fullButton(..., id = id, outline = outline, clear = clear) 263 | 264 | if(!inherits(section, "numeric")) 265 | section <- paste0("'", section, "'") 266 | 267 | JS <- paste0("$(document).on('click', '#", id, "', function(){$.fn.pagepiling.moveTo(", section, ");});") 268 | 269 | shiny::tagList( 270 | shiny::tags$head( 271 | shiny::tags$script( 272 | JS 273 | ) 274 | ), 275 | button 276 | ) 277 | } 278 | 279 | #' @rdname button 280 | #' @export 281 | multiButtonUp <- function(..., outline = FALSE, clear = FALSE){ 282 | 283 | id <- rand() 284 | 285 | button <- fullButton(..., id = id, outline = outline, clear = clear) 286 | 287 | JS <- paste0("$(document).on('click', '#", id, "', function(){$.fn.multiscroll.moveSectionDown();});") 288 | 289 | shiny::tagList( 290 | shiny::tags$head( 291 | shiny::tags$script( 292 | JS 293 | ) 294 | ), 295 | button 296 | ) 297 | } 298 | 299 | #' @rdname button 300 | #' @export 301 | multiButtonDown <- function(..., outline = FALSE, clear = FALSE){ 302 | 303 | id <- rand() 304 | 305 | button <- fullButton(..., id = id, outline = outline, clear = clear) 306 | 307 | JS <- paste0("$(document).on('click', '#", id, "', function(){$.fn.multiscroll.moveSectionDown();});") 308 | 309 | shiny::tagList( 310 | shiny::tags$head( 311 | shiny::tags$script( 312 | JS 313 | ) 314 | ), 315 | button 316 | ) 317 | } 318 | 319 | #' @rdname button 320 | #' @export 321 | multiButtonTo <- function(..., section, outline = FALSE, clear = FALSE){ 322 | 323 | if(missing(section)) 324 | stop("must pass section", call. = FALSE) 325 | 326 | id <- rand() 327 | 328 | button <- fullButton(..., id = id, outline = outline, clear = clear) 329 | 330 | if(!inherits(section, "numeric")) 331 | section <- paste0("'", section, "'") 332 | 333 | JS <- paste0("$(document).on('click', '#", id, "', function(){$.fn.multiscroll.moveTo(", section, ");});") 334 | 335 | shiny::tagList( 336 | shiny::tags$head( 337 | shiny::tags$script( 338 | JS 339 | ) 340 | ), 341 | button 342 | ) 343 | } 344 | -------------------------------------------------------------------------------- /docs/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | Three Families of Functions for Three Different Single Page Shiny Apps • fullPage 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 26 | 27 | 28 |
    29 |
    96 | 97 | 98 | 99 |
    100 |
    101 | 102 | 103 | 104 | 105 |
    106 | 109 | 110 |
    111 |

    Many of the amazing works of Álvaro Trigo for Shiny!

    112 |
    113 |

    114 | fullPage demo 115 | pagePiling demo 116 | multiScroll demo 117 |

    118 |
    119 |

    120 | Installation

    121 |

    Install the stable version from CRAN:

    122 |
    install.packages("fullPage")
    123 |

    Install the dev version from Github with:

    124 |
    # install.packages("remotes")
    125 | remotes::install_github("RinteRface/fullPage")
    126 |
    127 |
    128 |

    129 | Features

    130 | 138 |

    All ships with:

    139 |
      140 |
    • 141 | Milligram grid, button, typography, and themes. 142 |
    • 143 |
    144 |
    145 |
    146 |
    147 | 148 | 184 | 185 |
    186 | 187 | 188 |
    191 | 192 |
    193 |

    Site built with pkgdown 1.3.0.

    194 |
    195 |
    196 |
    197 | 198 | 199 | 200 | 201 | 202 | -------------------------------------------------------------------------------- /inst/js/jquery.pagepiling.min.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * pagepiling.js 1.5.4 3 | * 4 | * https://github.com/alvarotrigo/pagePiling.js 5 | * @license MIT licensed 6 | * 7 | * Copyright (C) 2016 alvarotrigo.com - A project by Alvaro Trigo 8 | */ 9 | !function(e,n,t,o){"use strict";e.fn.pagepiling=function(i){function a(e){e.addClass("pp-table").wrapInner('
    ')}function s(n){var t=e(".pp-section.active").index(".pp-section"),o=n.index(".pp-section");return t>o?"up":"down"}function c(n,t){var o={destination:n,animated:t,activeSection:e(".pp-section.active"),anchorLink:n.data("anchor"),sectionIndex:n.index(".pp-section"),toMove:n,yMovement:s(n),leavingSection:e(".pp-section.active").index(".pp-section")+1};if(!o.activeSection.is(n)){"undefined"==typeof o.animated&&(o.animated=!0),"undefined"!=typeof o.anchorLink&&v(o.anchorLink,o.sectionIndex),o.destination.addClass("active").siblings().removeClass("active"),o.sectionsToMove=p(o),"down"===o.yMovement?(o.translate3d=U(),o.scrolling="-100%",Z.css3||o.sectionsToMove.each(function(n){n!=o.activeSection.index(".pp-section")&&e(this).css(u(o.scrolling))}),o.animateSection=o.activeSection):(o.translate3d="translate3d(0px, 0px, 0px)",o.scrolling="0",o.animateSection=n),e.isFunction(Z.onLeave)&&Z.onLeave.call(this,o.leavingSection,o.sectionIndex+1,o.yMovement),r(o),A(o.anchorLink),z(o.anchorLink,o.sectionIndex),W=o.anchorLink;var i=(new Date).getTime();Q=i}}function r(n){Z.css3?(w(n.animateSection,n.translate3d,n.animated),n.sectionsToMove.each(function(){w(e(this),n.translate3d,n.animated)}),setTimeout(function(){l(n)},Z.scrollingSpeed)):(n.scrollOptions=u(n.scrolling),n.animated?n.animateSection.animate(n.scrollOptions,Z.scrollingSpeed,Z.easing,function(){d(n),l(n)}):(n.animateSection.css(u(n.scrolling)),setTimeout(function(){d(n),l(n)},400)))}function l(n){e.isFunction(Z.afterLoad)&&Z.afterLoad.call(this,n.anchorLink,n.sectionIndex+1)}function p(n){var t;return t="down"===n.yMovement?e(".pp-section").map(function(t){if(tn.destination.index(".pp-section"))return e(this)})}function d(n){"up"===n.yMovement&&n.sectionsToMove.each(function(t){e(this).css(u(n.scrolling))})}function u(e){return"vertical"===Z.direction?{top:e}:{left:e}}function v(e,n){Z.anchors.length?(location.hash=e,f(location.hash)):f(String(n))}function f(n){n=n.replace("#",""),e("body")[0].className=e("body")[0].className.replace(/\b\s?pp-viewing-[^\s]+\b/g,""),e("body").addClass("pp-viewing-"+n)}function h(){var o=t.location.hash.replace("#",""),i=o,a=e(n).find('.pp-section[data-anchor="'+i+'"]');a.length>0&&c(a,Z.animateAnchor)}function m(){var e=(new Date).getTime();return e-Q149&&G.shift(),G.push(Math.abs(i));var r=o-_;if(_=o,r>200&&(G=[]),!m()){var l=e(".pp-section.active"),p=T(l),d=y(G,10),u=y(G,70),v=d>=u;return v&&c&&(a<0?x("down",p):a>0&&x("up",p)),!1}}function y(e,n){for(var t=0,o=e.slice(Math.max(e.length-n,1)),i=0;i0){if(!M(t,n))return!0;o()}else o()}function M(e,n){return"top"===e?!n.scrollTop():"bottom"===e?n.scrollTop()+1+n.innerHeight()>=n[0].scrollHeight:void 0}function T(e){return e.filter(".pp-scrollable")}function C(){F.get(0).addEventListener?(F.get(0).removeEventListener("mousewheel",b,!1),F.get(0).removeEventListener("wheel",b,!1)):F.get(0).detachEvent("onmousewheel",b)}function k(){F.get(0).addEventListener?(F.get(0).addEventListener("mousewheel",b,!1),F.get(0).addEventListener("wheel",b,!1)):F.get(0).attachEvent("onmousewheel",b)}function E(){if(R){var e=D();F.off("touchstart "+e.down).on("touchstart "+e.down,P),F.off("touchmove "+e.move).on("touchmove "+e.move,Y)}}function L(){if(R){var e=D();F.off("touchstart "+e.down),F.off("touchmove "+e.move)}}function D(){var e;return e=t.PointerEvent?{down:"pointerdown",move:"pointermove",up:"pointerup"}:{down:"MSPointerDown",move:"MSPointerMove",up:"MSPointerUp"}}function I(e){var n=new Array;return n.y="undefined"!=typeof e.pageY&&(e.pageY||e.pageX)?e.pageY:e.touches[0].pageY,n.x="undefined"!=typeof e.pageX&&(e.pageY||e.pageX)?e.pageX:e.touches[0].pageX,n}function X(e){return"undefined"==typeof e.pointerType||"mouse"!=e.pointerType}function P(e){var n=e.originalEvent;if(X(n)){var t=I(n);j=t.y,H=t.x}}function Y(n){var t=n.originalEvent;if(!N(n.target)&&X(t)){var o=e(".pp-section.active"),i=T(o);if(i.length||n.preventDefault(),!m()){var a=I(t);K=a.y,V=a.x,"horizontal"===Z.direction&&Math.abs(H-V)>Math.abs(j-K)?Math.abs(H-V)>F.width()/100*Z.touchSensitivity&&(H>V?x("down",i):V>H&&x("up",i)):Math.abs(j-K)>F.height()/100*Z.touchSensitivity&&(j>K?x("down",i):K>j&&x("up",i))}}}function N(n,t){t=t||0;var o=e(n).parent();return!!(t
      ');var n=e("#pp-nav");n.css("color",Z.navigation.textColor),n.addClass(Z.navigation.position);for(var t=0;t
    • ')}n.find("span").css("border-color",Z.navigation.bulletsColor)}function z(n,t){Z.navigation&&(e("#pp-nav").find(".active").removeClass("active"),n?e("#pp-nav").find('a[href="#'+n+'"]').addClass("active"):e("#pp-nav").find("li").eq(t).find("a").addClass("active"))}function A(n){Z.menu&&(e(Z.menu).find(".active").removeClass("active"),e(Z.menu).find('[data-menuanchor="'+n+'"]').addClass("active"))}function O(){var e,i=n.createElement("p"),a={webkitTransform:"-webkit-transform",OTransform:"-o-transform",msTransform:"-ms-transform",MozTransform:"-moz-transform",transform:"transform"};n.body.insertBefore(i,null);for(var s in a)i.style[s]!==o&&(i.style[s]="translate3d(1px,1px,1px)",e=t.getComputedStyle(i).getPropertyValue(a[s]));return n.body.removeChild(i),e!==o&&e.length>0&&"none"!==e}function U(){return"vertical"!==Z.direction?"translate3d(-100%, 0px, 0px)":"translate3d(0px, -100%, 0px)"}var W,B=e.fn.pagepiling,F=e(this),Q=0,R="ontouchstart"in t||navigator.msMaxTouchPoints>0||navigator.maxTouchPoints,j=0,H=0,K=0,V=0,G=[],J=600,Z=e.extend(!0,{direction:"vertical",menu:null,verticalCentered:!0,sectionsColor:[],anchors:[],scrollingSpeed:700,easing:"easeInQuart",loopBottom:!1,loopTop:!1,css3:!0,navigation:{textColor:"#000",bulletsColor:"#000",position:"right",tooltips:[]},normalScrollElements:null,normalScrollElementTouchThreshold:5,touchSensitivity:5,keyboardScrolling:!0,sectionSelector:".section",animateAnchor:!1,afterLoad:null,onLeave:null,afterRender:null},i);e.extend(e.easing,{easeInQuart:function(e,n,t,o,i){return o*(n/=i)*n*n*n+t}}),B.setScrollingSpeed=function(e){Z.scrollingSpeed=e},B.setMouseWheelScrolling=function(e){e?k():C()},B.setAllowScrolling=function(e){e?(B.setMouseWheelScrolling(!0),E()):(B.setMouseWheelScrolling(!1),L())},B.setKeyboardScrolling=function(e){Z.keyboardScrolling=e},B.moveSectionUp=function(){var n=e(".pp-section.active").prev(".pp-section");!n.length&&Z.loopTop&&(n=e(".pp-section").last()),n.length&&c(n)},B.moveSectionDown=function(){var n=e(".pp-section.active").next(".pp-section");!n.length&&Z.loopBottom&&(n=e(".pp-section").first()),n.length&&c(n)},B.moveTo=function(t){var o="";o=isNaN(t)?e(n).find('[data-anchor="'+t+'"]'):e(".pp-section").eq(t-1),o.length>0&&c(o)},e(Z.sectionSelector).each(function(){e(this).addClass("pp-section")}),Z.css3&&(Z.css3=O()),e(F).css({overflow:"hidden","-ms-touch-action":"none","touch-action":"none"}),B.setAllowScrolling(!0),e.isEmptyObject(Z.navigation)||q();var $=e(".pp-section").length;e(".pp-section").each(function(n){e(this).data("data-index",n),e(this).css("z-index",$),n||0!==e(".pp-section.active").length||e(this).addClass("active"),"undefined"!=typeof Z.anchors[n]&&e(this).attr("data-anchor",Z.anchors[n]),"undefined"!=typeof Z.sectionsColor[n]&&e(this).css("background-color",Z.sectionsColor[n]),Z.verticalCentered&&!e(this).hasClass("pp-scrollable")&&a(e(this)),$-=1}).promise().done(function(){Z.navigation&&(e("#pp-nav").css("margin-top","-"+e("#pp-nav").height()/2+"px"),e("#pp-nav").find("li").eq(e(".pp-section.active").index(".pp-section")).find("a").addClass("active")),e(t).on("load",function(){h()}),e.isFunction(Z.afterRender)&&Z.afterRender.call(this)}),e(t).on("hashchange",g),e(n).keydown(function(n){if(Z.keyboardScrolling&&!m())switch(n.which){case 38:case 33:B.moveSectionUp();break;case 40:case 34:B.moveSectionDown();break;case 36:B.moveTo(1);break;case 35:B.moveTo(e(".pp-section").length);break;case 37:B.moveSectionUp();break;case 39:B.moveSectionDown();break;default:return}}),Z.normalScrollElements&&(e(n).on("mouseenter",Z.normalScrollElements,function(){B.setMouseWheelScrolling(!1)}),e(n).on("mouseleave",Z.normalScrollElements,function(){B.setMouseWheelScrolling(!0)}));var _=(new Date).getTime();e(n).on("click touchstart","#pp-nav a",function(n){n.preventDefault();var t=e(this).parent().index();c(e(".pp-section").eq(t))}),e(n).on({mouseenter:function(){var n=e(this).data("tooltip");e('
      '+n+"
      ").hide().appendTo(e(this)).fadeIn(200)},mouseleave:function(){e(this).find(".pp-tooltip").fadeOut(200,function(){e(this).remove()})}},"#pp-nav li")}}(jQuery,document,window); 10 | //# sourceMappingURL=jquery.pagepiling.min.js.map 11 | -------------------------------------------------------------------------------- /inst/js/jquery.multiscroll.min.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * multiscroll.js 0.1.8 Beta 3 | * https://github.com/alvarotrigo/multiscroll.js 4 | * @license MIT licensed 5 | * 6 | * Copyright (C) 2016 alvarotrigo.com - A project by Alvaro Trigo 7 | */ 8 | !function(e,t,n,o,i){e.fn.multiscroll=function(s){function a(){var n=t.location.hash.replace("#",""),o=n;if(o.length){var i=e(".ms-left").find('[data-anchor="'+o+'"]'),s="undefined"==typeof lastScrolledDestiny;(s||o!==lastScrolledDestiny)&&h(i)}}function l(t){clearTimeout(O);var o=e(n.activeElement);if(!o.is("textarea")&&!o.is("input")&&!o.is("select")&&s.keyboardScrolling){var i=t.which,a=[40,38,32,33,34];e.inArray(i,a)>-1&&t.preventDefault(),O=setTimeout(function(){r(t)},150)}}function r(t){var n=t.shiftKey;switch(t.which){case 38:case 33:X.moveSectionUp();break;case 32:if(n){X.moveSectionUp();break}case 40:case 34:X.moveSectionDown();break;case 36:X.moveTo(1);break;case 35:X.moveTo(e(".ms-left .ms-section").length);break;default:return}}function c(t){t.preventDefault();var n=e(this).parent().index();h(e(".ms-left .ms-section").eq(n))}function m(){var t=e(this).data("tooltip");e('
      '+t+"
      ").hide().appendTo(e(this)).fadeIn(200)}function f(){e(this).find(".multiscroll-tooltip").fadeOut(200,function(){e(this).remove()})}function d(){N=e(t).height(),e(".ms-tableCell").each(function(){e(this).css({height:P(e(this).parent())})}),u(),e.isFunction(s.afterResize)&&s.afterResize.call(this)}function u(){s.css3?(S(e(".ms-left"),"translate3d(0px, -"+e(".ms-left").find(".ms-section.active").position().top+"px, 0px)",!1),S(e(".ms-right"),"translate3d(0px, -"+e(".ms-right").find(".ms-section.active").position().top+"px, 0px)",!1)):(e(".ms-left").css("top",-e(".ms-left").find(".ms-section.active").position().top),e(".ms-right").css("top",-e(".ms-right").find(".ms-section.active").position().top))}function h(t){var n=t.index(),o=e(".ms-right").find(".ms-section").eq(W-1-n),i=t.data("anchor"),a=e(".ms-left .ms-section.active"),l=a.index()+1,r=b(t);K=!0;var c={left:t.position().top,right:o.position().top};if(o.addClass("active").siblings().removeClass("active"),t.addClass("active").siblings().removeClass("active"),C(i),s.css3){e.isFunction(s.onLeave)&&s.onLeave.call(this,l,n+1,r);var m="translate3d(0px, -"+c.left+"px, 0px)",f="translate3d(0px, -"+c.right+"px, 0px)";S(e(".ms-left"),m,!0),S(e(".ms-right"),f,!0),setTimeout(function(){e.isFunction(s.afterLoad)&&s.afterLoad.call(this,i,n+1),setTimeout(function(){K=!1},q)},s.scrollingSpeed)}else e.isFunction(s.onLeave)&&s.onLeave.call(this,l,n+1,r),e(".ms-left").animate({top:-c.left},s.scrollingSpeed,s.easing,function(){e.isFunction(s.afterLoad)&&s.afterLoad.call(this,i,n+1),setTimeout(function(){K=!1},q)}),e(".ms-right").animate({top:-c.right},s.scrollingSpeed,s.easing);lastScrolledDestiny=i,w(i),x(i,n)}function v(){n.addEventListener?(n.removeEventListener("mousewheel",g,!1),n.removeEventListener("wheel",g,!1)):n.detachEvent("onmousewheel",g)}function p(){n.addEventListener?(n.addEventListener("mousewheel",g,!1),n.addEventListener("wheel",g,!1)):n.attachEvent("onmousewheel",g)}function g(e){e=t.event||e;var n=o.max(-1,o.min(1,e.wheelDelta||-e.deltaY||-e.detail));return K||(n<0?X.moveSectionDown():X.moveSectionUp()),!1}function S(e,t,n){e.toggleClass("ms-easing",n),e.css(y(t))}function y(e){return{"-webkit-transform":e,"-moz-transform":e,"-ms-transform":e,transform:e}}function x(t,n){s.navigation&&(e("#multiscroll-nav").find(".active").removeClass("active"),t?e("#multiscroll-nav").find('a[href="#'+t+'"]').addClass("active"):e("#multiscroll-nav").find("li").eq(n).find("a").addClass("active"))}function w(t){s.menu&&(e(s.menu).find(".active").removeClass("active"),e(s.menu).find('[data-menuanchor="'+t+'"]').addClass("active"))}function b(t){var n=e(".ms-left .ms-section.active").index(),o=t.index();return n>o?"up":"down"}function C(e){s.anchors.length&&(location.hash=e),T()}function T(){var t=e(".ms-left .ms-section.active"),n=t.data("anchor"),o=t.index(),i=String(o);s.anchors.length&&(i=n),i=i.replace("/","-").replace("#","");var a=new RegExp("\\b\\s?ms-viewing-[^\\s]+\\b","g");e("body")[0].className=e("body")[0].className.replace(a,""),e("body").addClass("ms-viewing-"+i)}function E(){var e,o=n.createElement("p"),s={webkitTransform:"-webkit-transform",OTransform:"-o-transform",msTransform:"-ms-transform",MozTransform:"-moz-transform",transform:"transform"};n.body.insertBefore(o,null);for(var a in s)o.style[a]!==i&&(o.style[a]="translate3d(1px,1px,1px)",e=t.getComputedStyle(o).getPropertyValue(s[a]));return n.body.removeChild(o),e!==i&&e.length>0&&"none"!==e}function M(e){e.addClass("ms-table").wrapInner('
      ')}function P(e){var t=N;if(s.paddingTop||s.paddingBottom){var n=parseInt(e.css("padding-top"))+parseInt(e.css("padding-bottom"));t=N-n}return t}function k(){var n=t.location.hash.replace("#",""),o=e('.ms-left .ms-section[data-anchor="'+n+'"]');n.length&&h(o)}function L(n){var i=n.originalEvent;if(D(i)){n.preventDefault();e(".ms-left .ms-section.active");if(!K){var a=F(i);A=a.y,V=a.x,o.abs(Q-A)>e(t).height()/100*s.touchSensitivity&&(Q>A?X.moveSectionDown():A>Q&&X.moveSectionUp())}}}function D(e){return"undefined"==typeof e.pointerType||"mouse"!=e.pointerType}function z(e){var t=e.originalEvent;if(D(t)){var n=F(t);Q=n.y,j=n.x}}function B(){I&&(MSPointer=Y(),e(n).off("touchstart "+MSPointer.down).on("touchstart "+MSPointer.down,z),e(n).off("touchmove "+MSPointer.move).on("touchmove "+MSPointer.move,L))}function R(){I&&(MSPointer=Y(),e(n).off("touchstart "+MSPointer.down),e(n).off("touchmove "+MSPointer.move))}function Y(){var e;return e=t.PointerEvent?{down:"pointerdown",move:"pointermove"}:{down:"MSPointerDown",move:"MSPointerMove"}}function F(e){var t=[];return t.y="undefined"!=typeof e.pageY&&(e.pageY||e.pageX)?e.pageY:e.touches[0].pageY,t.x="undefined"!=typeof e.pageX&&(e.pageY||e.pageX)?e.pageX:e.touches[0].pageX,I&&D(e)&&(t.y=e.touches[0].pageY,t.x=e.touches[0].pageX),t}var X=e.fn.multiscroll;s=e.extend({verticalCentered:!0,scrollingSpeed:700,easing:"easeInQuart",menu:!1,sectionsColor:[],anchors:[],navigation:!1,navigationPosition:"right",navigationColor:"#000",navigationTooltips:[],loopBottom:!1,loopTop:!1,css3:!1,paddingTop:0,paddingBottom:0,fixedElements:null,normalScrollElements:null,keyboardScrolling:!0,touchSensitivity:5,sectionSelector:".ms-section",leftSelector:".ms-left",rightSelector:".ms-right",afterLoad:null,onLeave:null,afterRender:null,afterResize:null},s);var q=600,I="ontouchstart"in t||navigator.msMaxTouchPoints>0||navigator.maxTouchPoints;".ms-right"!==s.rightSelector&&e(s.rightSelector).addClass("ms-right"),".ms-left"!==s.leftSelector&&e(s.leftSelector).addClass("ms-left");var U,W=e(".ms-left").find(".ms-section").length,K=!1,N=e(t).height();p(),B(),s.css3&&(s.css3=E()),e("html, body").css({overflow:"hidden",height:"100%"}),".ms-section"!==s.sectionSelector&&e(s.sectionSelector).each(function(){e(this).addClass("ms-section")}),s.navigation&&(e("body").append('
      '),U=e("#multiscroll-nav"),U.css("color",s.navigationColor),U.addClass(s.navigationPosition)),e(".ms-right, .ms-left").css({width:"50%",position:"absolute",height:"100%","-ms-touch-action":"none"}),e(".ms-right").css({right:"1px",top:"0","-ms-touch-action":"none","touch-action":"none"}),e(".ms-left").css({left:"0",top:"0","-ms-touch-action":"none","touch-action":"none"}),e(".ms-left .ms-section, .ms-right .ms-section").each(function(){var t=e(this).index();if((s.paddingTop||s.paddingBottom)&&e(this).css("padding",s.paddingTop+" 0 "+s.paddingBottom+" 0"),"undefined"!=typeof s.sectionsColor[t]&&e(this).css("background-color",s.sectionsColor[t]),"undefined"!=typeof s.anchors[t]&&e(this).attr("data-anchor",s.anchors[t]),s.verticalCentered&&M(e(this)),e(this).closest(".ms-left").length&&s.navigation){var n="";s.anchors.length&&(n=s.anchors[t]);var o=s.navigationTooltips[t];"undefined"==typeof o&&(o=""),s.navigation&&U.find("ul").append('
    • ')}}),e(".ms-right").html(e(".ms-right").find(".ms-section").get().reverse()),e(".ms-left .ms-section, .ms-right .ms-section").each(function(){var t=e(this).index();e(this).css({height:"100%"}),!t&&s.navigation&&U.find("li").eq(t).find("a").addClass("active")}).promise().done(function(){e(".ms-left .ms-section.active").length||(e(".ms-right").find(".ms-section").last().addClass("active"),e(".ms-left").find(".ms-section").first().addClass("active")),s.navigation&&U.css("margin-top","-"+U.height()/2+"px"),e.isFunction(s.afterRender)&&s.afterRender.call(this),u(),T(),e(t).on("load",function(){k()})}),e(t).on("hashchange",a),e(n).keydown(l);var O;e(n).mousedown(function(e){if(1==e.button)return e.preventDefault(),!1}),e(n).on("click","#multiscroll-nav a",c),e(n).on({mouseenter:m,mouseleave:f},"#multiscroll-nav li"),s.normalScrollElements&&(e(n).on("mouseenter",s.normalScrollElements,function(){X.setMouseWheelScrolling(!1)}),e(n).on("mouseleave",s.normalScrollElements,function(){X.setMouseWheelScrolling(!0)})),e(t).on("resize",d),X.moveSectionUp=function(){var t=e(".ms-left .ms-section.active").prev(".ms-section");!t.length&&s.loopTop&&(t=e(".ms-left .ms-section").last()),t.length&&h(t)},X.moveSectionDown=function(){var t=e(".ms-left .ms-section.active").next(".ms-section");!t.length&&s.loopBottom&&(t=e(".ms-left .ms-section").first()),t.length&&h(t)},X.moveTo=function(t){var n="";n=isNaN(t)?e('.ms-left [data-anchor="'+t+'"]'):e(".ms-left .ms-section").eq(t-1),h(n)},X.setKeyboardScrolling=function(e){s.keyboardScrolling=e},X.setMouseWheelScrolling=function(e){e?p():v()},X.setScrollingSpeed=function(e){s.scrollingSpeed=e};var Q=0,j=0,A=0,V=0;X.destroy=function(){X.setKeyboardScrolling(!1),X.setMouseWheelScrolling(!1),R(),e(t).off("hashchange",a).off("resize",d),e(n).off("mouseenter","#multiscroll-nav li").off("mouseleave","#multiscroll-nav li").off("click","#multiscroll-nav a")},X.build=function(){X.setKeyboardScrolling(!0),X.setMouseWheelScrolling(!0),B(),e(t).on("hashchange",a).on("resize",d),e(n).on("mouseenter","#multiscroll-nav li",m).on("mouseleave","#multiscroll-nav li",f).on("click","#multiscroll-nav a",c)}}}(jQuery,window,document,Math); 9 | //# sourceMappingURL=jquery.multiscroll.min.js.map 10 | -------------------------------------------------------------------------------- /docs/reference/sides.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | Create multi sections — multiLeft • fullPage 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 59 | 60 | 61 | 62 | 63 | 64 |
      65 |
      66 | 132 | 133 | 134 |
      135 | 136 |
      137 |
      138 | 143 | 144 |
      145 |

      Create multi page sides; left and right.

      146 |
      147 | 148 |
      multiLeft(..., align = NULL)
      149 | 
      150 | multiRight(..., align = NULL)
      151 | 152 |

      Arguments

      153 | 154 | 155 | 156 | 157 | 158 | 159 | 160 | 161 | 162 | 163 |
      ...

      any element.

      align

      text alignment passed to CSS, takes left, right or center.

      164 | 165 |

      Details

      166 | 167 |

      Only use one of each in multiPage.

      168 | 169 |

      Examples

      170 |
      if(interactive()){ 171 | library(shiny) 172 | 173 | ui <- multiPage( 174 | multiLeft( 175 | multiSection( 176 | align = "right", 177 | h1("Left") 178 | ), 179 | multiSection( 180 | align = "center", 181 | h1("Left Again") 182 | ) 183 | ), 184 | multiRight( 185 | multiSection( 186 | align = "left", 187 | h1("Right") 188 | ), 189 | multiSection( 190 | align = "center", 191 | h1("Right again") 192 | ) 193 | ) 194 | ) 195 | 196 | server <- function(input, output){} 197 | 198 | shinyApp(ui, server) 199 | }
      200 |
      201 | 212 |
      213 | 214 |
      215 | 218 | 219 |
      220 |

      Site built with pkgdown 1.3.0.

      221 |
      222 |
      223 |
      224 | 225 | 226 | 227 | 228 | 229 | 230 | -------------------------------------------------------------------------------- /docs/reference/theme.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | Set theme — fullTheme • fullPage 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 59 | 60 | 61 | 62 | 63 | 64 |
      65 |
      66 | 132 | 133 | 134 |
      135 | 136 |
      137 |
      138 | 143 | 144 |
      145 |

      Set a theme.

      146 |
      147 | 148 |
      fullTheme(theme)
      149 | 
      150 | multiTheme(theme)
      151 | 
      152 | pageTheme(theme)
      153 | 154 |

      Arguments

      155 | 156 | 157 | 158 | 159 | 160 | 161 |
      theme

      theme, see details.

      162 | 163 |

      Details

      164 | 165 |

      Valid theme:

        166 |
      • aqua

      • 167 |
      • black

      • 168 |
      • blue

      • 169 |
      • dark2

      • 170 |
      • fuchsia

      • 171 |
      • gray

      • 172 |
      • green

      • 173 |
      • lime

      • 174 |
      • maroon

      • 175 |
      • navy

      • 176 |
      • olive

      • 177 |
      • orange

      • 178 |
      • purple

      • 179 |
      • red

      • 180 |
      • silver

      • 181 |
      • teal

      • 182 |
      • yellow

      • 183 |
      184 | 185 |

      Examples

      186 |
      if(interactive()){ 187 | 188 | ui <- fullPage( 189 | 190 | center = TRUE, 191 | 192 | fullTheme("red"), # theme 193 | 194 | fullSection( 195 | center = TRUE, 196 | h1("Themes") 197 | ), 198 | fullSection( 199 | fullButtonTo("Move to first section", section = 1) 200 | ), 201 | fullSection( 202 | center = TRUE, 203 | fullSlide( 204 | fullButtonRight("Slide right", clear = TRUE) 205 | ), 206 | fullSlide( 207 | fullButtonLeft("Slide left", clear = TRUE) 208 | ) 209 | ) 210 | ) 211 | 212 | server <- function(input, output){} 213 | 214 | shinyApp(ui, server) 215 | }
      216 |
      217 | 228 |
      229 | 230 |
      231 | 234 | 235 |
      236 |

      Site built with pkgdown 1.3.0.

      237 |
      238 |
      239 |
      240 | 241 | 242 | 243 | 244 | 245 | 246 | -------------------------------------------------------------------------------- /docs/reference/container.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | Add containers — fullContainer • fullPage 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 59 | 60 | 61 | 62 | 63 | 64 |
      65 |
      66 | 132 | 133 | 134 |
      135 | 136 |
      137 |
      138 | 143 | 144 |
      145 |

      Add a container.

      146 |
      147 | 148 |
      fullContainer(...)
      149 | 
      150 | pageContainer(...)
      151 | 
      152 | multiContainer(...)
      153 | 154 |

      Arguments

      155 | 156 | 157 | 158 | 159 | 160 | 161 |
      ...

      any element.

      162 | 163 |

      Details

      164 | 165 |

      Pass within your grid, sections or slides.

      166 | 167 |

      Examples

      168 |
      if(interactive()){ 169 | library(shiny) 170 | 171 | ui <- fullPage( 172 | center = TRUE, 173 | fullSection( 174 | h1("Containers") 175 | ), 176 | fullSection( 177 | h1("Without container"), 178 | plotOutput("plot1") 179 | ), 180 | fullSection( 181 | fullContainer( 182 | h1("With container"), 183 | plotOutput("plot2"), 184 | pre( 185 | code( 186 | "fullContainer()" 187 | ) 188 | ) 189 | ) 190 | ) 191 | ) 192 | 193 | server <- function(input, output){ 194 | output$plot1 <- renderPlot({ 195 | plot(mtcars$wt, mtcars$mpg) 196 | }) 197 | 198 | output$plot2 <- renderPlot({ 199 | plot(mtcars$wt, mtcars$mpg) 200 | }) 201 | } 202 | 203 | shinyApp(ui, server) 204 | }
      205 |
      206 | 217 |
      218 | 219 |
      220 | 223 | 224 |
      225 |

      Site built with pkgdown 1.3.0.

      226 |
      227 |
      228 |
      229 | 230 | 231 | 232 | 233 | 234 | 235 | -------------------------------------------------------------------------------- /R/multiPage.R: -------------------------------------------------------------------------------- 1 | #' Setup a page 2 | #' 3 | #' Create a full scrolling page. 4 | #' 5 | #' @inheritParams fullPage 6 | #' 7 | #' @details use the \code{menu} parameter on one "side" (\code{\link{multiLeft}} or \code{\link{multiRight}}) only; 8 | #' No need to specify it twice, it would breaks things as it is a \code{CSS} id, see examples. 9 | #' 10 | #' Valid \code{opts}: 11 | #' \itemize{ 12 | #' \item{\code{verticalCentered} - boolean - vertically centering of the content within sections.} 13 | #' \item{\code{scrollingSpeed} - numeric - speed in milliseconds for the scrolling transitions.} 14 | #' \item{\code{easing} - character string, \href{jQuery UI}{http://jqueryui.com/} easing, i.e.: \code{easeInQuart}} 15 | #' \item{\code{sectionsColor} - character vector, i.e.: \code{c("blue", "red")}} 16 | #' \item{\code{navigation} - boolean - if set, it will show a navigation bar made up of small circles.} 17 | #' \item{\code{navigationPosition} - character string, takes \code{none}, \code{left}, or \code{right}} 18 | #' \item{\code{navigationColor} - character string, i.e.:"black"} 19 | #' \item{\code{navigationTooltips} - character vector, i.e.: \code{c("Tooltip 1", "Tooltip 2")}} 20 | #' \item{\code{loopBottom} - boolean - defines whether scrolling down in the last section should scroll to the first one or not.} 21 | #' \item{\code{loopTop} - boolean - defines whether scrolling up in the first section should scroll to the last one or not.} 22 | #' \item{\code{css3} - boolean - defines whether to use JavaScript or CSS3 transforms to scroll within sections. Useful to speed up the movement in tablet and mobile devices with browsers supporting CSS3. If this option is set to true and the browser doesn't support CSS3, a jQuery fallback will be used instead.} 23 | #' \item{\code{paddingTop} - defines the top padding for each section with a numerical value and its measure, i.e.: \code{5em}} 24 | #' \item{\code{paddingBottom} - defines the bottom padding for each section with a numerical value and its measure , i.e.: \code{10px}} 25 | #' \item{\code{keyboardScrolling} boolean - defines if the content can be navigated using the keyboard} 26 | #' \item{\code{touchSensitivity} - numeric - defines a percentage of the browsers window width/height, and how far a swipe must measure for navigating to the next section, i.e.: \code{5}} 27 | #' \item{\code{responsiveWidth} - a class \code{ms-responsive} is added to the body tag in case the user wants to use it for his own responsive CSS. For example, if set to 900, whenever the browser's width is less than 900 the plugin will scroll like a normal site.} 28 | #' \item{\code{responsiveHeight} - a class \code{ms-responsive} is added to the body tag in case the user wants to use it for his own responsive CSS. For example, if set to 900, whenever the browser's height is less than 900 the plugin will scroll like a normal site.} 29 | #' \item{\code{responsiveExpand} - boolean - when responsive mode is fired (by using the \code{responsiveWidth} or \code{responsiveHeight} options) it turns auto scrolling off and expands each left and right side into a full-width section placing one after another. Then the page can be scrolled normally. \href{Read more about how to use the Responsive Expand option.}{https://github.com/alvarotrigo/multiscroll.js/wiki/Responsive-Expand-Extension}} 30 | #' } 31 | #' 32 | #' @examples 33 | #' if(interactive()){ 34 | #' # Run de demo 35 | #' demo("muliPage", package = "fullPage") 36 | #' 37 | #' # OR 38 | #' library(shiny) 39 | #' 40 | #' options <- list( 41 | #' sectionsColor = c("#4BBFC3", "#7BAABE", "#d3d3d3", "#000") 42 | #' ) 43 | #' 44 | #' ui <- multiPage( 45 | #' opts = options, 46 | #' menu = c("Multi Scroll" = "multiscroll", 47 | #' "Plots" = "plots", 48 | #' "Full Section plots" = "fullplots", 49 | #' "Images" = "images"), 50 | #' multiLeft( 51 | #' align = "right", 52 | #' multiSection( 53 | #' menu = "multiscroll", 54 | #' h1("Multi") 55 | #' ), 56 | #' multiSection( 57 | #' menu = "plots", 58 | #' multiContainer( 59 | #' h1("Plot ->"), 60 | #' numericInput( 61 | #' "max", 62 | #' "Maximum", 63 | #' min = 50, 64 | #' max = 250, 65 | #' value = 10 66 | #' ) 67 | #' ) 68 | #' ), 69 | #' multiSectionPlot( 70 | #' menu = "fullplots", 71 | #' "fullPlot" 72 | #' ), 73 | #' multiSection( 74 | #' menu = "images", 75 | #' h1("Image ") 76 | #' ) 77 | #' ), 78 | #' multiRight( 79 | #' align = "left", 80 | #' multiSection( 81 | #' h1("Page()") 82 | #' ), 83 | #' multiSection( 84 | #' plotOutput("plot") 85 | #' ), 86 | #' multiSection( 87 | #' multiContainer( 88 | #' h1("<- Full Section plot"), 89 | #' sliderInput( 90 | #' "number", 91 | #' "Data points", 92 | #' min = 50, 93 | #' max = 250, 94 | #' value = 10 95 | #' ) 96 | #' ) 97 | #' ), 98 | #' multiSectionImage( 99 | #' img = "https://alvarotrigo.com/multiScroll/imgs/tiger.jpg", 100 | #' side = "right", 101 | #' h1("Background") 102 | #' ) 103 | #' ) 104 | #' ) 105 | #' 106 | #' server <- function(input, output){ 107 | #' 108 | #' output$plot <- renderPlot({ 109 | #' par(bg = "#7BAABE") 110 | #' hist(rnorm(100, 20, input$max)) 111 | #' }) 112 | #' 113 | #' output$fullPlot <- renderPlot({ 114 | #' par(bg = "#d3d3d3") 115 | #' hist(rnorm(input$number, 20, 250)) 116 | #' }) 117 | #' } 118 | #' 119 | #' shinyApp(ui, server) 120 | #' } 121 | #' @author John Coene, \email{jcoenep@@gmail.com} 122 | #' 123 | #' @seealso \href{Official documentation}{https://github.com/alvarotrigo/multiscroll.js}. 124 | #' 125 | #' @export 126 | multiPage <- function(..., opts = list(), menu = NULL){ 127 | 128 | # add menu anchors 129 | opts$anchors <- unname(menu) 130 | opts$menu <- "#tocMenu" 131 | 132 | # build menu 133 | if(!is.null(menu)){ 134 | 135 | # unordered list ot append to 136 | ul <- shiny::tags$ul( 137 | id = "tocMenu" 138 | ) 139 | 140 | # loop through items add list 141 | for(i in 1:length(menu)){ 142 | 143 | if(!length(names(menu))) 144 | stop("Menu must be a named vector", call. = FALSE) 145 | 146 | li <- shiny::tags$li( 147 | `data-menuanchor` = unname(menu[i]), 148 | shiny::tags$a( 149 | href = paste0("#", unname(menu[i])), 150 | names(menu)[i] 151 | ) 152 | ) 153 | 154 | # append to unordered list 155 | ul <- shiny::tagAppendChild(ul, li) 156 | } 157 | 158 | # build body 159 | body <- shiny::tags$body( 160 | ul, 161 | shiny::tags$div( 162 | id = "fp", 163 | ... 164 | ), 165 | shiny::tags$script( 166 | build_opts_mp(opts) 167 | ) 168 | ) 169 | } else { # no menu 170 | body <- shiny::tags$body( 171 | shiny::tags$div( 172 | id = "fp", 173 | ... 174 | ), 175 | shiny::tags$script( 176 | build_opts_mp(opts) 177 | ) 178 | ) 179 | } 180 | 181 | shiny::tags$html( 182 | shiny::tags$head( 183 | shiny::bootstrapLib(), 184 | shiny::includeCSS( 185 | system.file("css/jquery.multiscroll.min.css", package = "fullPage") 186 | ), 187 | shiny::includeCSS( 188 | system.file("css/styles.css", package = "fullPage") 189 | ), 190 | shiny::includeScript( 191 | system.file("jquery-3.2.1/jquery.easing.min.js", package = "fullPage") 192 | ), 193 | shiny::includeScript( 194 | system.file("js/jquery.multiscroll.min.js", package = "fullPage") 195 | ), 196 | shiny::includeScript( 197 | system.file("js/jquery.multiscroll.extensions.min.js", package = "fullPage") 198 | ) 199 | ), 200 | body 201 | ) 202 | } 203 | 204 | #' Create multi sections 205 | #' 206 | #' Create multi sections. 207 | #' 208 | #' @inheritParams fullPage 209 | #' @param align text alignment, takes \code{left}, \code{right} or, \code{center}, defaults to \code{none}. 210 | #' @param img path to image. 211 | #' @param side image side. 212 | #' 213 | #' @examples 214 | #' if(interactive()){ 215 | #' library(shiny) 216 | #' 217 | #' options <- list( 218 | #' sectionsColor = c("#f3f3f3", "#d3d3d3", "#000") 219 | #' ) 220 | #' 221 | #' ui <- multiPage( 222 | #' opts = options, 223 | #' multiLeft( 224 | #' align = "right", 225 | #' multiSection( 226 | #' h1("multi") 227 | #' ), 228 | #' multiSection( 229 | #' h2("Section ") 230 | #' ), 231 | #' multiSection( 232 | #' h2("Image ") 233 | #' ) 234 | #' ), 235 | #' multiRight( 236 | #' align = "left", 237 | #' multiSection( 238 | #' h1("page()") 239 | #' ), 240 | #' multiSection( 241 | #' h2(" 2") 242 | #' ), 243 | #' multiSectionImage( 244 | #' img = "https://alvarotrigo.com/multiScroll/imgs/tiger.jpg", 245 | #' side = "right", 246 | #' h2("Background") 247 | #' ) 248 | #' ) 249 | #' ) 250 | #' 251 | #' server <- function(input, output){} 252 | #' 253 | #' shinyApp(ui, server) 254 | #' } 255 | #' 256 | #' @rdname mp 257 | #' @export 258 | multiSection <- function(..., menu = NULL, align = "none"){ 259 | 260 | if(!align %in% c("none", "left", "right", "center")) 261 | stop("Incorrect alignment, must be one of none, left, right or, center.", call. = FALSE) 262 | 263 | div <- shiny::tags$div( 264 | class = "ms-section", 265 | ... 266 | ) 267 | 268 | if(!is.null(menu)) 269 | div <- shiny::tagAppendAttributes(div, `data-anchor` = menu) 270 | 271 | if(align != "none") 272 | div <- shiny::tagAppendAttributes(div, style = paste0("text-align: ", align, ";")) 273 | 274 | div 275 | } 276 | 277 | #' @rdname mp 278 | #' @export 279 | multiSectionImage <- function(..., img, side, menu = NULL, align = "none"){ 280 | 281 | if(missing(img)) 282 | stop("must pass path to image", call. = FALSE) 283 | 284 | if(missing(side)) 285 | stop("must pass side", call. = FALSE) 286 | 287 | if(!align %in% c("none", "left", "right", "center")) 288 | stop("Incorrect alignment, must be one of none, left, right or, center.", call. = FALSE) 289 | 290 | id <- rand() 291 | 292 | # image css 293 | style <- paste0( 294 | '.ms-', side, ' .', id, '{ 295 | background-image: url("', img, '"); 296 | background-repeat: no-repeat; 297 | background-position: ', side, '; 298 | background-size: auto 100%; 299 | }' 300 | ) 301 | 302 | div <- shiny::tags$div( 303 | class = paste("ms-section", id), 304 | ... 305 | ) 306 | 307 | if(!is.null(menu)) 308 | div <- shiny::tagAppendAttributes(div, `data-anchor` = menu) 309 | 310 | if(align != "none") 311 | div <- shiny::tagAppendAttributes(div, style = paste0("text-align: ", align, ";")) 312 | 313 | shiny::tagList( 314 | shiny::tags$head( 315 | shiny::tags$style( 316 | style 317 | ) 318 | ), 319 | div 320 | ) 321 | } 322 | -------------------------------------------------------------------------------- /docs/reference/mp.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | Create multi sections — multiSection • fullPage 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 59 | 60 | 61 | 62 | 63 | 64 |
      65 |
      66 | 132 | 133 | 134 |
      135 | 136 |
      137 |
      138 | 143 | 144 |
      145 |

      Create multi sections.

      146 |
      147 | 148 |
      multiSection(..., menu = NULL, align = "none")
      149 | 
      150 | multiSectionImage(..., img, side, menu = NULL, align = "none")
      151 | 152 |

      Arguments

      153 | 154 | 155 | 156 | 157 | 158 | 159 | 160 | 161 | 162 | 163 | 164 | 165 | 166 | 167 | 168 | 169 | 170 | 171 | 172 | 173 | 174 | 175 |
      ...

      any element.

      menu

      named vector of menu links.

      align

      text alignment, takes left, right or, center, defaults to none.

      img

      path to image.

      side

      image side.

      176 | 177 | 178 |

      Examples

      179 |
      if(interactive()){ 180 | library(shiny) 181 | 182 | options <- list( 183 | sectionsColor = c("#f3f3f3", "#d3d3d3", "#000") 184 | ) 185 | 186 | ui <- multiPage( 187 | opts = options, 188 | multiLeft( 189 | align = "right", 190 | multiSection( 191 | h1("multi") 192 | ), 193 | multiSection( 194 | h2("Section ") 195 | ), 196 | multiSection( 197 | h2("Image ") 198 | ) 199 | ), 200 | multiRight( 201 | align = "left", 202 | multiSection( 203 | h1("page()") 204 | ), 205 | multiSection( 206 | h2(" 2") 207 | ), 208 | multiSectionImage( 209 | img = "https://alvarotrigo.com/multiScroll/imgs/tiger.jpg", 210 | side = "right", 211 | h2("Background") 212 | ) 213 | ) 214 | ) 215 | 216 | server <- function(input, output){} 217 | 218 | shinyApp(ui, server) 219 | }
      220 |
      221 | 229 |
      230 | 231 | 240 |
      241 | 242 | 243 | 244 | 245 | 246 | 247 | --------------------------------------------------------------------------------