js+css实现万圣节Trick AND Treat恶搞代码

代码语言:html

所属分类:搞笑

代码描述:js+css实现万圣节Trick AND Treat恶搞代码

代码标签: js css 万圣节 Trick AND Treat 恶搞 代码

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

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

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

  
  
  
<style>
@import url("https://fonts.googleapis.com/css?family=Montserrat:400,400i,700");

* {
	border-box: box-sizing;
}

body {
	height: 100vh;
	margin: 0;
	background-color: antiquewhite;
	overflow: hidden;
}

h1 {
	position: absolute;
	width: 100%;
	top: 1rem;
	text-align: center;
}

.container {
	position: relative;
	height: 100vh;
}

button {
	font-size: 1.2em;
	padding: 10px 20px;
	cursor: pointer;
	border: none;

	position: absolute;
	top: 50%;

	--button-spacing: 4rem;

	transition: all 0.1s ease-out;
}

button#trick-button {
	color: black;
	background-color: orange;
	left: calc(50% - var(--button-spacing));
	z-index: 3;
}

button#treat-button {
	color: orange;
	background-color: black;
	left: calc(50% + var(--button-spacing));
	z-index: 2;
}

#toast-container {
	position: fixed;
	top: 1rem;
	right: 1rem;
	z-index: 5;
	.toast {
		width: min(70vw, 300px);
		background-color: var(--pico-secondary-background);
		padding: 1rem;
		margin-bottom: 0.25rem;
		border-radius: 0.25rem;
		display: flex;
		justify-content: flex-start;
		align-items: center;
		gap: 1rem;
		font-family: Montserrat, sans-serif;
		font-size: 1.25rem;

		opacity: 0;
		transition: opacity 0.5s ease;
		&.visible {
			opacity: 1;
		}
		&.success {
			color: #fff;
			background-color: #408140;
		}
		&.error {
			color: #fff;
			background-color: #eb6123;
		}
	}
}

#overlay {
	--opacity: 0;
	position: absolute;
	left: 0;
	top: 0;
	width: 250px;
	height: 250px;
	border-radius: 50%;
	border-width: 10000px;
	border-style: solid;
	border-color: rgb(0 0 0 / var(--opacity));
	background-color: transparent;
	transform: translate3d(-50%, -50%, 0);
	z-index: 4;
	pointer-events: none;
	filter: blur(12px);
}
</style>

  
  
</head>

<body translate="no">
  <h1>Wouldn't you like a nice treat?</h1>
<div class="container">
	<button id="trick-button">Trick</button>
</div>
<div class="button-container">
	<button id="treat-button">Treat</button>
</div>

<div id="toast-container"></div>

<div id="overlay"></div>
  
      <script >
console.clear();
const trickBtn = .........完整代码请登录后点击上方下载按钮下载查看

网友评论0