•  


GitHub - tholman/intense-images: A simple library to view large images up close using simple mouse interaction, and the full screen.
Skip to content

A simple library to view large images up close using simple mouse interaction, and the full screen.

Notifications You must be signed in to change notification settings

tholman/intense-images

Folders and files

Name Name
Last commit message
Last commit date

Latest commit

 

History

128 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Intense Images

A stand alone javascript library for viewing images on the full, full screen. Using the touch/mouse position for panning. Here's a demo ! You can also play with the code live on CodePen .

Instructions

Intense images is a stand alone library (no jquery, or the likes) so usage is pretty straight forward. All styling of image elements is up to the user, Intense.js only handles the creation, styling and management of the image viewer and captions.

HTML

There aren't many restrictions for the html elements you want to use to activate the Intense image viewer, the one mandatory attribute is either a src , data-image or a href , which needs to point to an image file. You can use data-image if you want to load in a different version of the image to the original source (higher resolution, for example).

<
img
 src
="
./img/awesome-source.jpg
" />

<!-- OR -->


<
div
 class
="
anything
" 
data-image
="
./img/awesome-source.jpg
" />

You can also pass through titles, and subcaptions, which will appear at the bottom right of the viewer. To do this, you use the data-title and data-caption attributes.

<
img
 src
="
./img/awesome-source.jpg
" 
data-title
="
My beach adventure
" 
data-caption
="
Thanks Sam, for the great picture
"/>

JS

Intense.js is fairly robust when it comes to assigning elements to be used, its as simple as passing them to the Intense function, once they have been rendered. You can do this with document.querySelector finding your elements however you like.

<
img
 src
="
./img/awesome-source.jpg
" />

<
script
>

window
.
onload
 =
 function
(
)
 {

	// Intensify all images on the page.

    var
 element
 =
 document
.
querySelector
(
 'img'
 )
;

	Intense
(
 element
 )
;

}

</
script
>

Or doing multiple at once, with a classname.

<
img
 src
="
./img/awesome-source.jpg
" 
class
="
intense
" />
<
img
 src
="
./img/awesome-source.jpg
" 
class
="
intense
" />

<
script
>

window
.
onload
 =
 function
(
)
 {

	// Intensify all images with the 'intense' classname.

    var
 elements
 =
 document
.
querySelectorAll
(
 '.intense'
 )
;

	Intense
(
 elements
 )
;

}

</
script
>

If you want, you can invert the direction of the interactions

<
img
 src
="
./img/awesome-source.jpg
" 
class
="
intense
" />
<
img
 src
="
./img/awesome-source.jpg
" 
class
="
intense
" />

<
script
>

window
.
onload
 =
 function
(
)
 {

	// Intensify all images with the 'intense' classname.

	var
 elements
 =
 document
.
querySelectorAll
(
 '.intense'
 )
;

	Intense
(
 elements
,
 {
invertInteractionDirection
: 
true
}
)
;

}

</
script
>

CSS

There aren't any css restrictions. Although you'll want to avoid tainting the js files css with anything else (editing the base h1 tag, for instance), unless of course, thats what you want to customize.

If you wish to use the + cursor, you can find the image in the demo folder, here's the css snippet.

.
your-image-class
 {
	
cursor
:
 url
(
'./you-image-directory/plus_cursor.png'
) 
25
 25
,
 auto;
}

Image/Example

Here's a quick screenshot of Intense.js in action. You should really look at the demo though, to get a full feel for the interactions.

Intense.js in action

Browser support

Intense has been tested in the latest stable builds of Safari, Chrome and Firefox. It "should work" in Internet Explorer 9 and up as well.

Other frameworks

If you're using React, check out react-intense !

License

The MIT License (MIT)

Copyright (C) 2016 ~ Tim Holman ~ timothy.w.holman@gmail.com

- "漢字路" 한글한자자동변환 서비스는 교육부 고전문헌국역지원사업의 지원으로 구축되었습니다.
- "漢字路" 한글한자자동변환 서비스는 전통문화연구회 "울산대학교한국어처리연구실 옥철영(IT융합전공)교수팀"에서 개발한 한글한자자동변환기를 바탕하여 지속적으로 공동 연구 개발하고 있는 서비스입니다.
- 현재 고유명사(인명, 지명등)을 비롯한 여러 변환오류가 있으며 이를 해결하고자 많은 연구 개발을 진행하고자 하고 있습니다. 이를 인지하시고 다른 곳에서 인용시 한자 변환 결과를 한번 더 검토하시고 사용해 주시기 바랍니다.
- 변환오류 및 건의,문의사항은 juntong@juntong.or.kr로 메일로 보내주시면 감사하겠습니다. .
Copyright ⓒ 2020 By '전통문화연구회(傳統文化硏究會)' All Rights reserved.
 한국   대만   중국   일본