吾爱破解 - 52pojie.cn

 找回密码
 注册[Register]

QQ登录

只需一步,快速开始

查看: 1791|回复: 19
收起左侧

[其他] 图文记事本 本地版(持续升级中)

  [复制链接]
qujianzhan 发表于 2025-3-20 10:07
本帖最后由 qujianzhan 于 2025-3-22 21:00 编辑

图文记事本地版
简介及使用说明:本人利用某AI软件自行设计,为个人使用。文件仅一个单HTLM网页,下载到手机,选择某一种浏览器打开,数据自动保存在本地手机存储中。
友情提醒:勿记重要的个人信息,如帐户,密码等,临事记事本即可。
注意:由于数据存在浏览器的本地缓存上,因些不要清理浏览器缓存数据,该问题我正在更新中(目前pc老板的已更新结束,实现了导入导出数据,近期在调试手机版)
1、支持图文记事。
2、支持多图上传,上传的图片有缩略图,点击可放大查看。
3、支持拍照上传。
4、支持上传DOC等文档,并提供下载。
5、支持单个删除或批量删除日记,批量删除时删除后对话框要点取消选择可消除,但不影响上传。
下载链接:
微信图片_20250320095442.jpg
微信图片_20250320095451.jpg

下载链接.txt

101 Bytes, 下载次数: 52, 下载积分: 吾爱币 -1 CB

免费评分

参与人数 3吾爱币 +3 热心值 +3 收起 理由
ancyxie + 1 + 1 我很赞同!
dukkha739 + 1 + 1 谢谢@Thanks!
yzy93 + 1 + 1 热心回复!

查看全部评分

发帖前要善用论坛搜索功能,那里可能会有你要找的答案或者已经有人发布过相同内容了,请勿重复发帖。

ancyxie 发表于 2025-3-21 08:43
本帖最后由 ancyxie 于 2025-3-21 15:40 编辑

受楼主启发,我用deepseek生成了(又修改了一下,添加了日记记录删除按钮)
指令如下
我是编程小白,请帮我生成一个html网页写日记代码,带一个输入框,三个按钮,分别是“添加图片附件”、“保存”、“另存为”,添加图片需添加到光标下方另起一行处,保存按钮实现在网页下方显示日记记录,每条日记前方加复选框,以日期时间为标题保存,另存为按钮实现选择相应日记另存到指定目录,已html网页形式生成日记。请将以上功能整合到一个html文件代码中,让我可以直接复制代码到html文件中,直接可以运行。

代码如下,复制到txt文件保存后更改扩展名为html,即可在电脑上右键用浏览器打开,日记另存为html网页形式,可指定存在任意目录下,以下载的形式保存,感觉不错,请大家指导,手机上保存需要到浏览器下载列表里去找
[Asm] 纯文本查看 复制代码
001
002
003
004
005
006
007
008
009
010
011
012
013
014
015
016
017
018
019
020
021
022
023
024
025
026
027
028
029
030
031
032
033
034
035
036
037
038
039
040
041
042
043
044
045
046
047
048
049
050
051
052
053
054
055
056
057
058
059
060
061
062
063
064
065
066
067
068
069
070
071
072
073
074
075
076
077
078
079
080
081
082
083
084
085
086
087
088
089
090
091
092
093
094
095
096
097
098
099
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <title>电子日记本</title>
    <style>
        body {
            font-family: 'Microsoft YaHei', sans-serif;
            max-width: 800px;
            margin: 20px auto;
            padding: 20px;
        }
        #editor {
            border: 1px solid #ccc;
            min-height: 200px;
            padding: 10px;
            margin: 10px 0;
            white-space: pre-wrap;
        }
        .button-group button {
            margin: 5px;
            padding: 8px 15px;
            background: #4CAF50;
            color: white;
            border: none;
            border-radius: 4px;
            cursor: pointer;
        }
        .button-group button.delete {
            background: #ff4444;
        }
        .button-group button:hover {
            background: #45a049;
        }
        .button-group button.delete:hover {
            background: #cc0000;
        }
        .entry-item {
            border: 1px solid #ddd;
            margin: 10px 0;
            padding: 10px;
            border-radius: 4px;
        }
        .entry-item input[type="checkbox"] {
            margin-right: 10px;
        }
        .entry-content {
            margin: 10px 0;
            color: #666;
        }
        img {
            max-width: 100%;
            height: auto;
            margin: 5px 0;
        }
    </style>
