TA的每日心情 | 擦汗 2020-6-6 16:10 |
---|
签到天数: 164 天 [LV.7]常住居民III
|
发表于 2020-2-5 08:43:53
|
显示全部楼层
代码如下: 上中下 =====分割9 ~+ W2 E0 Z2 g
$ H( J3 h ^8 U<!-- front -->9 D2 Y( j6 M/ D7 H
<div id="stage-face" class="section" >
) p6 p4 M3 Y7 C) P; S% R, T0 i1 t <img src="_mj_friends01.jpg" width="100%" height="auto">
- W! A; T4 W E' |3 o [( O" i</div>$ V/ B/ m& H5 _% ]' d: j2 g
<div class="section">
5 p% m4 Z! z1 ~/ K <div id="tv-src">{{Video}}</div>
0 Z# n4 {* N3 z- { <div id="tv" class="item"> V( y% ?: r" k7 j7 M/ P, \
<video autoplay="true" width="100%" height="auto" src="{{Video}}" controls="controls" webkit-playsinline="true" playsinline="true" poster="_mj_friends01.jpg"></video>' V% j( E( ~% F+ G! j9 n3 g
</div>
- ^! f2 Q% s+ ]( H0 C9 H</div>
3 g* j1 b0 I2 W( m' z0 F. j
7 I4 [& I9 O) H0 p<div class="section">. v: q( y0 q( c# z
<div id="voice" class="item">) Z8 }& {; c& S7 i$ c5 e
<span>播放音频:</span>
* O! `! Y& h3 \/ C <img src="_mj_play_button.png" onClick="playAudio(1);">
5 d0 o* S" b# Q <img src="_mj_pause_button.png" class="mobile" onClick="playAudio(0);">1 i2 Y1 @$ R" Y% }" H. N7 t
<audio id="audiotag" src="{{Audio}}" style="display:none"></audio>
6 [0 h/ x# N S- G Q) ]3 b <label class="mobile"><input id="loop" name="loop" type="checkbox" onclick="loopAudio(this);"/>循环播放</label>
. a" I4 _+ |2 d, p3 C: V </div>
% D4 f8 A! v4 g* h</div># L2 ^2 g8 c( R8 s
/ x. g) o% a9 k- B
<div class="footer">
* X, C( x' \% X <p>{{Timeline}}</p>
- W- y7 D* a7 F& I' v+ C</div>
& F1 m! _- L, q
+ L( _ N, f5 E( z3 y4 h l. K' ~<script type="text/javascript">
6 |+ P% y W$ Y& d L if(bWin) {playVideo();}# j. P; h' {) {# l1 C t* Y
</script>. z& Q) s% D5 l/ q" P. J5 u
7 e, t( [1 e4 d, [! h+ z! q7 b$ j, {) o
+ S' E5 u r2 x/ ~8 X1 n
( Q) u8 ]5 \$ b" N% [1 p) D========================================================================================, {" V! i1 b5 r: F( p# s- _
+ t0 h6 M3 L# ^* _</style>
* C+ V+ i/ o- z4 u<style>+ F6 b1 f* x4 o; D% J
/ `8 f( X# u( q2 @! @
.card {
8 K& Y `4 W) W1 F font-family : Helvetica, Arial, Sans-serif;
' f G4 t9 u: S' r5 I; }: g0 j1 y+ m font-size : 16px;& f) `/ R, s4 l/ N* `
text-align : left;
4 ?" W4 L7 i" Q/ ]* M7 T0 J5 D( E color : #1d2129;
0 g! ~" H* g/ R+ G background-color : #e9ebee;
( ^) b! o- u8 t) o4 X9 V0 E) e3 Q6 f}
2 V; N9 R5 z! Z# J% f* X4 s2 p
, `: I4 J7 P" k4 n9 w.section { n. p+ _: T; w8 P2 r$ x
border : 1px solid;
+ Z% y# I& v. T5 [2 o border-color : #e5e6e9 #dfe0e4 #d0d1d5;
" }" p1 L4 U8 V$ K border-radius : 3px;
) X, |0 |- P. @9 {7 S+ y background-color : #fff;
/ d! @6 W$ o) t; Q# { position : relative;
# {2 K j4 F+ n8 M! F margin : 5px 0;
6 v+ c7 j1 X8 O3 o7 |. O d$ p}/ R! P$ V3 W5 o4 l8 x
.item {margin:0 10px; padding:10px 0;}
$ o% k% X' D: o* t' e/ {.section p {padding:0 10px}
1 r' A2 D/ m$ b. V.center {text-align:center}: `$ T$ _: W0 S0 a. t5 {0 E" G
hr {border:0; margin:0 12px;border-top:1px solid #e5e5e5;}
" ^7 b# y' U& ~2 K2 l#voice, #tv {
. G. C5 P& w7 I6 K0 E. b# Y7 P font-family : Helvetica, Arial, Sans-serif;- ] E m9 C6 O9 y2 _+ R# E
font-size : 16px;
0 W5 ^; v- M5 p' a; J' y2 g( [. U) ? text-align : left;
# F5 b( @" \7 N" Y) Q' [ color : #1d2129;( ?, z+ h, M) N( ?+ {
}/ o2 V* ?: p; n: C6 X
#voice label{display:block; float:right; padding-top:5px;}
/ k+ ^7 O. G# |. a! H5 v#voice img, #tv img{vertical-align:middle;padding:0 5px 0 10px;}
# {5 _8 l- \2 F& `6 g, O
1 v2 N1 B: Z, a( }5 }+ ap {font-size:16px;line-height:1.5em;margin:0.5em 0; text-align:center;}6 N* L- i, s* B/ X* E" V
. gray {color:#666}
0 z, M9 \1 l# h3 u. \, z.footer {margin-top:5rem;padding-right:5px}
/ Q9 m( N! z5 l* C% K, c. S.footer p {font-size: 12px; font-style: italic; color: gray;text-align:right;}1 H* [' n: ~% W% S D: A2 w6 ~8 y3 R( j
#tv-src, #stage-face, #notes{display:none}
; s& N: C; ]& j
1 k( j1 P0 i0 c9 N</style>. V2 M8 Q9 j3 z) K6 ]6 a! N( [
7 |$ ]; C/ d" I+ |, `$ @. |6 e' s
<script type="text/javascript">) L8 g+ V& l% v5 b2 w
bWin = navigator.platform.indexOf("Win") == 0;) G# c- |7 q) j& c% n: |
8 M$ g- I1 T/ \2 m function playVideo(){
5 g0 E+ b1 r! C) _2 z: @' `( p$ O var videoSrc = document.getElementById("tv-src").textContent;
! W, \/ F; z9 h( H9 Y R7 ] py.link("ankiplay" + videoSrc);" L4 f& N5 |2 }' O' c) }5 G
}) h+ @2 v) q. r9 ?1 V
/ C5 J, R0 E- v
function playAudio(bPlay){
% R9 E' D, o( {, g) S8 R s2 b$ s8 ^ var player = document.getElementById('audiotag');
# G5 ?* H. C6 D' b9 ^% ^9 ^' k var audioSrc = player.getAttribute("src");; t9 u* R- R) o }( I& z0 S9 x
if (bWin) {
) t+ |9 W- D) ^5 l py.link("ankiplay" + audioSrc);; `8 `; }; }# j* R- M( R2 @$ n6 u! y
} else {# b9 u9 \ n; w* s9 U' O
if (bPlay) player.play(); else player.pause(); I+ ?. E- R- j2 b' v, @& A" ~
}6 H- ^0 |$ i) ~' ^' R
}
9 t6 ] ~, d; w4 K* |
1 |+ O/ |$ W4 R( D/ G$ f' e& B# e4 J function loopAudio(cb){7 [! H. T0 Q; P' W: L/ o
var bLoop = cb.checked;
q, S" ]4 i t# y) x var player = document.getElementById('audiotag'); p% L T! J6 d5 z9 h! Y
if (bLoop)
k! W* K0 F# @3 d% r player.setAttribute("loop", "true");3 ^! h: c) B$ p! @/ f
else
% y7 U0 O8 u- h$ m7 K player.removeAttribute("loop");/ t3 o# |" z# i
}& I0 x: }( l6 R1 ^* e
; [ ] G- Y' h5 S& q, Q
function hidex(x){8 P+ r0 w$ u* l% V$ }
if (x.length > 1) {# k- W( |- V9 C, o3 o/ V. D% I8 w
for(var i=0; i<x.length; i++) {. j" Z! f1 S( |! q, ]
x[i].setAttribute("style", "display:none"): O2 `* T0 ~9 N: h0 A7 r5 i
}* W: {7 X, Q8 u! h9 I* ?& L
} else {
8 R% R; y' C6 C( { x.setAttribute("style", "display:none")
U9 d, m' w1 C } @0 {) O4 p1 X2 V3 C* T* [4 C
}
$ j! O5 F3 Q: n" q/ u' f
! Y |! Z; h5 D6 N: |8 ?) h function update() {
; G7 W# _& L4 _3 ?+ [' Q8 q. h1 h7 w# J var tv = document.getElementById("tv");
T/ u& L9 {5 y8 Q1 ]4 @; F3 W2 ]4 s if (bWin) {
4 l* h5 o; h7 H3 n2 K/ C; a tv.innerHTML = '<span>播放视频:</span><img src="_mj_play_button.png" onClick="playVideo();">';
1 K, o4 B; @1 G6 k! n
8 U" f* l, [" w2 a7 H3 b var stage_face = document.getElementById("stage-face");
! Z7 \5 s+ Z/ h# v stage_face.setAttribute("style", "display:block")" w; B+ U$ ]+ `9 j, J
$ E7 R& F; V2 O* u7 O9 }6 M( @" j9 g var mobile_only = document.getElementsByClassName("mobile");
4 @/ g: A; Z+ J4 p hidex(mobile_only);6 b/ W0 H: `& G1 G4 t5 S
}
( K5 V, i, x# ]3 r) M4 ? + u+ L& u5 Y4 W2 g
var notes = document.getElementById("notes");) n5 w. M3 l2 f# M6 M A" d
var child = notes.getElementsByClassName("item")+ X! l1 W3 J' k3 [* ^' x
if (notes!=null && child!=null && child[0].textContent) {! U2 ~- g$ }) j( @
notes.setAttribute("style", "display:block");8 F8 [2 B: `( s; H6 K2 Q* y4 F
}
$ v7 g' x: C5 J. h* i9 Z+ f }
; g3 f! c4 M. ?% u$ o
# U" @0 n7 K: l. }8 F) _. L) t window.onload = update;
) F0 H& }# H" ^( _! Z% x update();4 ^# h. v' u% y, G' o4 ^. ]
0 A. [( v& K. s9 z1 Z; H</script>
- _( x% n5 {. D& T* T7 N4 h' o/ z
<style>
9 l% o5 R P3 w6 D/ ]7 V, h# }! [( V( K# B+ f2 H) s0 [
2 ~& q8 C! R# \# G5 t
- Z! j! b. i7 G& g=========================================================0 H: ?9 p4 ]+ k" k. W3 w$ k$ w+ f8 h
<div id="stage-face" class="section" >2 v* f3 U5 G% p x
<img src="_mj_friends01.jpg" width="100%" height="auto">/ T# m7 v, [1 S
</div>& ~% i6 V' d$ o6 [+ j* ^
<div class="section">+ L9 _( C+ d1 ]* h
<div id="tv-src">{{Video}}</div>
) Z2 k" o5 [$ ? <div id="tv" class="item">. R) t G' ?9 n! ~3 C
<video width="100%" height="auto" src="{{Video}}" controls="controls" webkit-playsinline="true" playsinline="true" poster="_mj_friends01.jpg"></video>2 [) @) z) V4 |. V
</div>* J; O" ~. W6 n* L2 ?# e" X" }3 B
4 u3 U) r; q, f! c# @
<p>{{Subtitle-EN}}</p>: M2 f) [5 B1 F5 d( b
<p class="gray">{{Subtitle-CN}}</p>
) D* V9 v9 J; e</div>4 J% D$ C/ F+ s+ @. R+ U- p$ ^
' ~$ \, `" a( m* J! ?<div class="section">( A c8 \7 Y5 B
<div id="voice" class="item">2 w, ~ C$ i, D0 o* s6 F( q* f) C
<span>播放音频:</span>" U9 X$ a6 C% e* Z8 e; Y
<img src="_mj_play_button.png" onClick="playAudio(1);">3 }$ e8 q* a/ K/ N
<img src="_mj_pause_button.png" class="mobile" onClick="playAudio(0);">
8 {/ }7 e$ z2 ?( ^ <audio id="audiotag" src="{{Audio}}" style="display:none"></audio>
2 k9 I: o+ o3 i' H6 v/ L <label class="mobile"><input id="loop" name="loop" type="checkbox" onclick="loopAudio(this);"/>循环播放</label>
. F9 }1 @( \% D1 [1 x- i </div>$ R" w: Q8 D. y& `3 t" G
</div>2 D& M8 s3 Z- j+ |
. _ d/ ~0 s/ C9 w+ N9 A% L% U0 |<div class="section" id="notes">
3 f3 N6 ^% q2 ]1 I2 N0 V' p <div class="item">{{Notes}}</div>! N/ j7 `+ i* A3 S. h, h& J1 T& e
</div> |
|