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:52] 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() { | + | autoplay : true, |
- | | + | picker : pickerOptions |
- | window.removeEventListener(' | + | }); |
- | } | + | } |
- | if (document.readyState === ' | + | |
- | | + | |
- | } else { | + | |
- | 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; |
- | | + | } |
- | | + | |
- | height: 100%; | + | height: 100%; |
- | } | + | } |
- | | + | |
- | display: block; | + | |
- | margin: auto; | + | max-height: 100%; |
- | cursor : pointer; | + | |
- | } | + | margin: auto; |
+ | cursor : pointer; | ||
+ | } | ||
- | | + | |
- | width: 120px; | + | width: 120px; |
- | height: 170px; | + | height: 170px; |
- | } | + | } |
- | | + | |
- | | + | |
- | | + | display: block; |
- | height : 220px; | + | height : 220px; |
- | width: 220px; | + | width: 220px; |
- | | + | } |
- | | + | |
- | | + | height : 360px; |
- | } | + | |
+ | | ||
- | | + | |
- | display: block; | + | display: block; |
- | height : 80%; | + | height : 360px; |
- | width : 360px | + | width : 360px; |
+ | } | ||
+ | |||
+ | | ||
+ | display: block; | ||
+ | height : 420px; | ||
+ | width : 840px | ||
+ | } | ||
+ | </ | ||
+ | |||
+ | </ | ||
+ | |||
+ | ===== Code ===== | ||
+ | < | ||
+ | <div style=" | ||
+ | < | ||
+ | </ | ||
+ | </ | ||
+ | |||
+ | <script id=" | ||
+ | |||
+ | <div class = " | ||
+ | <div class=" | ||
+ | <ul class=" | ||
+ | </ | ||
+ | <div class=" | ||
+ | </ | ||
+ | </ | ||
+ | </ | ||
+ | |||
+ | </ | ||
+ | |||
+ | <script id=" | ||
+ | <li data-pickfrom="< | ||
+ | <a data-toggle=" | ||
+ | </ | ||
+ | </ | ||
+ | |||
+ | <script id=" | ||
+ | <div class=" | ||
+ | </ | ||
+ | |||
+ | <script id=" | ||
+ | <div class=" | ||
+ | < | ||
+ | <ul class= " | ||
+ | | ||
+ | </ | ||
+ | <!-- Text at center of ground --> | ||
+ | <p class = " | ||
+ | <div id=" | ||
+ | </ | ||
+ | <a class=" | ||
+ | <a class=" | ||
+ | <a class=" | ||
+ | <ol class=" | ||
+ | </ | ||
+ | </ | ||
+ | </ | ||
+ | |||
+ | <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) { | ||
+ | | ||
+ | | ||
+ | | ||
+ | }); | ||
+ | } | ||
+ | } | ||
+ | } | ||
} | } | ||
+ | </ | ||
- | .uop-picker | + | <link type=" |
- | display: | + | < |
- | height : 80%; | + | |
- | | + | |
+ | top: 0px; | ||
+ | left: 0px; | ||
+ | background: rgba(255, 152, 0, 0.86); | ||
+ | color: rgb(255, 255, 255); | ||
+ | | ||
+ | | ||
+ | justify-content: | ||
+ | width: 100%; | ||
+ | | ||
+ | | ||
+ | } | ||
+ | .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; | ||
+ | } | ||
- | ===== Code ===== | + | .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 | ||
+ | } | ||
+ | </ | ||
+ | </ |