网页炫酷特效拿来即可用(看板娘鼠标点击炫酷登录页面樱花特效生日祝福彩虹屁)

news/2024/10/17 19:28:06/

前言

作为一个乐于分享知识的程序员来说,博客必不可少。

在制作博客的过程中,改前端改得让人不言而喻🤡

其次,为了大伙们不步我后尘,给大家陆续分享出来,如果觉得有帮助可以点赞收藏支持一下,如果能关注一下就再好不过了ヾ(≧▽≦*)o,之后还会分享许多内容,废话不多说,上干货~

这是小编的博客,大伙们可以去逛逛哦~点击

目录

    • 前言
    • 看板娘
    • 鼠标点击效果
    • 炫酷登录
    • 樱花特效
    • 生日祝福
    • 定时给女朋友彩虹屁
    • 文件获取

看板娘

image-20220419172506465

代码(直接引入js文件即可)

<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/font-awesome/css/font-awesome.min.css"><link rel="stylesheet" href="https://cdn.jsdelivr.net/semantic-ui/2.2.4/semantic.min.css"><script src="https://cdn.jsdelivr.net/npm/jquery@3.2/dist/jquery.min.js"></script><script src="https://cdn.jsdelivr.net/semantic-ui/2.2.4/semantic.min.js"></script><script src="https://cdn.jsdelivr.net/npm/jquery.scrollto@2.1.2/jquery.scrollTo.min.js"></script><script src="https://cdn.jsdelivr.net/gh/stevenjoezhang/live2d-widget@latest/autoload.js"></script>

鼠标点击效果

1、弹出字体

image-20220419171606683

