js+css实现ViewTransition过渡动画效果代码

代码语言:html

所属分类:布局界面

代码描述:js+css实现ViewTransition过渡动画效果代码

代码标签: js css ViewTransition 过渡 动画

下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开

<!DOCTYPE html>
<html lang="en" >

<head>
  <meta charset="UTF-8">
  

  
  
  
<style>
.box1 {
  width: 10rem;
  view-transition-name: box;
}

.box2 {
  float: none;
  width: 100%;
  view-transition-name: box;
}






:root {
  --color-primary: #da3654;
  --color-text: #000;
  --color-text-2: #3c4856c2;
}



html {
  box-sizing: border-box;
  scroll-behavior: smooth;
}

html *,
html *::after,
html *::before {
  box-sizing: inherit;
}

body {
  margin: 0;
  font: 100%/1.6 'Poppins', sans-serif;
  background-color: #1b1b1b;
}

:is(h1, h2) {
  font-family: 'Recoleta', 'Poppins';
}

ul {
  padding: 0;
  margin: 0;
  list-style-type: none;
}

.container {
  max-width: min(90vw, 42rem);
  margin-inline: auto;
}

nav .........完整代码请登录后点击上方下载按钮下载查看

网友评论0