1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-22 06:42:42 +01:00

Document icons sprite sheet.

Summary: Adds 32 and 64 px images to represent basic documents.

Test Plan: Differential

Reviewers: epriestley, btrahan

Reviewed By: epriestley

CC: aran, Korvin

Differential Revision: https://secure.phabricator.com/D5317
This commit is contained in:
Chad Little 2013-03-10 14:16:16 -07:00
parent ca20323b87
commit fbb032c710
23 changed files with 158 additions and 2 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

View file

@ -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"
}

View file

@ -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(),
);

View file

@ -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',

View file

@ -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');

View file

@ -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;
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3 KiB