cover.html 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. <style>
  2. #component-anim .layui-card-body{padding: 15px;}
  3. #component-anim .component-anim-demo{font-size: 0;}
  4. #component-anim .component-anim-demo li{display: inline-block; vertical-align: middle; width: 127px; line-height: 25px; padding: 20px 0; font-size: 14px; text-align: center; color: #666; transition: all .3s; -webkit-transition: all .3s;margin:5px;}
  5. #component-anim .component-anim-demo li .layui-icon{display: inline-block; font-size: 36px;}
  6. #component-anim .component-anim-demo li .fontclass{display: none;}
  7. #component-anim .component-anim-demo li .name{color: #c2c2c2;}
  8. #component-anim .component-anim-demo li:hover{background-color: #f2f2f2; color: #000;}
  9. #component-anim .component-anim-demo li{width: 168px;}
  10. #component-anim .component-anim-demo .layui-anim{cursor: pointer;}
  11. #component-anim .component-anim-demo .layui-anim{width:150px;height:100px;}
  12. #component-anim .component-anim-demo .code{height:25px;width: auto;
  13. overflow: hidden;
  14. text-overflow: ellipsis;
  15. white-space: nowrap;}
  16. #component-anim .component-anim-demo .layui-anim-yes
  17. {
  18. border:1px solid #0000ff;
  19. }
  20. #component-anim .component-anim-demo .layui-anim-no
  21. {
  22. border: 1px solid #e2e2e2;
  23. }
  24. </style>
  25. <div class="layui-card" id="component-anim">
  26. <div class="layui-card-header">
  27. <input type="hidden" id="cover_key" value="<{$key}>">
  28. <input type="hidden" id="cover_cur" value="<{$cur}>">
  29. <input type="hidden" id="cover_pic_url" value="<{$cover_pic_url}>">
  30. <div class="layui-inline">第几秒截图:<div class="layui-input-inline"><input type="text" style="width: 100%;" class="layui-input" id="cover_num" value="<{$num}>" ></div></div>
  31. <div class="layui-inline" class="file-search" onclick="crop()"><div class="layui-input-inline"><button type="button" class="layui-btn"><i class="fa fa-save"></i> 生成</button></div></div>
  32. </div>
  33. <div class="layui-card-body">
  34. <div class="layui-row layui-col-space15">
  35. <div class="layui-col-md6">
  36. <div class="layui-panel">
  37. <video src="<{$cur}>" width="300" controls="true"/>
  38. </div>
  39. </div>
  40. <div class="layui-col-md6">
  41. <div class="layui-panel">
  42. <img src="<{$cover_pic}>" id="cover_pic" width="300" />
  43. </div>
  44. </div>
  45. </div>
  46. </div>
  47. <script>
  48. function crop()
  49. {
  50. var num = $('#cover_num').val();
  51. var cur = $('#cover_cur').val();
  52. var key = $('#cover_key').val();
  53. var url = $('#cover_pic_url').val() + '&json=1&callback=?';
  54. $.getJSON(url, {num:num}, function(t) {
  55. $('#cover_pic').attr('src', t.data);
  56. })
  57. }
  58. </script>
  59. </div>