diff --git a/resources/sprite/docs_1x/audio.png b/resources/sprite/docs_1x/audio.png new file mode 100644 index 0000000000..2f06fc8951 Binary files /dev/null and b/resources/sprite/docs_1x/audio.png differ diff --git a/resources/sprite/docs_1x/doc.png b/resources/sprite/docs_1x/doc.png new file mode 100644 index 0000000000..568b80ddcc Binary files /dev/null and b/resources/sprite/docs_1x/doc.png differ diff --git a/resources/sprite/docs_1x/file.png b/resources/sprite/docs_1x/file.png new file mode 100644 index 0000000000..5118a9589d Binary files /dev/null and b/resources/sprite/docs_1x/file.png differ diff --git a/resources/sprite/docs_1x/image.png b/resources/sprite/docs_1x/image.png new file mode 100644 index 0000000000..0d1f404919 Binary files /dev/null and b/resources/sprite/docs_1x/image.png differ diff --git a/resources/sprite/docs_1x/movie.png b/resources/sprite/docs_1x/movie.png new file mode 100644 index 0000000000..0eb10e2e7d Binary files /dev/null and b/resources/sprite/docs_1x/movie.png differ diff --git a/resources/sprite/docs_1x/pdf.png b/resources/sprite/docs_1x/pdf.png new file mode 100644 index 0000000000..514fb9c52b Binary files /dev/null and b/resources/sprite/docs_1x/pdf.png differ diff --git a/resources/sprite/docs_1x/place.png b/resources/sprite/docs_1x/place.png new file mode 100644 index 0000000000..f9e817fcda Binary files /dev/null and b/resources/sprite/docs_1x/place.png differ diff --git a/resources/sprite/docs_1x/zip.png b/resources/sprite/docs_1x/zip.png new file mode 100644 index 0000000000..fc288bb6b0 Binary files /dev/null and b/resources/sprite/docs_1x/zip.png differ diff --git a/resources/sprite/docs_2x/audio.png b/resources/sprite/docs_2x/audio.png new file mode 100644 index 0000000000..e5ad1e20fe Binary files /dev/null and b/resources/sprite/docs_2x/audio.png differ diff --git a/resources/sprite/docs_2x/doc.png b/resources/sprite/docs_2x/doc.png new file mode 100644 index 0000000000..7f87a9a679 Binary files /dev/null and b/resources/sprite/docs_2x/doc.png differ diff --git a/resources/sprite/docs_2x/file.png b/resources/sprite/docs_2x/file.png new file mode 100644 index 0000000000..6323e9ff78 Binary files /dev/null and b/resources/sprite/docs_2x/file.png differ diff --git a/resources/sprite/docs_2x/image.png b/resources/sprite/docs_2x/image.png new file mode 100644 index 0000000000..9af85529fb Binary files /dev/null and b/resources/sprite/docs_2x/image.png differ diff --git a/resources/sprite/docs_2x/movie.png b/resources/sprite/docs_2x/movie.png new file mode 100644 index 0000000000..216ea40fe6 Binary files /dev/null and b/resources/sprite/docs_2x/movie.png differ diff --git a/resources/sprite/docs_2x/pdf.png b/resources/sprite/docs_2x/pdf.png new file mode 100644 index 0000000000..10cb451831 Binary files /dev/null and b/resources/sprite/docs_2x/pdf.png differ diff --git a/resources/sprite/docs_2x/place.png b/resources/sprite/docs_2x/place.png new file mode 100644 index 0000000000..d1791d5061 Binary files /dev/null and b/resources/sprite/docs_2x/place.png differ diff --git a/resources/sprite/docs_2x/zip.png b/resources/sprite/docs_2x/zip.png new file mode 100644 index 0000000000..d969383650 Binary files /dev/null and b/resources/sprite/docs_2x/zip.png differ diff --git a/resources/sprite/manifest/docs.json b/resources/sprite/manifest/docs.json new file mode 100644 index 0000000000..1239c458fc --- /dev/null +++ b/resources/sprite/manifest/docs.json @@ -0,0 +1,51 @@ +{ + "version" : 1, + "sprites" : { + "docs_audio" : { + "name" : "docs_audio", + "rule" : ".docs_audio", + "hash" : "d3fccd15fc53b04b6caf22a3bb5f4634" + }, + "docs_doc" : { + "name" : "docs_doc", + "rule" : ".docs_doc", + "hash" : "31496e2953350c276a6b8619b071f299" + }, + "docs_file" : { + "name" : "docs_file", + "rule" : ".docs_file", + "hash" : "3d88ce46362e723cf76bf552550c82a6" + }, + "docs_image" : { + "name" : "docs_image", + "rule" : ".docs_image", + "hash" : "8eaa89c50f3be46c87706d649bd304af" + }, + "docs_movie" : { + "name" : "docs_movie", + "rule" : ".docs_movie", + "hash" : "859f7df4027e145290607d78d9500b45" + }, + "docs_pdf" : { + "name" : "docs_pdf", + "rule" : ".docs_pdf", + "hash" : "c423839d6b35baf59e79c0cd8d3e580f" + }, + "docs_place" : { + "name" : "docs_place", + "rule" : ".docs_place", + "hash" : "8ee9e4dad7df830c487227083e0091f5" + }, + "docs_zip" : { + "name" : "docs_zip", + "rule" : ".docs_zip", + "hash" : "91d6be2027be6a7791477ac12cd94b6d" + } + }, + "scales" : [ + 1, + 2 + ], + "header" : "\/**\n * @provides sprite-docs-css\n * @generated\n *\/\n\n.sprite-docs {\n background-image: url(\/rsrc\/image\/sprite-docs.png);\n background-repeat: no-repeat;\n}\n\n@media\nonly screen and (min-device-pixel-ratio: 1.5),\nonly screen and (-webkit-min-device-pixel-ratio: 1.5) {\n .sprite-docs {\n background-image: url(\/rsrc\/image\/sprite-docs-X2.png);\n background-size: {X}px {Y}px;\n }\n}\n", + "type" : "standard" +} diff --git a/scripts/celerity/generate_sprites.php b/scripts/celerity/generate_sprites.php index 6dffa334fd..bef79db7c4 100755 --- a/scripts/celerity/generate_sprites.php +++ b/scripts/celerity/generate_sprites.php @@ -33,8 +33,7 @@ $sheets = array( 'conpher' => $generator->buildConpherenceSheet(), 'apps-large' => $generator->buildAppsLargeSheet(), 'tokens' => $generator->buildTokenSheet(), -// TODO: @chad: should we actually remove this? -// 'apps-xlarge' => $generator->buildAppsXLargeSheet(), + 'docs' => $generator->buildDocsSheet(), 'gradient' => $generator->buildGradientSheet(), ); diff --git a/src/__celerity_resource_map__.php b/src/__celerity_resource_map__.php index 755648e2d1..b4dc528588 100644 --- a/src/__celerity_resource_map__.php +++ b/src/__celerity_resource_map__.php @@ -497,6 +497,20 @@ celerity_register_resource_map(array( 'disk' => '/rsrc/image/sprite-conpher.png', 'type' => 'png', ), + '/rsrc/image/sprite-docs-X2.png' => + array( + 'hash' => '57d3286ce88133f3ec9240e35f6bb897', + 'uri' => '/res/57d3286c/rsrc/image/sprite-docs-X2.png', + 'disk' => '/rsrc/image/sprite-docs-X2.png', + 'type' => 'png', + ), + '/rsrc/image/sprite-docs.png' => + array( + 'hash' => 'b2b089072d6eddd831402a77c02b5736', + 'uri' => '/res/b2b08907/rsrc/image/sprite-docs.png', + 'disk' => '/rsrc/image/sprite-docs.png', + 'type' => 'png', + ), '/rsrc/image/sprite-gradient.png' => array( 'hash' => '92aebaab67dcc6baf2ea99294368d895', @@ -3455,6 +3469,15 @@ celerity_register_resource_map(array( ), 'disk' => '/rsrc/css/sprite-conpher.css', ), + 'sprite-docs-css' => + array( + 'uri' => '/res/b32f93bc/rsrc/css/sprite-docs.css', + 'type' => 'css', + 'requires' => + array( + ), + 'disk' => '/rsrc/css/sprite-docs.css', + ), 'sprite-gradient-css' => array( 'uri' => '/res/e62e7a0f/rsrc/css/sprite-gradient.css', diff --git a/src/infrastructure/celerity/CeleritySpriteGenerator.php b/src/infrastructure/celerity/CeleritySpriteGenerator.php index 5763ed4874..1fbc3a213d 100644 --- a/src/infrastructure/celerity/CeleritySpriteGenerator.php +++ b/src/infrastructure/celerity/CeleritySpriteGenerator.php @@ -256,6 +256,38 @@ final class CeleritySpriteGenerator { return $sheet; } + public function buildDocsSheet() { + $icons = $this->getDirectoryList('docs_1x'); + $scales = array( + '1x' => 1, + '2x' => 2, + ); + $template = id(new PhutilSprite()) + ->setSourceSize(32, 32); + + $sprites = array(); + $prefix = 'docs_'; + foreach ($icons as $icon) { + $sprite = id(clone $template) + ->setName($prefix.$icon) + ->setTargetCSS('.'.$prefix.$icon); + + foreach ($scales as $scale_key => $scale) { + $path = $this->getPath($prefix.$scale_key.'/'.$icon.'.png'); + $sprite->setSourceFile($path, $scale); + } + $sprites[] = $sprite; + } + + $sheet = $this->buildSheet('docs', true); + $sheet->setScales($scales); + foreach ($sprites as $sprite) { + $sheet->addSprite($sprite); + } + + return $sheet; + } + public function buildGradientSheet() { $gradients = $this->getDirectoryList('gradients'); diff --git a/webroot/rsrc/css/sprite-docs.css b/webroot/rsrc/css/sprite-docs.css new file mode 100644 index 0000000000..d6890ee9e9 --- /dev/null +++ b/webroot/rsrc/css/sprite-docs.css @@ -0,0 +1,51 @@ +/** + * @provides sprite-docs-css + * @generated + */ + +.sprite-docs { + background-image: url(/rsrc/image/sprite-docs.png); + background-repeat: no-repeat; +} + +@media +only screen and (min-device-pixel-ratio: 1.5), +only screen and (-webkit-min-device-pixel-ratio: 1.5) { + .sprite-docs { + background-image: url(/rsrc/image/sprite-docs-X2.png); + background-size: 99px 99px; + } +} + + +.docs_audio { + background-position: 0px 0px; +} + +.docs_doc { + background-position: -33px 0px; +} + +.docs_file { + background-position: -66px 0px; +} + +.docs_image { + background-position: 0px -33px; +} + +.docs_movie { + background-position: -33px -33px; +} + +.docs_pdf { + background-position: -66px -33px; +} + +.docs_place { + background-position: 0px -66px; +} + +.docs_zip { + background-position: -33px -66px; +} diff --git a/webroot/rsrc/image/sprite-docs-X2.png b/webroot/rsrc/image/sprite-docs-X2.png new file mode 100644 index 0000000000..01e95932eb Binary files /dev/null and b/webroot/rsrc/image/sprite-docs-X2.png differ diff --git a/webroot/rsrc/image/sprite-docs.png b/webroot/rsrc/image/sprite-docs.png new file mode 100644 index 0000000000..55870440ff Binary files /dev/null and b/webroot/rsrc/image/sprite-docs.png differ