<!DOCTYPE html>
<html lang="en"><head><meta charset="UTF-8"><title>Document</title>
</head><body><script>(function () {var a_idx = 0;window.onclick = function (event) {var a = new Array("富强", "民主", "文明", "和谐", "自由", "平等", "公正", "法治", "爱国","敬业", "诚信", "友善");var heart = document.createElement("b"); //创建b元素heart.onselectstart = new Function('event.returnValue=false'); //防止拖动document.body.appendChild(heart).innerHTML = a[a_idx]; //将b元素添加到页面上a_idx = (a_idx + 1) % a.length;heart.style.cssText = "position: fixed;left:-100%;"; //给p元素设置样式var f = 16, // 字体大小x = event.clientX - f / 2, // 横坐标y = event.clientY - f, // 纵坐标c = randomColor(), // 随机颜色a = 1, // 透明度s = 1.2; // 放大缩小var timer = setInterval(function () { //添加定时器if (a <= 0) {document.body.removeChild(heart);clearInterval(timer);} else {heart.style.cssText = "font-size:16px;cursor: default;position: fixed;color:" +c + ";left:" + x + "px;top:" + y + "px;opacity:" + a + ";transform:scale(" +s + ");";y--;a -= 0.016;s += 0.002;}}, 15)}// 随机颜色function randomColor() {return "rgb(" + (~~(Math.random() * 255)) + "," + (~~(Math.random() * 255)) + "," + (~~(Math.random() * 255)) + ")";}}());</script>
</body></html>

2、变色❤

335ff5fd42e849c0bbd878ae4a02562b

<!DOCTYPE html>
<html lang="en">
<head><meta charset="UTF-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><title>Document</title>
</head><body><!-- 网页鼠标点击特效(爱心) --><script type="text/javascript">! function (e, t, a) {function r() {for (var e = 0; e < s.length; e++) s[e].alpha <= 0 ? (t.body.removeChild(s[e].el), s.splice(e, 1)) : (s[e].y--, s[e].scale += .004, s[e].alpha -= .013, s[e].el.style.cssText = "left:" + s[e].x +"px;top:" + s[e].y + "px;opacity:" + s[e].alpha + ";transform:scale(" + s[e].scale + "," + s[e].scale + ") rotate(45deg);background:" + s[e].color + ";z-index:99999");requestAnimationFrame(r)}function n() {var t = "function" == typeof e.onclick && e.onclick;e.onclick = function (e) {t && t(), o(e)}}function o(e) {var a = t.createElement("div");a.className = "heart", s.push({el: a,x: e.clientX - 5,y: e.clientY - 5,scale: 1,alpha: 1,color: c()}), t.body.appendChild(a)}function i(e) {var a = t.createElement("style");a.type = "text/css";try {a.appendChild(t.createTextNode(e))} catch (t) {a.styleSheet.cssText = e}t.getElementsByTagName("head")[0].appendChild(a)}function c() {return "rgb(" + ~~(255 * Math.random()) + "," + ~~(255 * Math.random()) + "," + ~~(255 * Math.random()) + ")"}var s = [];e.requestAnimationFrame = e.requestAnimationFrame || e.webkitRequestAnimationFrame || e.mozRequestAnimationFrame || e.oRequestAnimationFrame || e.msRequestAnimationFrame || function (e) {setTimeout(e, 1e3 / 60)}, i(".heart{width: 10px;height: 10px;position: fixed;background: #f00;transform: rotate(45deg);-webkit-transform: rotate(45deg);-moz-transform: rotate(45deg);}.heart:after,.heart:before{content: '';width: inherit;height: inherit;background: inherit;border-radius: 50%;-webkit-border-radius: 50%;-moz-border-radius: 50%;position: fixed;}.heart:after{top: -5px;}.heart:before{left: -5px;}"), n(), r()}(window, document);</script>
</body></html>

3、弹出烟花波纹

b64b3cc0e1d24a5b8d8d3b0b78b4df7e

<html>
<head></head>
<body>
<script>
function clickEffect() {let balls = [];let longPressed = false;let longPress;let multiplier = 0;let width, height;let origin;let normal;let ctx;const colours = ["#F73859", "#14FFEC", "#00E0FF", "#FF99FE", "#FAF15D"];const canvas = document.createElement("canvas");document.body.appendChild(canvas);canvas.setAttribute("style", "width: 100%; height: 100%; top: 0; left: 0; z-index: 99999; position: fixed; pointer-events: none;");const pointer = document.createElement("span");pointer.classList.add("pointer");document.body.appendChild(pointer);if (canvas.getContext && window.addEventListener) {ctx = canvas.getContext("2d");updateSize();window.addEventListener('resize', updateSize, false);loop();window.addEventListener("mousedown", function(e) {pushBalls(randBetween(10, 20), e.clientX, e.clientY);document.body.classList.add("is-pressed");longPress = setTimeout(function(){document.body.classList.add("is-longpress");longPressed = true;}, 500);}, false);window.addEventListener("mouseup", function(e) {clearInterval(longPress);if (longPressed == true) {document.body.classList.remove("is-longpress");pushBalls(randBetween(50 + Math.ceil(multiplier), 100 + Math.ceil(multiplier)), e.clientX, e.clientY);longPressed = false;}document.body.classList.remove("is-pressed");}, false);window.addEventListener("mousemove", function(e) {let x = e.clientX;let y = e.clientY;pointer.style.top = y + "px";pointer.style.left = x + "px";}, false);} else {console.log("canvas or addEventListener is unsupported!");}function updateSize() {canvas.width = window.innerWidth * 2;canvas.height = window.innerHeight * 2;canvas.style.width = window.innerWidth + 'px';canvas.style.height = window.innerHeight + 'px';ctx.scale(2, 2);width = (canvas.width = window.innerWidth);height = (canvas.height = window.innerHeight);origin = {x: width / 2,y: height / 2};normal = {x: width / 2,y: height / 2};}class Ball {constructor(x = origin.x, y = origin.y) {this.x = x;this.y = y;this.angle = Math.PI * 2 * Math.random();if (longPressed == true) {this.multiplier = randBetween(14 + multiplier, 15 + multiplier);} else {this.multiplier = randBetween(6, 12);}this.vx = (this.multiplier + Math.random() * 0.5) * Math.cos(this.angle);this.vy = (this.multiplier + Math.random() * 0.5) * Math.sin(this.angle);this.r = randBetween(8, 12) + 3 * Math.random();this.color = colours[Math.floor(Math.random() * colours.length)];}update() {this.x += this.vx - normal.x;this.y += this.vy - normal.y;normal.x = -2 / window.innerWidth * Math.sin(this.angle);normal.y = -2 / window.innerHeight * Math.cos(this.angle);this.r -= 0.3;this.vx *= 0.9;this.vy *= 0.9;}}function pushBalls(count = 1, x = origin.x, y = origin.y) {for (let i = 0; i < count; i++) {balls.push(new Ball(x, y));}}function randBetween(min, max) {return Math.floor(Math.random() * max) + min;}function loop() {ctx.fillStyle = "rgba(255, 255, 255, 0)";ctx.clearRect(0, 0, canvas.width, canvas.height);for (let i = 0; i < balls.length; i++) {let b = balls[i];if (b.r < 0) continue;ctx.fillStyle = b.color;ctx.beginPath();ctx.arc(b.x, b.y, b.r, 0, Math.PI * 2, false);ctx.fill();b.update();}if (longPressed == true) {multiplier += 0.2;} else if (!longPressed && multiplier >= 0) {multiplier -= 0.4;}removeBall();requestAnimationFrame(loop);}function removeBall() {for (let i = 0; i < balls.length; i++) {let b = balls[i];if (b.x + b.r < 0 || b.x - b.r > width || b.y + b.r < 0 || b.y - b.r > height || b.r < 0) {balls.splice(i, 1);}}}
}
clickEffect();//调用特效函数
</script>
</body>
</html>

炫酷登录

1、动态云层登录

image-20220419171702619

2、彩色气泡登录

img

image-20220419171720465

樱花特效

img

生日祝福

20160913190010651

定时给女朋友彩虹屁

image-20220419180125508

image-20220419180139056

文件获取

百度网盘
链接:https://pan.baidu.com/s/1EJ8v2e707x5jeicdDVnbmQ
提取码:0llp

满满的干货哦
如果觉得有帮助的话,就光顾一下小编博客吧 ~ 点击
如果能留下你的见解,那就最好不过了哈 ~ 前往


http://www.ppmy.cn/news/581130.html

相关文章

网页版《2048游戏》

源码下载&#xff1a; https://gitee.com/cheng-hanyuan/example_projec/tree/main/%E6%A1%88%E4%BE%8B%E9%A1%B9%E7%9B%AE/2048 网页版《2048游戏》教程 1.课程介绍 1.1关于《2048》 《2048》是比较流行的一款数字游戏。原版2048首先在github上发布&#xff0c;原作者是Gabr…

汽车芯片,竞逐新周期

在过去几年&#xff0c;SoC几乎成了智能汽车行业皇冠上的明珠。汽车芯片从通用型、分散化的单一功能芯片&#xff08;MCU&#xff09;快速转向集成化的多功能SoC&#xff08;System on Chip&#xff09;芯片。 比如&#xff0c;在智能座舱领域&#xff0c;CPU算力用于提高任务处…

html用css写彩虹,[网页设计]CSS制作彩虹效果

[网页设计]CSS制作彩虹效果 0 2016-07-06 16:00:04 今天看到一篇文章&#xff0c;说到margin的塌陷的问题&#xff0c;并提供了好几个例子。 自己之前还没怎么遇到过这个问题&#xff0c;正好来研究一下。 css样式一&#xff0c;使用margin塌陷&#xff1a;.box1, .box2, .box3…

彩虹岛水果服务器维护,《彩虹岛水果》攻略 彩虹岛不相信眼泪,只相信产量...

[摘要]彩虹岛水果游戏怎么玩&#xff1f;不了解彩虹岛水果游戏怎么玩的小伙伴&#xff0c;小编为你准备了最新公分攻略&#xff0c;要不要来看一眼&#xff1f; 彩虹岛水果游戏怎么玩&#xff1f;不了解彩虹岛水果游戏怎么玩的小伙伴&#xff0c;小编为你准备了最新公分攻略&am…

LiveGBS流媒体平台GB/T28181功能-海康大华宇视华为NVR等4G摄像头自带物联网卡注册国标平台后看不到设备的时候如何排查及抓包

LiveGBS流媒体平台GB/T28181功能-海康大华宇视华为NVR等4G摄像头自带物联网卡注册国标平台后看不到设备的时候如何排查及抓包 1、设备注册后查看不到1.1、是否是4G|5G摄像头1.2、关闭萤石云1.3、防火墙排查1.4、端口排查1.5、IP地址排查1.6、设备TCP/IP配置排查1.7、设备多网卡…

基于Matlab实现SVM算法的手写字体识别(附上完整仿真源码+数据 )

手写字体识别是一个重要的人工智能应用领域。在本文中&#xff0c;我们将展示如何使用MATLAB实现手写数字的识别。 首先&#xff0c;我们需要准备一个手写数字数据集。在本文中&#xff0c;我们将使用MNIST数据集&#xff0c;这是一个广泛使用的手写数字数据集&#xff0c;包含…

【机器学习】正则化对过拟合和欠拟合的影响

模型过拟合和欠拟合的图像特征 偏差大表示欠拟合&#xff0c;而方差大表示过拟合&#xff0c;我们这一节再深入探讨下过拟合和欠拟合问题。一个经典的图如下&#xff1a; 其中d1为欠拟合&#xff0c;d4为过拟合&#xff0c;而d2则刚刚好。回顾下刚刚说的使用训练集和交叉验证…

RISC-V处理器的设计与实现(一)—— 基本指令集

本人小白一枚&#xff0c;在学习FPGA的过程中偶然刷到了tinyriscv这个开源项目&#xff0c;并且自己对计算机体系结构的知识也很感兴趣&#xff0c;所以想参考这个开源项目做一个基于RISC-V指令集的CPU&#xff0c;下面是tinyriscv这个开源项目的地址&#xff0c;本项目很多思路…