diff --git a/resources/celerity/map.php b/resources/celerity/map.php index 5d8e648f1e..b50513ba5e 100644 --- a/resources/celerity/map.php +++ b/resources/celerity/map.php @@ -151,6 +151,7 @@ return array( 'rsrc/css/sprite-apps-large.css' => '0a453d4b', 'rsrc/css/sprite-apps-xlarge.css' => 'db66c878', 'rsrc/css/sprite-apps.css' => 'c3857e4e', + 'rsrc/css/sprite-buttonbar.css' => 'bbec51ec', 'rsrc/css/sprite-conpherence.css' => '084b1f13', 'rsrc/css/sprite-docs.css' => '7ea4927e', 'rsrc/css/sprite-gradient.css' => 'a10def53', @@ -305,6 +306,8 @@ return array( 'rsrc/image/sprite-apps-large.png' => 'b0aa7d64', 'rsrc/image/sprite-apps-xlarge.png' => 'a751a580', 'rsrc/image/sprite-apps.png' => '35052ada', + 'rsrc/image/sprite-buttonbar-X2.png' => '36fcc19d', + 'rsrc/image/sprite-buttonbar.png' => 'e488cf8d', 'rsrc/image/sprite-conpherence-X2.png' => '5ed80fb0', 'rsrc/image/sprite-conpherence.png' => '7146f76f', 'rsrc/image/sprite-docs-X2.png' => '520858fa', @@ -778,6 +781,7 @@ return array( 'sprite-apps-css' => 'c3857e4e', 'sprite-apps-large-css' => '0a453d4b', 'sprite-apps-xlarge-css' => 'db66c878', + 'sprite-buttonbar-css' => 'bbec51ec', 'sprite-conpherence-css' => '084b1f13', 'sprite-docs-css' => '7ea4927e', 'sprite-gradient-css' => 'a10def53', diff --git a/resources/sprite/button_bar_1x/calendar.png b/resources/sprite/button_bar_1x/calendar.png new file mode 100644 index 0000000000..4e3f3462bb Binary files /dev/null and b/resources/sprite/button_bar_1x/calendar.png differ diff --git a/resources/sprite/button_bar_1x/chevron-left.png b/resources/sprite/button_bar_1x/chevron-left.png new file mode 100644 index 0000000000..a34ed901b5 Binary files /dev/null and b/resources/sprite/button_bar_1x/chevron-left.png differ diff --git a/resources/sprite/button_bar_1x/chevron-right.png b/resources/sprite/button_bar_1x/chevron-right.png new file mode 100644 index 0000000000..b6ef1b019a Binary files /dev/null and b/resources/sprite/button_bar_1x/chevron-right.png differ diff --git a/resources/sprite/button_bar_1x/cog.png b/resources/sprite/button_bar_1x/cog.png new file mode 100644 index 0000000000..7596187aa0 Binary files /dev/null and b/resources/sprite/button_bar_1x/cog.png differ diff --git a/resources/sprite/button_bar_1x/home.png b/resources/sprite/button_bar_1x/home.png new file mode 100644 index 0000000000..9e37a1b621 Binary files /dev/null and b/resources/sprite/button_bar_1x/home.png differ diff --git a/resources/sprite/button_bar_1x/pencil.png b/resources/sprite/button_bar_1x/pencil.png new file mode 100644 index 0000000000..9774c10a0d Binary files /dev/null and b/resources/sprite/button_bar_1x/pencil.png differ diff --git a/resources/sprite/button_bar_1x/time.png b/resources/sprite/button_bar_1x/time.png new file mode 100644 index 0000000000..48f0a5c9ff Binary files /dev/null and b/resources/sprite/button_bar_1x/time.png differ diff --git a/resources/sprite/button_bar_2x/calendar.png b/resources/sprite/button_bar_2x/calendar.png new file mode 100644 index 0000000000..ccf14e0a59 Binary files /dev/null and b/resources/sprite/button_bar_2x/calendar.png differ diff --git a/resources/sprite/button_bar_2x/chevron-left.png b/resources/sprite/button_bar_2x/chevron-left.png new file mode 100644 index 0000000000..b28e46eb3b Binary files /dev/null and b/resources/sprite/button_bar_2x/chevron-left.png differ diff --git a/resources/sprite/button_bar_2x/chevron-right.png b/resources/sprite/button_bar_2x/chevron-right.png new file mode 100644 index 0000000000..cf84011ad7 Binary files /dev/null and b/resources/sprite/button_bar_2x/chevron-right.png differ diff --git a/resources/sprite/button_bar_2x/cog.png b/resources/sprite/button_bar_2x/cog.png new file mode 100644 index 0000000000..c9362b8eca Binary files /dev/null and b/resources/sprite/button_bar_2x/cog.png differ diff --git a/resources/sprite/button_bar_2x/home.png b/resources/sprite/button_bar_2x/home.png new file mode 100644 index 0000000000..94a1e9b1e9 Binary files /dev/null and b/resources/sprite/button_bar_2x/home.png differ diff --git a/resources/sprite/button_bar_2x/pencil.png b/resources/sprite/button_bar_2x/pencil.png new file mode 100644 index 0000000000..49d14cd444 Binary files /dev/null and b/resources/sprite/button_bar_2x/pencil.png differ diff --git a/resources/sprite/button_bar_2x/time.png b/resources/sprite/button_bar_2x/time.png new file mode 100644 index 0000000000..943290a900 Binary files /dev/null and b/resources/sprite/button_bar_2x/time.png differ diff --git a/resources/sprite/manifest/buttonbar.json b/resources/sprite/manifest/buttonbar.json new file mode 100644 index 0000000000..098ed3756c --- /dev/null +++ b/resources/sprite/manifest/buttonbar.json @@ -0,0 +1,46 @@ +{ + "version" : 1, + "sprites" : { + "buttonbar-calendar" : { + "name" : "buttonbar-calendar", + "rule" : ".buttonbar-calendar", + "hash" : "51aed380faf290dab35d736a92d15aba" + }, + "buttonbar-chevron-left" : { + "name" : "buttonbar-chevron-left", + "rule" : ".buttonbar-chevron-left", + "hash" : "24e52c724c85eb313e19ecd222be73b5" + }, + "buttonbar-chevron-right" : { + "name" : "buttonbar-chevron-right", + "rule" : ".buttonbar-chevron-right", + "hash" : "9bbe40f752ee650646021b348b2971a9" + }, + "buttonbar-cog" : { + "name" : "buttonbar-cog", + "rule" : ".buttonbar-cog", + "hash" : "1c816c27b8d7b6bffe5e32ba716e5930" + }, + "buttonbar-home" : { + "name" : "buttonbar-home", + "rule" : ".buttonbar-home", + "hash" : "3ab3bfd5bf3c1ba0a422c200a70578d5" + }, + "buttonbar-pencil" : { + "name" : "buttonbar-pencil", + "rule" : ".buttonbar-pencil", + "hash" : "17d42be118aa21bc154b3f7da3faf7cb" + }, + "buttonbar-time" : { + "name" : "buttonbar-time", + "rule" : ".buttonbar-time", + "hash" : "1355aa26ecd63e76a59352aba95e54ad" + } + }, + "scales" : [ + 1, + 2 + ], + "header" : "\/**\n * @provides sprite-buttonbar-css\n * @generated\n *\/\n\n.sprite-buttonbar {\n background-image: url(\/rsrc\/image\/sprite-buttonbar.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-buttonbar {\n background-image: url(\/rsrc\/image\/sprite-buttonbar-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 e0d3c72f16..6d099b3052 100755 --- a/scripts/celerity/generate_sprites.php +++ b/scripts/celerity/generate_sprites.php @@ -36,6 +36,7 @@ $sheets = array( 'apps-large' => $generator->buildAppsLargeSheet(), 'payments' => $generator->buildPaymentsSheet(), 'tokens' => $generator->buildTokenSheet(), + 'buttonbar' => $generator->buildButtonBarSheet(), 'docs' => $generator->buildDocsSheet(), 'gradient' => $generator->buildGradientSheet(), 'main-header' => $generator->buildMainHeaderSheet(), diff --git a/src/infrastructure/celerity/CeleritySpriteGenerator.php b/src/infrastructure/celerity/CeleritySpriteGenerator.php index 3ff0217b1c..95102cf5ce 100644 --- a/src/infrastructure/celerity/CeleritySpriteGenerator.php +++ b/src/infrastructure/celerity/CeleritySpriteGenerator.php @@ -343,6 +343,38 @@ final class CeleritySpriteGenerator { return $sheet; } + public function buildButtonBarSheet() { + $icons = $this->getDirectoryList('button_bar_1x'); + $scales = array( + '1x' => 1, + '2x' => 2, + ); + $template = id(new PhutilSprite()) + ->setSourceSize(14, 14); + + $sprites = array(); + $prefix = 'button_bar_'; + foreach ($icons as $icon) { + $sprite = id(clone $template) + ->setName('buttonbar-'.$icon) + ->setTargetCSS('.buttonbar-'.$icon); + + foreach ($scales as $scale_key => $scale) { + $path = $this->getPath($prefix.$scale_key.'/'.$icon.'.png'); + $sprite->setSourceFile($path, $scale); + } + $sprites[] = $sprite; + } + + $sheet = $this->buildSheet('buttonbar', true); + $sheet->setScales($scales); + foreach ($sprites as $sprite) { + $sheet->addSprite($sprite); + } + + return $sheet; + } + public function buildProjectsSheet() { $icons = $this->getDirectoryList('projects_1x'); $scales = array( diff --git a/webroot/rsrc/css/sprite-buttonbar.css b/webroot/rsrc/css/sprite-buttonbar.css new file mode 100644 index 0000000000..5d96425d50 --- /dev/null +++ b/webroot/rsrc/css/sprite-buttonbar.css @@ -0,0 +1,47 @@ +/** + * @provides sprite-buttonbar-css + * @generated + */ + +.sprite-buttonbar { + background-image: url(/rsrc/image/sprite-buttonbar.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-buttonbar { + background-image: url(/rsrc/image/sprite-buttonbar-X2.png); + background-size: 45px 45px; + } +} + + +.buttonbar-calendar { + background-position: 0px 0px; +} + +.buttonbar-chevron-left { + background-position: -15px 0px; +} + +.buttonbar-chevron-right { + background-position: -30px 0px; +} + +.buttonbar-cog { + background-position: 0px -15px; +} + +.buttonbar-home { + background-position: -15px -15px; +} + +.buttonbar-pencil { + background-position: 0px -30px; +} + +.buttonbar-time { + background-position: -15px -30px; +} diff --git a/webroot/rsrc/image/sprite-buttonbar-X2.png b/webroot/rsrc/image/sprite-buttonbar-X2.png new file mode 100644 index 0000000000..b783ef45a0 Binary files /dev/null and b/webroot/rsrc/image/sprite-buttonbar-X2.png differ diff --git a/webroot/rsrc/image/sprite-buttonbar.png b/webroot/rsrc/image/sprite-buttonbar.png new file mode 100644 index 0000000000..1e3dbf2ce7 Binary files /dev/null and b/webroot/rsrc/image/sprite-buttonbar.png differ