Toggle navigation
在线编辑器
在线代码
文本比较
jQuery下载
前端库
在线手册
登录/注册
下载代码
html
css
js
分享到微信朋友圈
X
html
happy
HALLOWEEN
Choose One:
Ghost
Ghoul
Marshmallow Monster
Vampire
Werewolf
Skeleton
css
@import url("https://fonts.googleapis.com/css2?family=Cinzel:wght@800&family=Gamja+Flower&family=Lakki+Reddy&family=Nosifer&family=Rock+Salt&family=Sniglet:wght@800&family=Sue+Ellen+Francisco&family=Walter+Turncoat&display=swap"); * { margin: 0; padding: 0; box-sizing: border-box; } * ::-moz-selection { color: #f09328; } * ::selection { color: #f09328; } body { height: 100vh; overflow: hidden; position: relative; display: flex; flex-flow: column nowrap; align-items: center; justify-content: space-between; background: radial-gradient(circle at 50% 70%, white 0, white 10rem, #632c90 10.1rem, #632c90 20rem, #532881 20.1rem, #532881 30rem, #3d2673 30.1rem, #3d2673 40rem, #272163 40.1rem) no-repeat center center fixed; -webkit-background-size: cover; -moz-background-size: cover; -o-background-size: cover; background-size: cover; font-family: "Lakki Reddy", cursive; font-size: 2rem; line-height: 3.5rem; color: #f0f7ff; text-align: center; } body a { color: inherit; text-decoration: none; } .container { position: relative; height: 100%; max-width: 58.125rem; display: flex; flex-flow: column nowrap; align-items: center; justify-content: space-between; } .bats { position: fixed; width: 58.125rem; height: 100%; fill: transparent; } .bats #bat-2 { fill: #022136; transform-origin: 50% 50%; } .bats #bat-3 { fill: #022136; transform-origin: 50% 50%; } .bats #bat-4 { fill: #022136; transform-origin: 50% 50%; } .bats #bat-5 { fill: #022136; transform-origin: 50% 50%; } .bats #bat-6 { fill: #022136; transform-origin: 50% 50%; } .bats #bat-7 { fill: #022136; transform-origin: 50% 50%; } .bats #bat-2 { x: 10%; y: 10%; transform: rotate(-10deg) scale(0.45); filter: opacity(0.75); } .bats #bat-3 { x: 30%; y: 30%; transform: rotate(10deg) scale(0.35); filter: opacity(0.55); } .bats #bat-4 { x: 90%; y: -10%; transform: rotate(-20deg) scale(0.55); filter: opacity(0.95); } .bats #bat-5 { x: 70%; y: 5%; transform: rotate(20deg) scale(0.45); filter: opacity(0.75); } .bats #bat-6 { x: 0%; y: 55%; transform: rotate(20deg) scale(0.25); filter: opacity(0.35); } .bats #bat-7 { x: 60%; y: 60%; transform: rotate(-20deg) scale(0.25); filter: opacity(0.15); } .sky { position: absolute; top: 10%; display: flex; flex-flow: column wrap; align-items: center; justify-content: center; } .sky .title.orange { color: #f09328; font-size: 4rem; line-height: 4rem; } .ground { display: flex; flex-flow: column nowrap; align-items: center; justify-content: flex-end; width: 100%; height: 100%; } .ground__wave { fill: #022136; font-size: 4.5rem; } .ground__wave svg { width: 100vw; height: 100%; overflow: visible; } .ground #ground__group { transform-origin: 50% 50%; transform: translate3d(0, 0, 0); backface-visibility: hidden; perspective: 1000px; animation: ghost 5s infinite linear alternate; } @keyframes ghost { 0% { transform: translate(0, -30%); filter: blur(0.5rem); opacity: 0; } 100% { transform: translate(0, -10%); opacity: 0.2; } } @keyframes ghoul { 0% { transform: translate(0, 70%) rotate(25deg); } 70% { transform: translate(0, 0); } } @keyframes marshmallow { 0% { transform: translateY(-5%) skewX(5deg) scale(1.02); } 50% { transform: translateY(-5.5%) skewX(-5deg) scale(0.98); } } @keyframes vampire { 0% { transform: translate(0, -20%); } 100% { transform: translate(0, -40%); } } @keyframes werewolf { 50% { text-shadow: 0 0.025em 0.01em #022136, 0.025em -0.025em 0.01em #022136, 0.025em 0 0.01em #022136, -0.025em 0.025em 0.01em #022136; } } @keyframes skeleton { 20% { transform: translate3d(-1px, -1px, 0); } 80% { transform: translate3d(1px, 0, 1px); } } .dropdown { display: flex; flex-flow: column nowrap; font-family: "Gamja Flower", cursive; color: #f09328; text-shadow: 0 1px #532881; } .dropdown #monster-select { width: 10rem; height: 3rem; border: 0.5rem solid #632c90; font-family: "Gamja Flower", cursive; font-size: 1.2rem; color: rgba(255, 255, 255, 0.5); padding: 0.25rem; background: #532881; border-radius: 0.3rem; } @media (max-height: 400px) { body { background: radial-gradient(circle at 50% 70%, white 0, white 5rem, #632c90 5.1rem, #632c90 10rem, #532881 10.1rem, #532881 15rem, #3d2673 15.1rem, #3d2673 20rem, #272163 20.1rem) no-repeat center center fixed; } .container { transform: scale(0.5); } .container .sky { margin-top: -12%; } .ground__wave svg { margin-bottom: -25%; width: 200vw; height: 200vh; } }
JavaScript
const selectMonster = document.querySelector("#monster-select"); const groundText = document.querySelector("#ground__text"); const groundGroup = document.querySelector("#ground__group"); const groundWave = document.querySelector(".ground__wave"); const monsterBkgd = { ghost: "#FF7B00", ghoul: "#096B00", "marshmallow monster": "#009DFF", vampire: "#c1121f", werewolf: "#FF3700", skeleton: "#8F8F8F" }; selectMonster.addEventListener("change", (e) => { groundText.textContent = `${e.target.value}`; //update background based on current option const lowercase = e.target.value.toLowerCase(); const colors = (monsterColors) => { for (let color in monsterColors) { if (color === lowercase) { document.body.style.background = `radial-gradient(circle at 50% 100%, ${monsterColors[color]} 0, ${monsterColors[color]} .25rem,transparent), radial-gradient(circle at 50% 70%, white 0, white 10rem, #632c90 10.1rem, #632c90 20rem, #532881 20.1rem, #532881 30rem, #3d2673 30.1rem, #3d2673 40rem, #272163 40.1rem) no-repeat center center fixed`; } } }; colors(monsterBkgd); if (e.target.value === "Ghost") { ghost(); } else if (e.target.value === "Ghoul") { ghoul(); } else if (e.target.value === "Marshmallow Monster") { marshmallow(); } else if (e.target.value === "Vampire") { vampire(); } else if (e.target.value === "Werewolf") { werewolf(); } else if (e.target.value === "Skeleton") { skeleton(); } }); const ghost = () => { groundText.style.fontFamily = "Walter Turncoat"; groundWave.style.fontSize = "4.25rem"; groundGroup.style.animationName = "ghost"; groundGroup.style.animationDuration = "4s"; }; const ghoul = () => { groundText.style.fontFamily = "Rock Salt"; groundWave.style.fontSize = "4.25rem"; groundGroup.style.animationName = "ghoul"; groundGroup.style.animationDuration = "4s"; }; const marshmallow = () => { groundText.style.fontFamily = "Sniglet"; groundGroup.style.animationName = "marshmallow"; groundWave.style.fontSize = "2.25rem"; groundGroup.style.animationDuration = "4s"; }; const vampire = () => { groundText.style.fontFamily = "Nosifer"; groundGroup.style.animationName = "vampire"; groundGroup.style.animationDuration = "6s"; }; const werewolf = () => { groundText.style.fontFamily = "Cinzel"; groundGroup.style.animationName = "werewolf"; groundGroup.style.animationDuration = "4s"; }; const skeleton = () => { groundText.style.fontFamily = "Sue Ellen Francisco"; groundWave.style.fontSize = "4.25rem"; groundGroup.style.animationName = "skeleton"; groundGroup.style.animationDuration = ".5s"; };
粒子
时间
文字
hover
canvas
3d
游戏
音乐
火焰
水波
轮播图
鼠标跟随
动画
css
加载动画
导航
菜单
按钮
滑块
tab
弹出层
统计图
svg
×
Close
在线代码下载提示
开通在线代码永久免费下载,需支付20jQ币
开通后,在线代码模块中所有代码可终身免费下!
您已开通在线代码永久免费下载,关闭提示框后,点下载代码可直接下载!
您已经开通过在线代码永久免费下载
对不起,您的jQ币不足!可通过发布资源 或
直接充值获取jQ币
取消
开通下载
<!doctype html> <html> <head> <meta charset="utf-8"> <title>万圣节怪物字体-jq22.com</title> <script src="https://www.jq22.com/jquery/jquery-1.10.2.js"></script> <style>
</style> </head> <body>
<script>
</script>
</body> </html>
2012-2021 jQuery插件库版权所有
jquery插件
|
jq22工具库
|
网页技术
|
广告合作
|
在线反馈
|
版权声明
沪ICP备13043785号-1
浙公网安备 33041102000314号