Skip to content

Commit 93eac1f

Browse files
committed
Add Conpherence sprites.
Summary: Let's see if I did this right. This adds on and off state icons (1 and 2x) for conpherence. I think I need to tweak and add more CSS to have the off hover state be the on icon. Will check. Test Plan: spritegen Reviewers: epriestley, btrahan Reviewed By: epriestley CC: aran, Korvin Maniphest Tasks: T2400 Differential Revision: https://secure.phabricator.com/D4709
1 parent add39ef commit 93eac1f

32 files changed

+175
-0
lines changed
263 Bytes
Loading
272 Bytes
Loading
886 Bytes
Loading
895 Bytes
Loading
177 Bytes
Loading
199 Bytes
Loading
385 Bytes
Loading
410 Bytes
Loading
1005 Bytes
Loading
965 Bytes
Loading
Loading
1.1 KB
Loading
418 Bytes
Loading
421 Bytes
Loading
1.73 KB
Loading
1.55 KB
Loading
1.67 KB
Loading
1.56 KB
Loading
306 Bytes
Loading
295 Bytes
Loading
776 Bytes
Loading
923 Bytes
Loading
1.63 KB
Loading
1.51 KB
Loading
1.84 KB
Loading
1.45 KB
Loading

resources/sprite/manifest/conph.json

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
{
2+
"version" : 1,
3+
"sprites" : {
4+
"conpher_calendar_off" : {
5+
"name" : "conpher_calendar_off",
6+
"rule" : "conpher_calendar_off",
7+
"hash" : "a8228ab90fd90f4c2500d9285179bf26"
8+
},
9+
"conpher_calendar_on" : {
10+
"name" : "conpher_calendar_on",
11+
"rule" : "conpher_calendar_on",
12+
"hash" : "931243bc3c414782ddb2d1d9607908ba"
13+
},
14+
"conpher_files_off" : {
15+
"name" : "conpher_files_off",
16+
"rule" : "conpher_files_off",
17+
"hash" : "de1aee01b9b47b354e6ac280ae68bae1"
18+
},
19+
"conpher_files_on" : {
20+
"name" : "conpher_files_on",
21+
"rule" : "conpher_files_on",
22+
"hash" : "9ccbbd5e86fd4ec87a11aee0c9ec8c60"
23+
},
24+
"conpher_list_off" : {
25+
"name" : "conpher_list_off",
26+
"rule" : "conpher_list_off",
27+
"hash" : "2611311d0c2aec04416433be74d3a30e"
28+
},
29+
"conpher_list_on" : {
30+
"name" : "conpher_list_on",
31+
"rule" : "conpher_list_on",
32+
"hash" : "cee6de0301c84b0d195282642642afa0"
33+
},
34+
"conpher_more_off" : {
35+
"name" : "conpher_more_off",
36+
"rule" : "conpher_more_off",
37+
"hash" : "3b7099bdde20a13864b48552b11e92c3"
38+
},
39+
"conpher_more_on" : {
40+
"name" : "conpher_more_on",
41+
"rule" : "conpher_more_on",
42+
"hash" : "b146f0cff9c2e5f0b57f7ebcfe0704d3"
43+
},
44+
"conpher_people_off" : {
45+
"name" : "conpher_people_off",
46+
"rule" : "conpher_people_off",
47+
"hash" : "641a6a21aa32a12416e85caf8a22e340"
48+
},
49+
"conpher_people_on" : {
50+
"name" : "conpher_people_on",
51+
"rule" : "conpher_people_on",
52+
"hash" : "f13745fd7036564eefb1c0ebc3502a92"
53+
},
54+
"conpher_settings_off" : {
55+
"name" : "conpher_settings_off",
56+
"rule" : "conpher_settings_off",
57+
"hash" : "aa9ab000d9e33e3c50c2fe70367f30b4"
58+
},
59+
"conpher_settings_on" : {
60+
"name" : "conpher_settings_on",
61+
"rule" : "conpher_settings_on",
62+
"hash" : "a5fe22965997f9559800ca7db5ea32c8"
63+
}
64+
},
65+
"scales" : [
66+
1,
67+
2
68+
],
69+
"header" : "\/**\n * @provides sprite-conpher-css\n * @generated\n *\/\n\n.sprite-conpher {\n background-image: url(\/rsrc\/image\/sprite-conpher.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-conpher {\n background-image: url(\/rsrc\/image\/sprite-conpher-X2.png);\n background-size: {X}px {Y}px;\n }\n}\n",
70+
"type" : "standard"
71+
}

