HTML5ã«ãããã¤ããªããã¢ããªéçºã«é¢ããéè¨
HTML5ã§iPhoneãAndroidåãã®ãã¤ããªããã¢ããªãä½ãã®ãæè¿ã®æµè¡ãã¿ããã§ãããã¤ããªããã¢ããªã¨ã¯ãå¤é¢ã¯æ®éã®ã¢ããªã¨ãã¦AppStoreãGoogle play marketã§ã¤ã³ã¹ãã¼ã«ã§ãããã®ã®ããã®ä¸èº«ãä¸é¨ãHTML5ã§è¨è¿°ããã¦ããã¢ããªã§ãã
æè¿ã®æåãªä¾ã ã¨ãCookpadãLinkedInãはてなスペースãå°ãåã«ãã¤ãã£ãã«ç§»è¡ãã¦ãã¾ãã¾ãããfacebookã®ã¢ãã¤ã«ã¢ããªãHTML5ã使ã£ã¦è¨è¿°ããã¦ãã¾ãããGREE界隈で言われているらしいã¬ã¯ãã¤ãã£ãã£ã¦ããè¨èããã¤ããªããã¢ããªãæãã¾ããã¡ãã£ã¨ã°ã°ã£ã¦ã¿ãã¨ã2016å¹´ã«ã¯ä¼æ¥åãã®ã¢ããªã®50%ããã¤ããªããã¢ããªã«ãªãã¨ãã予測ãããã¾ãã
ãã¤ããªããã¢ããªã®ä½ããããã¨ããã¨ãObjective-Cã¨ãJavaã¨ããããããªãã¦ãã¦ã§ãç³»æè¡è ã§ããã°AndroidãiPhoneåãã¢ããªãæ¸ãã¡ããã®ã§ãä»ã¾ã§ã¦ã§ãã§ãã£ã¦ããæè¡è ã®ã¹ãã«ããã®ã¾ã¾ä½¿ããã¨ããã¨ãããããè¨ããã¾ããã¾ãããã«ããã©ãããã©ã¼ã 対å¿ããéã«ã¯ãå ¨ã¦ãã¤ãã£ãã§æ¸ãã¨åãå 容ã®ã¢ããªãJavaã¨Objective-Cã§éçºããªããã°ããã¾ããããHTML5ã§ããã°ã¯ã³ã½ã¼ã¹ã§Androidã¨iOS両æ¹ã®ãã©ãããã©ã¼ã ã«å¯¾å¿ã§ããã¨ããäºãããè¨ããã¾ããä¸ã®ä¸ã¦ã§ãç³»æè¡è ã¯ãã£ã±ããã¾ãããã¹ãã¼ããã©ã³ã¨ããæ¯è¼çæ´å²ã®æµ ããã©ãããã©ã¼ã ã®éçºè ã¯ä½ãç¨ããããã§ã¯ãªãã¨ãããã¨ãªãã ããã¨æãã¾ãã
ãã ãHTML5ã§ã¢ãã¤ã«ã¢ããªãéçºããéã®ãã¦ãã¦ã¨ãããã®ã¯ãçµæ§ç´°ã ã¨ãã話ãå¤ããããããã»ã©å ±æããã¦ãã¾ãããããããHTML5ã ããæ®éã®ã¦ã§ãæè¡è ãæ®éã«éçºã§ãããããããªãã¦ãã¦ã¨ãå¿ è¦ãªãããããªãã®ãã¨æãããããã¾ãããããåãHTML5ã§ãPCã¨ããã¹ã¦ã¹ããã¯ã®ä½ãAndroid端æ«ãiOS端æ«ã§ãã¡ãã¨åãããã«ããªããã°ãããªãã£ãããã¢ãã¤ã«ã¢ããªç¹æã®äºæ ããã£ããããããã§ãããã¨ãã¤ãã£ãã¨HTML5ãæ©æ¸¡ãããã®ã¯ã©ãããããã¨ããããã¤ããªããã¢ããªãéã®å¼¾ä¸¸ã§ã¯ç¡ããè²ããªãããã©ãããããã¾ããããããã®ã¯ãHTML5ã§ä½ã£ã¦ã¿ããã©éããã¦ä½¿ãç©ã«ãªããªãã£ãããä¸å¿åããã©UIçã«å¤§å¤ãããã¢ããªãã§ãã¦ãã¾ããã¾ãã¯facebookãç´é¢ãããããªHTML5ã§ä½ã£ãã¢ããªãè½ã¡ããã©WebViewã®ä¸èº«ããã©ãã¯ããã¯ã¹ãªã®ã§ãªãã§è½ã¡ãã®ãããããããªããã¨ããã¨ããã§ãã
ã¨ãããããã¤ããªããã¢ããªéçºã®æã«å¿ è¦ã¨ãªãç´°ã ã¨ãããã¦ãã¦ãªã©ãéå¤ã«ã¾ã¨ãã¦æ¸ãã¦ããã¾ãã
以ä¸ãç®æ¡æ¸ãã
- ãã¤ããªããã¢ããªã®ä½ãæ¹
- èªåã§HTML5ã¨ãã¤ãã£ããçµã¶ãã¬ã¼ã ã¯ã¼ã¯ãä½ãåã«æ¢åã®ãã¬ã¼ã ã¯ã¼ã¯ãé¸å®ãããã¨
- PhoneGapãtrigger.ioãªã©ã®ãã¬ã¼ã ã¯ã¼ã¯ããã
- HTML5ã§ã¢ããªããã«ãã§ããã ãã§ã¯ãªããHTML5ã¨ãã¤ãã£ãã®éä¿¡ã®æ©æ¸¡ããã§ãã
- HTML5ãããã¤ãã£ãã®æ©è½ãå¼ã³åºãããã¨ãã¯PhoneGapãªã©ã使ãã
- PhoneGapã«å®è£ ããã¦ããªãæ©è½ã§ãããã©ã°ã¤ã³ãæ¸ããã¨ã§å®è£ ã§ãã
- ã»ãã¥ãªãã£
- ãã¤ããªããã¢ããªå ã§ã¯JSãããã¤ãã£ãã®æ©è½ãå¼ã³åºããã®ã§ãXSSã«æ°ãã¤ããã®ã¯ãã¡ãããiframeå ã§ä¿¡é ¼åºæ¥ãªãHTMLãèªã¿è¾¼ãéã«ãæ°ãã¤ãã
- PhoneGapã ã¨ãã¯ã¤ããªã¹ãå¼ã§èªã¿è¾¼ãHTMLãå¶éãããªã©è²ã 対çããã¦ãã
- èªåã§HTML5ã¨ãã¤ãã£ããéä¿¡ããä»çµã¿ãä½ã£ã¦èå¼±æ§çããããç´ ç´ã«PhoneGap使ã£ãã»ãããã
- ã¢ãã¤ã«ç«¯æ«ã§è¡¨ç¤ºãã¦ããHTMLã«ã¦ã§ãã¤ã³ã¹ãã¯ã¿ãå©ç¨ããã«ã¯
- iOSãªãsafariのリモートインスペクタã使ã
- ãã以å¤ã¯weinre使ã
- èªåã®å ´åã社å ã«weinreãµã¼ãç«ã¦ã¦ããã«ä½¿ããããã«ãã¦ã
- ä½ãããHTML5ã§æ¸ããã¨ããã¨ã ãããç ´ç¶»ãã
- android2.3ãiOS4ã ã¨ï¼CSSã®position: fixedãã¾ã¨ãã«ä½¿ããªãã®ã§ãä¸é¨ã«åºå®ããããã¼ã«ãã¼ãä½ããªã
- ããã©ã¼ãã³ã¹ä¸HTML5ã ã¨ç¡çã£ã½ãé¨åãåºã¦ãã
- ãã¤ãã£ãã§ãã§ã«ç¨æããã¦ããUIé¨åãããã®ã«HTML5ã§ã¤ããã¼ã·ã§ã³ãä½ãç¡æå³ã
- éçºå¹çãä¸ããããã«ãã¤ããªããã§ãã¨ããå ´åã«ãªãã§ãHTML5ã§ãããã¨ããã¨ããã£ã¦å¹çæªããªã£ããã¸ã¼ãã¢ããªãåºæ¥ä¸ãã£ãããã¦æ¬æ«è»¢åã«ãªã
- èªåã®å ´åãç»é¢ã®ãã¼ã«ãã¼ããã®ãã¿ã³ãªã©ã¯ãHTML5ã§æ¸ããã«ãã¤ãã£ãã§æ¸ãã¦ã(ä¸èº«ã®ã³ã³ãã³ãã®é¨åã ãHTML5ã§æ¸ãã¦ãã)
- ãã¨ç»é¢é·ç§»æã®ã¹ã©ã¤ãã¢ãã¡ã¼ã·ã§ã³ãªã©ããã¤ãã£ãã®ã³ã¼ãã§æ¸ãã¦ã
- ããã©ã¼ãã³ã¹ãåççã«HTML5ã§ã¯é£ããç»é¢ã®å ´åãPhoneGapãã©ã°ã¤ã³æ¸ãã¦ãã®ç»é¢ã ããã¤ãã£ãã«ããã®ãå
- ãã¿ã³ãªã©ã«clickã¤ãã³ãã¯ä½¿ããªã
- 試ãã¦ã¿ãã¨ããããã©ã³ã£ããããã»ã©é 延ãçºçãã
- tappableã®ãããªã¿ããã¤ãã³ãããã¾ãæ±ããã©ã¤ãã©ãªã使ã
- jQueryãããªãã¦zepto.js使ãã¾ããã
- zepto.jsã¯jQueryã¨åãã¤ã³ã¿ã¼ãã§ã¤ã¹ãæã¤ããã¢ãã¤ã«ã§å©ç¨ãããã¬ã³ããªã³ã°ã¨ã³ã¸ã³ã ãã«ç¹åãjQueryãã軽ã
- ãã¨jQuery mobileéãã¦ããã¾ã使ããªãå°è±¡
- ã¢ãã¡ã¼ã·ã§ã³ã«ã¯CSSã¢ãã¡ã¼ã·ã§ã³ä½¿ãã¾ããã
- JavaScriptã®ã¿ã§ç´æ¥ã¢ãã¡ã¼ã·ã§ã³ããã¨ã¯ã½éã
- JavaScriptããã¢ãã¡ã¼ã·ã§ã³æä½ããã¨ã㯠domElement.style.webkitAnimation ã¿ãããªã¢ãã¡ã¼ã·ã§ã³é¢é£ã®ã¹ã¿ã¤ã«ã®ããããã£ãæ¸ãæãã¦ä½¿ã
- ã¢ãã¡ã¼ã·ã§ã³ã©ã¤ãã©ãªã使ãå ´åã¯å é¨ã§CSSã¢ãã¡ã¼ã·ã§ã³ä½¿ã£ã¦ãããã©ãã確èªãã¦ãã
- ä»æ¹ãªãJavaScriptã ãã§ã¢ãã¡ã¼ã·ã§ã³ããå ´åã§ããsetTimeoutãsetIntervalã§ã¯ãªããã§ããã°requestAnimationFrame使ã
- iOSã ã¨ãwebkitTransformã«translateXãtranslateã使ãã¨ãã©ã¤ãã®ã§ãtranslate3dã®æ¹ã使ãã
- ã¢ãã¡ã¼ã·ã§ã³ã®æç»ã«ã¯GPUãæå¹ã«ãã¦æ©ããã
- GPUãæå¹ã«ãããè¦ç´ ã«ã¯ãã®呪文: -webkit-transform-style: preserve-3d;
- androidã§GPUãå¹ãã¦ããã©ããã確èªããã«ã¯ãéçºè åããªãã·ã§ã³ã§ãGPUãªã¼ãã¼ããã¼ãæå¹ã«ããããä»ãã¦ãã端æ«ã§è¦ã
- iOSã®å ´åã¯ãã·ãã¥ã¬ã¼ã¿ã§ç¢ºèªã§ãããã³ãã³ãã©ã¤ã³ã§ããå®è¡ => CA_COLOR_OPAQUE=1 open /Applications/Xcode.app/Contents/Applications/iPhone\ Simulator.app
- 解説è¨äº: iOSのアクセラレーターが使えるCSS3
- ããã©ã¼ãã³ã¹ãå¿
è¦ãªã¨ãã¯ãDOMãããããªã
- è¦ãç®ãå¤ããã¨ãã«ãclasså±æ§ãå¤æ´ããããæ¹ã¯ããããããã¢ãã¡ã¼ã·ã§ã³ä¸ã®å¦çãªã©ã®ããã©ã¼ãã³ã¹ãå¿ è¦ãªã¨ãã«ããã¨éããåè¦ç´ ã追å ãããããã®ãåæ§
- DOMãã®ãã®ããããã®ã§ã¯ãªããDOMè¦ç´ ã®styleããããã£ãJavaScriptããç´æ¥å¼ã£ãã»ããæç¶è»½ã
- viewport使ãã¾ããã
- viewportã¯ã¢ãã¤ã«ç¨ã®HTML5ã«ç¹æã®æ¦å¿µ
- 端æ«ã®å¹ ã«åããã¦ç»é¢ãèªåçã«æ¡å¤§ç¸®å°ã¿ãããªãã¨ãã§ãã
- androidã ã¨viewportã®widthè¨å®ãå¹ããªãã®ã§ãviewport.jsã®ãããªviewportã®åä½ãã¨ãã¥ã¬ã¼ã·ã§ã³ããã©ã¤ãã©ãªã使ã
- ãªã¹ãã®ãããªè¦ç´ ã沢山表示ããç»é¢ã§ã®ã¤ãã³ãå¦çã«ã¯ãã¤ãã³ããçºçããDOMElementä¸åä¸åã«addEventListenerããã¨éããªã
- document.bodyã«ã²ã¨ã¤ã ãã¤ãã³ããã³ãã©ãã¤ãã¦event.targetã§ã©ã®DOMè¦ç´ ã§ã®ã¤ãã³ãããè¦ã¦å¦çãã
- android4ç³»ã ã¨ãWebViewãassetsãããªã½ã¼ã¹ã512å以ä¸èªã¿è¾¼ãã¨SIGSEGVã§必ず落ちるバグããã
- HTMLã ãã§ã¯ãªãJSãCSSãç»åãªã©ãåæ°ã«å«ããåããªã½ã¼ã¹ãä½åº¦ãèªã¿è¾¼ãã§ãçºçããããªã½ã¼ã¹ã®èªã¿è¾¼ã¿ãããç»é¢é·ç§»ãç¹°ãè¿ãã¨ç¢ºå®ã«è½ã¡ã
- WebViewå é¨ã®NDKã§æ¸ãããé¨åã®ãã°ãªã®ã§ã©ããããããªã
- HTMLãªã©ã¯assetsãããªãã¦ãã¡ã¤ã«ã·ã¹ãã ããèªã¿è¾¼ãããã«ãã
- ã¢ããªã®ååèµ·åæãªã©ã«assetãããã¡ã¤ã«ã·ã¹ãã ã«ç§»ãã¨ãã
- ç»é¢ã®å¾ãããã³ããªã³ã°ãã
- ç»é¢ãå¾ããæã«ã¯ãiOSã ã¨orientationChangeã¤ãã³ããçºç«ãã
- android2.2以åã ã¨orientationChangeã¤ãã³ããçºç«ãããã代ããã«resizeã¤ãã³ããçºç«ãã
- ãªã®ã§androidã§ã¯resizeã¤ãã³ãããwindowã®ç¸¦æ¨ªã®ã¢ã¹ãã¯ãæ¯ãè¦ã¦å¤æãã
- touché¢é£ã¤ãã³ãã®æ±ã
- iOSãAndroidã§ã¯æã®ã¿ãããæ±ãã¤ãã³ãã¨ãã¦ãtouchstartãtouchmoveãtouchendãtouchcancelã¨ããmouseã¤ãã³ãã¨ã¯å¥ã®æ±ãã®ã¤ãã³ããçºç«ããã
- touchstartã¤ãã³ããçºç«ãããè¦ç´ ã§ãtouchendã¤ãã³ããçºç«ãããã¨ã¯éããªã
- touchendã®ææã¯ãã®åå¥ã®DOMè¦ç´ ã§ã¯ãªããã¼ã¸å ¨ä½ã§ãã
- ããã¨ã¯å¥ã®è©±ã§ãandroidã ã¨touchstartããå¾touchendã¤ãã³ãããã°ãã°çºç«ãããªã
- iOSã§åãããã¤ããªããã¢ããªã®ã»ããã¯ããã«éã