计科知识库
  • 源界面
  • 博客圈
  • 专题
  • 博友
  • 登录
  • 注册
源界面 源界面 2天前

404 Not Found 效果图片

html/css

一个 显示 404 错误的精简界面
FH5UI4Pn

404演示效果界面

源码如下:

  1. <!--
  2. 禁止用于违法用途。
  3. -->
  4. <!DOCTYPE html>
  5. <html lang="zh">
  6. <head>
  7. <!-- 设置字符编码 -->
  8. <meta charset="UTF-8">
  9. <!-- 设置页面在不同设备上的显示效果 -->
  10. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  11. <title>404 Not Found</title>
  12. <!-- 引入 Font Awesome 图标库 -->
  13. <link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.7.2/css/all.min.css" rel="stylesheet">
  14. <style>
  15. body {
  16. /* 设置背景渐变 */
  17. background: linear-gradient(135deg, #3498db, #9b59b6);
  18. font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  19. color: white;
  20. margin: 0;
  21. padding: 0;
  22. /* 垂直和水平居中内容 */
  23. display: flex;
  24. flex-direction: column;
  25. justify-content: center;
  26. align-items: center;
  27. min-height: 100vh;
  28. overflow: hidden;
  29. /* 背景动画 */
  30. animation: backgroundShift 10s ease infinite alternate;
  31. }
  32. /* 背景渐变动画 */
  33. @keyframes backgroundShift {
  34. 0% {
  35. background: linear-gradient(135deg, #3498db, #9b59b6);
  36. }
  37. 100% {
  38. background: linear-gradient(135deg, #9b59b6, #3498db);
  39. }
  40. }
  41. h1 {
  42. font-size: 6em;
  43. margin-bottom: 20px;
  44. text-shadow: 0 0 15px rgba(255, 255, 255, 0.3), 0 0 25px rgba(255, 255, 255, 0.3);
  45. /* 应用霓虹灯闪烁和淡入动画 */
  46. animation: neonGlow 1.5s ease-in-out infinite alternate, fadeInDown 1s ease-out, bounce 1s ease infinite alternate;
  47. }
  48. /* 霓虹灯闪烁动画 */
  49. @keyframes neonGlow {
  50. from {
  51. text-shadow: 0 0 15px rgba(255, 255, 255, 0.3), 0 0 25px rgba(255, 255, 255, 0.3);
  52. }
  53. to {
  54. text-shadow: 0 0 25px rgba(255, 255, 255, 0.6), 0 0 35px rgba(255, 255, 255, 0.6);
  55. }
  56. }
  57. /* 从上方淡入动画 */
  58. @keyframes fadeInDown {
  59. from {
  60. opacity: 0;
  61. transform: translateY(-50px);
  62. }
  63. to {
  64. opacity: 1;
  65. transform: translateY(0);
  66. }
  67. }
  68. /* 弹跳动画 */
  69. @keyframes bounce {
  70. from {
  71. transform: translateY(0);
  72. }
  73. to {
  74. transform: translateY(-10px);
  75. }
  76. }
  77. hr {
  78. width: 70%;
  79. border: 1px solid rgba(255, 255, 255, 0.3);
  80. margin-bottom: 30px;
  81. /* 淡入动画 */
  82. animation: fadeIn 1s ease-out, scaleIn 1s ease;
  83. }
  84. /* 淡入动画 */
  85. @keyframes fadeIn {
  86. from {
  87. opacity: 0;
  88. }
  89. to {
  90. opacity: 1;
  91. }
  92. }
  93. /* 缩放入场动画 */
  94. @keyframes scaleIn {
  95. from {
  96. transform: scale(0);
  97. }
  98. to {
  99. transform: scale(1);
  100. }
  101. }
  102. p.special-tip {
  103. font-size: 1.8em;
  104. color: #ecf0f1;
  105. text-align: center;
  106. margin-bottom: 30px;
  107. max-width: 80%;
  108. /* 从下方淡入动画 */
  109. animation: fadeInUp 1s ease-out, slideInLeft 1s ease;
  110. }
  111. /* 从下方淡入动画 */
  112. @keyframes fadeInUp {
  113. from {
  114. opacity: 0;
  115. transform: translateY(50px);
  116. }
  117. to {
  118. opacity: 1;
  119. transform: translateY(0);
  120. }
  121. }
  122. /* 从左侧滑入动画 */
  123. @keyframes slideInLeft {
  124. from {
  125. transform: translateX(-100%);
  126. }
  127. to {
  128. transform: translateX(0);
  129. }
  130. }
  131. a {
  132. color: #ecf0f1;
  133. text-decoration: none;
  134. border-bottom: 1px solid #ecf0f1;
  135. transition: all 0.3s ease;
  136. }
  137. a:hover {
  138. color: #bdc3c7;
  139. border-bottom-color: #bdc3c7;
  140. transform: scale(1.1);
  141. }
  142. .search-container {
  143. margin-bottom: 30px;
  144. display: flex;
  145. justify-content: center;
  146. align-items: center;
  147. flex-wrap: wrap;
  148. /* 淡入动画 */
  149. animation: fadeIn 1s ease-out, rotateIn 1s ease;
  150. }
  151. /* 旋转入场动画 */
  152. @keyframes rotateIn {
  153. from {
  154. transform: rotate(-90deg);
  155. opacity: 0;
  156. }
  157. to {
  158. transform: rotate(0);
  159. opacity: 1;
  160. }
  161. }
  162. .search-container input {
  163. padding: 12px;
  164. border: none;
  165. border-radius: 4px;
  166. margin: 5px;
  167. flex: 1 1 auto;
  168. background-color: rgba(255, 255, 255, 0.1);
  169. color: white;
  170. outline: none;
  171. transition: all 0.3s ease;
  172. }
  173. .search-container input:focus {
  174. background-color: rgba(255, 255, 255, 0.2);
  175. transform: scale(1.05);
  176. }
  177. .search-container button {
  178. padding: 8px 25px;
  179. border: none;
  180. border-radius: 4px;
  181. background-color: rgba(255, 255, 255, 0.2);
  182. color: white;
  183. cursor: pointer;
  184. transition: all 0.3s ease;
  185. font-size: 16px;
  186. font-weight: 500;
  187. margin: 5px;
  188. }
  189. .search-container button:hover {
  190. background-color: rgba(255, 255, 255, 0.3);
  191. transform: translateY(-2px) scale(1.05);
  192. }
  193. .nav-links {
  194. margin-bottom: 30px;
  195. display: flex;
  196. justify-content: center;
  197. align-items: center;
  198. flex-wrap: wrap;
  199. /* 淡入动画 */
  200. animation: fadeIn 1s ease-out, slideInRight 1s ease;
  201. }
  202. /* 从右侧滑入动画 */
  203. @keyframes slideInRight {
  204. from {
  205. transform: translateX(100%);
  206. }
  207. to {
  208. transform: translateX(0);
  209. }
  210. }
  211. .nav-links a {
  212. margin: 10px;
  213. display: inline-flex;
  214. align-items: center;
  215. transition: transform 0.3s ease;
  216. }
  217. .nav-links a:hover {
  218. transform: scale(1.1);
  219. }
  220. .nav-links a i {
  221. margin-right: 5px;
  222. transition: all 0.3s ease;
  223. }
  224. .nav-links a:hover i {
  225. transform: scale(1.2);
  226. }
  227. /* 音乐播放按钮样式 */
  228. .music-button {
  229. position: fixed;
  230. top: 20px;
  231. right: 20px;
  232. background-color: rgba(255, 255, 255, 0.2);
  233. border: none;
  234. border-radius: 50%;
  235. width: 40px;
  236. height: 40px;
  237. color: white;
  238. font-size: 18px;
  239. cursor: pointer;
  240. transition: all 0.3s ease;
  241. display: flex;
  242. justify-content: center;
  243. align-items: center;
  244. animation: pulse 2s ease infinite;
  245. }
  246. /* 脉冲动画 */
  247. @keyframes pulse {
  248. 0% {
  249. transform: scale(1);
  250. }
  251. 50% {
  252. transform: scale(1.1);
  253. }
  254. 100% {
  255. transform: scale(1);
  256. }
  257. }
  258. .music-button:hover {
  259. background-color: rgba(255, 255, 255, 0.3);
  260. transform: scale(1.1);
  261. }
  262. /* 模态框样式 */
  263. .modal {
  264. display: none;
  265. position: fixed;
  266. z-index: 1;
  267. left: 0;
  268. top: 0;
  269. width: 100%;
  270. height: 100%;
  271. overflow: auto;
  272. background-color: rgba(0, 0, 0, 0.4);
  273. justify-content: center;
  274. align-items: center;
  275. }
  276. .modal-content {
  277. background-color: #fefefe;
  278. padding: 20px;
  279. border: 1px solid #888;
  280. width: 300px;
  281. text-align: center;
  282. border-radius: 8px;
  283. animation: fadeInModal 0.3s ease;
  284. }
  285. /* 模态框淡入动画 */
  286. @keyframes fadeInModal {
  287. from {
  288. opacity: 0;
  289. transform: scale(0.8);
  290. }
  291. to {
  292. opacity: 1;
  293. transform: scale(1);
  294. }
  295. }
  296. .close {
  297. color: #aaa;
  298. float: right;
  299. font-size: 28px;
  300. font-weight: bold;
  301. }
  302. .close:hover,
  303. .close:focus {
  304. color: black;
  305. text-decoration: none;
  306. cursor: pointer;
  307. }
  308. /* 媒体查询,适配小屏幕 */
  309. @media (max-width: 768px) {
  310. h1 {
  311. font-size: 4em;
  312. }
  313. p.special-tip {
  314. font-size: 1.4em;
  315. }
  316. .search-container {
  317. flex-direction: column;
  318. }
  319. .search-container input,
  320. .search-container button {
  321. width: 90%;
  322. }
  323. }
  324. </style>
  325. </head>
  326. <body>
  327. <!-- 显示 404 错误标题 -->
  328. <h1>404 Not Found</h1>
  329. <!-- 分割线 -->
  330. <hr>
  331. <!-- 提示信息 -->
  332. <p class="special-tip">哎呀,你好像来到了一个不存在的地方。<br>点击 <a href="/">这里</a> 返回主页吧。</p>
  333. <!-- 搜索框和按钮 -->
  334. <div class="search-container">
  335. <input type="text" id="search-input" placeholder="使用百度搜索">
  336. <button onclick="searchOnBaidu()">百度搜索</button>
  337. </div>
  338. <!-- 模态框 -->
  339. <div id="myModal" class="modal">
  340. </div>
  341. <center>道客天下个人主页</center>
  342. <script>
  343. // 百度搜索功能
  344. function searchOnBaidu() {
  345. const input = document.getElementById('search-input');
  346. const keyword = input.value;
  347. if (keyword) {
  348. const searchUrl = `https://www.baidu.com/s?wd=${encodeURIComponent(keyword)}`;
  349. window.open(searchUrl, '_blank');
  350. }
  351. }
  352. const musicButton = document.getElementById('musicButton');
  353. const music = document.getElementById('music');
  354. // 打开模态框
  355. function openModal() {
  356. const modal = document.getElementById('myModal');
  357. modal.style.display = "flex";
  358. }
  359. // 关闭模态框
  360. function closeModal() {
  361. const modal = document.getElementById('myModal');
  362. modal.style.display = "none";
  363. }
  364. // 点击模态框外部关闭模态框
  365. window.onclick = function (event) {
  366. const modal = document.getElementById('myModal');
  367. if (event.target == modal) {
  368. closeModal();
  369. }
  370. }
  371. // 禁止 F12 打开开发者工具
  372. document.addEventListener('keydown', function (e) {
  373. if (e.key === 'F12') {
  374. e.preventDefault();
  375. }
  376. });
  377. // 禁止右键菜单
  378. document.addEventListener('contextmenu', function (e) {
  379. e.preventDefault();
  380. });
  381. </script>
  382. </body>
  383. </html>
  • © 2025 源界面 源码为笔,博客为路,写就数字未来
  • 建议
  • 图片压缩
  • | 鄂ICP备14016484号-6

    鄂公网安备 42068402000140