1
0
mirror of https://github.com/ZeroCatDev/Classworks.git synced 2025-07-02 00:59:23 +00:00

deploy: 223d5bf794e0c1a1e19247af2b33bb2a3a3a5996

This commit is contained in:
SunWuyuan 2025-04-05 06:09:36 +00:00
commit 4334c968da
36 changed files with 155 additions and 0 deletions

0
.nojekyll Normal file
View File

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1 @@
import{e as L}from"./VList-ChfyLBDv.js";import{g as $,p as z,Q as D,f as o,a as E,bx as F,aI as R,L as j,c as w,af as N,ag as O,d as p,aJ as J,t as M,aj as Q,k as t,by as q,V as G,a5 as d,$ as H,T as K,bz as U,m as W,n as X,o as Y,ah as Z,ai as ee,v as ae,N as te,aE as le,x as ne,a3 as se}from"./index-CZWOVMJZ.js";const oe=L("v-alert-title"),ie=["success","info","warning","error"],re=z({border:{type:[Boolean,String],validator:e=>typeof e=="boolean"||["top","end","bottom","start"].includes(e)},borderColor:String,closable:Boolean,closeIcon:{type:se,default:"$close"},closeLabel:{type:String,default:"$vuetify.close"},icon:{type:[Boolean,String,Function,Object],default:null},modelValue:{type:Boolean,default:!0},prominent:Boolean,title:String,text:String,type:{type:String,validator:e=>ie.includes(e)},...ne(),...le(),...te(),...ae(),...ee(),...Z(),...Y(),...X(),...W(),...U({variant:"flat"})},"VAlert"),de=$()({name:"VAlert",props:re(),emits:{"click:close":e=>!0,"update:modelValue":e=>!0},setup(e,v){let{emit:m,slots:a}=v;const i=D(e,"modelValue"),n=o(()=>{if(e.icon!==!1)return e.type?e.icon??`$${e.type}`:e.icon}),y=o(()=>({color:e.color??e.type,variant:e.variant})),{themeClasses:f}=E(e),{colorClasses:b,colorStyles:k,variantClasses:P}=F(y),{densityClasses:V}=R(e),{dimensionStyles:C}=j(e),{elevationClasses:g}=w(e),{locationStyles:x}=N(e),{positionClasses:S}=O(e),{roundedClasses:_}=p(e),{textColorClasses:T,textColorStyles:h}=J(M(e,"borderColor")),{t:B}=Q(),r=o(()=>({"aria-label":B(e.closeLabel),onClick(s){i.value=!1,m("click:close",s)}}));return()=>{const s=!!(a.prepend||n.value),I=!!(a.title||e.title),A=!!(a.close||e.closable);return i.value&&t(e.tag,{class:["v-alert",e.border&&{"v-alert--border":!!e.border,[`v-alert--border-${e.border===!0?"start":e.border}`]:!0},{"v-alert--prominent":e.prominent},f.value,b.value,V.value,g.value,S.value,_.value,P.value,e.class],style:[k.value,C.value,x.value,e.style],role:"alert"},{default:()=>{var c,u;return[q(!1,"v-alert"),e.border&&t("div",{key:"border",class:["v-alert__border",T.value],style:h.value},null),s&&t("div",{key:"prepend",class:"v-alert__prepend"},[a.prepend?t(d,{key:"prepend-defaults",disabled:!n.value,defaults:{VIcon:{density:e.density,icon:n.value,size:e.prominent?44:28}}},a.prepend):t(G,{key:"prepend-icon",density:e.density,icon:n.value,size:e.prominent?44:28},null)]),t("div",{class:"v-alert__content"},[I&&t(oe,{key:"title"},{default:()=>{var l;return[((l=a.title)==null?void 0:l.call(a))??e.title]}}),((c=a.text)==null?void 0:c.call(a))??e.text,(u=a.default)==null?void 0:u.call(a)]),a.append&&t("div",{key:"append",class:"v-alert__append"},[a.append()]),A&&t("div",{key:"close",class:"v-alert__close"},[a.close?t(d,{key:"close-defaults",defaults:{VBtn:{icon:e.closeIcon,size:"x-small",variant:"text"}}},{default:()=>{var l;return[(l=a.close)==null?void 0:l.call(a,{props:r.value})]}}):t(H,K({key:"close-btn",icon:e.closeIcon,size:"x-small",variant:"text"},r.value),null)])]}})}}});export{de as V};

