• 前端用F11打开伪装更新页面demo后,老板被欺骗多次!


    前言

            无意间看见朋友分享的页面看到了一个有趣的页面,通过F11之后给人以假乱真的感觉,这个代码并不难,我们一起来看看!

    正文

            通过引入jQuery快速实现电脑浏览器全屏伪装更新页面!

    一、js逻辑代码

    1. function changeFullScreen() {
    2. const element = document.documentElement
    3. console.log(1)
    4. // 如果是全屏状态
    5. if (this.fullscreen) {
    6. // 如果浏览器有这个Function
    7. if (document.exitFullscreen) {
    8. document.exitFullscreen()
    9. } else if (document.webkitCancelFullScreen) {
    10. document.webkitCancelFullScreen()
    11. } else if (document.mozCancelFullScreen) {
    12. document.mozCancelFullScreen()
    13. } else if (document.msExitFullscreen) {
    14. document.msExitFullscreen()
    15. }
    16. } else {
    17. // 如果浏览器有这个Function
    18. if (element.requestFullscreen) {
    19. element.requestFullscreen()
    20. } else if (element.webkitRequestFullScreen) {
    21. element.webkitRequestFullScreen()
    22. } else if (element.mozRequestFullScreen) {
    23. element.mozRequestFullScreen()
    24. } else if (element.msRequestFullscreen) {
    25. element.msRequestFullscreen()
    26. }
    27. }
    28. // 判断全屏状态的变量
    29. this.fullscreen = !this.fullscreen
    30. }

    判断全屏状态的变量

    this.fullscreen = !this.fullscreen;

    二、样式代码

    1. html,
    2. body,
    3. div {
    4. margin: 0;
    5. padding: 0;
    6. }
    7. html,
    8. body {
    9. width: 100%;
    10. height: 100%;
    11. }
    12. .tips-to{
    13. text-align: center;
    14. color: #ffffff;
    15. font-weight: 400;
    16. font-size: 18px;
    17. font-style:normal;
    18. position: absolute;
    19. bottom: 68px;
    20. left: 0;
    21. right: 0;
    22. }
    23. .update,.tips-one{
    24. width: 375px;
    25. text-align: center;
    26. color: #ffffff;
    27. font-weight: 400;
    28. font-size: 18px;
    29. font-style:normal;
    30. margin: 0;
    31. }
    32. .text{
    33. margin: 0 auto;
    34. margin-top: 68px;
    35. margin-left: -163px;
    36. }
    37. .loading i {
    38. margin: auto;
    39. position: absolute;
    40. top: calc(50% - 120px);
    41. left: calc(50% - 20px);
    42. width: 45px;
    43. height: 45px;
    44. display: block;
    45. }
    46. .loading span {
    47. position: absolute;
    48. width: 100%;
    49. height: 100%;
    50. opacity: 0;
    51. }
    52. .loading span:after {
    53. content: "";
    54. display: block;
    55. position: absolute;
    56. left: 0px;
    57. top: 0px;
    58. width: 6px;
    59. height: 6px;
    60. background: var(--main, #ffffff);
    61. border-radius: 50%;
    62. }
    63. .loading span:nth-child(1) {
    64. animation: i1 5.5s 0.2s infinite;
    65. }
    66. .loading span:nth-child(2) {
    67. animation: i2 5.5s 0.4s infinite;
    68. }
    69. .loading span:nth-child(3) {
    70. animation: i3 5.5s 0.6s infinite;
    71. }
    72. .loading span:nth-child(4) {
    73. animation: i4 5.5s 0.8s infinite;
    74. }
    75. .loading span:nth-child(5) {
    76. animation: i5 5.5s 1s infinite;
    77. }
    78. .loading span:nth-child(6) {
    79. animation: i6 5.5s 1.2s infinite;
    80. }
    81. @keyframes i1 {
    82. 0% {
    83. opacity: 1;
    84. transform: rotate(190deg);
    85. animation-timing-function: cubic-bezier(0.29, 0.44, 0.32, 0.74);
    86. }
    87. 7% {
    88. opacity: 1;
    89. transform: rotate(300deg);
    90. animation-timing-function: linear;
    91. }
    92. 30% {
    93. opacity: 1;
    94. transform: rotate(450deg);
    95. animation-timing-function: cubic-bezier(0.53, 0.27, 0.37, 0.81);
    96. }
    97. 39% {
    98. opacity: 1;
    99. transform: rotate(645deg);
    100. animation-timing-function: linear;
    101. }
    102. 63% {
    103. opacity: 1;
    104. transform: rotate(800deg);
    105. animation-timing-function: cubic-bezier(0.5, 0.32, 0.82, 0.54);
    106. }
    107. 68% {
    108. opacity: 1;
    109. transform: rotate(920deg);
    110. animation-timing-function: ease-in;
    111. }
    112. 69% {
    113. opacity: 0;
    114. transform: rotate(930deg);
    115. }
    116. }
    117. @keyframes i2 {
    118. 0% {
    119. opacity: 1;
    120. transform: rotate(180deg);
    121. animation-timing-function: cubic-bezier(0.29, 0.44, 0.32, 0.74);
    122. }
    123. 7% {
    124. opacity: 1;
    125. transform: rotate(300deg);
    126. animation-timing-function: linear;
    127. }
    128. 30% {
    129. opacity: 1;
    130. transform: rotate(450deg);
    131. animation-timing-function: cubic-bezier(0.53, 0.27, 0.37, 0.81);
    132. }
    133. 39% {
    134. opacity: 1;
    135. transform: rotate(645deg);
    136. animation-timing-function: linear;
    137. }
    138. 63% {
    139. opacity: 1;
    140. transform: rotate(800deg);
    141. animation-timing-function: cubic-bezier(0.5, 0.32, 0.82, 0.54);
    142. }
    143. 68% {
    144. opacity: 1;
    145. transform: rotate(910deg);
    146. animation-timing-function: ease-in;
    147. }
    148. 69% {
    149. opacity: 0;
    150. transform: rotate(920deg);
    151. }
    152. }
    153. @keyframes i3 {
    154. 0% {
    155. opacity: 1;
    156. transform: rotate(170deg);
    157. animation-timing-function: cubic-bezier(0.29, 0.44, 0.32, 0.74);
    158. }
    159. 7% {
    160. opacity: 1;
    161. transform: rotate(300deg);
    162. animation-timing-function: linear;
    163. }
    164. 30% {
    165. opacity: 1;
    166. transform: rotate(450deg);
    167. animation-timing-function: cubic-bezier(0.53, 0.27, 0.37, 0.81);
    168. }
    169. 39% {
    170. opacity: 1;
    171. transform: rotate(645deg);
    172. animation-timing-function: linear;
    173. }
    174. 63% {
    175. opacity: 1;
    176. transform: rotate(800deg);
    177. animation-timing-function: cubic-bezier(0.5, 0.32, 0.82, 0.54);
    178. }
    179. 68% {
    180. opacity: 1;
    181. transform: rotate(900deg);
    182. animation-timing-function: ease-in;
    183. }
    184. 69% {
    185. opacity: 0;
    186. transform: rotate(910deg);
    187. }
    188. }
    189. @keyframes i4 {
    190. 0% {
    191. opacity: 1;
    192. transform: rotate(160deg);
    193. animation-timing-function: cubic-bezier(0.29, 0.44, 0.32, 0.74);
    194. }
    195. 7% {
    196. opacity: 1;
    197. transform: rotate(300deg);
    198. animation-timing-function: linear;
    199. }
    200. 30% {
    201. opacity: 1;
    202. transform: rotate(450deg);
    203. animation-timing-function: cubic-bezier(0.53, 0.27, 0.37, 0.81);
    204. }
    205. 39% {
    206. opacity: 1;
    207. transform: rotate(645deg);
    208. animation-timing-function: linear;
    209. }
    210. 63% {
    211. opacity: 1;
    212. transform: rotate(800deg);
    213. animation-timing-function: cubic-bezier(0.5, 0.32, 0.82, 0.54);
    214. }
    215. 68% {
    216. opacity: 1;
    217. transform: rotate(890deg);
    218. animation-timing-function: ease-in;
    219. }
    220. 69% {
    221. opacity: 0;
    222. transform: rotate(900deg);
    223. }
    224. }
    225. @keyframes i5 {
    226. 0% {
    227. opacity: 1;
    228. transform: rotate(150deg);
    229. animation-timing-function: cubic-bezier(0.29, 0.44, 0.32, 0.74);
    230. }
    231. 7% {
    232. opacity: 1;
    233. transform: rotate(300deg);
    234. animation-timing-function: linear;
    235. }
    236. 30% {
    237. opacity: 1;
    238. transform: rotate(450deg);
    239. animation-timing-function: cubic-bezier(0.53, 0.27, 0.37, 0.81);
    240. }
    241. 39% {
    242. opacity: 1;
    243. transform: rotate(645deg);
    244. animation-timing-function: linear;
    245. }
    246. 63% {
    247. opacity: 1;
    248. transform: rotate(800deg);
    249. animation-timing-function: cubic-bezier(0.5, 0.32, 0.82, 0.54);
    250. }
    251. 68% {
    252. opacity: 1;
    253. transform: rotate(880deg);
    254. animation-timing-function: ease-in;
    255. }
    256. 69% {
    257. opacity: 0;
    258. transform: rotate(880deg);
    259. }
    260. }
    261. @keyframes i6 {
    262. 0% {
    263. opacity: 1;
    264. transform: rotate(140deg);
    265. animation-timing-function: cubic-bezier(0.29, 0.44, 0.32, 0.74);
    266. }
    267. 7% {
    268. opacity: 1;
    269. transform: rotate(300deg);
    270. animation-timing-function: linear;
    271. }
    272. 30% {
    273. opacity: 1;
    274. transform: rotate(450deg);
    275. animation-timing-function: cubic-bezier(0.53, 0.27, 0.37, 0.81);
    276. }
    277. 39% {
    278. opacity: 1;
    279. transform: rotate(645deg);
    280. animation-timing-function: linear;
    281. }
    282. 63% {
    283. opacity: 1;
    284. transform: rotate(800deg);
    285. animation-timing-function: cubic-bezier(0.5, 0.32, 0.82, 0.54);
    286. }
    287. 68% {
    288. opacity: 1;
    289. transform: rotate(870deg);
    290. animation-timing-function: ease-in;
    291. }
    292. 69% {
    293. opacity: 0;
    294. transform: rotate(880deg);
    295. }
    296. }

    三、完整代码

    1. html>
    2. <html lang="en">
    3. <head>
    4. <meta charset="UTF-8">
    5. <meta http-equiv="X-UA-Compatible" content="IE=edge">
    6. <meta name="viewport" content="width=device-width, initial-scale=1.0">
    7. <title>F11伪装更新页面title>
    8. <style>
    9. html,
    10. body,
    11. div {
    12. margin: 0;
    13. padding: 0;
    14. }
    15. html,
    16. body {
    17. width: 100%;
    18. height: 100%;
    19. }
    20. .tips-to{
    21. text-align: center;
    22. color: #ffffff;
    23. font-weight: 400;
    24. font-size: 18px;
    25. font-style:normal;
    26. position: absolute;
    27. bottom: 68px;
    28. left: 0;
    29. right: 0;
    30. }
    31. .update,.tips-one{
    32. width: 375px;
    33. text-align: center;
    34. color: #ffffff;
    35. font-weight: 400;
    36. font-size: 18px;
    37. font-style:normal;
    38. margin: 0;
    39. }
    40. .text{
    41. margin: 0 auto;
    42. margin-top: 68px;
    43. margin-left: -163px;
    44. }
    45. .loading i {
    46. margin: auto;
    47. position: absolute;
    48. top: calc(50% - 120px);
    49. left: calc(50% - 20px);
    50. width: 45px;
    51. height: 45px;
    52. display: block;
    53. }
    54. .loading span {
    55. position: absolute;
    56. width: 100%;
    57. height: 100%;
    58. opacity: 0;
    59. }
    60. .loading span:after {
    61. content: "";
    62. display: block;
    63. position: absolute;
    64. left: 0px;
    65. top: 0px;
    66. width: 6px;
    67. height: 6px;
    68. background: var(--main, #ffffff);
    69. border-radius: 50%;
    70. }
    71. .loading span:nth-child(1) {
    72. animation: i1 5.5s 0.2s infinite;
    73. }
    74. .loading span:nth-child(2) {
    75. animation: i2 5.5s 0.4s infinite;
    76. }
    77. .loading span:nth-child(3) {
    78. animation: i3 5.5s 0.6s infinite;
    79. }
    80. .loading span:nth-child(4) {
    81. animation: i4 5.5s 0.8s infinite;
    82. }
    83. .loading span:nth-child(5) {
    84. animation: i5 5.5s 1s infinite;
    85. }
    86. .loading span:nth-child(6) {
    87. animation: i6 5.5s 1.2s infinite;
    88. }
    89. @keyframes i1 {
    90. 0% {
    91. opacity: 1;
    92. transform: rotate(190deg);
    93. animation-timing-function: cubic-bezier(0.29, 0.44, 0.32, 0.74);
    94. }
    95. 7% {
    96. opacity: 1;
    97. transform: rotate(300deg);
    98. animation-timing-function: linear;
    99. }
    100. 30% {
    101. opacity: 1;
    102. transform: rotate(450deg);
    103. animation-timing-function: cubic-bezier(0.53, 0.27, 0.37, 0.81);
    104. }
    105. 39% {
    106. opacity: 1;
    107. transform: rotate(645deg);
    108. animation-timing-function: linear;
    109. }
    110. 63% {
    111. opacity: 1;
    112. transform: rotate(800deg);
    113. animation-timing-function: cubic-bezier(0.5, 0.32, 0.82, 0.54);
    114. }
    115. 68% {
    116. opacity: 1;
    117. transform: rotate(920deg);
    118. animation-timing-function: ease-in;
    119. }
    120. 69% {
    121. opacity: 0;
    122. transform: rotate(930deg);
    123. }
    124. }
    125. @keyframes i2 {
    126. 0% {
    127. opacity: 1;
    128. transform: rotate(180deg);
    129. animation-timing-function: cubic-bezier(0.29, 0.44, 0.32, 0.74);
    130. }
    131. 7% {
    132. opacity: 1;
    133. transform: rotate(300deg);
    134. animation-timing-function: linear;
    135. }
    136. 30% {
    137. opacity: 1;
    138. transform: rotate(450deg);
    139. animation-timing-function: cubic-bezier(0.53, 0.27, 0.37, 0.81);
    140. }
    141. 39% {
    142. opacity: 1;
    143. transform: rotate(645deg);
    144. animation-timing-function: linear;
    145. }
    146. 63% {
    147. opacity: 1;
    148. transform: rotate(800deg);
    149. animation-timing-function: cubic-bezier(0.5, 0.32, 0.82, 0.54);
    150. }
    151. 68% {
    152. opacity: 1;
    153. transform: rotate(910deg);
    154. animation-timing-function: ease-in;
    155. }
    156. 69% {
    157. opacity: 0;
    158. transform: rotate(920deg);
    159. }
    160. }
    161. @keyframes i3 {
    162. 0% {
    163. opacity: 1;
    164. transform: rotate(170deg);
    165. animation-timing-function: cubic-bezier(0.29, 0.44, 0.32, 0.74);
    166. }
    167. 7% {
    168. opacity: 1;
    169. transform: rotate(300deg);
    170. animation-timing-function: linear;
    171. }
    172. 30% {
    173. opacity: 1;
    174. transform: rotate(450deg);
    175. animation-timing-function: cubic-bezier(0.53, 0.27, 0.37, 0.81);
    176. }
    177. 39% {
    178. opacity: 1;
    179. transform: rotate(645deg);
    180. animation-timing-function: linear;
    181. }
    182. 63% {
    183. opacity: 1;
    184. transform: rotate(800deg);
    185. animation-timing-function: cubic-bezier(0.5, 0.32, 0.82, 0.54);
    186. }
    187. 68% {
    188. opacity: 1;
    189. transform: rotate(900deg);
    190. animation-timing-function: ease-in;
    191. }
    192. 69% {
    193. opacity: 0;
    194. transform: rotate(910deg);
    195. }
    196. }
    197. @keyframes i4 {
    198. 0% {
    199. opacity: 1;
    200. transform: rotate(160deg);
    201. animation-timing-function: cubic-bezier(0.29, 0.44, 0.32, 0.74);
    202. }
    203. 7% {
    204. opacity: 1;
    205. transform: rotate(300deg);
    206. animation-timing-function: linear;
    207. }
    208. 30% {
    209. opacity: 1;
    210. transform: rotate(450deg);
    211. animation-timing-function: cubic-bezier(0.53, 0.27, 0.37, 0.81);
    212. }
    213. 39% {
    214. opacity: 1;
    215. transform: rotate(645deg);
    216. animation-timing-function: linear;
    217. }
    218. 63% {
    219. opacity: 1;
    220. transform: rotate(800deg);
    221. animation-timing-function: cubic-bezier(0.5, 0.32, 0.82, 0.54);
    222. }
    223. 68% {
    224. opacity: 1;
    225. transform: rotate(890deg);
    226. animation-timing-function: ease-in;
    227. }
    228. 69% {
    229. opacity: 0;
    230. transform: rotate(900deg);
    231. }
    232. }
    233. @keyframes i5 {
    234. 0% {
    235. opacity: 1;
    236. transform: rotate(150deg);
    237. animation-timing-function: cubic-bezier(0.29, 0.44, 0.32, 0.74);
    238. }
    239. 7% {
    240. opacity: 1;
    241. transform: rotate(300deg);
    242. animation-timing-function: linear;
    243. }
    244. 30% {
    245. opacity: 1;
    246. transform: rotate(450deg);
    247. animation-timing-function: cubic-bezier(0.53, 0.27, 0.37, 0.81);
    248. }
    249. 39% {
    250. opacity: 1;
    251. transform: rotate(645deg);
    252. animation-timing-function: linear;
    253. }
    254. 63% {
    255. opacity: 1;
    256. transform: rotate(800deg);
    257. animation-timing-function: cubic-bezier(0.5, 0.32, 0.82, 0.54);
    258. }
    259. 68% {
    260. opacity: 1;
    261. transform: rotate(880deg);
    262. animation-timing-function: ease-in;
    263. }
    264. 69% {
    265. opacity: 0;
    266. transform: rotate(880deg);
    267. }
    268. }
    269. @keyframes i6 {
    270. 0% {
    271. opacity: 1;
    272. transform: rotate(140deg);
    273. animation-timing-function: cubic-bezier(0.29, 0.44, 0.32, 0.74);
    274. }
    275. 7% {
    276. opacity: 1;
    277. transform: rotate(300deg);
    278. animation-timing-function: linear;
    279. }
    280. 30% {
    281. opacity: 1;
    282. transform: rotate(450deg);
    283. animation-timing-function: cubic-bezier(0.53, 0.27, 0.37, 0.81);
    284. }
    285. 39% {
    286. opacity: 1;
    287. transform: rotate(645deg);
    288. animation-timing-function: linear;
    289. }
    290. 63% {
    291. opacity: 1;
    292. transform: rotate(800deg);
    293. animation-timing-function: cubic-bezier(0.5, 0.32, 0.82, 0.54);
    294. }
    295. 68% {
    296. opacity: 1;
    297. transform: rotate(870deg);
    298. animation-timing-function: ease-in;
    299. }
    300. 69% {
    301. opacity: 0;
    302. transform: rotate(880deg);
    303. }
    304. }
    305. style>
    306. <script src="https://cdn.bootcdn.net/ajax/libs/jquery/1.10.2/jquery.min.js">script>
    307. head>
    308. <body onclick="changeFullScreen()" style="background-color: #3277D1; cursor:none;">
    309. <div class="loading">
    310. <i>
    311. <span>span>
    312. <span>span>
    313. <span>span>
    314. <span>span>
    315. <span>span>
    316. <span>span>
    317. <div class="text">
    318. <h3 class="update">正在进行更新   5%h3>
    319. <h3 class="tips-one">请不要关闭电脑。完成此操作需要一定时间。h3>
    320. div>
    321. i>
    322. div>
    323. <div class="tips-to">
    324. 你的电脑将重启若干次
    325. div>
    326. body>
    327. <script>
    328. function changeFullScreen() {
    329. const element = document.documentElement
    330. console.log(1)
    331. // 如果是全屏状态
    332. if (this.fullscreen) {
    333. // 如果浏览器有这个Function
    334. if (document.exitFullscreen) {
    335. document.exitFullscreen()
    336. } else if (document.webkitCancelFullScreen) {
    337. document.webkitCancelFullScreen()
    338. } else if (document.mozCancelFullScreen) {
    339. document.mozCancelFullScreen()
    340. } else if (document.msExitFullscreen) {
    341. document.msExitFullscreen()
    342. }
    343. } else {
    344. // 如果浏览器有这个Function
    345. if (element.requestFullscreen) {
    346. element.requestFullscreen()
    347. } else if (element.webkitRequestFullScreen) {
    348. element.webkitRequestFullScreen()
    349. } else if (element.mozRequestFullScreen) {
    350. element.mozRequestFullScreen()
    351. } else if (element.msRequestFullscreen) {
    352. element.msRequestFullscreen()
    353. }
    354. }
    355. // 判断全屏状态的变量
    356. this.fullscreen = !this.fullscreen
    357. }
    358. script>
    359. html>

    总结

            如果您有更好的创业demo,欢迎交流~

         

  • 相关阅读:
    Python完整教程
    EuroVis2022论文—2—FP-长论文
    go的singleFlight学习
    leetcode_2558 从数量最多的堆取走礼物
    java 面试之经典算法篇
    Unity基础课程之物理引擎8-扔保龄球游戏案例(完)
    html相关知识点 笔记
    【Python黑科技】制作一个定时小闹钟,自动发送系统通知提示(保姆级图文+实现代码)
    对比勒索病毒和熊猫烧香,谈如何保证服务器端数据安全?
    【pytorch 中 torch.max 和 torch.argmax 的区别】
  • 原文地址:https://blog.csdn.net/XU441520/article/details/133924798