</head>
<body>
    <div id="editor" contenteditable="true"></div>
    <div class="button-group">
        <button>添加图片附件</button>
        <button>保存</button>
        <button>另存为</button>
        <button class="delete">删除</button>
    </div>
    <div id="entries"></div>
 
    <script>
        function addImage() {
            const input = document.createElement('input');
            input.type = 'file';
            input.accept = 'image/*';
            input.onchange = function(e) {
                const file = e.target.files[0];
                const reader = new FileReader();
                reader.onload = function() {
                    const img = document.createElement('img');
                    img.src = reader.result;
                    const selection = window.getSelection();
                    const range = selection.getRangeAt(0);
                    range.insertNode(document.createElement('br'));
                    range.insertNode(img);
                    range.collapse(false);
                };
                reader.readAsDataURL(file);
            };
            input.click();
        }
 
        function saveEntry() {
            const editor = document.getElementById('editor');
            const timestamp = new Date().getTime();
            const dateStr = new Date().toLocaleString();
             
            const entry = {
                content: editor.innerHTML,
                date: dateStr,
                timestamp: timestamp
            };
 
            localStorage.setItem(`entry_${timestamp}`, JSON.stringify(entry));
            showEntries();
            editor.innerHTML = '';
        }
 
        function showEntries() {
            const entriesDiv = document.getElementById('entries');
            entriesDiv.innerHTML = '';
             
            for (let i = 0; i < localStorage.length; i++) {
                const key = localStorage.key(i);
                if (key.startsWith('entry_')) {
                    const entry = JSON.parse(localStorage.getItem(key));
                    const entryHTML = `
                        <div class="entry-item">
                            <input type="checkbox" id="${entry.timestamp}">
                            <label for="${entry.timestamp}"><strong>${entry.date}</strong></label>
                            <div class="entry-content">${entry.content}</div>
                        </div>
                    `;
                    entriesDiv.innerHTML += entryHTML;
                }
            }
        }
 
        function exportEntries() {
            const checkboxes = document.querySelectorAll('#entries input[type="checkbox"]:checked');
            if (checkboxes.length === 0) {
                alert('请先选择要导出的日记');
                return;
            }
 
            let exportContent = '<html><head><meta charset="UTF-8"><title>导出的日记</title></head><body>';
             
            checkboxes.forEach(checkbox => {
                const entry = JSON.parse(localStorage.getItem(`entry_${checkbox.id}`));
                exportContent += `<h2>${entry.date}</h2>`;
                exportContent += `<div>${entry.content}</div><hr>`;
            });
 
            exportContent += '</body></html>';
 
            const blob = new Blob([exportContent], { type: 'text/html' });
            const url = URL.createObjectURL(blob);
            const a = document.createElement('a');
            a.href = url;
            a.download = `日记_${new Date().toLocaleDateString()}.html`;
            a.click();
            URL.revokeObjectURL(url);
        }
 
        function deleteEntries() {
            const checkboxes = document.querySelectorAll('#entries input[type="checkbox"]:checked');
            if (checkboxes.length === 0) {
                alert('请先选择要删除的日记');
                return;
            }
 
            if (!confirm(`确定要删除选中的 ${checkboxes.length} 篇日记吗?`)) return;
 
            checkboxes.forEach(checkbox => {
                localStorage.removeItem(`entry_${checkbox.id}`);
            });
 
            showEntries();
        }
 
        showEntries();
    </script>
</body>
</html>

不坑人的中学生 发表于 2025-3-24 08:53
看见这忍不住试了下


[HTML] 纯文本查看 复制代码
001
002
003
004
005
006
007
008
009
010
011
012
013
014
015
016
017
018
019
020
021
022
023
024
025
026
027
028
029
030
031
032
033
034
035
036
037
038
039
040
041
042
043
044
045
046
047
048
049
050
051
052
053
054
055
056
057
058
059
060
061
062
063
064
065
066
067
068
069
070
071
072
073
074
075
076
077
078
079
080
081
082
083
084
085
086
087
088
089
090
091
092
093
094
095
096
097
098
099
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>在线笔记 - 类博客平台</title>
  <link href="https://cdn.jsdelivr.net/npm/tinymce@6.4.0/themes/snow/theme.min.css" rel="stylesheet">
  <style>
    body {
      font-family: Arial, sans-serif;
      background-color: #f4f4f4;
      margin: 0;
      padding: 0;
    }
 
    .container {
      width: 80%;
      margin: 20px auto;
      background-color: white;
      padding: 20px;
      border-radius: 10px;
      box-shadow: 0 0 10px rgba(0,0,0,0.1);
    }
 
    h1 {
      text-align: center;
      color: #333;
    }
 
    .note-list {
      margin-top: 20px;
    }
 
    .note-item {
      background-color: #fafafa;
      padding: 10px;
      margin: 10px 0;
      border-radius: 5px;
      box-shadow: 0 0 5px rgba(0,0,0,0.1);
    }
 
    .note-item button {
      background-color: #007bff;
      color: white;
      border: none;
      padding: 5px 10px;
      cursor: pointer;
      border-radius: 5px;
    }
 
    .note-item button:hover {
      background-color: #0056b3;
    }
 
    #editor-container {
      margin-top: 20px;
    }
 
    .footer {
      text-align: center;
      margin-top: 30px;
      font-size: 14px;
      color: #777;
    }
  </style>
