项目备份

This commit is contained in:
林觅
2026-04-09 10:37:51 +08:00
parent 7ed8d2dcb4
commit 4eab443148
32 changed files with 9468 additions and 0 deletions

49
static/dexieParse.js Normal file
View File

@@ -0,0 +1,49 @@
// dexie文档https://dexie.org/docs/API-Reference https://www.npmrc.cn/en/Dexie-js.html
class dexieDemo {
dbName = "jafar";
dbVersion = 1;
constructor(dbName, dbVersion) {
if (dbName) {
this.dbName = dbName;
}
if (dbVersion) {
this.dbVersion = dbVersion;
}
this.db = new Dexie(this.dbName);
this.db.version(this.dbVersion).stores(
{ tabName: "++id,nKey,nValue,nTime" }, // 创建表已有表则建立链接id为自增主键仅需要列举需要索引的字段即可
);
}
async get() {
const getLastData = await this.db.tabName.orderBy("id").last();
return getLastData;
}
async post(nKey, nValue) {
await this.db.tabName.add({
nKey: nKey,
nValue: nValue,
nTime: Date.now(),
});
const getLastData = await this.db.tabName.orderBy("id").last();
}
async put(id) {
await this.db.tabName.put({
id: 1,
userName: "zhangsan",
});
}
async del(id) {
await this.db.tabName.delete(id);
}
}
export const myDexie = new dexieDemo();
// document.querySelector("#goto_indexedDB_post").addEventListener("click",async () => {
// let nKey = Math.random()
// let nValue = new Date().getTime();
// await myDexieDemo.post( nKey,nValue );
// })
// document.querySelector("#goto_indexedDB_get").addEventListener("click",async () => {
// console.log( await myDexieDemo.get() )
// })

BIN
static/favicon.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.2 KiB

18
static/script.js Normal file
View File

@@ -0,0 +1,18 @@
// addEventListener 能添加事件
// 鼠标事件 : 如 click点击、dblclick双击、mousedown按下鼠标键、mouseup释放鼠标键、mousemove鼠标移动、mouseenter鼠标进入元素、mouseleave鼠标离开元素、mouseover鼠标悬停和 mouseout鼠标移出
// 键盘事件 : 如 keydown按下键盘键、keyup释放键盘键和 keypress按下字符键已废弃
// 触摸与指针事件 : 如 touchstart触摸开始、touchmove触摸移动、touchend触摸结束、pointerdown指针按下和 pointerup指针释放适用于触屏设备和笔输入。
// 表单事件 : 如 submit表单提交、change值改变、input输入内容、focus获得焦点和 blur失去焦点
// 窗口与页面事件 : 如 load页面加载完成、resize窗口大小改变、scroll滚动、beforeunload页面即将卸载和 unload页面卸载
// 媒体事件 : 如 play媒体开始播放、pause媒体暂停、ended媒体播放结束和 loadeddata媒体数据加载完成
// 自定义事件 : 可以通过 Event 构造函数创建并派发自定义事件,用于应用内部组件通信。
// 监听DOM加载完成事件
document.addEventListener("DOMContentLoaded", function () {
console.log("document加载完成!!!");
});
document.querySelector("#appChildEleButton").addEventListener("click", () => {
const resultDiv = document.getElementById("appChildEle");
resultDiv.innerHTML += `<li>点击添加元素完成</li>`;
});

39
static/styles.css Normal file
View File

@@ -0,0 +1,39 @@
.myFontWenDao {
font-family: myFontWenDao, sans-serif;
}
#app {
border: 1px dotted blueviolet;
border-radius: 3rem;
padding: 2rem;
margin: 1rem;
}
#app .title {
text-align: center;
}
#appChildEleButton {
background-color: whitesmoke;
border: 2px dotted grey;
border-radius: 0.5rem;
}
#appChildEleButton :hover {
opacity: 0.5;
background-color: black;
}
.con {
padding: 0.5rem;
margin: 1rem auto;
border: 1px dotted grey;
border-radius: 1rem;
text-align: center;
width: fit-content;
}
li {
display: block;
}
#localVideo {
display: none;
}