You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Foresight.js was originally introduced when the first iPad with Retina display was announced in 2012. It helped solve the problem of providing the optimal image for the device, with the goal to decrease image loading time, and to not waste bandwidth.
4
+
5
+
Since then however, the [picture element](https://developers.google.com/web/fundamentals/media/images/images-in-markup#art-direction-in-responsive-images-with-picture) has been working its way through the [standards](http://www.w3.org/html/wg/drafts/html/master/embedded-content.html#the-picture-element) and is actively being [implemented](http://blog.chromium.org/2014/08/chrome-38-beta-new-primitives-for-next.html) by browsers. It's recommended to use [picture element polyfill](https://github.com/scottjehl/picturefill), rather than this out-dated solution.
6
+
7
+
## Old Intro
8
+
2
9
__Foresight.js__ gives webpages the ability to tell if the user's device is capable of viewing high-resolution images (such as the 3rd generation iPad) before the image has been requested from the server. Additionally, it judges if the user's device currently has a fast enough network connection for high-resolution images. Depending on device display and network connectivity, __foresight.js__ will request the appropriate image for the webpage. By customizing the _img__src_ attribute using methods such as URI templates, or finding and replacing values within the URI, it is able to form requests built for your image's resolution variants. Media queries however, could be used when dealing with CSS background-images, while foresight.js is used to handle inline _img_ elements (or until current web standards are improved). Recently __Washington Post__ implemented foresight.js to determine hi-res/responsive images on their [mobile site](http://m.washingtonpost.com/).
3
10
4
11
Foresight's methods centralizes how to configure image variants across your entire site (compared to hard-coding each image variant's src and its dimensions into markup on every page), and specifically uses a hybrid implementation of the [new CSS image-set() function](http://blog.cloudfour.com/safari-6-and-chrome-21-add-image-set-to-support-retina-images/).
5
12
6
-
This project's overall goal is to tackle these current issues faced by web developers designing for hi-res: [Challenges for High-Resolution Images](//github.com/adamdbradley/foresight.js/wiki/Challenges-for-High-Resolution-Images). Foresight.js aims at providing a lightweight, cross-browser and framework independent tool for a __high-resolution web on today's browsers__. Please feel free to contact me ([@adamdbradley](https://twitter.com/adamdbradley)) or contribute to this project to help improve it. I also put together this slide deck to help explain hi-res: [Responding to the New High-Resolution Web: Considerations for High-Density Displays](http://goo.gl/Zo4XF).
13
+
This project's overall goal is to tackle these current issues faced by web developers designing for hi-res: [Challenges for High-Resolution Images](//github.com/adamdbradley/foresight.js/wiki/Challenges-for-High-Resolution-Images). Foresight.js aims at providing a lightweight, cross-browser and framework independent tool for a __high-resolution web on today's browsers__.
7
14
8
15
For a small set of CSS classnames to help keep images cropped on the focal point check out [Focal Point](https://github.com/adamdbradley/focal-point).
9
16
@@ -19,22 +26,6 @@ For a small set of CSS classnames to help keep images cropped on the focal point
19
26
* Does not use device detection through user-agents
20
27
* Minifies to 7K
21
28
22
-
23
-
## Demos
24
-
Currently most desktop and laptops do not have high-resolution displays and are limited to a device pixel ratio of only 1, so you will not be able to see the effects on a standard monitor. Make sure you view the demos from multiple devices, such as your mobile phone, tablet and traditional computer.
All documentation can be found at [CDNConnect.com](http://www.cdnconnect.com/docs/foresightjs)
32
-
33
-
34
-
## Contribute
35
-
36
-
This project was originally created as a need for an ecommerce mobile homepage, which basically showed high-resolution images for high-resolution devices, and adjust image widths accordingly. This is by no means the end-all solution for high-resolution images; I'd label this more as an interim solution as the web standards evolve for handling device pixel ratios. Please feel free to improve this project in any way you can.
@@ -46,14 +37,8 @@ Find a bug? Please create an issue here on GitHub!
46
37
47
38
[Submit an issue](https://github.com/adamdbradley/foresight.js/issues)
48
39
49
-
50
-
## Presentation
51
-
52
-
*[Responding to the New High-Resolution Web: Considerations for High-Density Displays](http://goo.gl/Zo4XF)
53
-
54
40
## References/Resources
55
41
56
-
*[CDNConnect](http://www.cdnconnect.com/): Production File Management & Fast Content Delivery For The Team
57
42
*[Focal Point](https://github.com/adamdbradley/focal-point): A small set of CSS classnames to help keep images cropped on the focal point for responsive designs
58
43
*[Safari 6 and Chrome 21 add image-set to support retina images](http://blog.cloudfour.com/safari-6-and-chrome-21-add-image-set-to-support-retina-images/)
59
44
*[Using CSS to control image variants](http://www.w3.org/community/respimg/2012/04/08/using-css-to-control-image-variants/)
@@ -65,7 +50,7 @@ Find a bug? Please create an issue here on GitHub!
65
50
66
51
## License
67
52
68
-
Copyright (c) 2012 Adam Bradley[CDNConnect.com](http://www.cdnconnect.com/docs/foresightjs)
0 commit comments