Electron快速入门(三):在(二)的基础上修改了一个文件夹做了个备忘录

Lingering Memories 诗绪萦怀

修改index.html

<!--index.html-->
<!DOCTYPE html>
<html lang="zh-CN"><head><meta charset="UTF-8"><!-- https://developer.mozilla.org/en-US/docs/Web/HTTP/CSP --><meta http-equiv="Content-Security-Policy" content="width=device-width, initial-scale=1.0"><title>空空我啊</title><!-- <link rel="stylesheet" href="./src/style.css"> --><style>/* 格式化样式 */* {margin: 0;padding: 0;/* box-sizing: border-box; *//* 防止用户选中文本 */user-select: none;}body {width: 100vw;height: 100vh;background: #2c3e50;/* 溢出隐藏 */overflow: hidden;}/* title-bar自定义标题栏  */.title-bar {width: 100vw;height: 35px;display: flex;align-items: center;justify-content: space-between;background: #ffffff9c;-webkit-app-region: drag;.logo {img {width: 30px;height: 30px;margin: 6px 0 0px 5px;-webkit-app-region: no-drag;transition: transform 0.3s ease;&:hover {transform: scale(1.2);}}}#time {font-size: 1.5rem;background: -webkit-linear-gradient(315deg, #e1ff00 50%, #ff0000);/*将背景剪切成文字的形状*/background-clip: text;-webkit-background-clip: text;/*文字颜色设为透明,使文字与背景融为一体*/-webkit-text-fill-color: transparent;/* 设置字体粗细 */font-weight: 900;text-shadow: 2px -1px 8px rgba(250, 80, 193, 0.323);sub {/* font-size: 1rem; */text-shadow: 2px -1px 8px rgba(250, 80, 193, 0.323);}}iframe {-webkit-app-region: no-drag;}.window-btn {display: flex;min-width: 110px;i {cursor: pointer;img {width: 30px;height: 30px;-webkit-app-region: no-drag;transition: transform 0.3s ease;margin: 6px 0 0px 5px;&:hover {background-color: hsla(0, 0%, 40%, 0.68);transform: scale(1.2);}}}}}/* 自定义标题栏 结束 *//* content内容区 开始 */li {list-style: none;}a {text-decoration: none;color: hsla(160, 100%, 37%, 1);text-shadow: 1px 1px 1px rgb(0, 0, 0);&:hover {background-color: #ebf303;color: #f30303;}}button {box-shadow: 0 0 5px rgba(255, 254, 254, 0.5);cursor: pointer;}button:hover {background-color: #f3d303;}#content {display: flex;width: 100vw;}#content h2 {text-align: center;margin-top: 10px;}#centre {width: 85vw;height: 96vh;display: flex;flex-direction: column;justify-content: space-evenly;}.displayBtn {display: flex;color: #E6A23C;background-color: #67c23a79;border: none;text-align: center;}.displayBtn i {width: 100%;color: chartreuse;cursor: pointer;&:hover {background-color: #f3d303;color: blueviolet;}}#hidden {display: none;flex-direction: column;position: fixed;transform: translate(5%, 15%);border-radius: 8px;background-color: rgba(0, 0, 0, 0.737);z-index: 9;box-shadow: 0 0 10px rgba(255, 254, 254, 0.5);}#hidden #Drag {height: 35px;display: flex;justify-content: space-between;font-size: 1.5rem;box-shadow: 0 0 10px rgba(93, 93, 93, 0.537);cursor: move;color: #fffcfc;}#hidden #Drag p {margin: 0 10px;}#hidden #Drag i {font-style: normal;margin: 0 10px;cursor: pointer;}#hidden #Drag i:hover {color: #f30303;}#hidden #form {display: flex;flex-direction: column;background-color: rgba(20, 20, 20, 0.5);margin: 10px;padding: 5px;border-radius: 5px;box-shadow: 0 0 5px rgba(255, 254, 254, 0.5);z-index: 10;}#hidden #form sub {margin: 10px 0;user-select: text;color: hsla(160, 100%, 37%, 1);text-shadow: 1px 1px 1px rgba(0, 0, 0, 0.951);text-align: center;}#hidden #form input[type="file"] {width: 100%;background: #67c23a3e;}#hidden #form div {display: flex;}#hidden #form textarea {background-color: rgba(20, 20, 20, 0.5);color: #fffcfc;text-shadow: 1px 1px 1px #000;font-size: 20px;}#hidden #form textarea::placeholder {text-align: center;}#closeButton {background: linear-gradient(to right, #4CAF50, #FF0000);color: #f3d303;font-weight: bold;margin: 0;padding: 0;cursor: pointer;&:hover {background-color: #f3d303;color: #ff0505;}}#delete {color: #f3d303;text-shadow: 1px 1px 1px rgb(0, 0, 0);background: #ff0000;border: none;text-align: center;font-weight: bold;cursor: pointer;&:hover {background-color: #f3d303;color: #ff0505;}}#memo {height: 90vh;margin: 0 10px;border-radius: 10px;display: flex;align-content: flex-start;border: 2px solid rgb(134, 133, 133);background-color: #144756;font-size: 20px;flex-wrap: wrap;overflow-x: hidden;}#memo pre,#memo span {user-select: text;color: #1ded39a0;margin: 10px;border-radius: 5px;}#memo pre:hover,#memo span:hover {color: #ffffff8c;}#memo sub {position: sticky;top: 0;color: rgb(252, 181, 181);text-shadow: 1px 1px 1px #030303;box-shadow: inset -2px -2px 3px rgba(255, 255, 255, 0.6), inset 2px 2px 3px rgba(0, 0, 0, 0.6);margin: 0 10px;user-select: text;border-radius: 20px;}.a_href {box-shadow: 1px 1px 2px 2px rgba(255, 251, 251, 0.5);padding: 2px;border-radius: 3px;}.finish {background-color: rgb(191, 210, 255);color: rgb(255, 250, 250);text-shadow: 1px 1px 1px #030303;box-shadow: inset -2px -2px 3px rgba(255, 255, 255, 0.6), inset 2px 2px 3px rgba(0, 0, 0, 0.6);}a {text-decoration: none;color: #ebf704;}#left,#right {width: 9vw;height: 96vh;box-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);h2 {color: #fffcfc;}}#localList,#webList {text-align: center;margin-top: 10px;}#localList li,#webList li {margin: 5px;font-size: 18px;box-shadow: 1px 1px 2px 2px rgba(255, 251, 251, 0.5);padding: 2px;border-radius: 3px;color: hsla(160, 100%, 37%, 1);background-color: #ff000000;cursor: pointer;&:hover {background-color: #f3d303;color: #ff0505;}}/* 内容区 结束 */</style>
</head><body><!--title-bar 自定义标题栏 --><div class="title-bar"><a class="logo" href="https://blog.csdn.net/lulei5153" title="与妖为邻CSDN博客" class="" target="_blank"><img src="./img/icon.png" alt="与妖为邻" /></a><div id="time">当前时间</div><iframe id="tianqi" frameborder="0" width="150" height="36" scrolling="no" hspace="0"src="https://i.tianqi.com/?c=code&id=99" style="margin-left: 20px"></iframe><div class="window-btn"><i id="minimize" onclick="minimize()"><img src="/img/最小化.svg" alt="最小化" /></i><i id="maximize" onclick="maximize()"><img src="./img/最大化.svg" alt="最大化" /></i></i><i id="closeMize" onclick="closeMize()"><img src="./img/关闭.svg" alt="关闭" /></i></div></div><div id="content"><div id="left"><h2>收藏网站</h2><hr /><li id="localList"></li></div><div id="centre"><div class="displayBtn"><i id="displayBtn">编辑首页页面按钮</i><marquee behavior="alternate" direction="right" id="closeButton"></marquee><i id="delete"> 删除首页页面按钮</i></div><div id="hidden"><div id="Drag"><p>文本操作</p><i id="closeBtn">&times</i></div><form id="form"><input type="file" name="file" accept="text/plain, text/css, text/html, text/javascript, text/markdown"class="file" /><sub>&lt;a class="a_href" href=" " target="_blank"&gt;&lt;/a&gt;&lt&lt&amp;lt &amp;gt &gt</sub><div><input type="reset" value="重置"><textarea class="textarea" name="textarea" rows="10" cols="50%"placeholder="选择txt、js、css或html文件,文件内容会被自动读取"></textarea><button type="button" class="abb-text">添加</button></div></form></div><div id="memo"></div><button id="author">作者:与妖为邻</button></div><div id="right"><h2>收藏网站</h2><hr /><ul id="webList"></ul></div></div><!-- <script src="./src/renderer.js"></script> -->
</body>
<script>/* 当前时间*/var current_time = document.getElementById("time");function showTime() {var now = new Date();var year = now.getFullYear();var month = now.getMonth() + 1;var day = now.getDate();var hour = now.getHours();var min = now.getMinutes();var second = now.getSeconds();var arr_work = new Array("星期日","星期一","星期二","星期三","星期四","星期五","星期六");var week = arr_work[now.getDay()];month = month < 10 ? "0" + month : month; //时间月份个位补0day = day < 10 ? "0" + day : day;hour = hour < 10 ? "0" + hour : hour;min = min < 10 ? "0" + min : min;second = second < 10 ? "0" + second : second;var time =year +"-" +month +"-" +day +"<sub id='sub'>" +week +"</sub>" +hour +":" +min +":" +second;current_time.innerHTML = time;}window.setInterval(showTime, 1000);showTime();/* 当前时间 结束 *//*最大化、还原窗口*/const maximize = () => {if (!document.fullscreenElement) {document.documentElement.requestFullscreen();} else {if (document.exitFullscreen) {document.exitFullscreen();}}};/* 最大化、还原窗口结束 *//* 关闭窗口*/const closeMize = () => {window.close();};/* 关闭窗口结束*//*缩小窗口*/let originalSize = { width: window.innerWidth, height: window.innerHeight };const minimize = async () => {try {if (document.fullscreenElement) {await document.exitFullscreen();}window.resizeTo(1, 1);window.moveTo(1200, 100);createRestoreButton();} catch (error) {console.error("Error exiting fullscreen: ", error);}};const createRestoreButton = () => {let button = document.createElement("button");button.id = "restore";button.addEventListener("click", restore);document.body.appendChild(button);Object.assign(button.style, {position: "absolute",top: "50%",left: "50%",transform: "translate(-50%, -50%)",backgroundImage: "url('./img/icon.png')",backgroundSize: "contain",backgroundRepeat: "no-repeat",backgroundPosition: "center",width: "100px",height: "100px",border: "none",cursor: "pointer",backgroundColor: "rgba(255, 255, 255, 0)",});};// 恢复窗口到原始大小const restore = () => {console.log("Restore button clicked");window.resizeTo(originalSize.width, originalSize.height);let x = screen.width / 2 - 500;let y = screen.height / 2 - 300;window.moveTo(x, y);document.getElementById("restore").remove();};/*缩小窗口 结束*/// 控制隐藏元素显示与否var hidden = document.querySelector("#hidden");document.getElementById("displayBtn").addEventListener("click", function () {hidden.style.display = "block";});document.getElementById("closeBtn").addEventListener("click", function () {hidden.style.display = "none";});// 拖动元素功能document.querySelector("#Drag").addEventListener("mousedown", function (e) {var x = e.pageX - hidden.offsetLeft;var y = e.pageY - hidden.offsetTop;function move(e) {hidden.style.left = e.pageX - x + "px";hidden.style.top = e.pageY - y + "px";}document.addEventListener("mousemove", move);document.addEventListener("mouseup", function () {document.removeEventListener("mousemove", move);}, { once: true });});// 处理备忘录var upText = document.querySelector(".textarea");var addTo = document.querySelector(".abb-text");var text = document.querySelector("#memo");addTo.onclick = function () {insertHtml(upText.value, '');upText.value = '';upText.focus();saveTodo();};function saveTodo() {let todoArr = Array.from(document.querySelectorAll('.JS_content')).map(content => ({name: content.innerHTML,finish: content.classList.contains('finish')}));localStorage.todoText = JSON.stringify(todoArr);}function loadTodo() {let todoArr = JSON.parse(localStorage.todoText || "[]");todoArr.forEach(todo => {insertHtml(todo.name, todo.finish ? 'finish' : '');});}text.addEventListener("click", function (event) {var tg = event.target;var tgKids = tg.parentElement.children;if (tgKids[0].checked) {tgKids[1].classList.add("finish");} else {tgKids[1].classList.remove("finish");}saveTodo();});document.getElementById("delete").addEventListener("click", function () {if (confirm("是否删除所选?")) {document.querySelectorAll("input[name='checkbox']:checked").forEach(checkbox => {checkbox.parentElement.remove();});saveTodo();}});function insertHtml(val, cls) {text.insertAdjacentHTML("beforeend",`<div class='dddd'><input type="checkbox" name='checkbox'><span class='JS_content ${cls}'>${val}</span></div>`);}// 在页面加载时调用持久化存储的loadTodo()函数loadTodo();window.onload = function () {var text = document.getElementsByName('textarea')[0];var inputFile = document.getElementsByName('file')[0];inputFile.onchange = function () {var reader = new FileReader();reader.readAsText(this.files[0], 'UTF-8');reader.onload = function () {text.value = this.result;};};};// 创建链接列表function createLinkList() {let newWindows = [];const closeAllWindows = () => newWindows.forEach(win => win && !win.closed && win.close(), newWindows = []);const createLinkList = (containerId, links) => {const container = document.getElementById(containerId);links.forEach(link => {const li = document.createElement('li');li.textContent = link.title;if (link.id === 'closeButton') {li.id = link.id;li.onclick = closeAllWindows;} else if (!link.src) {li.classList.add('disabled');} else {li.onclick = () => {const newWindow = window.open(link.src, "_blank", "width=900,height=680,top=200,left=400");if (newWindow) {newWindows.push(newWindow);newWindow.focus();}};}container.appendChild(li);});};const links1 = [{ title: "智能翻译", src: "https://fanyi.baidu.com" },{ title: "哔哩哔哩", src: "https://www.bilibili.com" },{ title: "菜鸟教程", src: "https://www.runoob.com/" },{ title: "Electron中文网", src: "https://www.electronjs.org/zh/docs/latest/" },{ title: "制作ico图标", src: "https://www.bitbug.net" },{ title: "Element组件", src: "https://element-plus.org/zh-CN/" },{ title: "原神大地图", src: "https://act.mihoyo.com/ys/app/interactive-map/index.html?bbs_presentation_style=no_header&lang=zh-cn&utm_source=bbs&utm_medium=mys&utm_campaign=pcicon&_markerFps=24#/map/2?shown_types=NaN,-1084,508,2&center=2008.50,-1084.00&zoom=-3.00" },{ title: "vue.js", src: "https://cn.vuejs.org/" },];const links2 = [{ title: "百度一下,你就知道", src: "https://www.baidu.com" },{ title: "w3schools教程", src: "https://www.w3ccoo.com/" },{ title: "现代JS教程", src: "https://zh.javascript.info/" },{ title: "CSS3D字体", src: "https://www.dedexuexi.com/tool/3D/" },{ title: "MDN网络文档", src: "https://developer.mozilla.org/zh-CN/" },{ title: "UI组件", src: "https://uiverse.io/switches" },{ title: "IconFont图标", src: "https://www.iconfont.cn/" },{ title: "vue图标", src: "https://vue-icons.kalimah-apps.com/" },{ title: "GitHub", src: "https://github.com" }];const links3 = [{ title: "关闭全部新窗口", id: "closeButton" },];createLinkList('localList', links1);createLinkList('webList', links2);createLinkList('closeButton', links3);}createLinkList();</script></html>

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.rhkb.cn/news/362185.html

如若内容造成侵权/违法违规/事实不符,请联系长河编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

检索增强生成RAG系列1--RAG的实现

大模型出现涌现能力之后&#xff0c;针对大模型的应用也如雨后春笋般。但是&#xff0c;在大模型真正落地之前&#xff0c;其实还需要做好最后一公里&#xff0c;而这个最后一公里&#xff0c;其中不同应用有着不同的方法。其中prompt、微调和RAG都是其中方法之一。本系列就是针…

抖音外卖服务商有哪些,盘点这几家正规服务商!

当前&#xff0c;抖音外卖的关注度不断上涨&#xff0c;抖音外卖服务商也逐渐成为了众多创业者心中的理想创业赛道。在此背景下&#xff0c;抖音外卖服务商的入局途径多次引发创业者热议&#xff0c;以抖音外卖服务商有哪些公司为代表的相关话题更是长期位居创业者问题榜单的前…

解决数据丢失问题的MacOS 数据恢复方法

每个人都经历过 Mac 硬盘或 USB 驱动器、数码相机、SD/存储卡等数据丢失的情况。我们中的一些人可能认为已删除或格式化的数据将永远丢失&#xff0c;因此就此作罢。对于 macOS 用户来说&#xff0c;当文件被删除时&#xff0c;垃圾箱已被清空&#xff0c;他们可能不知道如何恢…

【最新综述】基于伪标签的半监督语义分割

Semi-Supervised Semantic Segmentation Based on Pseudo-Labels: A Survey 摘要&#xff1a; 语义分割是计算机视觉领域的一个重要而热门的研究领域&#xff0c;其重点是根据图像中像素的语义对其进行分类。然而&#xff0c;有监督的深度学习需要大量数据来训练模型&#xff…

数据恢复篇:适用于Windows 的顶级数据恢复软件

适用于Windows的免费和付费的最佳数据恢复软件 **嘿&#xff0c;我要和大家一起泄露所有的测试工具。在评论中留下您的想法和最喜欢的选择&#xff01; 适用于 Windows 的最佳数据恢复软件 1.奇客数据恢复 奇客数据恢复版是Microsoft操作系统的顶级数据恢复软件应用程序之一&a…

基于协方差信息的Massive MIMO信道估计算法性能研究

1. 引言 随着移动互联网不断发展&#xff0c;人们对通信的速率和可靠性的要求越来越高[1]。目前第四代移动通信系统已经逐渐商用&#xff0c;研究人员开始着手研究下一代移动通信系统相关技术[2][3]。在下一代移动通信系统中要求下行速率达到10Gbps&#xff0c;这就要求我们使…

怎么把图片转成jpg格式?其他格式快速转换成jpg图片的方法

怎么把图片在线转jpg&#xff1f;jpg格式的图片是现在使用最广泛的一种图片格式&#xff0c;一般在网上传图时都会需要使用jpg格式的图片&#xff0c;那么当手中的图片不满足使用的要求时&#xff0c;如何操作能够快速将其他格式的图片转换jpg格式呢&#xff1f; 下面来教大家…

【Unity】Excel配置工具

1、功能介绍 通过Excel表配置表数据&#xff0c;一键生成对应Excel配置表的数据结构类、数据容器类、已经二进制数据文件&#xff0c;加载二进制数据文件获取所有表数据 需要使用Excel读取的dll包 2、关键代码 2.1 ExcelTool类 实现一键生成Excel配置表的数据结构类、数据…

iptables(11)target(SNAT、DNAT、MASQUERADE、REDIRECT)

简介 前面我们已经介绍了ACCEPT、DROP、REJECT、LOG,这篇文章我们介绍SNAT、DNAT、MASQUERADE、REDIRECT,这几个参数的定义我们在上篇文章中都有介绍,我这里再列出回顾一下 DNAT(目标地址转换)和 SNAT(源地址转换) 原理:修改数据包的源或目标 IP 地址。通常用于 NAT(…

重生之我要学后端0--HTTP协议和RESTful APIs

http和RESTful APIs HTTP协议RESTful APIs设计RESTful API设计实例 HTTP协议 HTTP&#xff08;超文本传输协议&#xff09;是用于分布式、协作式和超媒体信息系统的应用层协议。它是网页数据通讯的基础。工作原理简述如下&#xff1a; 客户端请求&#xff08;Request&#xf…

Linux下Cmake安装或版本更新

下载Cmake源码 https://cmake.org/download/ 找到对应的版本和类型 放进linux环境解压 编译 安装 tar -vxvf cmake-3.13.0.tar.gz cd cmake-3.13.0 ./bootstrap make make install设置环境变量 vi ~/.bashrc在文件尾加入 export PATH/your_path/cmake-3.13.0/bin:$PAT…

【D3.js in Action 3 精译】第一部分 D3.js 基础知识

第一部分 D3.js 基础知识 欢迎来到 D3.js 的世界&#xff01;可能您已经迫不及待想要构建令人惊叹的数据可视化项目了。我们保证&#xff0c;这一目标很快就能达成&#xff01;但首先&#xff0c;我们必须确保您已经掌握了 D3.js 的基础知识。这一部分提到的概念将会在您后续的…

Psychtoolbox 脑电实验范式之mp4视频绘制

1. 读取 首先需要使用到Screen(‘OpenMovie’)函数&#xff0c;该函数可以读取mp4、gif格式的数据&#xff0c;具体方式如下&#xff1a; clear; clc; Screen(Preference, SkipSyncTests, 1); screens Screen(Screens); screenNum max(screens); [window, screenRect] Scr…

AL8807是一款降压型DC/DC转换器,旨在以恒定电流驱动LED,可串联驱动多达9个LED,从6V至36V的电压源

一般描述 AL8807是一款降压型DC/DC转换器&#xff0c;旨在以恒定电流驱动LED。根据LED的正向电压&#xff0c;该设备可串联驱动多达9个LED&#xff0c;从6V至36V的电压源。LED的串联连接提供相同的LED电流&#xff0c;从而实现均匀的亮度&#xff0c;并消除了对镇流电阻…

数学建模 —— 矩阵的运算(上)

目录 调用函数运算 sum : 求和函数 prod : 求乘积函数(product) cumsum : 计算累积和(cumulative sum) diff : 计算差分(difference) mean : 计算平均值 (average) median : 计算中位数 mode : 计算众数 var : 计算方差 (variance) std : 计 算 标 准 差 (standard d…

教程:在 Kubernetes 集群上部署 WordPress 网站

WordPress 是专为每个人设计的开源软件&#xff0c;强调创建网站、博客或应用程序的可访问性、性能、安全性和易用性。WordPress 是一个基于 PHP 的内容管理系统&#xff08;CMS&#xff09;&#xff0c;使用 MySQL 作为数据存储&#xff0c;目前很多网站、电商独立站、个人博客…

华为od-C卷200分题目3 - 两个字符串间的最短路径问题

华为od-C卷200分题目3 - 两个字符串间的最短路径问题 题目描述 给定两个字符串&#xff0c;分别为字符串A与字符串B。 例如A字符串为ABCABBA&#xff0c;B字符串为CBABAC可以得到下图m*n的二维数组&#xff0c;定义原点为(0, 0)&#xff0c;终点为(m, n)&#xff0c;水平与垂…

知识图谱介绍及其应用领域分析

1.知识图谱 知识图谱(Knowledge Graph)乃一种精心设计的技术,旨在储存并整合交织的描述性知识信息。此技术通过构建由实体及其相互关系所组成的网络结构,实现对知识的有序组织与呈现。这些实体涵盖广泛的范畴,包括但不限于具体的物体、事件或抽象概念,它们经由多样化的关…

【论文导读】CCF语音对话与听觉专委会论文导读(2024年第1期)-- INTERSPEECH 2024专题(一)

为促进最新研究成果的传播与交流&#xff0c;CCF语音对话与听觉专委在专委会微信公众号启动论文导读栏目&#xff0c;定期分享最新语音、对话与听觉相关研究方向论文。本期是2024年导读栏目的第1期&#xff0c;也是INTERSPEECH 2024专题第一部分&#xff0c;共遴选了7篇论文&am…

参加六西格玛绿带培训是投资未来,还是花冤枉钱?

是否值得花费资金参加六西格玛绿带培训&#xff0c;取决于多个因素。 从积极的方面来看&#xff0c;参加六西格玛绿带培训具有以下潜在价值&#xff1a; 1. 提升专业技能&#xff1a;使您掌握一套系统的问题解决方法和流程改进工具&#xff0c;有助于在工作中更高效地解决复杂…