Author: Oleg Gomozov, Senior Software Engineer
Agenda:
- Chose yours: flexible, fluid, adaptive, responsive
- Some data about units
- Media Queries Magic
- JavaScript practices
- Browser, please, help me
- Mobile first, how and why
- Tricks, tools and hacks
4. •Flexible–change size, scale
•Fluid–flexible + grid or some layout rules
•Adaptive–fluid + change in content, UI elements face and appearance
•Responsive –adaptive + change of interface, behavior, interactions, device and human specifics
19. Meta viewport and @viewport
<metaname="viewport"content="width=device- width, initial-scale=1.0, user-scalable=false,
minimum-scale=0.9, maximum-scale=1.1">
Apple-specific meta
<metaname="apple-mobile-web-app-capable"content="yes">
navigator.standalonemode
20. Mobile first, how and why?
Desktop is specific device, mobile is basic
22. http://adaptive-images.com:
1.The HTML starts to load in the browser and a snippet of JS in the <head> writes a session cookie, storing the visitor's screen size in pixels.
2.Browser then encounters <img> tag and sends a request to the server for that image. It also sends the browser cookie.
3.Apache receives the request and looks in the website's .htaccessfile.
4..htaccess: any request for JPG, GIF, or PNG file send to the adaptive- images.phpfile.
5.PHP file looks for a cookie and finds user maximum screen size of 480px.
6.It compares the cookie value with all $resolutionsizes that were configured, and decides which matches best.
7.Then looks into /ai-cache/480/folder to see if a rescaled image already exists.
8.If not the PHP then goes to the actual requested URI to find the original file.
9.It checks image width. If that's smaller than the user's screen width it sends the image.
10.If it's larger, the PHP creates a down-scaled copy and saves that into the /ai- cache/480/folder ready for the next time it's needed, and sends it to the user.
25. Iconic fonts benefits
•Lossless change size, vector graphics in fonts
•Change of solid colormask
•Change of shape, shadow and other text transformations
29. Proper HTML5 input types
<form>
<inputtype="url"placeholder="Go to a Website"autofocus>
<inputtype="email"required maxlength="12">
<inputtype="date">
<inputtype="datetime">
<inputtype="number"min="0"max="10"step="2"value="6“
pattern="[A-Z]{3}[0-9]{4}">
<inputtype="color">
<inputtype="submit"value="Search">
</form>
30. Pixel is not a pixel
1 CSS Px= 1 Device Px
CSS pixel –reference pixels, which are the main measure points for browsers measurements.
Device pixel –physical pixels, which are the main measure points for device graphics actions.
Zoom out
Zoom in
1 CSS Px= 4 Device Px,
Retina=)
31. Prepare for responsive
-componentsfunction priority
-target devicesscreens
-target audience and it’s context