svg+css实现文字突出挤出效果代码

代码语言:html

所属分类:布局界面

代码描述:svg+css实现文字突出挤出效果代码

代码标签: 突出 挤出 效果

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


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

<head>

  <meta charset="UTF-8">
  

  
<style>
@import url("https://fonts.googleapis.com/css2?family=Paytone+One&display=swap");

:root {
	--purple: #6a67ce;
	--pink: #fc636b;
	--green: #3be8b0;
	--blue: #1aafd0;
	--yellow: #ffb900;
	--offwhite: #f8efe9;
}

body {
	min-height: 100vh;
	display: flex;
	align-items: center;
	justify-content: center;
	background-color: var(--green);
	text-align: center;
}

h1 {
	display: block;
	font-family: "Paytone One", sans-serif;
	font-size: 10vw;
	color: var(--blue);
	filter: url(#extrude);
}

svg {
	position: absolute;
	left: -10000px;
	height: 0;
	width: 0;
}
</style>

</head>

<body >
  <h1>BFW.WIKI</h1>
<svg>
	<defs>
		<!-- 		make sure the filter convers the whole viewBox by makin it LORGE -->
		<filter id="extrude" x="-100%" y="-100%" width="300%" height="300%">
			<!-- 			flood with a nice purple color -->
			<feFlood result="PURPLE" flood-color="var(--purple)"></feFlood>
			<!-- 	Order defines the depth of the extrusion; angle is defined by the position of "1" in the matrix. This is a 45deg 16px deep extrusion. The more extruded it is the more numbers in the matrix you need. But I have no understanding beyond that. come on. I mean.... literally no clue. I don't think anyone REALLY actually understands convolve matrix.  -->
			<feConvolveMatrix order="16,16" divisor="1" in="SourceAlpha" result="EXTRUDE" kernelMatrix="1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 
	.........完整代码请登录后点击上方下载按钮下载查看

网友评论0