react+gsap+Draggable实现拖动撕开贴纸显示背部文字效果代码

代码语言:html

所属分类:拖放

代码描述:react+gsap+Draggable实现拖动撕开贴纸显示背部文字效果代码

代码标签: react gsap Draggable 拖动 撕开 贴纸 显示 背部 文字 代码

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

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

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


<link type="text/css" rel="stylesheet" href="//repo.bfw.wiki/bfwrepo/css/normalize.5.0.css">

  
  
<style>
*,
*:after,
*:before {
	box-sizing: border-box;
}

:root {
	--bg: hsl(0 0% 98%);
}

body {
	display: grid;
	place-items: center;
	min-height: 100vh;
	font-family:  "SF Pro Text", "SF Pro Icons", "AOS Icons", "Helvetica Neue", Helvetica, Arial, sans-serif, system-ui;
	overflow: hidden;
	background: var(--bg);
}

section {
	height: 100vh;
	display: grid;
	place-items: center;
	position: fixed;
	inset: 0;
}

.tear-strip:focus-within {
	outline: 10px solid hsl(0 0% 0% / 0.15);
}

.strip-adder {
	position: fixed;
	top: 2rem;
	right: 2rem;
	width: 48px;
	aspect-ratio: 1;
	z-index: 22;
	border-radius: 50%;
	border: 0;
	display: grid;
	place-items: center;
	padding: 0;
	background: hsl(0 0% 90% / var(--alpha, 0));
	transition: background 0.2s;
}

.strip-adder svg {
	width: 65%;
	color: hsl(0 0% 10% / var(--alpha, 0.5));
	transition: color 0.2s;
}

.strip-adder:is(:hover, :focus-visible) {
	--alpha: 1;
}

.reference {
	opacity: 1;
	position: fixed;
	top: 50%;
	left: 50%;
	translate: -50% -150%;
}

.tear-strip {
	font-size: 1.3rem;
	font-weight: bold;
	width: clamp(300px, 470px, 28vw);
	width: 340px;
	height: 78px;
	display: grid;
	place-items: center;
/*	translate: 0 -80%;*/
	position: relative;
	border: 4px dashed hsl(0 0% 91%);
	border-radius: 100px;
	background: linear-gradient(hsl(0 0% 91%), hsl(0 0% 91%)) padding-box;
	color: hsl(0, 0%, 70%);
}

.tear-strip__content {
	position: absolute;
	font-size: 1rem;
	text-align: right;
}

.tear-strip__strip {
	position: absolute;
	inset: 0;
	background: va.........完整代码请登录后点击上方下载按钮下载查看

网友评论0