scripts/celerity/generate_sprites.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
'icon' => $generator->buildIconSheet(),
3131
'menu' => $generator->buildMenuSheet(),
3232
'apps' => $generator->buildAppsSheet(),
33+
'conph' => $generator->buildConpherenceSheet(),
3334
'apps-large' => $generator->buildAppsLargeSheet(),
3435
// TODO: @chad: should we actually remove this?
3536
// 'apps-xlarge' => $generator->buildAppsXLargeSheet(),

src/infrastructure/celerity/CeleritySpriteGenerator.php

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,42 @@ public function buildMenuSheet() {
176176
return $sheet;
177177
}
178178

179+
public function buildConpherenceSheet() {
180+
$icons = $this->getDirectoryList('conpher_1x');
181+
$scales = array(
182+
'1x' => 1,
183+
'2x' => 2,
184+
);
185+
$template = id(new PhutilSprite())
186+
->setSourceSize(32, 32);
187+
188+
$sprites = array();
189+
foreach ($icons as $icon) {
190+
$color = preg_match('/_on/', $icon) ? 'on' : 'off';
191+
192+
$prefix = 'conpher_';
193+
194+
$sprite = id(clone $template)
195+
->setName($prefix.$icon);
196+
197+
$sprite->setTargetCSS($prefix.$icon);
198+
199+
foreach ($scales as $scale_key => $scale) {
200+
$path = $this->getPath($prefix.$scale_key.'/'.$icon.'.png');
201+
$sprite->setSourceFile($path, $scale);
202+
}
203+
$sprites[] = $sprite;
204+
}
205+
206+
$sheet = $this->buildSheet('conpher', true);
207+
$sheet->setScales($scales);
208+
foreach ($sprites as $sprite) {
209+
$sheet->addSprite($sprite);
210+
}
211+
212+
return $sheet;
213+
}
214+
179215
public function buildGradientSheet() {
180216
$gradients = $this->getDirectoryList('gradients');
181217

webroot/rsrc/css/sprite-conph.css

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
/**
2+
* @provides sprite-conpher-css
3+
* @generated
4+
*/
5+
6+
.sprite-conpher {
7+
background-image: url(/rsrc/image/sprite-conpher.png);
8+
background-repeat: no-repeat;
9+
}
10+
11+
@media
12+
only screen and (min-device-pixel-ratio: 1.5),
13+
only screen and (-webkit-min-device-pixel-ratio: 1.5) {
14+
.sprite-conpher {
15+
background-image: url(/rsrc/image/sprite-conpher-X2.png);
16+
background-size: 99px 132px;
17+
}
18+
}
19+
20+
21+
conpher_calendar_off {
22+
background-position: 0px 0px;
23+
}
24+
25+
conpher_calendar_on {
26+
background-position: -33px 0px;
27+
}
28+
29+
conpher_files_off {
30+
background-position: -66px 0px;
31+
}
32+
33+
conpher_files_on {
34+
background-position: 0px -33px;
35+
}
36+
37+
conpher_list_off {
38+
background-position: -33px -33px;
39+
}
40+
41+
conpher_list_on {
42+
background-position: -66px -33px;
43+
}
44+
45+
conpher_more_off {
46+
background-position: 0px -66px;
47+
}
48+
49+
conpher_more_on {
50+
background-position: -33px -66px;
51+
}
52+
53+
conpher_people_off {
54+
background-position: -66px -66px;
55+
}
56+
57+
conpher_people_on {
58+
background-position: 0px -99px;
59+
}
60+
61+
conpher_settings_off {
62+
background-position: -33px -99px;
63+
}
64+
65+
conpher_settings_on {
66+
background-position: -66px -99px;
67+
}
11.4 KB
Loading

webroot/rsrc/image/sprite-conph.png

5.4 KB
Loading

0 commit comments

Comments
 (0)