diff --git a/README.Rmd b/README.Rmd index d755ebe..1a2c1ee 100644 --- a/README.Rmd +++ b/README.Rmd @@ -13,7 +13,7 @@ knitr::opts_chunk$set( ) ``` -# positively +# positively positively website [![Lifecycle: experimental](https://img.shields.io/badge/lifecycle-experimental-orange.svg)](https://lifecycle.r-lib.org/articles/stages.html#experimental) diff --git a/README.md b/README.md index e6cef75..980f4ba 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ -# positively +# positively positively website diff --git a/data-raw/logo/.gitignore b/data-raw/logo/.gitignore new file mode 100644 index 0000000..4fba2ba --- /dev/null +++ b/data-raw/logo/.gitignore @@ -0,0 +1 @@ +exports/ diff --git a/data-raw/logo/README.md b/data-raw/logo/README.md new file mode 100644 index 0000000..2175006 --- /dev/null +++ b/data-raw/logo/README.md @@ -0,0 +1,13 @@ +# Package logo + +The text-free artwork was generated with the built-in image-generation tool. +`prompt.txt` records the artwork prompt. `sticker.svg` adds editable typography +and a border clipped to the 1.74 by 2 inch hexagon. + +Run `Rscript data-raw/logo/build.R` from the package root to export a 600 dpi +print PNG and an SVG with outlined text to `exports/`, then install the README +logo with `usethis::use_logo()`. + +The build requires the R packages base64enc, magick, rsvg, systemfonts, and +usethis, plus Gill Sans installed locally. +The artwork, fonts, and print tools are not package runtime dependencies. diff --git a/data-raw/logo/artwork.png b/data-raw/logo/artwork.png new file mode 100644 index 0000000..5eaf4c9 Binary files /dev/null and b/data-raw/logo/artwork.png differ diff --git a/data-raw/logo/build.R b/data-raw/logo/build.R new file mode 100644 index 0000000..01f9ec1 --- /dev/null +++ b/data-raw/logo/build.R @@ -0,0 +1,48 @@ +# Run from the package root: Rscript data-raw/logo/build.R +args <- commandArgs(trailingOnly = FALSE) +script <- sub("^--file=", "", args[grepl("^--file=", args)]) +source_dir <- dirname(normalizePath(script)) +root <- normalizePath(file.path(source_dir, "../..")) +svg <- paste(readLines(file.path(source_dir, "sticker.svg")), collapse = "\n") +families <- regmatches(svg, gregexpr('font-family="[^"]+"', svg))[[1]] +families <- unique(sub('font-family="([^"]+)"', "\\1", families)) +missing <- setdiff(families, systemfonts::system_fonts()$family) +if (length(missing)) { + stop( + "Install the source fonts before rebuilding: ", + paste(missing, collapse = ", ") + ) +} +art <- base64enc::dataURI( + file = file.path(source_dir, "artwork.png"), + mime = "image/png" +) +svg <- sub("artwork.png", art, svg, fixed = TRUE) +exports <- file.path(source_dir, "exports") +dir.create(exports, showWarnings = FALSE) +print_png <- file.path(exports, "logo.png") +raster <- rsvg::rsvg_png(charToRaw(svg), width = 1044, height = 1200) +magick::image_write( + magick::image_read(raster), + path = print_png, + format = "png", + density = "600x600" +) + +# Outline the text separately to avoid resampling the embedded artwork. +text_only <- gsub("]*/>", "", svg) +text_only <- gsub("]*/>", "", text_only) +text_only <- gsub(']*/>', "", text_only) +print_svg <- file.path(exports, "logo.svg") +rsvg::rsvg_svg(charToRaw(text_only), print_svg, width = 1740, height = 2000) +outlined <- paste(readLines(print_svg), collapse = "\n") +inner <- sub("(?s).*?]*>", "", outlined, perl = TRUE) +inner <- sub("\\s*$", "", inner, perl = TRUE) +without_text <- gsub("(?s)]*>.*?", "", svg, perl = TRUE) +combined <- sub("", paste0(inner, ""), without_text, fixed = TRUE) +stopifnot(!grepl("]", combined)) +writeLines(combined, print_svg) + +usethis::proj_set(root) +options(usethis.overwrite = TRUE) +usethis::use_logo(print_png) diff --git a/data-raw/logo/prompt.txt b/data-raw/logo/prompt.txt new file mode 100644 index 0000000..ba35018 --- /dev/null +++ b/data-raw/logo/prompt.txt @@ -0,0 +1 @@ +Use case: precise-object-edit. Simplify ONLY the surrounding foliage of the supplied happy flower illustration. Preserve the smiling cream face and ALL flower petals exactly, including gold tips blending through green into rich teal toward the center, pale vein lines, coral cheeks, and distressed print texture. Preserve the flower's size and placement. Reduce surrounding foliage by about HALF: remove the tall side sprigs, the little coral berry clusters and tiny extra flowers. Keep just the two broad crossed leaves immediately below the main flower, one teal and one ochre with their green overlap, plus at most one small short supporting leaf on each side. Leave generous warm cream negative space around the flower. The result is the SAME happy blended-color bloom, with a much simpler base of leaves, no wreath or tall side branches. Fill removed regions with the same opaque warm cream #f5ecd8 background; no black or transparent background. Keep original portrait 3:4 canvas and spacious lower quarter blank for separate real typography. No text, letters, numbers, borders, hexagons or added objects. diff --git a/data-raw/logo/sticker.svg b/data-raw/logo/sticker.svg new file mode 100644 index 0000000..7b42497 --- /dev/null +++ b/data-raw/logo/sticker.svg @@ -0,0 +1,6 @@ + +positively package logo + + + +positively diff --git a/man/figures/logo.png b/man/figures/logo.png new file mode 100644 index 0000000..f7d328e Binary files /dev/null and b/man/figures/logo.png differ diff --git a/pkgdown/favicon/apple-touch-icon.png b/pkgdown/favicon/apple-touch-icon.png new file mode 100644 index 0000000..5e290b4 Binary files /dev/null and b/pkgdown/favicon/apple-touch-icon.png differ diff --git a/pkgdown/favicon/favicon-96x96.png b/pkgdown/favicon/favicon-96x96.png new file mode 100644 index 0000000..00d1b9f Binary files /dev/null and b/pkgdown/favicon/favicon-96x96.png differ diff --git a/pkgdown/favicon/favicon.ico b/pkgdown/favicon/favicon.ico new file mode 100644 index 0000000..b3babf1 Binary files /dev/null and b/pkgdown/favicon/favicon.ico differ diff --git a/pkgdown/favicon/favicon.svg b/pkgdown/favicon/favicon.svg new file mode 100644 index 0000000..82caecf --- /dev/null +++ b/pkgdown/favicon/favicon.svg @@ -0,0 +1 @@ +RealFaviconGeneratorhttps://realfavicongenerator.net \ No newline at end of file diff --git a/pkgdown/favicon/site.webmanifest b/pkgdown/favicon/site.webmanifest new file mode 100644 index 0000000..4ebda26 --- /dev/null +++ b/pkgdown/favicon/site.webmanifest @@ -0,0 +1,21 @@ +{ + "name": "", + "short_name": "", + "icons": [ + { + "src": "/web-app-manifest-192x192.png", + "sizes": "192x192", + "type": "image/png", + "purpose": "maskable" + }, + { + "src": "/web-app-manifest-512x512.png", + "sizes": "512x512", + "type": "image/png", + "purpose": "maskable" + } + ], + "theme_color": "#ffffff", + "background_color": "#ffffff", + "display": "standalone" +} \ No newline at end of file diff --git a/pkgdown/favicon/web-app-manifest-192x192.png b/pkgdown/favicon/web-app-manifest-192x192.png new file mode 100644 index 0000000..cdfe77e Binary files /dev/null and b/pkgdown/favicon/web-app-manifest-192x192.png differ diff --git a/pkgdown/favicon/web-app-manifest-512x512.png b/pkgdown/favicon/web-app-manifest-512x512.png new file mode 100644 index 0000000..1dcace6 Binary files /dev/null and b/pkgdown/favicon/web-app-manifest-512x512.png differ