Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/mumuy/relationship
Browse files Browse the repository at this point in the history
# Conflicts:
#	dist/lang/relationship.zh-HK.min.js
#	dist/lang/relationship.zh-HK.min.mjs
#	dist/relationship.min.js
#	dist/relationship.min.mjs
  • Loading branch information
zhenghaole committed Sep 6, 2024
2 parents d54d804 + dc64307 commit 227f44d
Show file tree
Hide file tree
Showing 9 changed files with 978 additions and 606 deletions.
2 changes: 1 addition & 1 deletion dist/lang/relationship.zh-HK.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/lang/relationship.zh-HK.min.mjs

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions gulpfile.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
const gulp = require('gulp');
const rename = require("gulp-rename");
const cht = require('gulp-cht');
const replace = require('gulp-replace');

gulp.task('localization', () => {
// gulp.src('./index.html')
Expand All @@ -14,6 +15,7 @@ gulp.task('localization', () => {
'dist/relationship-mode.min.js',
'dist/relationship-mode.min.mjs',
]).pipe(cht())
.pipe(replace('嶽','岳'))
.pipe(rename(function(path) {
path.basename = path.basename.replace('.min','.zh-HK.min');
}))
Expand Down
438 changes: 222 additions & 216 deletions index.html

Large diffs are not rendered by default.

309 changes: 307 additions & 2 deletions package-lock.json

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
"bugs": {
"url": "https://github.com/mumuy/relationship/issues"
},
"files":[
"files": [
"dist"
],
"devDependencies": {
Expand All @@ -58,6 +58,7 @@
"gulp": "^5.0.0",
"gulp-cht": "^2.0.20",
"gulp-rename": "^2.0.0",
"gulp-replace": "^1.1.4",
"rollup": "^3.29.4",
"tape": "^5.7.5",
"through2": "^4.0.2"
Expand Down
23 changes: 8 additions & 15 deletions static/script/index.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
// 头部滚动
(function(){
let $header = document.querySelector('.header');
document.addEventListener('scroll',function(){
let scrollTop = document.documentElement.scrollTop;
let $header = document.querySelector('.mod-head');
document.querySelector('.scroll-container').addEventListener('scroll',function(){
let scrollTop = this.scrollTop;
let ratio = Math.min(scrollTop/1000,1);
$header.style.background = 'rgba(255,255,255,'+(ratio*0.8)+')';
$header.style.boxShadow = '1px 1px 6px rgba(0,0,0,'+(ratio*0.1)+')';
Expand All @@ -11,20 +11,13 @@

// 底部滚动
(function(){
let timer = null;
let $gotop = document.querySelector('.mod-fixedbar .gotop');
let $container = document.querySelector('.scroll-container');
$gotop.addEventListener('click',function(){
cancelAnimationFrame(timer);
let scrollTop = document.body.scrollTop || document.documentElement.scrollTop;
let move = scrollTop/18;
timer = requestAnimationFrame(function fn(){
var oTop = document.body.scrollTop || document.documentElement.scrollTop;
if(oTop > 0){
document.body.scrollTop = document.documentElement.scrollTop = oTop - move;
timer = requestAnimationFrame(fn);
}else{
cancelAnimationFrame(timer);
}
$container.scrollTo({
left:0,
top:0,
behavior:'smooth'
});
});
})();
Loading

0 comments on commit 227f44d

Please sign in to comment.