File diff suppressed because one or more lines are too long

1
assets/VList-ChfyLBDv.js Normal file

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1 @@
import{g as p,p as y,r as B,a as P,u as F,t as _,b as I,c as z,d as R,s as D,e as N,f as r,h as T,i as E,w as L,j as k,k as n,l as M,m as A,n as b,o as H,q as G,v as O,x as C,y as j,_ as q,z as J,A as V,B as K,C as U,D as d,E as h,F as W,G as m,H as Y,I as Z,V as $,J as v,K as Q,L as X,M as ee,N as te,O as ae,P as se}from"./index-CZWOVMJZ.js";import{u as oe}from"./ssrBoot-C9XVkltt.js";const ne=y({app:Boolean,color:String,height:{type:[Number,String],default:"auto"},...j(),...C(),...O(),...G(),...H(),...b({tag:"footer"}),...A()},"VFooter"),le=p()({name:"VFooter",props:ne(),setup(e,l){let{slots:a}=l;const o=B(),{themeClasses:t}=P(e),{backgroundColorClasses:s,backgroundColorStyles:u}=F(_(e,"color")),{borderClasses:i}=I(e),{elevationClasses:S}=z(e),{roundedClasses:w}=R(e),f=D(32),{resizeRef:x}=N(c=>{c.length&&(f.value=c[0].target.clientHeight)}),g=r(()=>e.height==="auto"?f.value:parseInt(e.height,10));return T(()=>e.app,()=>{const c=E({id:e.name,order:r(()=>parseInt(e.order,10)),position:r(()=>"bottom"),layoutSize:g,elementSize:r(()=>e.height==="auto"?void 0:g.value),active:r(()=>e.app),absolute:_(e,"absolute")});L(()=>{o.value=c.layoutItemStyles.value})}),k(()=>n(e.tag,{ref:x,class:["v-footer",t.value,s.value,i.value,S.value,w.value,e.class],style:[u.value,e.app?o.value:{height:M(e.height)},e.style]},a)),{}}}),re=["href","title"],ue={class:"text-caption text-disabled",style:{position:"absolute",right:"16px"}},ie={__name:"AppFooter",setup(e){const{mobile:l}=J(),a=[{title:"孙悟远",icon:"mdi-earth",href:"https://wuyuan.dev"},{title:"ZeroCat",icon:"mdi-xml",href:"https://zerocat.houlangs.com"},{title:"GitHub",icon:"mdi-github",href:"https://github.com/sunwuyuan/classworks-frontend"}];return(o,t)=>U(l)?(d(),V(le,{key:0,height:"40",app:""},{default:h(()=>[(d(),W(Y,null,Z(a,s=>m("a",{key:s.title,href:s.href,title:s.title,class:"d-inline-block mx-2 social-link",rel:"noopener noreferrer",target:"_blank"},[n($,{icon:s.icon,size:s.icon==="mdi-earth"?24:16},null,8,["icon","size"])],8,re)),64)),m("div",ue,[v(" © 2020-"+Q(new Date().getFullYear())+" ",1),t[0]||(t[0]=m("span",{class:"d-none d-sm-inline-block"},"SunWuyuan",-1)),t[1]||(t[1]=v(" — ")),t[2]||(t[2]=m("a",{class:"text-decoration-none on-surface",href:"https://github.com/sunwuyuan/classworks-frontend",rel:"noopener noreferrer",target:"_blank"}," Classworks ",-1))])]),_:1})):K("",!0)}},ce=q(ie,[["__scopeId","data-v-619113f3"]]),me=y({scrollable:Boolean,...C(),...te(),...b({tag:"main"})},"VMain"),de=p()({name:"VMain",props:me(),setup(e,l){let{slots:a}=l;const{dimensionStyles:o}=X(e),{mainStyles:t}=ee(),{ssrBootStyles:s}=oe();return k(()=>n(e.tag,{class:["v-main",{"v-main--scrollable":e.scrollable},e.class],style:[t.value,s.value,o.value,e.style]},{default:()=>{var u,i;return[e.scrollable?n("div",{class:"v-main__scroller"},[(u=a.default)==null?void 0:u.call(a)]):(i=a.default)==null?void 0:i.call(a)]}})),{}}}),ge={__name:"default",setup(e){return(l,a)=>{const o=ae("router-view"),t=ce;return d(),V(se,null,{default:h(()=>[n(de,null,{default:h(()=>[n(o)]),_:1}),n(t)]),_:1})}}};export{ge as default};

