Upgrade to Pro — share decks privately, control downloads, hide ads and more …

HiDPI時代のFireworks

Naoki Matsuda
October 25, 2013

 HiDPI時代のFireworks

Naoki Matsuda

October 25, 2013
Tweet

More Decks by Naoki Matsuda

Other Decks in Design

Transcript

  1. Χϯόε͸ԣ෯QY w ͋ͱ͔Β!Yը૾͕ ࡞Γʹ͍͘ w ϏοτϚοϓΛ ֦େ͢ΔͱྼԽ͢Δ w ςΩετͷϑΥϯτ αΠζ͕͓͔͘͠ͳΔ

    w εϥΠε่͕ΕΔ w ॻ͖ग़ͨ͠ޙͰഒʹ Ͱ͖ͳ͍ 320px σϝϦοτ Χϯόε͕ԣ෯QYͩͱ
  2. ഒͰ࡞Δίπ _ࢀߟ Workflow OptimizationDesign Cutting Edge iOS Apps With Adobe

    Fireworks http://fireworks.smashingmagazine.com/2012/12/03/design-ios-apps-with-adobe-fireworks/ ߴ͞ɺ෯ɺCPSEFS෯ɺ ͢΂ͯΛۮ਺஋Ͱ࡞Δ ʹॖখͨ͠ࡍɺΤοδ͕ ϘέΔͨΊ Why ?
  3. ഒͰ࡞Δίπ _ࢀߟ Workflow OptimizationDesign Cutting Edge iOS Apps With Adobe

    Fireworks http://fireworks.smashingmagazine.com/2012/12/03/design-ios-apps-with-adobe-fireworks/ 1IPUPTIPQϥΠϒ ΤϑΣΫτ͸࢖Θͳ͍ ֦େॖখͨ͠ࡍɺൺྫͯ͠ ϦαΠζ͞Εͳ͍ͨΊ Why ?
  4. ഒͰ࡞Δίπ _ࢀߟ Workflow OptimizationDesign Cutting Edge iOS Apps With Adobe

    Fireworks http://fireworks.smashingmagazine.com/2012/12/03/design-ios-apps-with-adobe-fireworks/ ؙ֯͸ɺͳΔ΂͘ $44Ͱ࣮૷͢Δ ॖখͨ͠ࡍɺͭͿΕͯ͠·͏ ͜ͱ͕͋ΔͨΊ Why ?
  5. ഒͰ࡞Δίπ ඪ४ͷςΫενϟ͸ ࢖Θͳ͍ ςΫενϟ͸ഒαΠζ͕ͳ͘ɺ ϦαΠζ΋Ͱ͖ͳ͍ͨΊ _ࢀߟ Workflow OptimizationDesign Cutting Edge

    iOS Apps With Adobe Fireworks http://fireworks.smashingmagazine.com/2012/12/03/design-ios-apps-with-adobe-fireworks/ Why ?
  6. ഒͰ࡞Δίπ In general, bitmaps are your enemy when designing iOS

    apps. Ivo Mynttinen ͬ͘͟Γ͍͑͹ɺJ04ΞϓϦΛ σβΠϯ͢Δ্ͰϏοτϚοϓ͸ ܅ͷఢɺͬͯײ͡ɻ
  7. Χϯόε͸ԣ෯QY άϥϑΟοΫγϯϘϧ ඇഁյฤू w γϯϘϧԽͨ͠ը૾͸ ֦େॖখΛ܁Γฦͯ͠΋ ྼԽ͠ͳ͍ w ճస΍Ώ͕ΈΛ Ճ͑ͯ΋ɺݩը૾ͷঢ়ଶ

    ͸ͦͷ·· w ը૾͸େ͖Ί QYҎ ্ Ͱ༻ҙ͠ɺ γϯϘϧԽ͔ͯ͠Β େ͖͞Λௐ੔ ϏοτϚοϓΛ ֦େɾॖখɾճస γϯϘϧΛ ֦େɾॖখɾճస ྼԽ อ࣋ ϏοτϚοϓ͸γϯϘϧԽ͓ͯ͘͠
  8. !Yͱ!Yͷը૾ॻ͖ग़͠ @ࢀߟ JQIPOF༻ͷը૾!YQOH͔Β௨ৗͷΛੜ੒ IUUQEIBUFOBOFKQEPPSTJEF Shell Script w pOEͰʮ!Yʯͷ ը૾Λ୳͢ w

    TJQTίϚϯυͰԣ෯Λ औಘ w TJQTίϚϯυͰʹ ϦαΠζ w XBUDIͰ͖ͨΓศར #!/bin/sh #dir=$1 find $dir -name "*@2x.*" | while read file; cd $(dirname $0) && pwd do width=`sips --getProperty pixelWidth $file | sed -E "s/.*pixelWidth: ([0-9]+)/ \1/g" | tail -1` width=`expr $width / 2` newFile=`echo $file | sed 's/@2x//'` sips --resampleWidth $width $(basename "$file") --out $(basename "$newFile") done ํ๏ͦͷ
  9. !Y !Yը૾ͷৼΓ෼͚ K2VFSZͰʮdevicePixelRatioʯΛ൑ผ͢Δ $(function(){ if( 'devicePixelRatio' in window && window.devicePixelRatio

    > 1 ){ var imgHidpi = $( 'img.hidpi' ).get(); var imgHidpiLength = imgHidpi.length; for (var i=0,l=imgHidpiLength; i<l; i++) { var src = imgHidpi[i].src; src = src.replace(/\.(png|jpg|gif)+$/i, '@2x.$1'); imgHidpi[i].src = src; }; } });
  10. !Y !Yը૾ͷৼΓ෼͚ @ࢀߟ Adaptation for Retina display http://egorkhmelev.github.com/retina/ Optimising for

    High Pixel Density Displays. http://menacingcloud.com/? c=highPixelDensityDisplays
  11. !Y !Yը૾ͷৼΓ෼͚ Media QueryͰഎܠը૾ΛৼΓ෼͚Δ .selector { background: url(../sample.png) no-repeat; }

    @media (-webkit-min-device-pixel-ratio: 1.5) { .selector { background-image: url(../[email protected]); background-size: cover; } }
  12. !Y !Yը૾ͷৼΓ෼͚ +4ϥΠϒϥϦʮConditionizrʯͰৼΓ෼͚Δ ߴਫ਼ࡉσόΠεʹͷΈʹద༻ͤ͞Δ +4 $44 $MBTTΛৼΓ෼͚ΒΕΔ <html class="retina"> <script>

    conditionizr({ retina : { scripts: true, styles: true, ɹɹɹɹɹɹɹɹɹɹclasses: true } }); </script> Conditionizr http://conditionizr.com
  13. 'JSFXPSLTత୤ϏοτϚοϓ SVG + Web Fonts w ϕΫλʔ 47( ͸ ϐΫηϧʹґଘ͠ͳ͍

    w '8Ͱ͸֦ுػೳΛ࢖ͬͯ 47(ग़ྗͰ͖Δ w 8FC'POUTԽ͢Ε͹ ৭ɾαΠζΛ$44Ͱ༰қʹ มߋՄೳ w ͍ܰ
  14. 'JSFXPSLTత୤ϏοτϚοϓ SVG ΛରԠσόΠεͰ͚ͩ࢖͏ <script src="jquery.js"></script> <script src="modernizr.js"></script> <script> if(!Modernizr.svg) {

    $('img[src*="svg"]').attr('src', function() { return $(this).attr('src').replace('.svg', '.png'); }); } </script>
  15. 'JSFXPSLTత୤ϏοτϚοϓ Data URI Scheme w #BTFܗࣜͰɺ )5.-΍$44ʹ௚઀هड़ w H[JQ͕༗ޮʹͳΔ ͍ܰ

    w ಺࣮ɺϏοτϚοϓͰ͕͢ w ม׵֦ுػೳ͕ग़Δӟ΋ data:image/ png;base64,iVBORw0KGgoAAAANSUhEUgA AAABQCAYAAABoMayFAAAABHNCSVQICAgIf AAAAAlwSFlzAAALEgAACxIB0t1+/ AAAABx0RVh0U29mdHdhcmUAQWRvYmUgRml vcmtzIENTNui8sowAAAJ/ cHJWV3ic7ZffkZswEMZlEclaiSJSgm/ ck5+vHXeSpxSQcQXXRBrIhOxKAvNH4nwzh 1hYBPJvdz+B5F9/f/5W7+q9k+3W3Xi/ drdLd712Vz6eu8ulu/BRdedzd1ad4sdgsP O9t7ABx988MEHH3zwwQcffPDBBx988MEHH +MTb34nK/P3ovsKP9BeVuR72m0v8kOKrs2 iD+FF28L3Q1NZ/z7CQNv49+tK/jQS6Wn+T