master
parent
45ab088e89
commit
8d0fb8ff74
14
package.json
14
package.json
|
@ -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"
|
||||
|
|
|
@ -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}
|
||||
|
|
|
@ -5,20 +5,25 @@
|
|||
* @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%;
|
||||
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 {
|
||||
|
@ -28,21 +33,30 @@ body {
|
|||
height: 100%;
|
||||
padding: px(16) 0 px(6);
|
||||
border-radius: px(6);
|
||||
background:rgba(88, 88, 88, .85);
|
||||
// background: rgba(88, 88, 88, 0.5);
|
||||
|
||||
&::before {
|
||||
position: absolute;
|
||||
left:px(155); top:px(-7);
|
||||
width:px(14); height:px(14);
|
||||
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, .85) 50%, transparent 50%);
|
||||
background: linear-gradient(
|
||||
to bottom right,
|
||||
rgba(88, 88, 88, 0.85) 50%,
|
||||
transparent 50%
|
||||
);
|
||||
transform: rotate(45deg);
|
||||
content:"";
|
||||
content: '';
|
||||
}
|
||||
|
||||
.option, .close, .load {
|
||||
.option,
|
||||
.close,
|
||||
.load {
|
||||
position: absolute;
|
||||
right:px(6);top:px(2);
|
||||
right: px(6);
|
||||
top: px(2);
|
||||
--size: #{px(14)};
|
||||
cursor: pointer;
|
||||
opacity: 0;
|
||||
|
@ -51,8 +65,14 @@ body {
|
|||
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;
|
||||
|
@ -63,23 +83,32 @@ body {
|
|||
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);
|
||||
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;
|
||||
|
||||
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);
|
||||
width: px(64);
|
||||
height: px(30);
|
||||
margin: 0 px(6);
|
||||
}
|
||||
|
||||
|
@ -89,12 +118,19 @@ body {
|
|||
color: #fff;
|
||||
text-align: right;
|
||||
|
||||
span {display:block;padding:0 px(4);}
|
||||
span {
|
||||
display: block;
|
||||
padding: 0 px(4);
|
||||
}
|
||||
.percent {
|
||||
border-radius: px(2);
|
||||
|
||||
&.red {background:nth($cr, 1);}
|
||||
&.green {background:nth($cg, 3);}
|
||||
&.red {
|
||||
background: nth($cr, 1);
|
||||
}
|
||||
&.green {
|
||||
background: nth($cg, 3);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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(
|
||||
|
|
11
src/main.js
11
src/main.js
|
@ -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
|
||||
}
|
||||
})
|
||||
|
||||
|
|
|
@ -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()
|
||||
|
|
Loading…
Reference in New Issue