Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
enterprise:demos:gallery [2021/10/24 00:45] admin |
enterprise:demos:gallery [2021/10/27 00:45] (current) admin |
||
---|---|---|---|
Line 2: | Line 2: | ||
====== Demo : Gallery ====== | ====== Demo : Gallery ====== | ||
- | |||
===== Overview ===== | ===== Overview ===== | ||
+ | This is a media gallery sample,you can switch carousel mode to rotating、slider or coverflow. | ||
===== Running ===== | ===== Running ===== | ||
Line 28: | Line 28: | ||
</ | </ | ||
- | <script id=" | + | <script id=" |
<li data-pickfrom="< | <li data-pickfrom="< | ||
<a data-toggle=" | <a data-toggle=" | ||
Line 34: | Line 34: | ||
</ | </ | ||
- | <script id=" | + | <script id=" |
<div class=" | <div class=" | ||
</ | </ | ||
Line 60: | Line 60: | ||
<div class=" | <div class=" | ||
<label class=" | <label class=" | ||
- | <input name=" | + | <input name=" |
</ | </ | ||
<label class=" | <label class=" | ||
- | <input name=" | + | <input name=" |
</ | </ | ||
<label class=" | <label class=" | ||
- | <input name=" | + | <input name=" |
</ | </ | ||
</ | </ | ||
Line 80: | Line 80: | ||
< | < | ||
function initPage(langx, | function initPage(langx, | ||
- | | + | |
+ | var medias = [ | ||
+ | { | ||
+ | type: ' | ||
+ | poster : "/ | ||
+ | media : "/ | ||
+ | title : " | ||
+ | }, | ||
+ | { | ||
+ | type: ' | ||
+ | poster : '/ | ||
+ | media : "/ | ||
+ | title : " | ||
+ | }, | ||
+ | { | ||
+ | type: ' | ||
+ | poster : '/ | ||
+ | media : "/ | ||
+ | title : " | ||
+ | }, | ||
+ | { | ||
+ | type: ' | ||
+ | poster : "/ | ||
+ | media : "/ | ||
+ | title : "grand view park" | ||
- | let _windowLoaded = false; | + | |
- | var medias = [ | + | |
- | { | + | |
- | type: ' | + | |
- | poster : "/ | + | |
- | media : "/ | + | |
- | title : " | + | |
- | | + | |
- | { | + | |
- | type: ' | + | |
- | poster : '/ | + | |
- | media : "/ | + | |
- | title : " | + | |
- | }, | + | |
- | { | + | |
- | type: ' | + | |
- | poster : '/ | + | |
- | media : "/ | + | |
- | title : " | + | |
- | }, | + | |
- | { | + | |
- | type: ' | + | |
- | poster : "/ | + | |
- | media : "/ | + | |
- | title : "grand view park" | + | |
- | | + | { |
+ | type: ' | ||
+ | poster : "/ | ||
+ | media : "/ | ||
+ | title : " | ||
+ | | ||
+ | |||
+ | { | ||
+ | type: ' | ||
+ | poster : "/ | ||
+ | media : "/ | ||
+ | title : " | ||
- | { | + | |
- | type: ' | + | { |
- | poster : "/ | + | |
- | media : "/ | + | poster : "/medias/ |
- | title : " | + | media : "/medias/ |
- | | + | title : "the earth around" |
- | + | ||
- | | + | |
- | | + | |
- | poster : "/_media/ | + | |
- | media : "/_media/ | + | |
- | title : "sam" | + | |
- | | + | |
- | { | + | ]; |
- | type: ' | + | |
- | poster : "/ | + | |
- | media : "/ | + | |
- | title : "the earth around" | + | |
- | } | + | const mediaEls |
- | ]; | + | |
- | | + | |
- | const mediaEls | + | if (mediaEls && |
+ | for (let i = 0, e = mediaEls.length; i < e; i++) { | ||
+ | const mediaEl = mediaEls[i], | ||
+ | pickerOptions = { | ||
+ | tabs : [ | ||
+ | {label:" | ||
+ | ], | ||
- | if (mediaEls && mediaEls.length > 0) { | + | template : $("# |
- | for (let i = 0, e = mediaEls.length; | + | |
- | const mediaEl = mediaEls[i], | + | templates : { |
- | pickerOptions = { | + | |
- | tabs : [ | + | tabpane |
- | {label:"Gallery",from:"listing", | + | |
- | ], | + | |
- | | + | froms : { |
+ | listing : { | ||
+ | | ||
- | templates | + | item : { |
- | | + | |
- | tabpane : $("# | + | }, |
- | }, | + | |
- | froms : { | + | modes : { |
- | | + | template : $("# |
- | | + | } |
- | + | ||
- | item : { | + | |
- | template : $("# | + | |
- | }, | + | |
- | + | ||
- | modes : { | + | |
- | template : $("# | + | |
- | } | + | |
- | } | + | |
- | } | + | |
- | }; | + | |
- | + | ||
- | if (mediaEl && mediaEl.getAttribute) { | + | |
- | if (mediaEl.player === undefined) { | + | |
- | let player = new oneplayer.Player(mediaEl, | + | |
- | | + | |
- | | + | |
- | }); | + | |
- | } | + | |
- | } else { | + | |
- | autoSetupTimeout(1); | + | |
- | break; | + | |
} | } | ||
- | | + | |
- | } else if (!_windowLoaded) { | + | }; |
- | | + | |
- | } | + | |
- | | + | |
- | function autoSetupTimeout(wait) { | + | |
- | window.setTimeout(autoSetup, | + | if (mediaEl.player === undefined) { |
- | } | + | mediaEl.player |
- | function setWindowLoaded() { | + | |
- | | + | |
- | window.removeEventListener(' | + | }); |
+ | } | ||
} | } | ||
- | if (document.readyState === ' | + | |
- | setWindowLoaded(); | + | |
- | | + | |
- | window.addEventListener(' | + | |
- | } | + | |
- | const hasLoaded = function () { | + | |
- | return _windowLoaded; | + | |
- | }; | + | |
- | + | ||
- | autoSetupTimeout(1, | + | |
} | } | ||
</ | </ | ||
Line 207: | Line 176: | ||
<link type=" | <link type=" | ||
< | < | ||
- | | + | |
- | position: absolute; | + | position: absolute; |
- | top: 0px; | + | top: 0px; |
- | left: 0px; | + | left: 0px; |
- | background: rgba(255, 152, 0, 0.86); | + | background: rgba(255, 152, 0, 0.86); |
- | color: rgb(255, 255, 255); | + | color: rgb(255, 255, 255); |
- | display: flex; | + | display: flex; |
- | align-items: | + | align-items: |
- | justify-content: | + | justify-content: |
- | width: 100%; | + | width: 100%; |
- | height: 100%; | + | height: 100%; |
- | z-index: 9999; | + | z-index: 9999; |
- | } | + | } |
- | .u-oneplayer { | + | .u-oneplayer { |
- | position: absolute; | + | position: absolute; |
- | } | + | } |
- | .uop-picker .lark-carousel .desc, .lark-carousel .ground { | + | |
- | display: none; | + | display: none; |
- | | + | } |
- | .uop-picker .lark-carousel.rotate .desc, .lark-carousel.rotate .ground { | + | |
- | display: block; | + | display: block; |
- | | + | } |
- | .uop-picker .lark-carousel.rotate .item img { | + | |
- | | + | |
- | } | + | } |
- | + | ||
- | | + | |
- | display: block; | + | |
- | height : 220px; | + | |
- | width: 220px; | + | |
- | } | + | |
- | | + | |
- | | + | |
- | height : 80%; | + | max-height: |
- | | + | |
- | } | + | |
+ | cursor : pointer; | ||
+ | | ||
- | .uop-picker .lark-carousel.slide .item img { | + | |
- | display: block; | + | width: 120px; |
- | height : 80%; | + | height: 170px; |
- | | + | } |
+ | |||
+ | .uop-picker .lark-carousel.rotate | ||
+ | display: block; | ||
+ | height : 220px; | ||
+ | width: 220px; | ||
+ | } | ||
- | | + | |
- | height: | + | height : 360px; |
- | } | + | |
+ | | ||
- | | + | |
- | width: 120px; | + | display: block; |
- | height: 170px; | + | |
- | } | + | |
- | + | } | |
- | .uop-picker .lark-carousel | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | + | ||
- | | + | |
+ | | ||
+ | display: block; | ||
+ | height : 420px; | ||
+ | width : 840px | ||
+ | } | ||
</ | </ | ||
Line 275: | Line 245: | ||
===== Code ===== | ===== Code ===== | ||
+ | < | ||
+ | <div style=" | ||
+ | < | ||
+ | </ | ||
+ | </ | ||
+ | |||
+ | <script id=" | ||
+ | | ||
+ | <div class = " | ||
+ | <div class=" | ||
+ | <ul class=" | ||
+ | </ul> | ||
+ | <div class=" | ||
+ | </ | ||
+ | </ | ||
+ | </ | ||
+ | | ||
+ | </ | ||
+ | |||
+ | <script id=" | ||
+ | <li data-pickfrom="< | ||
+ | <a data-toggle=" | ||
+ | </li> | ||
+ | </ | ||
+ | |||
+ | <script id=" | ||
+ | <div class=" | ||
+ | </ | ||
+ | |||
+ | <script id=" | ||
+ | <div class=" | ||
+ | < | ||
+ | <ul class= " | ||
+ | <!-- Add your images (or video) here --> | ||
+ | </ul> | ||
+ | <!-- Text at center of ground --> | ||
+ | <p class = " | ||
+ | <div id=" | ||
+ | </ | ||
+ | <a class=" | ||
+ | <a class=" | ||
+ | <a class=" | ||
+ | <ol class=" | ||
+ | </ol> | ||
+ | </ | ||
+ | </ | ||
+ | |||
+ | <script id=" | ||
+ | <li class=" | ||
+ | <div class=" | ||
+ | <label class=" | ||
+ | <input name=" | ||
+ | </ | ||
+ | <label class=" | ||
+ | <input name=" | ||
+ | </ | ||
+ | <label class=" | ||
+ | <input name=" | ||
+ | </ | ||
+ | </ | ||
+ | </ | ||
+ | </ | ||
+ | |||
+ | <script id=" | ||
+ | <li class=" | ||
+ | <div class=" | ||
+ | </ | ||
+ | </ | ||
+ | |||
+ | < | ||
+ | function initPage(langx, | ||
+ | let $ = domx.query; | ||
+ | var medias = [ | ||
+ | { | ||
+ | type: ' | ||
+ | poster : "/ | ||
+ | media : "/ | ||
+ | title : " | ||
+ | }, | ||
+ | { | ||
+ | type: ' | ||
+ | poster : '/ | ||
+ | media : "/ | ||
+ | title : " | ||
+ | }, | ||
+ | { | ||
+ | type: ' | ||
+ | poster : '/ | ||
+ | media : "/ | ||
+ | title : " | ||
+ | }, | ||
+ | { | ||
+ | type: ' | ||
+ | poster : "/ | ||
+ | media : "/ | ||
+ | title : "grand view park" | ||
+ | |||
+ | }, | ||
+ | |||
+ | { | ||
+ | type: ' | ||
+ | poster : "/ | ||
+ | media : "/ | ||
+ | title : " | ||
+ | }, | ||
+ | | ||
+ | { | ||
+ | type: ' | ||
+ | poster : "/ | ||
+ | media : "/ | ||
+ | title : " | ||
+ | |||
+ | }, | ||
+ | { | ||
+ | type: ' | ||
+ | poster : "/ | ||
+ | media : "/ | ||
+ | title : "the earth around" | ||
+ | |||
+ | } | ||
+ | ]; | ||
+ | |||
+ | const mediaEls = Array.prototype.slice.call(document.getElementsByTagName(' | ||
+ | |||
+ | if (mediaEls && mediaEls.length > 0) { | ||
+ | for (let i = 0, e = mediaEls.length; | ||
+ | const mediaEl = mediaEls[i], | ||
+ | pickerOptions = { | ||
+ | tabs : [ | ||
+ | {label:" | ||
+ | ], | ||
+ | |||
+ | template : $("# | ||
+ | |||
+ | templates : { | ||
+ | tabitem : $("# | ||
+ | tabpane : $("# | ||
+ | }, | ||
+ | |||
+ | froms : { | ||
+ | listing : { | ||
+ | template : $("# | ||
+ | |||
+ | item : { | ||
+ | template : $("# | ||
+ | }, | ||
+ | |||
+ | modes : { | ||
+ | template : $("# | ||
+ | } | ||
+ | } | ||
+ | } | ||
+ | }; | ||
+ | |||
+ | if (mediaEl.player === undefined) { | ||
+ | | ||
+ | | ||
+ | | ||
+ | }); | ||
+ | } | ||
+ | } | ||
+ | } | ||
+ | } | ||
+ | </ | ||
+ | |||
+ | <link type=" | ||
+ | < | ||
+ | .throbber { | ||
+ | position: absolute; | ||
+ | top: 0px; | ||
+ | left: 0px; | ||
+ | background: rgba(255, 152, 0, 0.86); | ||
+ | color: rgb(255, 255, 255); | ||
+ | display: flex; | ||
+ | align-items: | ||
+ | justify-content: | ||
+ | width: 100%; | ||
+ | height: 100%; | ||
+ | z-index: 9999; | ||
+ | } | ||
+ | .u-oneplayer { | ||
+ | position: absolute; | ||
+ | } | ||
+ | |||
+ | .uop-picker .lark-carousel .desc, .lark-carousel .ground { | ||
+ | display: none; | ||
+ | } | ||
+ | |||
+ | .uop-picker .lark-carousel.rotate .desc, .lark-carousel.rotate .ground { | ||
+ | display: block; | ||
+ | } | ||
+ | |||
+ | .uop-picker .lark-carousel .items-container { | ||
+ | height: 100%; | ||
+ | } | ||
+ | |||
+ | .uop-picker .lark-carousel | ||
+ | max-width: 90%; | ||
+ | max-height: 90%; | ||
+ | display: block; | ||
+ | margin: auto; | ||
+ | cursor : pointer; | ||
+ | } | ||
+ | |||
+ | .uop-picker .lark-carousel.rotate .items-container { | ||
+ | width: 120px; | ||
+ | height: 170px; | ||
+ | } | ||
+ | |||
+ | .uop-picker .lark-carousel.rotate .item img { | ||
+ | display: block; | ||
+ | height : 220px; | ||
+ | width: 220px; | ||
+ | } | ||
+ | |||
+ | .uop-picker .lark-carousel.coverflow .item { | ||
+ | height : 360px; | ||
+ | width : 360px; | ||
+ | } | ||
+ | |||
+ | .uop-picker .lark-carousel.coverflow .item img { | ||
+ | display: block; | ||
+ | height : 360px; | ||
+ | width : 360px; | ||
+ | } | ||
+ | |||
+ | | ||
+ | display: block; | ||
+ | height : 420px; | ||
+ | width : 840px | ||
+ | } | ||
+ | </ | ||
+ | </ |