整合營銷服務商

          電腦端+手機端+微信端=數據同步管理

          免費咨詢熱線:

          CSS3圖片翻頁動畫(10種動畫特效源碼)

          果圖

          今天給大家帶來的是 CSS3圖片翻頁動畫(10種動畫)!

          豐富一下列位的特效儲備庫!

          文件版源碼獲取,請看評論區

          廢話不多說,上源碼!

          CSS源碼:

          @import url(http://fonts.googleapis.com/css?family=Lato:400,700);

          @font-face {

          font-family: 'codropsicons';

          src:url('../fonts/codropsicons/codropsicons.eot');

          src:url('../fonts/codropsicons/codropsicons.eot?#iefix') format('embedded-opentype'),

          url('../fonts/codropsicons/codropsicons.woff') format('woff'),

          url('../fonts/codropsicons/codropsicons.ttf') format('truetype'),

          url('../fonts/codropsicons/codropsicons.svg#codropsicons') format('svg');

          font-weight: normal;

          font-style: normal;

          }

          body {

          background: #81c439;

          color: #fff;

          font-family: 'Lato', Arial, sans-serif;

          }

          .clearfix:before,

          .clearfix:after {

          content: '';

          display: table;

          }

          .clearfix:after {

          clear: both;

          }

          a {

          color: rgba(255,255,255,0.7);

          text-decoration: none;

          outline: none;

          }

          a:hover,

          a:focus {

          color: #fff

          }

          .container > header {

          margin: 0 auto;

          padding: 2em 15% 0;

          text-align: center;

          }

          .container > header h1 {

          font-size: 1.8em;

          line-height: 1.3;

          margin: 0;

          font-weight: 700;

          text-transform: uppercase;

          letter-spacing: 2px;

          word-spacing: 5px;

          }

          .container > header span {

          display: block;

          font-size: 60%;

          opacity: 0.7;

          padding: 0 0 0.6em 0.1em;

          }

          /* To Navigation Style */

          .codrops-top {

          background: rgba(255, 255, 255, 0.1);

          text-transform: uppercase;

          width: 100%;

          font-size: 0.69em;

          line-height: 2.2;

          font-weight: 700;

          }

          .codrops-top a {

          text-decoration: none;

          padding: 0 1em;

          letter-spacing: 0.1em;

          display: inline-block;

          }

          .codrops-top a:hover {

          background: rgba(255,255,255,0.95);

          color: #81c439;

          }

          .codrops-top span.right {

          float: right;

          }

          .codrops-top span.right a {

          float: left;

          display: block;

          }

          .codrops-icon:before {

          font-family: 'codropsicons';

          margin: 0 4px;

          speak: none;

          font-style: normal;

          font-weight: normal;

          font-variant: normal;

          text-transform: none;

          line-height: 1;

          -webkit-font-smoothing: antialiased;

          }

          .codrops-icon-drop:before {

          content: "\e001";

          }

          .codrops-icon-prev:before {

          content: "\e004";

          }

          /* Demo Buttons Style */

          .codrops-demos {

          padding-top: 1em;

          max-width: 700px;

          margin: 0 auto;

          }

          .codrops-demos a {

          text-decoration: none;

          outline: none;

          display: inline-block;

          font-weight: 700;

          text-transform: uppercase;

          font-size: 0.8em;

          margin: 0.5em 0.4em;

          letter-spacing: 1px;

          background: rgba(0,0,0,0.1);

          padding: 0.4em 0.9em;

          -webkit-transition: all 0.2s;

          transition: all 0.2s;

          }

          .codrops-demos a.current-demo,

          .codrops-demos a:hover,

          .codrops-demos a:focus {

          opacity: 1;

          background: rgba(0,0,0,0.25);

          }

          section {

          text-align: center;

          font-size: 150%;

          padding: 1em 1% 2em;

          }

          @media screen and (max-width: 25em) {

          .codrops-icon span {

          display: none;

          }

          }

          index源碼:

          <!DOCTYPE html>

          <html>

          <head>

          <meta charset="UTF-8" />

          <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">

          <meta name="viewport" content="width=device-width, initial-scale=1.0">

          <title>Animations for Thumbnail Grids | Demo 1</title>

          <link rel="stylesheet" type="text/css" href="css/normalize.css" />

          <link rel="stylesheet" type="text/css" href="css/demo.css" />

          <!--必要樣式-->

          <link rel="stylesheet" type="text/css" href="css/component.css" />

          <script src="js/modernizr.custom.js"></script>

          </head>

          <body>

          <div>

          <header>

          <h1>網格縮略圖動畫</h1>

          <nav>

          <a href="index.html">Fall</a>

          <a href="index2.html">Slide</a>

          <a href="index3.html">Rotate Fall</a>

          <a href="index4.html">Rotate Scale</a>

          <a href="index5.html">Stack</a>

          <a href="index6.html">3d Flip</a>

          <a href="index7.html">Bring back</a>

          <a href="index8.html">Superscale</a>

          <a href="index9.html">Center Flip</a>

          <a href="index10.html">Front Row</a>

          </nav>

          </header>

          <section>

          <ul class="tt-grid tt-effect-fall tt-effect-delay">

          <li><a href="#"><img src="img/1.jpg" alt="img01"/></a></li>

          <li><a href="#"><img src="img/2.jpg" alt="img02"/></a></li>

          <li><a href="#"><img src="img/3.jpg" alt="img03"/></a></li>

          <li><a href="#"><img src="img/4.jpg" alt="img04"/></a></li>

          <li><a href="#"><img src="img/5.jpg" alt="img05"/></a></li>

          <li><a href="#"><img src="img/6.jpg" alt="img06"/></a></li>

          </ul>

          <nav>

          <a></a><a></a><a></a><a></a>

          </nav>

          </section>

          </div><!-- /container -->

          <script src="js/classie.js"></script>

          <script src="js/thumbnailGridEffects.js"></script>

          </body>

          </html>

          、創建項目

          1、創建Maven項目

          2、添加依賴

          在pom.xml中添加依賴配置,具體如下:

          [html] view plain copy

          1. <dependencies>
          2. <dependency>
          3. <groupId>org.bytedeco</groupId>
          4. <artifactId>javacv-platform</artifactId>
          5. <version>1.3.1</version>
          6. </dependency>
          7. </dependencies>

          二、具體實現

          1、獲取視頻中間的幀作為縮略圖,并返回縮略圖實際存放地址

          [java] view plain copy

          1. package com.lyz.medis.image;
          2. import java.awt.image.BufferedImage;
          3. import java.io.File;
          4. import java.io.IOException;
          5. import java.util.ArrayList;
          6. import java.util.Collections;
          7. import java.util.List;
          8. import javax.imageio.ImageIO;
          9. import org.bytedeco.javacpp.opencv_core;
          10. import org.bytedeco.javacpp.opencv_core.IplImage;
          11. import org.bytedeco.javacv.FFmpegFrameGrabber;
          12. import org.bytedeco.javacv.Frame;
          13. import org.bytedeco.javacv.FrameGrabber.Exception;
          14. import org.bytedeco.javacv.Java2DFrameConverter;
          15. import org.bytedeco.javacv.OpenCVFrameConverter;
          16. /**
          17. * 獲取視頻縮略圖
          18. * @author liuyazhuang
          19. *
          20. */
          21. public class VideoImage {
          22. private static final String IMAGEMAT = "png";
          23. private static final String ROTATE = "rotate";
          24. /**
          25. * 默認截取視頻的中間幀為封面
          26. */
          27. public static final int MOD = 2;
          28. public static void main(String[] args) throws Exception {
          29. System.out.println(randomGrabberFFmpegImage("C:/lyz/1522372294724_79583.mov", 2));
          30. }
          31. /**
          32. * 獲取視頻縮略圖
          33. * @param filePath:視頻路徑
          34. * @param mod:視頻長度/mod獲取第幾幀
          35. * @throws Exception
          36. */
          37. public static String randomGrabberFFmpegImage(String filePath, int mod) throws Exception {
          38. String targetFilePath = "";
          39. FFmpegFrameGrabber ff = FFmpegFrameGrabber.createDefault(filePath);
          40. ff.start();
          41. String rotate = ff.getVideoMetadata(ROTATE);
          42. int ffLength = ff.getLengthInFrames();
          43. Frame f;
          44. int i = 0;
          45. int index = ffLength / mod;
          46. while (i < ffLength) {
          47. f = ff.grabImage();
          48. if(i == index){
          49. if (null != rotate && rotate.length() > 1) {
          50. OpenCVFrameConverter.ToIplImage converter = new OpenCVFrameConverter.ToIplImage();
          51. IplImage src = converter.convert(f);
          52. f = converter.convert(rotate(src, Integer.valueOf(rotate)));
          53. }
          54. targetFilePath = getImagePath(filePath, i);
          55. doExecuteFrame(f, targetFilePath);
          56. break;
          57. }
          58. i++;
          59. }
          60. ff.stop();
          61. return targetFilePath;
          62. }
          63. /**
          64. * 根據視頻路徑生成縮略圖存放路徑
          65. * @param filePath:視頻路徑
          66. * @param index:第幾幀
          67. * @return:縮略圖的存放路徑
          68. */
          69. private static String getImagePath(String filePath, int index){
          70. if(filePath.contains(".") && filePath.lastIndexOf(".") < filePath.length() - 1){
          71. filePath = filePath.substring(0, filePath.lastIndexOf(".")).concat("_").concat(String.valueOf(index)).concat(".").concat(IMAGEMAT);
          72. }
          73. return filePath;
          74. }
          75. /**
          76. * 旋轉圖片
          77. * @param src
          78. * @param angle
          79. * @return
          80. */
          81. public static IplImage rotate(IplImage src, int angle) {
          82. IplImage img = IplImage.create(src.height(), src.width(), src.depth(), src.nChannels());
          83. opencv_core.cvTranspose(src, img);
          84. opencv_core.cvFlip(img, img, angle);
          85. return img;
          86. }
          87. /**
          88. * 截取縮略圖
          89. * @param f
          90. * @param targerFilePath:封面圖片
          91. */
          92. public static void doExecuteFrame(Frame f, String targerFilePath) {
          93. if (null == f || null == f.image) {
          94. return;
          95. }
          96. Java2DFrameConverter converter = new Java2DFrameConverter();
          97. BufferedImage bi = converter.getBufferedImage(f);
          98. File output = new File(targerFilePath);
          99. try {
          100. ImageIO.write(bi, IMAGEMAT, output);
          101. } catch (IOException e) {
          102. e.printStackTrace();
          103. }
          104. }
          105. /**
          106. * 根據視頻長度隨機生成隨機數集合
          107. * @param baseNum:基礎數字,此處為視頻長度
          108. * @param length:隨機數集合長度
          109. * @return:隨機數集合
          110. */
          111. public static List<Integer> random(int baseNum, int length) {
          112. List<Integer> list = new ArrayList<Integer>(length);
          113. while (list.size() < length) {
          114. Integer next = (int) (Math.random() * baseNum);
          115. if (list.contains(next)) {
          116. continue;
          117. }
          118. list.add(next);
          119. }
          120. Collections.sort(list);
          121. return list;
          122. }
          123. }

          ello大家好,今天廣州藍景跟大家分享一些html的使用技巧。

          1. 使用capture屬性打開設備攝像頭

          正如input標簽具有email、text和password屬性一樣,我們也可以通過一些屬性打開移動設備的攝像頭以捕獲圖像。

          那就是capture屬性,屬性值有兩個:

          • user用于前置攝像頭
          • environment用于后置攝像頭
          <input type="file" capture="user" accept="image/*">
          

          2. 網站自動刷新

          你可以在head標簽中將網站設置為定時刷新!

          <head>
              <meta http-equiv="refresh" content="10">
          </head>
          

          此代碼段可以實現每10秒刷新一次網站。

          3. 激活拼寫檢查

          你可以使用HTML的spellcheck屬性并將其設置為true以激活拼寫檢查。使用lang屬性指定待檢查的語言。

          <input type="text" spellcheck="true" lang="en">
          

          這是一個標準屬性,得到了大多數瀏覽器的支持。

          4. 指定要上傳的文件類型

          你可以使用accept屬性在input標簽中指定允許用戶上傳的文件類型。

          <input type="file" accept=".jpeg,.png">
          

          5. 阻止瀏覽器翻譯

          將translate屬性設置為no會阻止瀏覽器翻譯該內容。如果你不想翻譯某個短語或單詞,例如logo、公司或品牌名稱,那就可以應用這個屬性。

          <p translate="no">Brand name</p>
          

          6. 在input標簽中輸入多個項目

          這可以通過multiple屬性來完成。

          <input type="file" multiple>
          

          適用于文件和電子郵件。如果是電子郵件,則可以用逗號分隔。

          7. 為視頻創建海報(縮略圖)

          使用poster屬性,我們可以在視頻加載時,或者在用戶點擊播放按鈕之前,顯示指定的縮略圖。

          如果不指定圖片,則默認使用視頻的第一幀作為縮略圖。

          <video poster="picture.png"></video>
          

          8. 點擊鏈接自動下載

          如果你希望在單擊目標資源的鏈接時下載特定資源,那就添加download屬性。

          <a href="image.png" download>
          

          今天就分享到這里,想要了解更多前端技術知識,可以關注我們廣州藍景。


          主站蜘蛛池模板: 国产成人精品无人区一区| 国产成人精品久久一区二区三区| 亚洲国产老鸭窝一区二区三区| 免费无码毛片一区二区APP| 日日摸夜夜添一区| 乱色熟女综合一区二区三区| 国产精品亚洲高清一区二区| 国产免费一区二区三区在线观看| 亚洲天堂一区二区三区| 国内精品一区二区三区最新| 国产91一区二区在线播放不卡 | 成人精品一区久久久久| 精品国产一区二区三区香蕉| 最新中文字幕一区| 精品国产AⅤ一区二区三区4区 | 免费一区二区三区| 亚洲丰满熟女一区二区哦| 国产丝袜一区二区三区在线观看| 成人乱码一区二区三区av| 2022年亚洲午夜一区二区福利| 精品免费国产一区二区三区| 亚洲日本一区二区三区在线| 亚洲乱码av中文一区二区| 国产美女av在线一区| 中文字幕一区二区三匹| www亚洲精品少妇裸乳一区二区| 久久亚洲一区二区| 日本一区二区三区在线视频| 肉色超薄丝袜脚交一区二区| 国产无人区一区二区三区 | 亚洲AV无码一区二区三区久久精品 | 国产精品综合AV一区二区国产馆| 一区二区三区杨幂在线观看| 蜜桃无码AV一区二区| 亚洲国产综合无码一区二区二三区 | 亚洲午夜在线一区| 综合人妻久久一区二区精品| 色综合久久一区二区三区| 日本伊人精品一区二区三区| 精品乱子伦一区二区三区高清免费播放| 精品乱码一区二区三区四区|