Coder Social home page Coder Social logo

isabella232 / imaging-sample-viewers Goto Github PK

View Code? Open in Web Editor NEW

This project forked from akamai/imaging-sample-viewers

0.0 0.0 0.0 135 KB

A library to visualize Images and Image Collections defined by Akamai's Image Manager.

License: Apache License 2.0

JavaScript 85.82% CSS 14.18%

imaging-sample-viewers's Introduction

Akamai Sample Image Viewers

This library visualizes various collections of images in a browser. A collection might represent a particular product on an e-commerce site, or a set of images related to a news article.

This library integrates directly with Images and Image Collections defined by Akamai's Image Manager. The Image Collection contains all relevant information about which images to display and how images should be organized.

The APIs can be found at: https://developer.akamai.com/api/imaging/imaging/reference.html

Project organization

  • /src - project sources
  • /lib - 3rd party dependency libraries

Install

See INSTALL for installation instructions.

Getting Started

  • Create a viewer page in HTML including Image Viewer widget.
  • Include the library and its dependencies in the HTML file.

For example:

...
    <!-- The file path will be similar to this assuming the HTML file is in root directory of this library -->
    <script src="https://code.jquery.com/jquery-2.1.3.min.js"></script>
    <script src="lib/galleria/galleria-1.4.2.min.js"></script>
    <script src="src/js/im-viewer-image-data.js"></script>
    <script src="src/js/im-viewer-image-selector.js"></script>
    <script src="src/js/im-viewer-util.js"></script>
    <script src="src/js/im-viewer-object.js"></script>
    <script src="src/js/im-viewer.js"></script>
...
  • Include the ccs files used by the libaries:

For example:

...
    <!-- The file path will be similar to this assuming the HTML file is in root directory of this library -->
    <link rel="stylesheet" href="lib/ionicons/css/ionicons.min.css">
    <link rel="stylesheet" href="src/css/im-viewer-image-data.css">
    <link rel="stylesheet" href="src/css/im-viewer.css">
...
  • Create an div to contain the image viewer:

For example:

...
    <div class="galleria"></div>
...
  • Finally, instantiate the widget on the page:
...
    <script type="text/javascript">
        jQuery(document).ready(function() {
            var options = {
                baseUrl: '<base_url>',
                lunaToken: '<luna_token>',
                imageCollectionId: '<image_collection_id>',
                galleriaTheme: "<path_to_theme_file>"
            };

            $(".galleria").viewer(options);
        });
    </script>
...

For example:

...
    <script type="text/javascript">
        jQuery(document).ready(function() {
            var options = {
                baseUrl: 'http://example.com',
                lunaToken: 'lunatoken123',
                imageCollectionId: '/sample/image/id',
                galleriaTheme: "lib/galleria/theme/classic/galleria.viewer.js",
            };

            $(".galleria").viewer(options);
        });
    </script>
...

Parameters

Parameter Description Type Default Required
baseUrl Base URL of the domain hosting the images. Typically this is the host that Image Manager is enabled on. String N/A Yes
lunaToken 'API Token' assigned when enabling Image Manager in Luna Property Manager. String N/A Yes
imageCollectionId The ID of the Image Collection defined in Image Manager. String N/A Yes
galleriaTheme The locatioa of the viewer theme file galleria.viewer.js in the directory lib/galleria/themes/classic. String N/A Yes
windowWidthThreshold The window width threshold used to choose between viewerWidth/viewerHeight and smViewerWidth/smViewerHeight. px "600px" No
viewerWidth Width of the viewer when the width of the browser window width is larger than the 'windowWidthThreshold'. px or % "100%" No
viewerHeight Height of the viewer when the width of the browser window width is larger than the 'windowWidthThreshold'. px or % "100%" No
smViewerWidth Width of the viewer when the width of the browser window width is smaller than the 'windowWidthThreshold'. px or % "100%" No
smViewerHeight Height of the viewer when the width of the browser window width is smaller than the 'windowWidthThreshold'. px or % "100%" No
thumbnailWidth Akamai query value for the thumbnail image width, used when requesting the thumbnail image from Akamai. px or % "50px" No
galleryContainer CSS selector for the div element that contains the swatches. The viewer will create the div if jQuery cannot find the element specified. String "#galleries" No
rotationInverse If true, the frames for the Rotatable images will be inversed. Boolean false No
hoverFocus If ture, the viewer will display the image when mouse hover over its thumbnail. Boolean false No
showImageData If ture, the the image data will always be displayed, if "hover", is will only be visible when hovered over, if false, it is not displayed. Boolean or "hover" false No
dummyImage The path to a dummy image to display if the viewer cannot fetch the image. String N/A No

Magnifier

The Akamai Sample Image Viewer has a built in magnifier. Please use instructions in MAGNIFIER_README to enable and initialize the magnifier.

imaging-sample-viewers's People

Contributors

rcalendi avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.