</head>
<body>
 
  <div class="container">
    <h1>在线笔记</h1>
     
    <!-- 编辑器容器 -->
    <div id="editor-container"></div>
    <button id="saveNote">保存笔记</button>
     
    <h2>我的笔记</h2>
    <div id="noteList" class="note-list"></div>
     
    <button id="exportMHTML">导出 MHTML</button>
  </div>
 
  <div class="footer">
    <p>版权所有 &#169; 2025 | 在线笔记平台</p>
  </div>
 
  <script src="https://cdn.jsdelivr.net/npm/tinymce@6.4.0/tinymce.min.js"></script>
  <script>
    // 初始化 TinyMCE 编辑器
    tinymce.init({
      selector: '#editor-container',
      plugins: 'link image table code',
      toolbar: 'undo redo | bold italic | alignleft aligncenter alignright | link image table | code',
      height: 400
    });
 
    // 保存笔记
    document.getElementById('saveNote').addEventListener('click', function() {
      const noteContent = tinymce.get('editor-container').getContent(); // 获取编辑器内容
      const notes = JSON.parse(localStorage.getItem('notes')) || [];
      const note = {
        id: Date.now(),
        content: noteContent,
        date: new Date().toISOString()
      };
      notes.push(note);
      localStorage.setItem('notes', JSON.stringify(notes)); // 保存笔记到本地存储
      alert('笔记已保存');
      loadNotes(); // 刷新笔记列表
    });
 
    // 加载笔记列表
    function loadNotes() {
      const notes = JSON.parse(localStorage.getItem('notes')) || [];
      const noteList = document.getElementById('noteList');
      noteList.innerHTML = '';
      notes.forEach(note => {
        const noteItem = document.createElement('div');
        noteItem.classList.add('note-item');
        noteItem.innerHTML = `
          <p><strong>创建时间:</strong> ${note.date}</p>
          <button>查看笔记</button>
          <button>删除</button>
        `;
        noteList.appendChild(noteItem);
      });
    }
 
    // 加载指定笔记到编辑器
    function loadNote(noteId) {
      const notes = JSON.parse(localStorage.getItem('notes')) || [];
      const note = notes.find(n => n.id === noteId);
      if (note) {
        tinymce.get('editor-container').setContent(note.content); // 加载内容到编辑器
      }
    }
 
    // 删除指定笔记
    function deleteNote(noteId) {
      let notes = JSON.parse(localStorage.getItem('notes')) || [];
      notes = notes.filter(n => n.id !== noteId);
      localStorage.setItem('notes', JSON.stringify(notes)); // 更新本地存储
      loadNotes(); // 刷新笔记列表
    }
 
    // 导出为 MHTML
    document.getElementById('exportMHTML').addEventListener('click', function() {
      const content = tinymce.get('editor-container').getContent();
      const blob = new Blob([content], { type: 'text/html' });
      const url = URL.createObjectURL(blob);
       
      const link = document.createElement('a');
      link.href = url;
      link.download = 'note.mhtml';
      link.click();
      URL.revokeObjectURL(url);
    });
 
    // 页面加载时显示笔记列表
    window.onload = loadNotes;
  </script>
   
</body>
</html>

免费评分

参与人数 1吾爱币 +1 热心值 +1 收起 理由
gztf + 1 + 1 谢谢@Thanks!

查看全部评分

头像被屏蔽
poloa1 发表于 2025-3-20 10:15
hhihh 发表于 2025-3-20 10:18
谢谢分享,,这种日记简单实用,,不错的软件
4leafcolver 发表于 2025-3-20 10:19
谢谢分享,这种很受用
1e3e 发表于 2025-3-20 10:29
谢谢分享
yfl 发表于 2025-3-20 14:14
分享出真知
vostro5 发表于 2025-3-20 14:17
谢谢分享 收藏
hubee 发表于 2025-3-20 16:22
没有电脑版吗?
 楼主| qujianzhan 发表于 2025-3-20 16:34
hubee 发表于 2025-3-20 16:22
没有电脑版吗?

电脑上也可以用啊
ancyxie 发表于 2025-3-21 06:15
试了试挺好,指定存储目录最好,不然不敢记很重要的东西,大神加油噢
您需要登录后才可以回帖 登录 | 注册[Register]

本版积分规则

返回列表

RSS订阅|小黑屋|处罚记录|联系我们|吾爱破解 - LCG - LSG ( 京ICP备16042023号 | 京公网安备 11010502030087号 )

GMT+8, 2025-4-17 00:56

Powered by Discuz!

Copyright © 2001-2020, Tencent Cloud.

快速回复 返回顶部 返回列表