jquery+bootstrap实现支持暗黑模式的滚动返回顶部按钮效果代码

代码语言:html

所属分类:其他

代码描述:jquery+bootstrap实现支持暗黑模式的滚动返回顶部按钮效果代码

代码标签: jquery bootstrap 返回 顶部

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

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

<head>
    <meta charset="UTF-8">
    <link type="text/css" rel="stylesheet" href="//repo.bfw.wiki/bfwrepo/css/bootstrap.4.3.1.min.css">
    <style>
        @import url('https://fonts.googleapis.com/css?family=Muli:200,200i,300,300i,400,400i,600,600i,700,700i,800,800i,900,900i&subset=latin-ext,vietnamese');
        @import url('https://fonts.googleapis.com/css?family=Raleway:100,100i,200,200i,300,300i,400,400i,500,500i,600,600i,700,700i,800,800i,900,900i&subset=latin-ext');
        
        
        
        :root {
        	font-size: 20px;
        	--red: #da2c4d;
        	--yellow: #f8ab37;
        	--green: #2ecc71;
        	--white: #ffffff;
        	--grey-light: #f2f7f9;
        	--grey: #ecedf3;
        	--black: #080808;
        	--black-blue: #1f2029;
        	--black-blue-light: #353746;
        	--black-blue-light-2: #404255;
        	--black-blue-light-3: #4b4d64;
        	--black-light: #424455;
        }
        body{
            font-family: 'Raleway', sans-serif;
        	font-size: 16px;
        	font-weight: 500;
        	line-height: 1.65;
        	color: var(--grey);
        	background-color: var(--black-blue);
        	overflow-x: hidden;
        	letter-spacing: 0.2px;
        	-webkit-transition: all 200ms linear;
        	transition: all 200ms linear; 
        	text-rendering: optimizeLegibility !important;
        	-webkit-font-smoothing: antialiased !important;
        }
        body.light{
        	color: var(--black-light);
        }
        h1{
            font-family: 'Muli', sans-serif;
        	font-size: 12vw;
        	font-weight: 900;
        	line-height: 1;
        	color: var(--white);
        	-webkit-transition: all 200ms linear;
        	transition: all 200ms linear; 
        }
        body.light h1{
        	color: var(--black);
        }
        body.light{
        	background-color: var(--white);
        }
        .navbar-brand{
        	height: 36px;
        	position: fixed;
        	top: 50px;
        	left: 70px;
        	z-index: 3333;
        	width: auto;
        	display: inline-block;
        	margin: 0;
        	padding: 0;
        	-webkit-transition : all 0.3s ease-out;
        	transition : all 0.3s ease-out;
        }
        .navbar-brand::before{
        	position: absolute;
        	content: '';
        	top: -13px;
        	left: 50%;
        	width: 80px;
        	transform: translateX(-50%);
        	height: calc(100% + 26px);
        	opacity: 0;
        	z-index: -1;
        	background-image: linear-gradient(260deg, var(--grey), var(--grey-light));
        	animation: border-transform 10s linear infinite alternate forwards;
        	-webkit-transition: all 200ms linear;
            transition: all 200ms linear;
        }
        .navbar-brand::after{
        	position: absolute;
        	content: '';
        	top: -13px;
        	left: 50%;
        	width: 80px;
        	transform: translateX(-50%);
        	height: calc(100% + 26px);
        	opacity: 1;
        	z-index: -1;
        	background-image: linear-gradient(160deg, var(--black-blue-light-3), var(--black-blue-light));
        	animation: border-transform 10s linear infinite alternate forwards;
        	-webkit-transition: all 200ms linear;
            transition: all 200ms linear;
        }
        .navbar-brand img{
        	padding: 7px 0;
        	height: 100%;
        	width: auto;
        	display: block;
        	-webkit-transition : all 0.3s ease-out;
        	transition : all 0.3s ease-out;
        }
        @-webkit-keyframes border-transform{
            0%,100% { border-radius: 63% 37% 54% 46% / 55% 48% 52% 45%; } 
        	14% { border-radius: 40% 60% 54% 46% / 49% 60% 40% 51%; } 
        	28% { border-radius: 54% 46% 38% 62% / 49% 70% 30% 51%; } 
        	42% { border-radius: 61% 39% 55% 45% / 61% 38% 62% 39%; } 
        	56% { border-radius: 61% 39% 67% 33% / 70% 50% 50% 30%; } 
        	70% { border-radius: 50% 50% 34% 66% / 56% 68% 32% 44%; } 
        	84% { border-radius: 46% 54% 50% 50% / 35% 61% 39% 65%; } 
        }
        @keyframes border-transform{
            0%,100% { border-radius: 63% 37% 54% 46% / 55% 48% 52% 45%; } 
        	14% { border-radius: 40% 60% 54% 46% / 49% 60% 40% 51%; } 
        	28% { border-radius: 54% 46% 38% 62% / 49% 70% 30% 51%; } 
        	42% { border-radius: 61% 39% 55% 45% / 61% 38% 62% 39%; } 
        	56% { border-radius: 61% 39% 67% 33% / 70% 50% 50% 30%; } 
        	70% { border-radius: 50% 50% 34% 66% / 56% 68% 32% 44%; } 
        	84% { border-radius: 46% 54% 50% 50% / 35% 61% 39% 65%; } 
        }
        body.light .navbar-brand::before{
        	opacity: 1;
        }
        body.light .navbar-brand::after{
        	opacity: 0;
        }
        
        .section {
            position: relative;
        	width: 100%;
        	display: block;
        	overflow: hidden;
        	height: 100vh;
        }
        .center-wrap {
            position: absolute;
        	width: 100%;
        	display: block;
        	overflow: hidden;
        	left: 0;
        	top: 50%;
        	transform: translateY(-50%);
        	z-index: 2;
        }
        .color-gradient-red-yellow {
        	background: linear-gradient(160deg, var(--red), var(--yellow));
        	-webkit-background-clip: text;
        	-webkit-text-fill-color: transparent;
        }
        .color-gradient-red-yellow .uil:before {
        	background: linear-gradient(160deg, var(--red), var(--yellow));
        	-webkit-background-clip: text;
        	-webkit-text-fill-color: transparent;
        }
        .size-22 {
        	font-size: 22px;
        }
        
        /* #Progress
        ================================================== */
        
        .progress-wrap {
        	position: fixed;
        	right: 50px;
        	bottom: 50px;
        	height: 46px;
        	width: 46px;
        	cursor: pointer;
        	display: block;
        	border-radius: 50px;
        	box-shadow: inset  0 0 0 2px rgba(255,255,255,0.2);
        	z-index: 10000;
        	opacity: 0;
        	visibility: hidden;
        	transform: translateY(15px);
        	-webkit-transition: all 200ms linear;
            transition: all 200ms linear;
        }
        .progress-wrap.active-progress {
        	opacity: 1;
        	visibility: visible;
        	transform: translateY(0);
        }
        .progress-wrap::after {
        	position: absolute;
        	font-family: 'unicons';
        	content: '↑';
        	text-align: center;
        	line-height: 46px;
        	font-size: 24px;
        	color: var(--grey);
        	left: 0;
        	top: 0;
        	height: 46px;
        	width: 46px;
        	cursor: pointer;
        	display: block;
        	z-index: 1;
        	-webkit-transition: all 200ms linear;
            transition: all 200ms linear;
        }
        .progress-wrap:hover::after {
        	opacity: 0;
        }
        .progress-wrap::before {
        	position: absolute;
        	font-family: 'unicons';
        	content: '↑';
        	text-align.........完整代码请登录后点击上方下载按钮下载查看

网友评论0