div+css实现情人节表白变色书签纸条代码

代码语言:html

所属分类:表白

代码描述:div+css实现情人节表白变色书签纸条代码

代码标签: div css 情人节 表白 变色 书签 纸条 代码

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

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

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




    <style>
        @import url("https://fonts.googleapis.com/css2?family=Caveat&display=swap");
        
        body {
        	display: flex;
        	justify-content: center;
        	align-items: center;
        	min-height: 100vh;
        	background: #b4b3aa;
        }
        
        fieldset {
        	--gap: 9px;
        	position: absolute;
        	top: calc(20px - var(--gap));
        	right: -5px;
        	border: none;
        	margin: 0;
        	padding: 0;
        	width: 40px;
        
        	legend {
        		position: absolute;
        		inset: 0;
        		display: flex;
        		align-items: center;
        		justify-content: center;
        		font-size: 0;
        	}
        
        	input {
        		position: absolute;
        		opacity: 0;
        		pointer-events: 0;
        	}
        
        	label {
        		position: relative;
        		display: block;
        		width: 40px;
        		height: 30px;
        		background: var(--bg-color);
        		margin: var(--gap) 0;
        		border-top-left-radius: 2px;
        		border-top-right-radius: 2px;
        		border-bottom-left-radius: 2px;
        		font-size: 0;
        		box-shadow: -2px 1px 3px rgba(0 0 0 / 0.2);
        		cursor: pointer;
        		transform: translate(0, 0) scaleX(1);
        		transform-origin: left center;
        		filter: brightness(90%);
        		transition-property: transform filter;
        		transition-duration: 0.2s;
        		transition-timing-function: cubic-bezier(1, 1, 0.5, 1.3333);
        
        		&:hover {
        			transform: translate(0, 0) scaleX(1.25);
        		}
        
        		&:after {
        			content: "";
        			position: absolute;
        			top: 100%;
        			right: 0;
        			width: 0;
        			height: 0;
        			border-top: 5px solid var(--bg-color);
        			border-right: 5px solid transparent;
        			border-left: 0px solid transparent;
        			border-bottom: 5px solid transparent;
        			filter: brightness(62%);
        			transition-property: border-right filter;
        			transition-duration: 0.2s;
        			transition-timing-function: cubic-bezier(1, 1, 0.5, 1.3333);
        		}
        
        		&:hover:after {
        			border-right: 12px solid transparent;
        		}
        	}
        
        	input:checked + label,
        	input:focus + label {
        		transform: translate(0, 0) scaleX(1.25);
        		filter: brightness(100%);
        
        		&:after {
        			border-right: 12px solid transparent;
        			filter: brightness(50%);
        		}
        	}
        
        	label:nth-of-type(1) {
        		--bg-color: #f3b2af;
        	}
        
        	label:nth-of-type(2) {
        		--bg-color: #b1f4fd;
        	}
        
        	label:nth-of-type(3) {
        		--bg-color: #d5fec5;
        	}
        
        	label:nth-of-type(4) {
        		--bg-color: #feffbe;
        	}
        
        	label:nth-of-type(5) {
        		--bg-color: #f9d7ac;
        	}
        }
        
        .card {
        	position: relative;
        	max-width: 240px;
        	width: 100%;
        	height: 360px;
        	background: repeating-linear-gradient(
        		transparent 0 calc(1.2rem - 1px),
        		#eecfd7 0 1.2rem
        	);
        	background-color: #e4e4e4;
        	border-radius: 10px;
        	box-shadow: 0 0 0 6px rgba(255 255 255 / 0.1) inset,
        		2px.........完整代码请登录后点击上方下载按钮下载查看

网友评论0