From 8c5dddc880c2d4a5deedb537446a3fd68b4cea52 Mon Sep 17 00:00:00 2001 From: Starry Source Date: Sun, 15 Oct 2023 23:56:50 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E9=97=AD=E5=B9=95=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- examp.css | 7 ++++--- examp.js | 17 +++++++++++++--- example.html | 19 +++++++++++------- index.css | 30 ++++++++++++++++++++++----- index.html | 15 ++++++++++++-- pics/closecrmn.json | 49 +++++++++++++++++++++++++++++++++++++++++++++ pics/opencrmn.json | 4 ++++ 7 files changed, 121 insertions(+), 20 deletions(-) create mode 100644 pics/closecrmn.json diff --git a/examp.css b/examp.css index a33d165..cf1e761 100644 --- a/examp.css +++ b/examp.css @@ -120,7 +120,7 @@ body{ text-align: center; transition: 200ms cubic-bezier(1, 0, 0, 1); overflow-y: auto; - overflow-x: hidden; + overflow-x: hidden !important; scroll-behavior: smooth; } @@ -135,6 +135,7 @@ body{ gap: 12px; justify-content: center; grid-auto-flow: row dense; + overflow: hidden; } @@ -223,11 +224,11 @@ body{ :root.mobile #music{ width: calc(100% - 30px); - min-width: 200px; + min-width: 170px; } #music>.ti{ - font-size: 100px; + font-size: 80px; margin: 0; } diff --git a/examp.js b/examp.js index c453396..aadbc5a 100644 --- a/examp.js +++ b/examp.js @@ -5,6 +5,17 @@ try{ pld=true; } let ph,played=false,playm=pld; +if(localStorage.getItem('playm')=='true'){ + playm=true; + $('#music>.btn.play').remove(); + $('#music>.tip').text('我们时刻准备趁浏览器不备播放音乐'); +}else if(localStorage.getItem('playm')=='false'){ + document.getElementById('audio').pause(); + playm=false; + $('#music>.btn.noplay').remove(); + $('#music>.tip').text('我们不会播放音乐'); + localStorage.setItem('playm',false); +} function init() { ph=window.innerHeight; $(':root').css('--ph',`${ph}px`); @@ -18,14 +29,14 @@ function start() { let pics=document.querySelectorAll('#content>.pic'); document.addEventListener('scroll',()=>{ if(playm && (!played)){ - document.getElementById('audio').play(); if(document.getElementById('audio').played.length>0){ played=true; + $('#music>.btn').remove(); $('#musctrl>.btn').text('暂停'); $('#musctrl>.btn').removeClass('play'); $('#music>.tip').text('我们已开始播放音乐'); - $('#music>.btn').remove(); - } + }else + document.getElementById('audio').play(); } let t=$('html').scrollTop(); pics.forEach(pic => { diff --git a/example.html b/example.html index fa57a47..9e8885a 100644 --- a/example.html +++ b/example.html @@ -7,6 +7,7 @@ Title + @@ -51,7 +52,7 @@

志愿服务

- +

闭幕式

@@ -128,17 +129,21 @@