mirror of
https://github.com/Grasscutters/Cultivation.git
synced 2025-12-14 16:14:48 +01:00
close and minimize buttons
This commit is contained in:
@@ -59,7 +59,8 @@
|
|||||||
"height": 600,
|
"height": 600,
|
||||||
"resizable": true,
|
"resizable": true,
|
||||||
"title": "Cultivation",
|
"title": "Cultivation",
|
||||||
"width": 800
|
"width": 800,
|
||||||
|
"decorations": false
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,38 +1,19 @@
|
|||||||
.App {
|
body {
|
||||||
text-align: center;
|
user-select: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
.App-logo {
|
.TopButton {
|
||||||
height: 40vmin;
|
height: 60%;
|
||||||
pointer-events: none;
|
margin: 0px 10px;
|
||||||
|
filter: invert(95%) sepia(0%) saturate(18%) hue-rotate(153deg) brightness(88%) contrast(81%);
|
||||||
|
|
||||||
|
transition: filter 0.1s ease-in-out;
|
||||||
}
|
}
|
||||||
|
|
||||||
@media (prefers-reduced-motion: no-preference) {
|
.TopButton:hover {
|
||||||
.App-logo {
|
filter: invert(100%) sepia(0%) saturate(18%) hue-rotate(153deg) brightness(100%) contrast(100%);
|
||||||
animation: App-logo-spin infinite 20s linear;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.App-header {
|
.TopButton img {
|
||||||
background-color: #282c34;
|
height: 80%;
|
||||||
min-height: 100vh;
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
align-items: center;
|
|
||||||
justify-content: center;
|
|
||||||
font-size: calc(10px + 2vmin);
|
|
||||||
color: white;
|
|
||||||
}
|
|
||||||
|
|
||||||
.App-link {
|
|
||||||
color: #61dafb;
|
|
||||||
}
|
|
||||||
|
|
||||||
@keyframes App-logo-spin {
|
|
||||||
from {
|
|
||||||
transform: rotate(0deg);
|
|
||||||
}
|
|
||||||
to {
|
|
||||||
transform: rotate(360deg);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
.TopBar {
|
.TopBar {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: row;
|
flex-direction: row-reverse;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 34px;
|
height: 34px;
|
||||||
|
|||||||
@@ -1,15 +1,31 @@
|
|||||||
import React from 'react'
|
import React from 'react'
|
||||||
|
import { appWindow } from '@tauri-apps/api/window'
|
||||||
import './TopBar.css'
|
import './TopBar.css'
|
||||||
|
import closeIcon from '../../resources/icons/close.svg'
|
||||||
|
import minIcon from '../../resources/icons/min.svg'
|
||||||
|
|
||||||
export default class TopBar extends React.Component {
|
export default class TopBar extends React.Component {
|
||||||
constructor(props: unknown[]) {
|
constructor(props: unknown[]) {
|
||||||
super(props)
|
super(props)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
handleClose() {
|
||||||
|
appWindow.close()
|
||||||
|
}
|
||||||
|
|
||||||
|
handleMinimize() {
|
||||||
|
appWindow.minimize()
|
||||||
|
}
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
return (
|
return (
|
||||||
<div className="TopBar">
|
<div className="TopBar" data-tauri-drag-region >
|
||||||
TOP BAR BABY
|
<div id="closeBtn" onClick={this.handleClose} className='TopButton'>
|
||||||
|
<img src={closeIcon} alt="close" />
|
||||||
|
</div>
|
||||||
|
<div id="minBtn" onClick={this.handleMinimize} className='TopButton'>
|
||||||
|
<img src={minIcon} alt="minimize" />
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user