first commit
5
.gitignore
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
node_modules
|
||||
.babelrc
|
||||
_notes/
|
||||
src/_notes
|
||||
.vscode/
|
16
LICENSE
Normal file
@@ -0,0 +1,16 @@
|
||||
Pandora.js 3.0.2 - Front-end common function set
|
||||
E-mail:work@pandorastudio.cn Web:https://www.pandorajs.com
|
||||
Copyright (C) 2015-2023 袁涛
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
3235
Pandora.js
Normal file
3262
Pandora.js_bak
Normal file
59
Pandora.min.js
vendored
Normal file
264
README.md
Normal file
@@ -0,0 +1,264 @@
|
||||
# Pandora.js
|
||||
|
||||
#### 专为新手优化的 JavaScript 插件,拥有前端较为常用的功能,属性丰富。
|
||||
|
||||
## 基础方法
|
||||
|
||||
```javascript
|
||||
//提示框
|
||||
window.alert(`文本内容`);
|
||||
//确认框
|
||||
window.confirm(`文本内容`).then(确认回调).catch(取消回调);
|
||||
window.confirm({
|
||||
//文本内容(类型:字符串)
|
||||
content: `提示内容`,
|
||||
//是否显示确认按钮(类型:布尔)
|
||||
showConfirm:true,
|
||||
//确认按钮文本(类型:字符串)
|
||||
confirmText: `确认`,
|
||||
//是否显示取消按钮(类型:布尔)
|
||||
showCancel:true,
|
||||
//取消按钮文本(类型:字符串)
|
||||
cancelText: `取消`,
|
||||
//点击确定(类型:方法)
|
||||
success() {},
|
||||
//点击取消(类型:方法)
|
||||
fail() {},
|
||||
});
|
||||
```
|
||||
|
||||
> 重置后的alert和confirm可修改样式(建议放置于样式表最顶部)
|
||||
```css
|
||||
:root{
|
||||
//alert背景色
|
||||
--alertTheme: white;
|
||||
//alert遮罩颜色
|
||||
--alertBg: inherit;
|
||||
//alert字体大小
|
||||
--alertFontSize: 1.2rem;
|
||||
//alert字体颜色
|
||||
--alertColor: #000;
|
||||
//confirm背景色
|
||||
--confirmTheme: white;
|
||||
//confirm遮罩颜色
|
||||
--confirmBg: inherit;
|
||||
//confirm字体大小
|
||||
--confirmFontSize: 1.2rem;
|
||||
//confirm字体颜色
|
||||
--confirmColor: #000;
|
||||
//confirm按钮颜色
|
||||
--confirmBtnBg: #8477b6;
|
||||
//confirm按钮字体颜色
|
||||
--confirmBtnColor: #fff;
|
||||
}
|
||||
```
|
||||
|
||||
```javascript
|
||||
//显示加载蒙层
|
||||
window.showLoading();
|
||||
window.showLoading(`可传入数字作为进度显示`);
|
||||
//隐藏加载蒙层
|
||||
window.hideLoading();
|
||||
```
|
||||
|
||||
> 必须在 \$ 关键字未被占用情况下使用否则请使用 new Pandora
|
||||
> 示例:new Pandora(`元素`).css(`width`);
|
||||
|
||||
## DOM 操作
|
||||
|
||||
```javascript
|
||||
//获取原生dom元素
|
||||
$(`元素`).get;
|
||||
//遍历元素
|
||||
$(`元素`).each((current, index) => {});
|
||||
//选择父级元素
|
||||
$(`元素`).parent();
|
||||
//选择子级元素
|
||||
$(`元素`).child(`p`);
|
||||
//选择指定下标元素
|
||||
$(`元素`).eq(0);
|
||||
//选择其他同级元素
|
||||
$(`元素`).siblings(`元素`);
|
||||
//选择上一个同级元素
|
||||
$(`元素`).prev();
|
||||
//选择下一个同级元素
|
||||
$(`元素`).next();
|
||||
//选择第一个同级元素
|
||||
$(`元素`).first();
|
||||
//选择最后一个同级元素
|
||||
$(`元素`).last();
|
||||
```
|
||||
|
||||
```javascript
|
||||
//获取样式
|
||||
$(`元素`).css(`width`);
|
||||
//设置样式
|
||||
$(`元素`).css({ `width`: `200px`});
|
||||
//获取宽度
|
||||
$(`元素`).width();
|
||||
//设置宽度
|
||||
$(`元素`).width(`200px`);
|
||||
//获取高度
|
||||
$(`元素`).height();
|
||||
//设置高度
|
||||
$(`元素`).height(`200px`);
|
||||
//获取布局信息
|
||||
$(`元素`).offset();
|
||||
```
|
||||
|
||||
```javascript
|
||||
//获取文本内容
|
||||
$(`元素`).text();
|
||||
//修改文本内容
|
||||
$(`元素`).text(`文字`);
|
||||
```
|
||||
|
||||
```javascript
|
||||
//获取值
|
||||
$(`元素`).val();
|
||||
//修改值
|
||||
$(`元素`).val(`值`);
|
||||
```
|
||||
|
||||
```javascript
|
||||
//获取页面结构
|
||||
$(`元素`).html();
|
||||
//插入页面结构
|
||||
$(`元素`).html(`插入的内容`);
|
||||
```
|
||||
|
||||
```javascript
|
||||
//在...之前插入结构
|
||||
$(`元素`).prepend(`<dfn>在...之前插入的dfn标签</dfn>`);
|
||||
//在...之后插入结构
|
||||
$(`元素`).append(`<i>在...之后插入的i标签</i>`);
|
||||
```
|
||||
|
||||
```javascript
|
||||
//清空容器
|
||||
$(`元素`).empty();
|
||||
//移除元素
|
||||
$(`要移除的元素`).remove();
|
||||
```
|
||||
|
||||
```javascript
|
||||
//是否含有class(返回true或false)
|
||||
$(`元素`).hasClass(`class名`);
|
||||
//添加class
|
||||
$(`元素`).addClass(`class名`);
|
||||
//移除class
|
||||
$(`元素`).removeClass(`class名`);
|
||||
```
|
||||
|
||||
```javascript
|
||||
//获取属性
|
||||
$(`元素`).attr(`属性名`);
|
||||
//添加属性
|
||||
$(`元素`).attr(`属性名`, `属性值`);
|
||||
//添加多条属性
|
||||
$(`元素`).attr({`属性名1`: `属性值1`,`属性名2`: `属性值2`});
|
||||
//移除属性
|
||||
$(`元素`).removeAttr(`属性名`);
|
||||
```
|
||||
|
||||
```javascript
|
||||
//显示
|
||||
$(`元素`).show(callback);
|
||||
//隐藏
|
||||
$(`元素`).hide(callback);
|
||||
//淡入
|
||||
$(`元素`).fadeIn("fast",callback);
|
||||
//淡出
|
||||
$(`元素`).fadeOut("slow",callback);
|
||||
```
|
||||
|
||||
## 数据交互
|
||||
|
||||
```javascript
|
||||
//ajax
|
||||
//以下所有参数值均为默认值
|
||||
$().ajax({
|
||||
//接口地址(类型:字符串)
|
||||
url: null,
|
||||
//请求类型(类型:字符串)
|
||||
type: "get",
|
||||
//是否异步请求(类型:布尔)
|
||||
async: false,
|
||||
//设置请求头(类型:JSON)
|
||||
headers: { "Content-Type": "application/json" },
|
||||
//发送数据类型(类型:字符串;可选参数:json、form)
|
||||
dataType: "json",
|
||||
//发送数据(类型:json或form;格式必须和发送数据类型保持一致)
|
||||
data: null,
|
||||
//请求中回调方法(类型:方法;返回类型:数字)
|
||||
progress: null,
|
||||
//成功回调方法(类型:方法;返回类型:对象)
|
||||
success: null,
|
||||
//失败回调方法(类型:方法)
|
||||
error: null
|
||||
});
|
||||
```
|
||||
|
||||
```javascript
|
||||
//fetch
|
||||
//以下所有参数值均为默认值
|
||||
$().fetch({
|
||||
//接口地址(类型:字符串)
|
||||
url: null,
|
||||
//请求类型(类型:字符串)
|
||||
type: "get",
|
||||
//设置请求头(类型:JSON)
|
||||
headers: { "Content-Type": "application/json" },
|
||||
//发送数据(类型:JSON)
|
||||
data: null,
|
||||
//返回数据格式化(类型:方法)
|
||||
returnData:function(res) {
|
||||
return res.json();
|
||||
},
|
||||
//成功回调方法(类型:方法;返回类型:对象)
|
||||
success: null,
|
||||
//失败回调方法(类型:方法)
|
||||
error: null
|
||||
});
|
||||
```
|
||||
|
||||
```javascript
|
||||
//表单序列化
|
||||
$(`表单`).serialize();
|
||||
|
||||
//获取url参数并转换成对象
|
||||
$().getParams();
|
||||
```
|
||||
|
||||
## 事件交互
|
||||
|
||||
```javascript
|
||||
//点击事件
|
||||
$(`元素`).click(callback);
|
||||
//长按事件
|
||||
$(`元素`).taping(callback);
|
||||
//事件绑定
|
||||
$("元素").bind("事件名", callback, 是否捕获);
|
||||
//事件解绑
|
||||
$("元素").unbind("事件名");
|
||||
|
||||
// 打乱数组
|
||||
$([0,1,2]).Array.Random(); //[1,2,0]
|
||||
//是否存在重复
|
||||
$([0,1,1]).Array.hasRepeat(); //true
|
||||
// 数组求和
|
||||
$([1,1,1]).Array.Sum(); //3
|
||||
```
|
||||
|
||||
## 全局修改
|
||||
|
||||
```javascript
|
||||
//是否开启插件跟踪统计(默认开启)
|
||||
window.enableTrack = true;
|
||||
//是否启用内置alert(默认开启)
|
||||
window.resetAlert = true;
|
||||
//是否启用内置confirm(默认开启)
|
||||
window.resetConfirm = true;
|
||||
|
||||
//tips:大多数函数均支持链式写法,包括构造函数和拓展函数
|
||||
```
|
234
davinci.html
Normal file
@@ -0,0 +1,234 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<title>davinci</title>
|
||||
<style>
|
||||
body {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
section {
|
||||
display: flex;
|
||||
justify-content: space-around;
|
||||
width: 80%;
|
||||
margin: 0 auto;
|
||||
}
|
||||
|
||||
fieldset {
|
||||
width: 48%;
|
||||
}
|
||||
|
||||
.edit_box {
|
||||
width: 512px;
|
||||
height: 512px;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.edit_box .mask {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
z-index: 2;
|
||||
}
|
||||
|
||||
.disable {
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
.edit_box .img {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
z-index: 1;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.edit_box img {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<section>
|
||||
<fieldset>
|
||||
<legend>需要修改的图片:</legend>
|
||||
<form>
|
||||
<div class="edit_box">
|
||||
<div class="mask disable"></div>
|
||||
<div class="img">
|
||||
<label for="image">点击选择图片</label>
|
||||
<input type="file" id="image" name="image" accept="image/png" hidden />
|
||||
</div>
|
||||
</div>
|
||||
<textarea id="prompt" placeholder="请输入修改描述词" name="prompt"></textarea>
|
||||
<button id="upload" disabled>上传&修改</button>
|
||||
</form>
|
||||
</fieldset>
|
||||
<fieldset>
|
||||
<legend>修改后的图片:</legend>
|
||||
<div class="result"></div>
|
||||
</fieldset>
|
||||
</section>
|
||||
</body>
|
||||
<script src="dist/Pandora.min.js"></script>
|
||||
<script>
|
||||
let userImg, userPrompt, timer;
|
||||
|
||||
// 选择图片
|
||||
$( "#image" ).bind( "change", e => {
|
||||
const { files } = e.target;
|
||||
const file = files[ 0 ];
|
||||
|
||||
// 判读文件是否大于4M
|
||||
if ( file.size > 4 * 1024 * 1024 ) {
|
||||
alert( "文件不能大于4M" );
|
||||
return;
|
||||
}
|
||||
// 清空img里面的内容
|
||||
$( ".img" ).empty();
|
||||
|
||||
const reader = new FileReader();
|
||||
reader.readAsDataURL( file );
|
||||
reader.onload = () => {
|
||||
const img = new Image();
|
||||
img.src = reader.result;
|
||||
|
||||
img.onload = () => {
|
||||
//把图片按中心裁切为512*512的尺寸
|
||||
const canvas = document.createElement( "canvas" );
|
||||
const ctx = canvas.getContext( "2d" );
|
||||
const { width, height } = img;
|
||||
const min = Math.min( width, height );
|
||||
canvas.width = 512;
|
||||
canvas.height = 512;
|
||||
ctx.drawImage( img, ( width - min ) / 2, ( height - min ) / 2, min, min, 0, 0, 512, 512 );
|
||||
|
||||
// 把canvas转为图片
|
||||
const result = canvas.toDataURL( "image/png" );
|
||||
$( ".img" ).append( `<img src="${ result }" />` );
|
||||
// 把result转换为二进制文件流
|
||||
const file = base64tofile( result );
|
||||
userImg = file;
|
||||
|
||||
// 移除mask的disable属性
|
||||
$( ".mask" ).removeClass( "disable" );
|
||||
// 在mask中添加一个canvas画板
|
||||
$( ".mask" ).append( `<canvas width="512" height="512"></canvas>` );
|
||||
const maskCanvas = $( ".mask canvas" ).get;
|
||||
const maskCtx = maskCanvas.getContext( "2d" );
|
||||
maskCtx.strokeStyle = "#000";
|
||||
maskCtx.lineWidth = 30;
|
||||
maskCtx.lineCap = "round";
|
||||
maskCtx.lineJoin = "round";
|
||||
let isDrawing = false;
|
||||
let lastX = 0;
|
||||
let lastY = 0;
|
||||
function draw ( e ) {
|
||||
if ( !isDrawing ) return;
|
||||
maskCtx.beginPath();
|
||||
maskCtx.moveTo( lastX, lastY );
|
||||
maskCtx.lineTo( e.offsetX, e.offsetY );
|
||||
maskCtx.stroke();
|
||||
[ lastX, lastY ] = [ e.offsetX, e.offsetY ];
|
||||
}
|
||||
maskCanvas.addEventListener( "mousedown", e => {
|
||||
isDrawing = true;
|
||||
[ lastX, lastY ] = [ e.offsetX, e.offsetY ];
|
||||
} );
|
||||
maskCanvas.addEventListener( "mousemove", draw );
|
||||
maskCanvas.addEventListener( "mouseup", () => ( isDrawing = false ) );
|
||||
maskCanvas.addEventListener( "mouseout", () => ( isDrawing = false ) );
|
||||
};
|
||||
};
|
||||
} );
|
||||
|
||||
// 点击上传按钮
|
||||
$( "#upload" ).bind( "click", e => {
|
||||
e.preventDefault();
|
||||
// 获取用户输入的描述词
|
||||
userPrompt = $( "textarea" ).val();
|
||||
// 判读userImg和userPrompt是否存在
|
||||
if ( !userImg || !userPrompt ) {
|
||||
alert( "请先选择图片和输入描述词" );
|
||||
return;
|
||||
}
|
||||
// 获取mask中画板的内容
|
||||
const mask = $( ".mask canvas" ).get.toDataURL( "image/png" );
|
||||
// 把mask转换为二进制文件流
|
||||
const maskFile = base64tofile( mask );
|
||||
// 创建一个新的表单对象
|
||||
const formData = new FormData();
|
||||
// 把用户输入的描述词和图片添加到表单中
|
||||
formData.append( "image", userImg );
|
||||
formData.append( "prompt", userPrompt );
|
||||
formData.append( "mask", maskFile );
|
||||
|
||||
let time = 0;
|
||||
// 生成过程中显示loading并开始计时
|
||||
timer = setInterval( () => {
|
||||
// loading中显示计时
|
||||
time++;
|
||||
window.showLoading( `生成中...${ time }s` );
|
||||
}, 1000 );
|
||||
$()
|
||||
.ajax( {
|
||||
url: "https://api-test.pandorastudio.cn/common/image",
|
||||
type: "post",
|
||||
dataType: "form",
|
||||
headers: null,
|
||||
data: formData,
|
||||
async: true,
|
||||
} )
|
||||
.then( res => {
|
||||
const { data } = res;
|
||||
$( ".result" ).empty();
|
||||
$( ".result" ).append( `<img src="${ data }" />` );
|
||||
} )
|
||||
.finally( () => {
|
||||
// 清除计时器
|
||||
clearInterval( timer );
|
||||
window.hideLoading();
|
||||
} );
|
||||
} );
|
||||
|
||||
// 监听prompt的输入
|
||||
$( "textarea" ).bind( "input", e => {
|
||||
const { value } = e.target;
|
||||
if ( value && userImg ) {
|
||||
$( "#upload" ).removeAttr( "disabled" );
|
||||
userPrompt = value;
|
||||
} else {
|
||||
$( "#upload" ).attr( "disabled", "disabled" );
|
||||
}
|
||||
} );
|
||||
|
||||
// base64转文件流
|
||||
function base64tofile ( base64, name ) {
|
||||
const arr = base64.split( "," );
|
||||
const mime = arr[ 0 ].match( /:(.*?);/ )[ 1 ];
|
||||
const bstr = atob( arr[ 1 ] );
|
||||
let n = bstr.length;
|
||||
let u8arr = new Uint8Array( n );
|
||||
// 如果name为空,就默认为时间戳
|
||||
if ( !name ) {
|
||||
name = new Date().getTime();
|
||||
}
|
||||
while ( n-- ) {
|
||||
u8arr[ n ] = bstr.charCodeAt( n );
|
||||
}
|
||||
return new File( [ u8arr ], name, { type: mime } );
|
||||
}
|
||||
</script>
|
||||
|
||||
</html>
|
91
dist/Pandora.min.js
vendored
Normal file
94
dist/atom-one-light.css
vendored
Normal file
@@ -0,0 +1,94 @@
|
||||
/*
|
||||
|
||||
Atom One Light by Daniel Gamage
|
||||
Original One Light Syntax theme from https://github.com/atom/one-light-syntax
|
||||
|
||||
base: #fafafa
|
||||
mono-1: #383a42
|
||||
mono-2: #686b77
|
||||
mono-3: #a0a1a7
|
||||
hue-1: #0184bb
|
||||
hue-2: #4078f2
|
||||
hue-3: #a626a4
|
||||
hue-4: #50a14f
|
||||
hue-5: #e45649
|
||||
hue-5-2: #c91243
|
||||
hue-6: #986801
|
||||
hue-6-2: #c18401
|
||||
|
||||
*/
|
||||
|
||||
.hljs {
|
||||
color: #383a42;
|
||||
background: #fafafa;
|
||||
}
|
||||
|
||||
.hljs-comment,
|
||||
.hljs-quote {
|
||||
color: #a0a1a7;
|
||||
font-style: italic;
|
||||
}
|
||||
|
||||
.hljs-doctag,
|
||||
.hljs-keyword,
|
||||
.hljs-formula {
|
||||
color: #a626a4;
|
||||
}
|
||||
|
||||
.hljs-section,
|
||||
.hljs-name,
|
||||
.hljs-selector-tag,
|
||||
.hljs-deletion,
|
||||
.hljs-subst {
|
||||
color: #e45649;
|
||||
}
|
||||
|
||||
.hljs-literal {
|
||||
color: #0184bb;
|
||||
}
|
||||
|
||||
.hljs-string,
|
||||
.hljs-regexp,
|
||||
.hljs-addition,
|
||||
.hljs-attribute,
|
||||
.hljs-meta .hljs-string {
|
||||
color: #50a14f;
|
||||
}
|
||||
|
||||
.hljs-attr,
|
||||
.hljs-variable,
|
||||
.hljs-template-variable,
|
||||
.hljs-type,
|
||||
.hljs-selector-class,
|
||||
.hljs-selector-attr,
|
||||
.hljs-selector-pseudo,
|
||||
.hljs-number {
|
||||
color: #986801;
|
||||
}
|
||||
|
||||
.hljs-symbol,
|
||||
.hljs-bullet,
|
||||
.hljs-link,
|
||||
.hljs-meta,
|
||||
.hljs-selector-id,
|
||||
.hljs-title {
|
||||
color: #4078f2;
|
||||
}
|
||||
|
||||
.hljs-built_in,
|
||||
.hljs-title.class_,
|
||||
.hljs-class .hljs-title {
|
||||
color: #c18401;
|
||||
}
|
||||
|
||||
.hljs-emphasis {
|
||||
font-style: italic;
|
||||
}
|
||||
|
||||
.hljs-strong {
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.hljs-link {
|
||||
text-decoration: underline;
|
||||
}
|
1207
dist/highlight.min.js
vendored
Normal file
3
dist/markdown-it.min.js
vendored
Normal file
259
gpt.html
Normal file
@@ -0,0 +1,259 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<title>问·想</title>
|
||||
<script src="dist/Pandora.min.js"></script>
|
||||
<script>
|
||||
$("html").AutoSize();
|
||||
</script>
|
||||
<style>
|
||||
:root {
|
||||
--alertFontSize: 0.15rem;
|
||||
--alertBg: rgba(0, 0, 0, 0);
|
||||
--confirmFontSize: 0.15rem;
|
||||
--confirmBg: rgba(0, 0, 0, 0);
|
||||
}
|
||||
body {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
font-family: "Microsoft YaHei", "Helvetica Neue", Helvetica, Arial, sans-serif;
|
||||
background: #edede9;
|
||||
overflow: hidden;
|
||||
}
|
||||
/* 自定义滚动条样式 */
|
||||
::-webkit-scrollbar {
|
||||
width: 5px;
|
||||
height: 5px;
|
||||
}
|
||||
::-webkit-scrollbar-track {
|
||||
background: #fff;
|
||||
}
|
||||
::-webkit-scrollbar-thumb {
|
||||
background: #ccc;
|
||||
border-radius: 5px;
|
||||
}
|
||||
::-webkit-scrollbar-thumb:hover {
|
||||
background: #aaa;
|
||||
}
|
||||
section {
|
||||
width: 90%;
|
||||
height: 100vh;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
margin: 0 auto;
|
||||
font-size: 0.4rem;
|
||||
}
|
||||
section article {
|
||||
width: 100%;
|
||||
height: 70%;
|
||||
overflow: auto;
|
||||
padding: 20px;
|
||||
box-shadow: 0 0 10px 5px rgba(0, 0, 0, 0.08);
|
||||
border-radius: 15px;
|
||||
margin: 2vh auto;
|
||||
box-sizing: border-box;
|
||||
flex-shrink: 0;
|
||||
background: #e5e5e5;
|
||||
}
|
||||
section article .left,
|
||||
section article .right {
|
||||
margin: 10px 0;
|
||||
line-height: 1.5;
|
||||
color: white;
|
||||
max-width: 60%;
|
||||
padding: 10px 20px;
|
||||
box-sizing: border-box;
|
||||
clear: both;
|
||||
border-radius: 15px;
|
||||
font-size: 0.45em;
|
||||
font-family: "Microsoft YaHei", "Helvetica Neue", Helvetica, Arial, sans-serif;
|
||||
}
|
||||
section article .left {
|
||||
float: left;
|
||||
background: #57cc99;
|
||||
border-top-left-radius: 0;
|
||||
}
|
||||
section article .right {
|
||||
float: right;
|
||||
background: #3a86ff;
|
||||
color: white;
|
||||
border-bottom-right-radius: 0;
|
||||
}
|
||||
section textarea {
|
||||
width: 100%;
|
||||
height: 4.5em;
|
||||
resize: none;
|
||||
padding: 10px;
|
||||
box-sizing: border-box;
|
||||
flex-shrink: 0;
|
||||
margin: 2vh auto;
|
||||
border: 0;
|
||||
font-size: 0.5em;
|
||||
font-family: "Microsoft YaHei", "Helvetica Neue", Helvetica, Arial, sans-serif;
|
||||
background: #e5e5e5;
|
||||
box-shadow: 0 0 10px 5px rgba(0, 0, 0, 0.08);
|
||||
border-radius: 15px;
|
||||
}
|
||||
section textarea:focus {
|
||||
outline: #40a9ff solid 1px;
|
||||
}
|
||||
section button {
|
||||
border: none;
|
||||
outline: none;
|
||||
background: #000;
|
||||
color: #fff;
|
||||
cursor: pointer;
|
||||
padding: 10px;
|
||||
box-shadow: 0 0 5px 5px rgba(0, 0, 0, 0.08);
|
||||
}
|
||||
section .buttons {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
section .buttons button {
|
||||
border-radius: 15px;
|
||||
font-size: 0.5em;
|
||||
margin: 0 0.5em;
|
||||
padding: 10px 30px;
|
||||
}
|
||||
section .buttons #reload {
|
||||
background: #ff4d4f;
|
||||
}
|
||||
section .buttons #submit {
|
||||
background: #40a9ff;
|
||||
}
|
||||
#Pd_loader {
|
||||
font-size: 0.2rem !important;
|
||||
}
|
||||
section article pre,
|
||||
section article p {
|
||||
margin: 0;
|
||||
white-space: break-spaces;
|
||||
word-break: break-all;
|
||||
}
|
||||
section article pre {
|
||||
background: #fafafa;
|
||||
padding: 1em;
|
||||
border-radius: 15px;
|
||||
margin: 0.5em 0;
|
||||
}
|
||||
section article a {
|
||||
color: #f6bd60;
|
||||
}
|
||||
</style>
|
||||
<link rel="stylesheet" href="dist/atom-one-light.css" />
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<section>
|
||||
<article></article>
|
||||
<textarea placeholder="请在这里输入你的提问..."></textarea>
|
||||
<div class="buttons"><button id="reload">重新发问</button><button id="submit">提问</button></div>
|
||||
</section>
|
||||
</body>
|
||||
<script src="dist/markdown-it.min.js"></script>
|
||||
<script src="dist/highlight.min.js"></script>
|
||||
<script>
|
||||
const md = window.markdownit();
|
||||
md.set({ linkify: true, typographer: true, breaks: true });
|
||||
const messages = [];
|
||||
let timer = null;
|
||||
|
||||
confirm({
|
||||
content: `欢迎使用问·想`,
|
||||
showCancel: false,
|
||||
confirmText: "进入",
|
||||
});
|
||||
|
||||
// 提交问题
|
||||
function questionSubmit() {
|
||||
const question = $("textarea").val().trim();
|
||||
if (question == "") {
|
||||
alert("请输入内容");
|
||||
return;
|
||||
}
|
||||
|
||||
$("textarea").blur();
|
||||
|
||||
let loadTime = 0;
|
||||
window.showLoading(`正在思考中... ${loadTime++}s`);
|
||||
timer = setInterval(() => {
|
||||
window.showLoading(`正在思考中... ${loadTime++}s`);
|
||||
}, 1000);
|
||||
$("article").append(`<p class="right">${question.toString()}</p>`);
|
||||
|
||||
//延时滚动到底部
|
||||
$("article").get.scrollTo({ top: $("article").get.scrollHeight, behavior: "smooth" });
|
||||
messages.splice(0, 0, { role: "user", content: question.toString() });
|
||||
|
||||
$()
|
||||
.ajax({
|
||||
url: "https://api.pandorastudio.cn/common/chat",
|
||||
type: "POST",
|
||||
data: { messages: JSON.stringify(messages.reverse()), model: "gpt-3.5-turbo" },
|
||||
async: true,
|
||||
})
|
||||
.then(res => {
|
||||
const { code, data } = res;
|
||||
if (code == 200) {
|
||||
// 生成时间戳id
|
||||
const id = new Date().getTime();
|
||||
$("article").append(`<div id="ass_${id}" class="left">${data[0].message.content}</div>`);
|
||||
// 解析markdown
|
||||
$(`#ass_${id}`).html(md.render($(`#ass_${id}`).html()));
|
||||
// 高亮html
|
||||
$(`#ass_${id}`)
|
||||
.get.querySelectorAll("code")
|
||||
.forEach(el => {
|
||||
// then highlight each
|
||||
hljs.highlightElement(el);
|
||||
});
|
||||
|
||||
messages.splice(0, 0, { role: "assistant", content: data[0].message.content });
|
||||
|
||||
// 清空输入框所有内容,删除换行符
|
||||
$("textarea").val("");
|
||||
} else {
|
||||
const { message } = JSON.parse(res.err).error;
|
||||
alert(message);
|
||||
}
|
||||
})
|
||||
.catch(err => {
|
||||
confirm({
|
||||
content: `发生错误:${JSON.stringify(err)}`,
|
||||
confirmText: "重新发送",
|
||||
}).then(questionSubmit);
|
||||
})
|
||||
.finally(() => {
|
||||
clearInterval(timer);
|
||||
window.hideLoading();
|
||||
|
||||
//延时滚动到底部
|
||||
$("article").get.scrollTo({
|
||||
top: $("article").get.scrollHeight,
|
||||
behavior: "smooth",
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
// 点击提交按钮
|
||||
$("#submit").click(questionSubmit);
|
||||
// 监听回车键
|
||||
$("textarea").bind("keydown", e => {
|
||||
if (e.keyCode == 13) {
|
||||
e.preventDefault();
|
||||
questionSubmit();
|
||||
}
|
||||
});
|
||||
|
||||
// 重新发问
|
||||
$("#reload").click(() => {
|
||||
$("article").empty();
|
||||
messages.splice(0, messages.length);
|
||||
});
|
||||
</script>
|
||||
</html>
|
67
gulpfile.js
Normal file
@@ -0,0 +1,67 @@
|
||||
const fs = require("fs");
|
||||
const gulp = require("gulp");
|
||||
const uglify = require("gulp-uglify");
|
||||
const header = require("gulp-header");
|
||||
const License = fs.readFileSync("LICENSE");
|
||||
const chinese2unicode = require("gulp-chinese2unicode");
|
||||
const ftpModule = require("ftp");
|
||||
|
||||
const ftpConfig = {
|
||||
host: "115.28.154.128",
|
||||
port: "21",
|
||||
user: "vscode",
|
||||
password: "MPzFE5tRThAMGnZf",
|
||||
remotePath: "/",
|
||||
connTimeout: 20000,
|
||||
};
|
||||
const ftp = new ftpModule();
|
||||
|
||||
// 构建
|
||||
gulp.task("minify", async () => {
|
||||
console.log("开始构建...");
|
||||
gulp
|
||||
.src("Pandora.min.js", {
|
||||
//sourcemaps: true,
|
||||
})
|
||||
.pipe(uglify())
|
||||
.pipe(chinese2unicode())
|
||||
.pipe(header(`/*\n${License.toString("utf-8")}\n*/\n`))
|
||||
.on("data", function () {
|
||||
console.log("构建完成!");
|
||||
})
|
||||
.pipe(
|
||||
gulp.dest("./", {
|
||||
// sourcemaps: ".",
|
||||
})
|
||||
);
|
||||
});
|
||||
|
||||
// 上传
|
||||
const uploadFile = fileName => {
|
||||
return new Promise((success, fail) => {
|
||||
ftp.put(fileName, fileName, err => {
|
||||
if (err) {
|
||||
console.log(err);
|
||||
fail(err);
|
||||
} else {
|
||||
success();
|
||||
}
|
||||
});
|
||||
});
|
||||
};
|
||||
gulp.task("upload", async () => {
|
||||
ftp.connect(ftpConfig);
|
||||
ftp.on("ready", e => {
|
||||
console.info("开始发布...");
|
||||
const uploadList = [uploadFile("Pandora.min.js"), uploadFile("Pandora.min.js.map")];
|
||||
|
||||
Promise.all(uploadList)
|
||||
.then(() => {
|
||||
console.info("发布成功!");
|
||||
ftp.end();
|
||||
})
|
||||
.catch(err => {
|
||||
console.error(`发布失败!${err}`);
|
||||
});
|
||||
});
|
||||
});
|
36
index.html
Normal file
@@ -0,0 +1,36 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<title></title>
|
||||
</head>
|
||||
<body>
|
||||
<b>1111</b>
|
||||
<div class="app"></div>
|
||||
<a href="/test?id=1">测试</a>
|
||||
<a href="http://baidu.com">百度</a>
|
||||
<a href="#a">锚点</a>
|
||||
</body>
|
||||
<script src="./dist/Pandora.min.js"></script>
|
||||
<script>
|
||||
const app = $('.app').Router({
|
||||
routes: [
|
||||
{
|
||||
path: '/',
|
||||
component: `./template/home/`,
|
||||
callback: () => {
|
||||
console.log('Home')
|
||||
$('b').text(3333)
|
||||
},
|
||||
},
|
||||
{
|
||||
path: '/test',
|
||||
component: `./template/test/`,
|
||||
callback: query => {
|
||||
console.log(query)
|
||||
},
|
||||
},
|
||||
],
|
||||
})
|
||||
</script>
|
||||
</html>
|
9
kit.html
Normal file
@@ -0,0 +1,9 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<title></title>
|
||||
</head>
|
||||
<body></body>
|
||||
<script src="kit.js"></script>
|
||||
</html>
|
129
kit.js
Normal file
@@ -0,0 +1,129 @@
|
||||
require("three/build/three");
|
||||
require("three/examples/js/loaders/GLTFLoader");
|
||||
require("three/examples/js/controls/TrackballControls");
|
||||
|
||||
// 工具组
|
||||
const Kit = {
|
||||
// 添加事件
|
||||
addCaster(renderer, camera, objects, click) {
|
||||
let raycaster, mouse;
|
||||
raycaster = new THREE.Raycaster();
|
||||
mouse = new THREE.Vector2();
|
||||
|
||||
$("#model").bind("click", onDocumentMouseDown, false);
|
||||
$("#model").bind("touchstart", onDocumentMouseDown, false);
|
||||
|
||||
function onDocumentMouseDown(event) {
|
||||
event.preventDefault();
|
||||
try {
|
||||
mouse.x = (event.touches[0].clientX / renderer.domElement.clientWidth) * 2 - 1;
|
||||
mouse.y = -(event.touches[0].clientY / renderer.domElement.clientHeight) * 2 + 1;
|
||||
} catch (err) {
|
||||
mouse.x = (event.clientX / renderer.domElement.clientWidth) * 2 - 1;
|
||||
mouse.y = -(event.clientY / renderer.domElement.clientHeight) * 2 + 1;
|
||||
}
|
||||
|
||||
raycaster.setFromCamera(mouse, camera);
|
||||
const intersects = raycaster.intersectObjects(objects);
|
||||
|
||||
for (let a = 0; a < intersects.length; a++) {
|
||||
click && click(intersects[a]);
|
||||
}
|
||||
}
|
||||
},
|
||||
// gLTF格式模型
|
||||
gLTFModel(options) {
|
||||
const { ele, src, minDistance, maxDistance, rotateSpeed, AmbientLight, DirectionalLight, SpotLight, cameraPosition, setMate, loading, click } = options;
|
||||
const that = this;
|
||||
|
||||
return new Promise(next => {
|
||||
let container, camera, scene, renderer, controls;
|
||||
let { width, height } = document.querySelector(ele).getBoundingClientRect();
|
||||
init();
|
||||
animate();
|
||||
|
||||
function init() {
|
||||
const ambientLight = new THREE.AmbientLight(0xffffff, AmbientLight || 0);
|
||||
const directionalLight = new THREE.DirectionalLight(0xffffff, DirectionalLight || 0);
|
||||
const spotLight = new THREE.SpotLight(0xffffff, SpotLight || 0);
|
||||
const manager = new THREE.LoadingManager();
|
||||
|
||||
container = document.createElement("div");
|
||||
document.querySelector(ele).appendChild(container);
|
||||
camera = new THREE.PerspectiveCamera(2, width / height, 1, 1000);
|
||||
camera.position.z = cameraPosition || 100;
|
||||
|
||||
// scene
|
||||
scene = new THREE.Scene();
|
||||
|
||||
directionalLight.position.set(0, 1, 0);
|
||||
spotLight.position.set(1, 0, 1);
|
||||
|
||||
scene.add(ambientLight);
|
||||
scene.add(directionalLight);
|
||||
camera.add(spotLight);
|
||||
scene.add(camera);
|
||||
|
||||
// model
|
||||
function onProgress(xhr) {
|
||||
if (xhr.lengthComputable) {
|
||||
let percentComplete = (xhr.loaded / xhr.total) * 100;
|
||||
loading && loading(Math.round(percentComplete, 2));
|
||||
console.log("已加载:" + Math.round(percentComplete, 2) + "%");
|
||||
}
|
||||
}
|
||||
|
||||
new THREE.GLTFLoader(manager).load(
|
||||
`${src}.gltf`,
|
||||
function (mod) {
|
||||
const gltf = mod.scene;
|
||||
for (let a = 0; a < gltf.children.length; a++) {
|
||||
gltf.children[a].castShadow = true;
|
||||
gltf.children[a].receiveShadow = true;
|
||||
}
|
||||
setMate(gltf);
|
||||
scene.add(mod.scene);
|
||||
that.addCaster(renderer, camera, gltf.children, click);
|
||||
render();
|
||||
next();
|
||||
},
|
||||
onProgress
|
||||
);
|
||||
|
||||
renderer = new THREE.WebGLRenderer({ alpha: true });
|
||||
// renderer.outputEncoding = THREE.sRGBEncoding;
|
||||
renderer.shadowMap.enabled = true;
|
||||
renderer.shadowMap.type = THREE.PCFSoftShadowMap;
|
||||
renderer.setPixelRatio(window.devicePixelRatio);
|
||||
renderer.setSize(width, height);
|
||||
container.appendChild(renderer.domElement);
|
||||
|
||||
window.addEventListener("resize", onWindowResize, false);
|
||||
|
||||
// controls
|
||||
controls = new THREE.TrackballControls(camera, renderer.domElement);
|
||||
controls.rotateSpeed = rotateSpeed || 0;
|
||||
controls.minDistance = minDistance || 10;
|
||||
controls.maxDistance = maxDistance || 30;
|
||||
}
|
||||
|
||||
function onWindowResize() {
|
||||
camera.aspect = width / height;
|
||||
camera.updateProjectionMatrix();
|
||||
|
||||
renderer.setSize(width, height);
|
||||
}
|
||||
|
||||
function animate() {
|
||||
requestAnimationFrame(animate);
|
||||
controls.update();
|
||||
render();
|
||||
}
|
||||
|
||||
function render() {
|
||||
camera.lookAt(scene.position);
|
||||
renderer.render(scene, camera);
|
||||
}
|
||||
});
|
||||
},
|
||||
};
|
15
new_mush.js
Normal file
@@ -0,0 +1,15 @@
|
||||
function bindDataToElement(data) {
|
||||
const proxy = new Proxy(data, {
|
||||
set(target, key, value) {
|
||||
target[key] = value;
|
||||
return true;
|
||||
},
|
||||
});
|
||||
|
||||
console.log("proxy", proxy);
|
||||
}
|
||||
|
||||
window.onload = () => {
|
||||
const data = { name: "张三", age: 20 };
|
||||
bindDataToElement(data);
|
||||
};
|
10894
package-lock.json
generated
Normal file
34
package.json
Normal file
@@ -0,0 +1,34 @@
|
||||
{
|
||||
"name": "pandora",
|
||||
"version": "2.0.0",
|
||||
"description": "Pandora.Js,专为新手优化的JavaScript插件,属性多样、功能丰富,足以满足大部分功能需求。",
|
||||
"main": "Pandora.js",
|
||||
"scripts": {
|
||||
"test": "webpack --config webpack.test.config.js --progress",
|
||||
"release": "npm run pack && babel Pandora.min.js --out-file Pandora.min.js && gulp minify --silent",
|
||||
"upload": "gulp upload --silent",
|
||||
"pack": "webpack --config webpack.config.js --progress"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/yuentao/Pandora.js.git"
|
||||
},
|
||||
"author": "Yuantao",
|
||||
"license": "ISC",
|
||||
"bugs": {
|
||||
"url": "https://github.com/yuentao/Pandora.js/issues"
|
||||
},
|
||||
"homepage": "https://www.pandorajs.com",
|
||||
"dependencies": {
|
||||
"gulp": "*",
|
||||
"webpack": "*",
|
||||
"gulp-uglify": "*",
|
||||
"gulp-header": "*",
|
||||
"gulp-chinese2unicode": "*",
|
||||
"ftp": "*"
|
||||
},
|
||||
"devDependencies": {
|
||||
"webpack-cli": "*",
|
||||
"babel-cli": "*"
|
||||
}
|
||||
}
|
61
src/base64.js
Normal file
@@ -0,0 +1,61 @@
|
||||
"use strict";
|
||||
|
||||
var OSSBase64 = {
|
||||
// private property
|
||||
_keyStr: "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",
|
||||
|
||||
// public method for encoding
|
||||
encode: function (input) {
|
||||
var output = "";
|
||||
var chr1, chr2, chr3, enc1, enc2, enc3, enc4;
|
||||
var i = 0;
|
||||
|
||||
input = OSSBase64._utf8_encode(input);
|
||||
|
||||
while (i < input.length) {
|
||||
chr1 = input.charCodeAt(i++);
|
||||
chr2 = input.charCodeAt(i++);
|
||||
chr3 = input.charCodeAt(i++);
|
||||
|
||||
enc1 = chr1 >> 2;
|
||||
enc2 = ((chr1 & 3) << 4) | (chr2 >> 4);
|
||||
enc3 = ((chr2 & 15) << 2) | (chr3 >> 6);
|
||||
enc4 = chr3 & 63;
|
||||
|
||||
if (isNaN(chr2)) {
|
||||
enc3 = enc4 = 64;
|
||||
} else if (isNaN(chr3)) {
|
||||
enc4 = 64;
|
||||
}
|
||||
|
||||
output = output + this._keyStr.charAt(enc1) + this._keyStr.charAt(enc2) + this._keyStr.charAt(enc3) + this._keyStr.charAt(enc4);
|
||||
}
|
||||
|
||||
return output;
|
||||
},
|
||||
|
||||
// private method for UTF-8 encoding
|
||||
_utf8_encode: function (string) {
|
||||
string = string.replace(/\r\n/g, "\n");
|
||||
var utftext = "";
|
||||
|
||||
for (var n = 0; n < string.length; n++) {
|
||||
var c = string.charCodeAt(n);
|
||||
|
||||
if (c < 128) {
|
||||
utftext += String.fromCharCode(c);
|
||||
} else if (c > 127 && c < 2048) {
|
||||
utftext += String.fromCharCode((c >> 6) | 192);
|
||||
utftext += String.fromCharCode((c & 63) | 128);
|
||||
} else {
|
||||
utftext += String.fromCharCode((c >> 12) | 224);
|
||||
utftext += String.fromCharCode(((c >> 6) & 63) | 128);
|
||||
utftext += String.fromCharCode((c & 63) | 128);
|
||||
}
|
||||
}
|
||||
|
||||
return utftext;
|
||||
},
|
||||
};
|
||||
|
||||
module.exports = OSSBase64;
|
7
src/crypto/crypto/crypto-min.js
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
/*
|
||||
* Crypto-JS v1.1.0
|
||||
* http://code.google.com/p/crypto-js/
|
||||
* Copyright (c) 2009, Jeff Mott. All rights reserved.
|
||||
* http://code.google.com/p/crypto-js/wiki/License
|
||||
*/
|
||||
(function(){var b="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";window.Crypto={};var a=Crypto.util={rotl:function(d,c){return(d<<c)|(d>>>(32-c))},rotr:function(d,c){return(d<<(32-c))|(d>>>c)},endian:function(d){if(d.constructor==Number){return a.rotl(d,8)&16711935|a.rotl(d,24)&4278255360}for(var c=0;c<d.length;c++){d[c]=a.endian(d[c])}return d},randomBytes:function(d){for(var c=[];d>0;d--){c.push(Math.floor(Math.random()*256))}return c},stringToBytes:function(e){var c=[];for(var d=0;d<e.length;d++){c.push(e.charCodeAt(d))}return c},bytesToString:function(c){var e=[];for(var d=0;d<c.length;d++){e.push(String.fromCharCode(c[d]))}return e.join("")},stringToWords:function(f){var e=[];for(var g=0,d=0;g<f.length;g++,d+=8){e[d>>>5]|=f.charCodeAt(g)<<(24-d%32)}return e},bytesToWords:function(d){var f=[];for(var e=0,c=0;e<d.length;e++,c+=8){f[c>>>5]|=d[e]<<(24-c%32)}return f},wordsToBytes:function(e){var d=[];for(var c=0;c<e.length*32;c+=8){d.push((e[c>>>5]>>>(24-c%32))&255)}return d},bytesToHex:function(c){var e=[];for(var d=0;d<c.length;d++){e.push((c[d]>>>4).toString(16));e.push((c[d]&15).toString(16))}return e.join("")},hexToBytes:function(e){var d=[];for(var f=0;f<e.length;f+=2){d.push(parseInt(e.substr(f,2),16))}return d},bytesToBase64:function(d){if(typeof btoa=="function"){return btoa(a.bytesToString(d))}var c=[],f;for(var e=0;e<d.length;e++){switch(e%3){case 0:c.push(b.charAt(d[e]>>>2));f=(d[e]&3)<<4;break;case 1:c.push(b.charAt(f|(d[e]>>>4)));f=(d[e]&15)<<2;break;case 2:c.push(b.charAt(f|(d[e]>>>6)));c.push(b.charAt(d[e]&63));f=-1}}if(f!=undefined&&f!=-1){c.push(b.charAt(f))}while(c.length%4!=0){c.push("=")}return c.join("")},base64ToBytes:function(d){if(typeof atob=="function"){return a.stringToBytes(atob(d))}d=d.replace(/[^A-Z0-9+\/]/ig,"");var c=[];for(var e=0;e<d.length;e++){switch(e%4){case 1:c.push((b.indexOf(d.charAt(e-1))<<2)|(b.indexOf(d.charAt(e))>>>4));break;case 2:c.push(((b.indexOf(d.charAt(e-1))&15)<<4)|(b.indexOf(d.charAt(e))>>>2));break;case 3:c.push(((b.indexOf(d.charAt(e-1))&3)<<6)|(b.indexOf(d.charAt(e))));break}}return c}};Crypto.mode={}})();
|
7
src/crypto/hmac/hmac-min.js
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
/*
|
||||
* Crypto-JS v1.1.0
|
||||
* http://code.google.com/p/crypto-js/
|
||||
* Copyright (c) 2009, Jeff Mott. All rights reserved.
|
||||
* http://code.google.com/p/crypto-js/wiki/License
|
||||
*/
|
||||
(function(){var a=Crypto.util;Crypto.HMAC=function(g,h,f,d){f=f.length>g._blocksize*4?g(f,{asBytes:true}):a.stringToBytes(f);var c=f,j=f.slice(0);for(var e=0;e<g._blocksize*4;e++){c[e]^=92;j[e]^=54}var b=g(a.bytesToString(c)+g(a.bytesToString(j)+h,{asString:true}),{asBytes:true});return d&&d.asBytes?b:d&&d.asString?a.bytesToString(b):a.bytesToHex(b)}})();
|
7
src/crypto/sha1/sha1-min.js
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
/*
|
||||
* Crypto-JS v1.1.0
|
||||
* http://code.google.com/p/crypto-js/
|
||||
* Copyright (c) 2009, Jeff Mott. All rights reserved.
|
||||
* http://code.google.com/p/crypto-js/wiki/License
|
||||
*/
|
||||
(function(){var a=Crypto.util;var b=Crypto.SHA1=function(e,c){var d=a.wordsToBytes(b._sha1(e));return c&&c.asBytes?d:c&&c.asString?a.bytesToString(d):a.bytesToHex(d)};b._sha1=function(k){var u=a.stringToWords(k),v=k.length*8,o=[],q=1732584193,p=-271733879,h=-1732584194,g=271733878,f=-1009589776;u[v>>5]|=128<<(24-v%32);u[((v+64>>>9)<<4)+15]=v;for(var y=0;y<u.length;y+=16){var D=q,C=p,B=h,A=g,z=f;for(var x=0;x<80;x++){if(x<16){o[x]=u[y+x]}else{var s=o[x-3]^o[x-8]^o[x-14]^o[x-16];o[x]=(s<<1)|(s>>>31)}var r=((q<<5)|(q>>>27))+f+(o[x]>>>0)+(x<20?(p&h|~p&g)+1518500249:x<40?(p^h^g)+1859775393:x<60?(p&h|p&g|h&g)-1894007588:(p^h^g)-899497514);f=g;g=h;h=(p<<30)|(p>>>2);p=q;q=r}q+=D;p+=C;h+=B;g+=A;f+=z}return[q,p,h,g,f]};b._blocksize=16})();
|
BIN
src/delete.png
Normal file
After Width: | Height: | Size: 1.1 KiB |
1
src/delete.svg
Normal file
@@ -0,0 +1 @@
|
||||
<svg t="1576350157338" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="1884" width="200" height="200"><path d="M571.733333 512l226.133334-226.133333c17.066667-17.066667 17.066667-42.666667 0-59.733334s-42.666667-17.066667-59.733334 0L512 452.266667 285.866667 226.133333c-17.066667-17.066667-42.666667-17.066667-59.733334 0s-17.066667 42.666667 0 59.733334l226.133334 226.133333-226.133334 226.133333c-17.066667 17.066667-17.066667 42.666667 0 59.733334 8.533333 8.533333 17.066667 12.8 29.866667 12.8s21.333333-4.266667 29.866667-12.8l226.133333-226.133334 226.133333 226.133334c8.533333 8.533333 21.333333 12.8 29.866667 12.8s21.333333-4.266667 29.866667-12.8c17.066667-17.066667 17.066667-42.666667 0-59.733334L571.733333 512z" p-id="1885" fill="#2c2c2c"></path></svg>
|
After Width: | Height: | Size: 815 B |
6
src/icoConfig.json
Normal file
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"load": "data:image/svg+xml;base64,PCEtLSBCeSBTYW0gSGVyYmVydCAoQHNoZXJiKSwgZm9yIGV2ZXJ5b25lLiBNb3JlIEAgaHR0cDovL2dvby5nbC83QUp6YkwgLS0+Cjxzdmcgd2lkdGg9IjM4IiBoZWlnaHQ9IjM4IiB2aWV3Qm94PSIwIDAgMzggMzgiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgc3Ryb2tlPSIjZmZmIj4KICAgIDxnIGZpbGw9Im5vbmUiIGZpbGwtcnVsZT0iZXZlbm9kZCI+CiAgICAgICAgPGcgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoMSAxKSIgc3Ryb2tlLXdpZHRoPSIyIj4KICAgICAgICAgICAgPGNpcmNsZSBzdHJva2Utb3BhY2l0eT0iLjUiIGN4PSIxOCIgY3k9IjE4IiByPSIxOCIvPgogICAgICAgICAgICA8cGF0aCBkPSJNMzYgMThjMC05Ljk0LTguMDYtMTgtMTgtMTgiPgogICAgICAgICAgICAgICAgPGFuaW1hdGVUcmFuc2Zvcm0KICAgICAgICAgICAgICAgICAgICBhdHRyaWJ1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zODggMjM1LjU5NzE5OCA0MTguMDk0NDE4IDIyOS4yOTQ4NzEgNDY0LjQ2MTAzOSAyMzAuNDQwMyA1MTAuNTU5ODgxTDMxMS4yNDA5NzggNDI5Ljc1OTIwMkMzMjMuNTg0MDk0IDQxNy40MTYwODUgMzQzLjg5MjUxMyA0MTcuNzEyMzU3IDM1Ni42MDEwOTkgNDMwLjQyMDk0NiAzNjkuMzA5Njg2IDQ0My4xMjk1MzUgMzY5LjYwNTk1OSA0NjMuNDM3OTUyIDM1Ny4yNjI4NDIgNDc1Ljc4MTA2OEwyMzAuNzc4NzgyIDYwMi4yNjUxMjhDMjI5LjI3MzgyNiA2MDUuNzY5Njc5IDIyNy4wOTg4NzcgNjA5LjA0MTM5NiAyMjQuMjUxMTQ1IDYxMS44ODkxMjggMjExLjkwODAyOSA2MjQuMjMyMjQ1IDE5MS41OTk2MSA2MjMuOTM1OTc0IDE3OC44OTEwMjQgNjExLjIyNzM4NUw0MC44MjU0MjggNDczLjE2MTc5QzI4LjExNjg0IDQ2MC40NTMyMDYgMjcuODIwNTY5IDQ0MC4xNDQ3ODQgNDAuMTYzNjg1IDQyNy44MDE2NjggNTIuNTA2ODAxIDQxNS40NTg1NTEgNzIuODE1MjE4IDQxNS43NTQ4MjcgODUuNTIzODA2IDQyOC40NjM0MTFMMTY1LjIzODg5OSA1MDguMTc4NTA2WiIgcC1pZD0iMTgxOSIgZmlsbD0iIzJjMmMyYyI+PC9wYXRoPjwvc3ZnPg=="
|
||||
}
|
17
src/loader.svg
Normal file
@@ -0,0 +1,17 @@
|
||||
<!-- By Sam Herbert (@sherb), for everyone. More @ http://goo.gl/7AJzbL -->
|
||||
<svg width="38" height="38" viewBox="0 0 38 38" xmlns="http://www.w3.org/2000/svg" stroke="#fff">
|
||||
<g fill="none" fill-rule="evenodd">
|
||||
<g transform="translate(1 1)" stroke-width="2">
|
||||
<circle stroke-opacity=".5" cx="18" cy="18" r="18"/>
|
||||
<path d="M36 18c0-9.94-8.06-18-18-18">
|
||||
<animateTransform
|
||||
attributeName="transform"
|
||||
type="rotate"
|
||||
from="0 18 18"
|
||||
to="360 18 18"
|
||||
dur="1s"
|
||||
repeatCount="indefinite"/>
|
||||
</path>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
After Width: | Height: | Size: 694 B |
BIN
src/resize.png
Normal file
After Width: | Height: | Size: 1.1 KiB |
1
src/resize.svg
Normal file
@@ -0,0 +1 @@
|
||||
<svg t="1575734524011" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="872" width="200" height="200"><path d="M448 554.666667 149.333333 554.666667c-12.8 0-21.333333 8.533333-21.333333 21.333333 0 12.8 8.533333 21.333333 21.333333 21.333333l247.466667 0L49.066667 945.066667C44.8 949.333333 42.666667 953.6 42.666667 960c0 12.8 8.533333 21.333333 21.333333 21.333333 6.4 0 10.666667-2.133333 14.933333-6.4L426.666667 627.2 426.666667 874.666667c0 12.8 8.533333 21.333333 21.333333 21.333333s21.333333-8.533333 21.333333-21.333333L469.333333 576C469.333333 563.2 460.8 554.666667 448 554.666667zM981.333333 64c0-12.8-8.533333-21.333333-21.333333-21.333333-6.4 0-10.666667 2.133333-14.933333 6.4L597.333333 396.8 597.333333 149.333333c0-12.8-8.533333-21.333333-21.333333-21.333333s-21.333333 8.533333-21.333333 21.333333l0 298.666667c0 12.8 8.533333 21.333333 21.333333 21.333333l298.666667 0c12.8 0 21.333333-8.533333 21.333333-21.333333s-8.533333-21.333333-21.333333-21.333333L627.2 426.666667 974.933333 78.933333C979.2 74.666667 981.333333 70.4 981.333333 64z" p-id="873" fill="#2c2c2c"></path></svg>
|
After Width: | Height: | Size: 1.1 KiB |
BIN
src/rotate.png
Normal file
After Width: | Height: | Size: 3.5 KiB |
1
src/rotate.svg
Normal file
@@ -0,0 +1 @@
|
||||
<svg t="1575734582770" class="icon" viewBox="0 0 1118 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="1818" width="200" height="200"><path d="M165.238899 508.178506C164.450369 456.442676 171.767779 404.485842 187.244542 353.863631 266.138632 95.812692 533.436225-51.353028 784.380224 25.368251 1035.324219 102.08953 1174.62994 373.566359 1095.735851 631.617298 1016.84176 889.66824 749.544168 1036.833959 498.600172 960.11268 424.134741 937.346313 357.837833 896.870788 303.973868 842.276436 291.310328 829.441176 291.396506 808.495802 304.166356 795.493625 316.936205 782.491452 337.554042 782.356136 350.217582 795.191397 396.640587 842.243889 453.73137 877.098901 517.975091 896.740177 734.436966 962.919213 965.320335 835.802028 1033.557737 612.607541 1101.795139 389.413057 981.467179 154.919792 765.005305 88.740755 548.543428 22.561718 317.660056 149.678904 249.422655 372.873388 235.597198 418.094418 229.294871 464.461039 230.4403 510.559881L311.240978 429.759202C323.584094 417.416085 343.892513 417.712357 356.601099 430.420946 369.309686 443.129535 369.605959 463.437952 357.262842 475.781068L230.778782 602.265128C229.273826 605.769679 227.098877 609.041396 224.251145 611.889128 211.908029 624.232245 191.59961 623.935974 178.891024 611.227385L40.825428 473.16179C28.11684 460.453206 27.820569 440.144784 40.163685 427.801668 52.506801 415.458551 72.815218 415.754827 85.523806 428.463411L165.238899 508.178506Z" p-id="1819" fill="#2c2c2c"></path></svg>
|
After Width: | Height: | Size: 1.4 KiB |
10
src/web.config
Normal file
@@ -0,0 +1,10 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<configuration>
|
||||
<system.webServer>
|
||||
<httpProtocol>
|
||||
<customHeaders>
|
||||
<remove name="Content-Disposition" />
|
||||
</customHeaders>
|
||||
</httpProtocol>
|
||||
</system.webServer>
|
||||
</configuration>
|
1
template/home/index.html
Normal file
@@ -0,0 +1 @@
|
||||
<h1>首页</h1>
|
1
template/test/index.html
Normal file
@@ -0,0 +1 @@
|
||||
<h2>33333</h2>
|
25
test.css
Normal file
@@ -0,0 +1,25 @@
|
||||
html{
|
||||
font-size: 20px;
|
||||
}
|
||||
body {
|
||||
margin: 0;
|
||||
}
|
||||
ul,
|
||||
li {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
list-style: none;
|
||||
}
|
||||
.switcher {
|
||||
width: 100vw;
|
||||
height: 100vh;
|
||||
overflow: hidden;
|
||||
}
|
||||
.switcher li {
|
||||
width: 100vw;
|
||||
height: 100vh;
|
||||
overflow: hidden;
|
||||
}
|
||||
.switcher li:nth-of-type(2) {
|
||||
overflow-y: scroll;
|
||||
}
|
41
test.html
Normal file
@@ -0,0 +1,41 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<title>无标题文档</title>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div class="test">
|
||||
{{test}}
|
||||
|
||||
<div class="rect" --show="false">{{test}}</div>
|
||||
</div>
|
||||
|
||||
<template route="/" src="index.html"></template>
|
||||
</body>
|
||||
<script src="Pandora.min.js"></script>
|
||||
<script>
|
||||
const a = $('.test').Mush({
|
||||
data: {
|
||||
test: '测试',
|
||||
},
|
||||
})
|
||||
|
||||
console.log($('.test').text())
|
||||
$('.rect').css({
|
||||
width: '100px',
|
||||
height: '100px',
|
||||
background: 'red',
|
||||
})
|
||||
$('.rect').click(() => {
|
||||
console.log('click')
|
||||
})
|
||||
|
||||
$().wxSDK({
|
||||
apiUrl: 'https://api.pandorastudio.cn/common/wxShare?url=',
|
||||
shareIcon: `https://src.pandorastudio.cn/favicon.jpg`,
|
||||
debug: true,
|
||||
})
|
||||
</script>
|
||||
</html>
|
11
webpack.config.js
Normal file
@@ -0,0 +1,11 @@
|
||||
const path = require("path");
|
||||
|
||||
module.exports = {
|
||||
mode: "none",
|
||||
entry: path.resolve(__dirname, "Pandora.js"),
|
||||
output: {
|
||||
path: path.resolve(__dirname, ""),
|
||||
filename: "./Pandora.min.js",
|
||||
},
|
||||
// devtool: "source-map",
|
||||
};
|
12
webpack.test.config.js
Normal file
@@ -0,0 +1,12 @@
|
||||
const path = require("path");
|
||||
|
||||
module.exports = {
|
||||
mode: "development",
|
||||
watch: true,
|
||||
watchOptions: {
|
||||
poll: 1000, // 每秒询问多少次
|
||||
aggregateTimeout: 200, //防抖 多少毫秒后再次触发
|
||||
},
|
||||
entry: path.resolve(__dirname, "Pandora.js"),
|
||||
output: { filename: "Pandora.min.js" },
|
||||
};
|