master
宇天 2020-12-09 20:38:11 +08:00
parent 45ab088e89
commit 8d0fb8ff74
7 changed files with 6033 additions and 79 deletions

View File

@ -1,6 +1,6 @@
{
"name": "io.yutent.gaystat",
"version": "1.7.0",
"version": "2.0.0",
"description": "搞基数据",
"main": "src/main.js",
"scripts": {
@ -12,16 +12,20 @@
"name": "yutent",
"email": "yutent.io@gmail.com"
},
"homepage": "https://yutent.me",
"homepage": "https://yutent.top",
"license": "MIT",
"build": {
"appId": "io.yutent.gaystat",
"productName": "gaystat",
"productName": "GayStat",
"copyright": "Copyright © 2019 ${author}",
"directories": {
"buildResources": "icons",
"output": "build"
},
"electronDownload": {
"version": "11.0.4",
"mirror": "https://npm.taobao.org/mirrors/electron/"
},
"files": ["src/**/*", "node_modules/iofs/*"],
"mac": {
"category": "public.app-category.developer-tools",
@ -31,8 +35,8 @@
}
},
"devDependencies": {
"electron": "^9.0.0",
"electron-builder": "^22.0.0"
"electron": "11.0.4",
"electron-builder": "^22.1.0"
},
"dependencies": {
"iofs": "^1.3.2"

View File

@ -1 +1 @@
html{font-size:12.8px;width:100%;height:100vh}body{display:flex;flex-direction:column;width:100%;height:100%;padding-top:.9375rem;line-height:1.25;font-size:1.09375rem;color:#f2f5fc;background:transparent}.app{position:relative;display:flex;flex-direction:column;height:100%;padding:1.25rem 0 .46875rem;border-radius:.46875rem;background:rgba(88,88,88,0.85)}.app::before{position:absolute;left:12.10938rem;top:-.54688rem;width:1.09375rem;height:1.09375rem;border-radius:.15625rem;background:linear-gradient(to bottom right, rgba(88,88,88,0.85) 50%, transparent 50%);-webkit-transform:rotate(45deg);transform:rotate(45deg);content:""}.app .option,.app .close,.app .load{position:absolute;right:.46875rem;top:.15625rem;--size: 1.09375rem;cursor:pointer;opacity:0}.app .option:hover,.app .close:hover,.app .load:hover{opacity:1}.app .close{right:auto;left:.46875rem}.app .load{right:auto;left:12.10938rem}.app .list{flex:1}.app .list .item{display:flex;align-items:center;height:4.21875rem;padding:.78125rem .9375rem;line-height:1.17188rem;border-bottom:.07812rem solid rgba(200,200,200,0.1);border-top:.07812rem solid rgba(0,0,0,0.1)}.app .list .item:first-child{border-top:0}.app .list .item:last-child{border-bottom:0}.app .list .item .info{overflow:hidden;flex:1}.app .list .item .info h3{font-size:1.09375rem}.app .list .item .info cite{color:#dae1e9}.app .list .item .last-days{display:flex;width:5rem;height:2.34375rem;margin:0 .46875rem}.app .list .item .today{width:4.0625rem;font-size:.9375rem;color:#fff;text-align:right}.app .list .item .today span{display:block;padding:0 .3125rem}.app .list .item .today .percent{border-radius:.15625rem}.app .list .item .today .percent.red{background:#ff5061}.app .list .item .today .percent.green{background:#4caf50}
html{font-size:12.8px;width:100%;height:100vh}body{display:flex;flex-direction:column;width:100%;height:100%;padding-top:.9375rem;line-height:1.25;font-size:1.09375rem;color:#f2f5fc;background:transparent}.app{position:relative;display:flex;flex-direction:column;height:100%;padding:1.25rem 0 .46875rem;border-radius:.46875rem}.app::before{position:absolute;left:12.10938rem;top:-5.46875rem;width:1.09375rem;height:1.09375rem;border-radius:.15625rem;background:linear-gradient(to bottom right, rgba(88,88,88,0.85) 50%, transparent 50%);-webkit-transform:rotate(45deg);transform:rotate(45deg);content:''}.app .option,.app .close,.app .load{position:absolute;right:.46875rem;top:.15625rem;--size: 1.09375rem;cursor:pointer;opacity:0}.app .option:hover,.app .close:hover,.app .load:hover{opacity:1}.app .close{right:auto;left:.46875rem}.app .load{right:auto;left:12.10938rem}.app .list{flex:1}.app .list .item{display:flex;align-items:center;height:4.21875rem;padding:.78125rem .9375rem;line-height:1.17188rem;border-bottom:.07812rem solid rgba(200,200,200,0.1);border-top:.07812rem solid rgba(0,0,0,0.1)}.app .list .item:first-child{border-top:0}.app .list .item:last-child{border-bottom:0}.app .list .item .info{overflow:hidden;flex:1}.app .list .item .info h3{font-size:1.09375rem}.app .list .item .info cite{color:#dae1e9}.app .list .item .last-days{display:flex;width:5rem;height:2.34375rem;margin:0 .46875rem}.app .list .item .today{width:4.0625rem;font-size:.9375rem;color:#fff;text-align:right}.app .list .item .today span{display:block;padding:0 .3125rem}.app .list .item .today .percent{border-radius:.15625rem}.app .list .item .today .percent.red{background:#ff5061}.app .list .item .today .percent.green{background:#4caf50}

View File

@ -5,96 +5,132 @@
* @date 2018/12/16 17:15:07
*/
@import './var.scss';
@import "./var.scss";
html {font-size:12.8px;width:100%;height:100vh;}
html {
font-size: 12.8px;
width: 100%;
height: 100vh;
}
body {
display:flex;flex-direction: column;
width:100%;height:100%;
padding-top:px(12);
line-height:1.25;
font-size:px(14);
color:nth($cp, 1);
background:transparent;
display: flex;
flex-direction: column;
width: 100%;
height: 100%;
padding-top: px(12);
line-height: 1.25;
font-size: px(14);
color: nth($cp, 1);
background: transparent;
// background: rgba(88, 88, 88, 0.5);
}
.app {
position:relative;
display:flex;
position: relative;
display: flex;
flex-direction: column;
height:100%;
padding:px(16) 0 px(6);
border-radius:px(6);
background:rgba(88, 88, 88, .85);
height: 100%;
padding: px(16) 0 px(6);
border-radius: px(6);
// background: rgba(88, 88, 88, 0.5);
&::before {
position:absolute;
left:px(155); top:px(-7);
width:px(14); height:px(14);
border-radius:px(2);
background: linear-gradient(to bottom right, rgba(88, 88, 88, .85) 50%, transparent 50%);
transform:rotate(45deg);
content:"";
position: absolute;
left: px(155);
top: px(-70);
width: px(14);
height: px(14);
border-radius: px(2);
background: linear-gradient(
to bottom right,
rgba(88, 88, 88, 0.85) 50%,
transparent 50%
);
transform: rotate(45deg);
content: '';
}
.option, .close, .load {
position:absolute;
right:px(6);top:px(2);
.option,
.close,
.load {
position: absolute;
right: px(6);
top: px(2);
--size: #{px(14)};
cursor:pointer;
opacity:0;
cursor: pointer;
opacity: 0;
&:hover {
opacity:1;
opacity: 1;
}
}
.close {right:auto;left:px(6)}
.load {right:auto;left:px(155)}
.close {
right: auto;
left: px(6);
}
.load {
right: auto;
left: px(155);
}
.list {
flex:1;
flex: 1;
.item {
display:flex;
align-items:center;
height:px(54);
padding:px(10) px(12);
line-height:px(15);
border-bottom:px(1) solid rgba(200, 200, 200, .1);
border-top:px(1) solid rgba(0, 0, 0, .1);
display: flex;
align-items: center;
height: px(54);
padding: px(10) px(12);
line-height: px(15);
border-bottom: px(1) solid rgba(200, 200, 200, 0.1);
border-top: px(1) solid rgba(0, 0, 0, 0.1);
&:first-child {border-top:0;}
&:last-child {border-bottom:0;}
&:first-child {
border-top: 0;
}
&:last-child {
border-bottom: 0;
}
.info {
overflow:hidden;
flex:1;
overflow: hidden;
flex: 1;
h3 {font-size:px(14);}
cite {color:nth($cp, 3);}
h3 {
font-size: px(14);
}
cite {
color: nth($cp, 3);
}
}
.last-days {
display:flex;
width:px(64);height:px(30);
margin:0 px(6);
display: flex;
width: px(64);
height: px(30);
margin: 0 px(6);
}
.today {
width:px(52);
font-size:px(12);
color:#fff;
text-align:right;
width: px(52);
font-size: px(12);
color: #fff;
text-align: right;
span {display:block;padding:0 px(4);}
span {
display: block;
padding: 0 px(4);
}
.percent {
border-radius:px(2);
border-radius: px(2);
&.red {background:nth($cr, 1);}
&.green {background:nth($cg, 3);}
&.red {
background: nth($cr, 1);
}
&.green {
background: nth($cg, 3);
}
}
}
}

View File

@ -16,9 +16,9 @@ import Utils from '/lib/utils.js'
const log = console.log
const { remote, ipcRenderer } = require('electron')
const { ipcRenderer } = require('electron')
const WIN = remote.getCurrentWindow()
// const WIN = remote.getCurrentWindow()
const $doc = Anot(document)
@ -72,14 +72,13 @@ Anot({
}
},
mounted() {
WIN.on('blur', _ => {
WIN.hide()
})
// WIN.on('blur', _ => {
// WIN.hide()
// })
var watch_list = Anot.ls('watch_list') || '[]'
if (watch_list) {
watch_list = JSON.parse(watch_list)
}
this.list = watch_list
@ -89,7 +88,7 @@ Anot({
},
methods: {
close() {
WIN.close()
// WIN.close()
},
getTodayStat(id) {
var res = ipcRenderer.sendSync(

View File

@ -80,12 +80,17 @@ app.once('ready', () => {
maximizable: false,
frame: false,
transparent: true,
show: false,
hasShadow: false,
// backgroundColor: '#80585858',
// show: false,
vibrancy: 'dark',
visualEffectState: 'active',
icon: path.resolve(ROOT, './images/app.png'),
webPreferences: {
webSecurity: false,
// webSecurity: false,
experimentalFeatures: true,
nodeIntegration: true
nodeIntegration: true,
spellcheck: false
}
})

View File

@ -6,15 +6,15 @@
'use strict'
const { app, Tray } = require('electron')
const { Tray } = require('electron')
const path = require('path')
const ROOT = __dirname
module.exports = function(win) {
app.__TRAY__ = new Tray(path.join(ROOT, '../images/tray.png'))
win.__TRAY__ = new Tray(path.join(ROOT, '../images/tray.png'))
app.__TRAY__.on('click', _ => {
var b = app.__TRAY__.getBounds()
win.__TRAY__.on('click', _ => {
var b = win.__TRAY__.getBounds()
win.setBounds({ x: b.x - 150, y: b.y + b.height + 4 })
win.show()
win.focus()

5910
test.js Normal file

File diff suppressed because it is too large Load Diff