From 90eac27dae1cb8737e776e547ac505fd1725ee45 Mon Sep 17 00:00:00 2001 From: Chenx221 Date: Fri, 14 Jun 2024 16:05:29 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E9=A6=96=E9=A1=B5=E5=8A=A8?= =?UTF-8?q?=E6=80=81=E8=A7=86=E8=A7=89=E5=8A=A0=E8=BD=BD=E6=80=A7=E8=83=BD?= =?UTF-8?q?=20=EF=BC=88=E6=94=B9=E6=88=90cdn=E5=8A=A0=E9=80=9F=EF=BC=8C?= =?UTF-8?q?=E5=8F=AF=E8=83=BD=E5=AF=B9=E4=B8=AD=E5=9B=BD=E5=A4=A7=E9=99=86?= =?UTF-8?q?=E7=94=A8=E6=88=B7=E4=B8=8D=E5=A4=AA=E5=8F=8B=E5=A5=BD=EF=BC=9F?= =?UTF-8?q?=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- assets/EChartsLiquidFillAsset.php | 13 -- assets/TSParticlesAsset.php | 4 +- composer.json | 2 - config/web.php | 2 +- views/site/index.php | 200 ++++++++++++++++++++---------- 5 files changed, 137 insertions(+), 84 deletions(-) delete mode 100644 assets/EChartsLiquidFillAsset.php diff --git a/assets/EChartsLiquidFillAsset.php b/assets/EChartsLiquidFillAsset.php deleted file mode 100644 index 4465442..0000000 --- a/assets/EChartsLiquidFillAsset.php +++ /dev/null @@ -1,13 +0,0 @@ - [ 'class' => 'yii\rbac\DbManager', // uncomment if you want to cache RBAC items hierarchy - // 'cache' => 'cache', +// 'cache' => 'cache', ], 'request' => [ // !!! insert a secret key in the following (if it is empty) - this is required by cookie validation diff --git a/views/site/index.php b/views/site/index.php index a21a5bc..4bf7784 100644 --- a/views/site/index.php +++ b/views/site/index.php @@ -9,7 +9,6 @@ use yii\helpers\Url; $this->title = '首页'; TSParticlesAsset::register($this); -//$latestAnnouncements = []; emulating empty data ?>
@@ -105,75 +104,144 @@ $(document).ready(function() { }); }); }); -async function loadParticles(options) { - - await tsParticles.load({ id: "tsparticles", options }); -} +(async () => { + await loadSlim(tsParticles); -const configs = { - fpsLimit: 60, - particles: { - number: { - value: 100, - density: { - enable: true, - area: 800 - } - }, - color: { - value: ["#2EB67D", "#ECB22E", "#E01E5B", "#36C5F0"] - }, - shape: { - type: "circle" - }, - opacity: { - value: 0.4 - }, - size: { - value: { min: 4, max: 8 } - }, - links: { - enable: true, - distance: 150, - color: "#808080", - opacity: 0.4, - width: 1 - }, - move: { - enable: true, - speed: 1, - outModes: { - default: "out" - } - } - }, - interactivity: { - events: { - onHover: { - enable: true, - mode: "grab" + await tsParticles.load({ + id: "tsparticles", + options: { + fpsLimit: 60, + particles: { + number: { + value: 100, + density: { + enable: true, + area: 800 + } + }, + color: { + value: ["#2EB67D", "#ECB22E", "#E01E5B", "#36C5F0"] + }, + shape: { + type: "circle" + }, + opacity: { + value: 0.4 + }, + size: { + value: { min: 4, max: 8 } + }, + links: { + enable: true, + distance: 150, + color: "#808080", + opacity: 0.4, + width: 1 + }, + move: { + enable: true, + speed: 1, + outModes: { + default: "out" + } + } }, - onClick: { - enable: true, - mode: "push" + interactivity: { + events: { + onHover: { + enable: true, + mode: "grab" + }, + onClick: { + enable: true, + mode: "push" + } + }, + modes: { + grab: { + distance: 230, + links: { + opacity: 1, + color: "#808080" + } + }, + push: { + quantity: 4 + } + } } - }, - modes: { - grab: { - distance: 230, - links: { - opacity: 1, - color: "#808080" - } - }, - push: { - quantity: 4 - } - } } - }; - -loadParticles(configs).then(r => console.log("Particles loaded")); + }); +})(); +// async function loadParticles(options) { +// +// await tsParticles.load({ id: "tsparticles", options }); +// } +// +// const configs = { +// fpsLimit: 60, +// particles: { +// number: { +// value: 100, +// density: { +// enable: true, +// area: 800 +// } +// }, +// color: { +// value: ["#2EB67D", "#ECB22E", "#E01E5B", "#36C5F0"] +// }, +// shape: { +// type: "circle" +// }, +// opacity: { +// value: 0.4 +// }, +// size: { +// value: { min: 4, max: 8 } +// }, +// links: { +// enable: true, +// distance: 150, +// color: "#808080", +// opacity: 0.4, +// width: 1 +// }, +// move: { +// enable: true, +// speed: 1, +// outModes: { +// default: "out" +// } +// } +// }, +// interactivity: { +// events: { +// onHover: { +// enable: true, +// mode: "grab" +// }, +// onClick: { +// enable: true, +// mode: "push" +// } +// }, +// modes: { +// grab: { +// distance: 230, +// links: { +// opacity: 1, +// color: "#808080" +// } +// }, +// push: { +// quantity: 4 +// } +// } +// } +// }; +// +// loadParticles(configs).then(r => console.log("Particles loaded")); JS;