View File

@ -0,0 +1 @@
.social-link[data-v-619113f3] .v-icon{color:rgba(var(--v-theme-on-background),var(--v-disabled-opacity));text-decoration:none;transition:.2s ease-in-out}.social-link[data-v-619113f3] .v-icon:hover{color:#1976d2}.v-footer{align-items:center;display:flex;flex:1 1 auto;padding:8px 16px;position:relative;transition:.2s cubic-bezier(.4,0,.2,1);transition-property:height,width,transform,max-width,left,right,top,bottom}.v-footer{border-color:rgba(var(--v-border-color),var(--v-border-opacity));border-style:solid;border-width:0}.v-footer--border{border-width:thin;box-shadow:none}.v-footer{box-shadow:0 0 0 0 var(--v-shadow-key-umbra-opacity, rgba(0, 0, 0, .2)),0 0 0 0 var(--v-shadow-key-penumbra-opacity, rgba(0, 0, 0, .14)),0 0 0 0 var(--v-shadow-key-ambient-opacity, rgba(0, 0, 0, .12))}.v-footer--absolute{position:absolute}.v-footer--fixed{position:fixed}.v-footer{border-radius:0}.v-footer{background:rgb(var(--v-theme-surface));color:rgba(var(--v-theme-on-surface),var(--v-high-emphasis-opacity))}.v-footer--rounded{border-radius:4px}.student-card{transition:all .2s cubic-bezier(.4,0,.2,1)}.bg-primary-subtle{background-color:rgb(var(--v-theme-primary),.05)}.action-buttons{transition:opacity .2s ease;opacity:0}.gap-1{gap:4px}.gap-2{gap:8px}.student-card .v-text-field{margin:0;padding:0}@media (max-width: 600px){.v-container{padding:12px}.v-col{padding:8px}}.student-card.mobile{margin-bottom:8px}.student-card.mobile .v-btn{min-width:40px;min-height:40px}.student-card.mobile .v-text-field{font-size:16px}@media (max-width: 600px){.v-col{padding:6px!important}.student-card{margin-bottom:4px}.action-buttons{opacity:1}}.student-card{-webkit-tap-highlight-color:transparent}.student-card:active{background-color:rgb(var(--v-theme-primary),.05)}.v-main{flex:1 0 auto;max-width:100%;transition:.2s cubic-bezier(.4,0,.2,1);padding-left:var(--v-layout-left);padding-right:var(--v-layout-right);padding-top:var(--v-layout-top);padding-bottom:var(--v-layout-bottom)}.v-main__scroller{max-width:100%;position:relative}.v-main--scrollable{display:flex}.v-main--scrollable{position:absolute;top:0;left:0;width:100%;height:100%}.v-main--scrollable>.v-main__scroller{flex:1 1 auto;overflow-y:auto;--v-layout-left: 0px;--v-layout-right: 0px;--v-layout-top: 0px;--v-layout-bottom: 0px}

File diff suppressed because one or more lines are too long

30
assets/index-CZWOVMJZ.js Normal file

File diff suppressed because one or more lines are too long

3
assets/index-VbTC__iC.js Normal file

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1 @@
import{s,ad as t,f as e,bO as n}from"./index-CZWOVMJZ.js";function i(){const o=s(!1);return t(()=>{window.requestAnimationFrame(()=>{o.value=!0})}),{ssrBootStyles:e(()=>o.value?void 0:{transition:"none !important"}),isBooted:n(o)}}export{i as u};

BIN
favicon.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 368 B

26
index.html Normal file
View File

@ -0,0 +1,26 @@
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<link rel="preconnect" href="https://fonts.gstatic.com/" crossorigin="anonymous">
<link rel="preload" as="style" onload="this.rel='stylesheet'" href="https://fonts.googleapis.com/css2?family=Roboto:wght@100;300;400;500;700;900&display=swap">
<link rel="preload" as="font" type="font/eot" href="/assets/materialdesignicons-webfont-CSr8KVlo.eot" crossorigin="anonymous">
<link rel="preload" as="font" type="font/woff2" href="/assets/materialdesignicons-webfont-Dp5v-WZN.woff2" crossorigin="anonymous">
<link rel="preload" as="font" type="font/woff" href="/assets/materialdesignicons-webfont-PXm3-2wK.woff" crossorigin="anonymous">
<link rel="preload" as="font" type="font/ttf" href="/assets/materialdesignicons-webfont-B7mPwVP_.ttf" crossorigin="anonymous">
<meta charset="UTF-8">
<link rel="icon" href="/favicon.ico">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Classworks 作业板</title>
<meta name="description" content="记录,查看并同步作业" />
<link rel="apple-touch-icon" href="/image/apple-touch-icon.png" sizes="180x180" />
<link rel="mask-icon" href="/image/mask-icon.svg" color="#212121" />
<meta name="theme-color" content="#212121" />
<script defer src="https://umami.wuyuan.dev/script.js" data-website-id="e3f8ed7a-4db4-4081-aaf4-45396b1f479c"></script>
<script type="module" crossorigin src="/assets/index-CZWOVMJZ.js"></script>
<link rel="stylesheet" crossorigin href="/assets/index-B-ipX9qk.css">
<link rel="manifest" href="/manifest.webmanifest"><script id="vite-plugin-pwa:register-sw" src="/registerSW.js"></script></head>
<body>
<div id="app"></div>
</body>
</html>

1
manifest.webmanifest Normal file
View File

@ -0,0 +1 @@
{"name":"Classworks作业板","short_name":"Classworks","description":"记录,查看并同步作业","start_url":"/","display":"standalone","background_color":"#212121","theme_color":"#212121","lang":"en","scope":"/","edge_side_panel":{"default_path":"/"},"icons":[{"src":"/pwa/image/pwa-64x64.png","sizes":"64x64","type":"image/png"},{"src":"/pwa/image/pwa-192x192.png","sizes":"192x192","type":"image/png"},{"src":"/pwa/image/pwa-512x512.png","sizes":"512x512","type":"image/png"},{"src":"/pwa/image/maskable-icon-512x512.png","sizes":"512x512","type":"image/png","purpose":"maskable"}],"shortcuts":[{"name":"随机点名","short_name":"随机点名","url":"/#random-picker","icons":[{"src":"/pwa/image/pwa-64x64.png","sizes":"64x64","type":"image/png"}]}]}

Binary file not shown.

After

Width:  |  Height:  |  Size: 526 B

BIN
pwa/image/favicon.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 368 B

13
pwa/image/logo.svg Normal file
View File

@ -0,0 +1,13 @@
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="256" height="256" viewBox="0 0 256 256" fill="none">
<path fill="#FFFFFF" d="M0 256L256 256L256 0L0 0L0 256Z">
</path>
<rect x="0" y="0" width="256" height="128" fill="#D8C4A0" >
</rect>
<rect x="0" y="128" width="256" height="128" fill="#F5E0BB" >
</rect>
<path d="M48 208L128 128L208 128L128 208L48 208Z" fill-rule="evenodd" fill="#241A04" >
</path>
<path d="M48 128L128 48L208 48L128 128L48 128Z" fill-rule="evenodd" fill="#52452A" >
</path>
</svg>

After

Width:  |  Height:  |  Size: 554 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

BIN
pwa/image/pwa-192x192.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 670 B

BIN
pwa/image/pwa-512x512.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

BIN
pwa/image/pwa-64x64.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 297 B

1
registerSW.js Normal file
View File

@ -0,0 +1 @@
if('serviceWorker' in navigator) {window.addEventListener('load', () => {navigator.serviceWorker.register('/sw.js', { scope: '/' })})}

44
sw-cache-manager.js Normal file
View File

@ -0,0 +1,44 @@
// 添加缓存管理消息处理
self.addEventListener('message', (event) => {
if (event.data && event.data.type === 'CACHE_KEYS') {
// 获取所有缓存键
caches.keys().then((cacheNames) => {
event.ports[0].postMessage({ cacheNames });
});
} else if (event.data && event.data.type === 'CACHE_CONTENT') {
// 获取特定缓存的内容
const cacheName = event.data.cacheName;
caches.open(cacheName).then((cache) => {
cache.keys().then((requests) => {
const urls = requests.map(request => request.url);
event.ports[0].postMessage({ cacheName, urls });
});
});
} else if (event.data && event.data.type === 'CLEAR_CACHE') {
// 清除特定缓存
const cacheName = event.data.cacheName;
caches.delete(cacheName).then((success) => {
event.ports[0].postMessage({ success, cacheName });
});
} else if (event.data && event.data.type === 'CLEAR_URL') {
// 清除特定URL的缓存
const cacheName = event.data.cacheName;
const url = event.data.url;
caches.open(cacheName).then((cache) => {
cache.delete(url).then((success) => {
event.ports[0].postMessage({ success, cacheName, url });
});
});
} else if (event.data && event.data.type === 'CLEAR_ALL_CACHES') {
// 清除所有缓存
caches.keys().then((cacheNames) => {
Promise.all(
cacheNames.map(name => caches.delete(name))
).then(() => {
event.ports[0].postMessage({ success: true });
});
});
}
});
console.log('Cache Manager extension loaded');

1
sw.js Normal file
View File

@ -0,0 +1 @@
if(!self.define){let e,s={};const a=(a,n)=>(a=new URL(a+".js",n).href,s[a]||new Promise((s=>{if("document"in self){const e=document.createElement("script");e.src=a,e.onload=s,document.head.appendChild(e)}else e=a,importScripts(a),s()})).then((()=>{let e=s[a];if(!e)throw new Error(`Module ${a} didnt register its module`);return e})));self.define=(n,c)=>{const i=e||("document"in self?document.currentScript.src:"")||location.href;if(s[i])return;let r={};const t=e=>a(e,i),o={module:{uri:i},exports:r,require:t};s[i]=Promise.all(n.map((e=>o[e]||t(e)))).then((e=>(c(...e),r)))}}define(["./workbox-dd2fb8cb"],(function(e){"use strict";importScripts("/sw-cache-manager.js"),self.skipWaiting(),e.clientsClaim(),e.precacheAndRoute([{url:"favicon.ico",revision:"8e3a55390cf66d227f765a6063bb6c31"},{url:"index.html",revision:"e459ae03088ee4a004ffeca8a9c226e5"},{url:"manifest.webmanifest",revision:"f1439ade6b7d8aaac202ed429ac27cd2"},{url:"registerSW.js",revision:"1872c500de691dce40960bb85481de07"},{url:"sw-cache-manager.js",revision:"e1c99eed8d27ad84cb5fc7c56efd223b"},{url:"pwa/image/maskable-icon-512x512.png",revision:"dfa412c4bbe0f716216ac5db7a4c706d"},{url:"pwa/image/pwa-192x192.png",revision:"81802c789e8b735f7f8b181f002932f8"},{url:"pwa/image/pwa-512x512.png",revision:"57cc60501279a6d172b32211b1c67688"},{url:"pwa/image/pwa-64x64.png",revision:"b4ca4c3d8333391f20cddbb3f6cca2df"},{url:"manifest.webmanifest",revision:"f1439ade6b7d8aaac202ed429ac27cd2"}],{}),e.cleanupOutdatedCaches(),e.registerRoute(new e.NavigationRoute(e.createHandlerBoundToURL("index.html"))),e.registerRoute((({url:e})=>e.pathname.startsWith("/assets/")),new e.CacheFirst({cacheName:"assets-cache",plugins:[new e.ExpirationPlugin({maxEntries:200,maxAgeSeconds:5184e3}),new e.CacheableResponsePlugin({statuses:[0,200]})]}),"GET"),e.registerRoute((({url:e})=>e.pathname.startsWith("/pwa/")),new e.StaleWhileRevalidate({cacheName:"pwa-cache",plugins:[new e.ExpirationPlugin({maxEntries:50,maxAgeSeconds:604800}),new e.CacheableResponsePlugin({statuses:[0,200]})]}),"GET"),e.registerRoute((({url:e})=>{const s=e.pathname;return!(s.includes("/assets/")||s.includes("/pwa/"))}),new e.NetworkFirst({cacheName:"other-resources",networkTimeoutSeconds:10,plugins:[new e.ExpirationPlugin({maxEntries:100,maxAgeSeconds:86400}),new e.CacheableResponsePlugin({statuses:[0,200]})]}),"GET")}));

1
workbox-dd2fb8cb.js Normal file

File diff suppressed because one or more lines are too long