Skip to content

Commit

Permalink
Cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
sindresorhus committed Aug 15, 2018
1 parent 276b39c commit 2273854
Show file tree
Hide file tree
Showing 32 changed files with 141 additions and 100 deletions.
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* text=auto eol=lf
17 changes: 4 additions & 13 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,14 +1,5 @@
# build output
out
.next
dist

# dependencies
node_modules

# logs
npm-debug.log
yarn-error.log

# MacOS
.DS_Store
/renderer/out
/renderer/.next
/app/dist
/dist
1 change: 1 addition & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
package-lock=false
21 changes: 0 additions & 21 deletions LICENSE

This file was deleted.

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
Or install with [Homebrew-Cask](https://caskroom.github.io):

```
$ brew update && brew cask install kap
$ brew cask install kap
```

## Contribute
Expand Down
2 changes: 1 addition & 1 deletion contributing.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

1. [Fork](https://help.github.com/articles/fork-a-repo/) this repository to your own GitHub account and then [clone](https://help.github.com/articles/cloning-a-repository/) it to your local device
2. Install the dependencies: `npm install`
3. Build the code, start the app, and watch for changes: `npm run dev`
3. Build the code, start the app, and watch for changes: `npm start`

To make sure that your code works in the finished app, you can generate the binary:

Expand Down
2 changes: 1 addition & 1 deletion main/common/aperture.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ const startRecording = async options => {
await desktopIcons.hide();
}

console.log(`Hid desktop icons after ${(Date.now() - past) / 1000}s`);
console.log(`Hide desktop icons after ${(Date.now() - past) / 1000}s`);

if (doNotDisturb) {
wasDoNotDisturbAlreadyEnabled = await dnd.isEnabled();
Expand Down
10 changes: 6 additions & 4 deletions main/common/settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,15 @@ store.set('actionBar', {});

const audioInputDeviceId = store.get('audioInputDeviceId');

audioDevices().then(audioDevices => {
if (!audioDevices.some(device => device.id === audioInputDeviceId)) {
const [device] = audioDevices;
(async () => {
const devices = await audioDevices();

if (!devices.some(device => device.id === audioInputDeviceId)) {
const [device] = devices;
if (device) {
store.set('audioInputDeviceId', device.id);
}
}
});
})();

module.exports = store;
17 changes: 14 additions & 3 deletions main/export.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,11 @@ class Export {
try {
await this.service.action(this.context);
if (!this.canceled) {
this.updateExport({text: 'Export completed', status: 'completed', percentage: undefined});
this.updateExport({
text: 'Export completed',
status: 'completed',
percentage: undefined
});
}
resolve();
} catch (error) {
Expand All @@ -65,7 +69,11 @@ class Export {
}

cancel() {
this.updateExport({text: 'Export canceled', status: 'canceled', percentage: undefined});
this.updateExport({
text: 'Export canceled',
status: 'canceled',
percentage: undefined
});
this.canceled = true;

if (this.resolve) {
Expand All @@ -80,7 +88,10 @@ class Export {
}

setProgress(text, percentage = 0) {
this.updateExport({text, percentage, status: 'processing'});
this.updateExport({
text, percentage,
status: 'processing'
});
}

async convert() {
Expand Down
2 changes: 2 additions & 0 deletions main/save-file-service.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use strict';

const {Notification, shell} = require('electron');
const moveFile = require('move-file');

Expand Down
2 changes: 1 addition & 1 deletion main/tray.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ const animateIcon = () => new Promise(resolve => {
try {
tray.setImage(path.join(__dirname, '..', 'static', 'menubar-loading', filename));
next();
} catch (err) {
} catch (_) {
resolve();
}
}, interval);
Expand Down
2 changes: 1 addition & 1 deletion renderer/components/action-bar/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ class ActionBar extends React.Component {
width: ${width}px;
background: white;
border-radius: 4px;
box-shadow: 0px 0px 5px 2px rgba(0,0,0,0.2);
box-shadow: 0px 0px 5px 2px rgba(0, 0, 0, 0.2);
z-index: 10;
top: ${y}px;
left: ${x}px;
Expand Down
32 changes: 24 additions & 8 deletions renderer/components/action-bar/record-button.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ class RecordButton extends React.Component {
this.setState({shouldStop: true});
}
};
}, err => {
console.error('An error occurred when trying to get audio levels:', err);
}, error => {
console.error('An error occurred when trying to get audio levels:', error);
});
}
}
Expand All @@ -61,7 +61,17 @@ class RecordButton extends React.Component {

startRecording = event => {
event.stopPropagation();
const {cropperExists, x, y, width, height, screenWidth, screenHeight, displayId, willStartRecording} = this.props;
const {
cropperExists,
x,
y,
width,
height,
screenWidth,
screenHeight,
displayId,
willStartRecording
} = this.props;

if (cropperExists) {
const {remote} = electron;
Expand Down Expand Up @@ -95,8 +105,8 @@ class RecordButton extends React.Component {
<div className="inner">
{!cropperExists && <div className="fill"/>}
</div>
{ showFirst && <div className="ripple first" onAnimationIteration={this.shouldFirstStop}/>}
{ showSecond && <div className="ripple second" onAnimationIteration={this.shouldSecondStop}/>}
{showFirst && <div className="ripple first" onAnimationIteration={this.shouldFirstStop}/>}
{showSecond && <div className="ripple second" onAnimationIteration={this.shouldSecondStop}/>}
</div>
<style jsx>{`
.container {
Expand Down Expand Up @@ -154,9 +164,15 @@ class RecordButton extends React.Component {
animation: ripple 1.8s linear 0.9s infinite;
}
@keyframes ripple{
0% {transform:scale(1); }
100% {transform:scale(1.3); opacity:0;}
@keyframes ripple {
0% {
transform: scale(1);
}
100% {
transform: scale(1.3);
opacity: 0;
}
}
`}</style>
</div>
Expand Down
10 changes: 8 additions & 2 deletions renderer/components/cropper/cursor.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,14 @@ class Cursor extends React.Component {
return null;
}

/// const {width: screenWidth, height: screenHeight} = this.remote.getGlobal('screen');
const {cursorY, cursorX, width, height, screenWidth, screenHeight} = this.props;
const {
cursorY,
cursorX,
width,
height,
screenWidth,
screenHeight
} = this.props;

const className = classNames('dimensions', {
flipY: screenHeight - cursorY < 35,
Expand Down
10 changes: 9 additions & 1 deletion renderer/components/cropper/handles.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,15 @@ class Handle extends React.Component {
}

render() {
const {size, top, bottom, right, left, onClick, ratioLocked} = this.props;
const {
size,
top,
bottom,
right,
left,
onClick,
ratioLocked
} = this.props;

const className = classNames('handle', {
'handle-top': top,
Expand Down
8 changes: 4 additions & 4 deletions renderer/components/cropper/overlay.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,20 +65,20 @@ class Overlay extends React.Component {
<div id="bottom" className={className} onMouseDown={startPicking}/>
<style jsx>{`
.overlay {
background-color: rgba(0, 0, 0, .5);
transition: background-color .5s ease-in-out, width .2s ease-out, height .2s ease-out;
background-color: rgba(0, 0, 0, 0.5);
transition: background-color 0.5s ease-in-out, width 0.2s ease-out, height 0.2s ease-out;
}
.overlay.recording {
background-color: rgba(0, 0, 0, .1);
background-color: rgba(0, 0, 0, 0.1);
}
.overlay.picking {
cursor: crosshair;
}
.overlay.no-transition {
transition: background-color .5s ease-in-out;
transition: background-color 0.5s ease-in-out;
}
#middle {
Expand Down
2 changes: 1 addition & 1 deletion renderer/components/editor/controls/play-bar.js
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ class PlayBar extends React.Component {
left: 50%;
transform: translateX(-50%);
width: 60%;
transition: all .12s ease-in-out;
transition: all 0.12s ease-in-out;
}
.progress-bar-container:not(.hover) {
Expand Down
4 changes: 2 additions & 2 deletions renderer/components/editor/controls/preview.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ class Preview extends React.Component {
transform: translateX(-50%);
width: max-content;
height: 24px;
background: rgba(0, 0, 0, .4);
background: rgba(0, 0, 0, 0.4);
color: #fff;
display: flex;
align-items: center;
Expand All @@ -53,7 +53,7 @@ class Preview extends React.Component {
width: 100%;
height: 100%;
border-radius: 4px;
box-shadow: 0px 0px 16px rgba(0,0,0,.1);
box-shadow: 0px 0px 16px rgba(0, 0, 0, 0.1);
${hidePreview ? 'display: none;' : ''}
}
`}</style>
Expand Down
3 changes: 2 additions & 1 deletion renderer/components/editor/controls/right.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@ class RightControls extends React.Component {
justify-content: flex-end;
}
.mute, .fullscreen {
.mute,
.fullscreen {
width: 24px;
height: 24px;
margin-left: 16px;
Expand Down
11 changes: 7 additions & 4 deletions renderer/components/editor/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ export default class Editor extends React.Component {
width: 100%;
height: 36px;
background: rgba(0, 0, 0, 0.4);
transition: top .12s ease-in-out;
transition: top 0.12s ease-in-out;
display: flex;
z-index: 10;
}
Expand Down Expand Up @@ -101,7 +101,8 @@ export default class Editor extends React.Component {
-webkit-app-region: no-drag;
}
.traffic-light:after, .traffic-light:before {
.traffic-light:after,
.traffic-light:before {
visibility: hidden;
}
Expand All @@ -118,7 +119,8 @@ export default class Editor extends React.Component {
background-color: #bf4942;
}
.close:after, .close:before {
.close:after,
.close:before {
background-color: #760e0e;
width: 8px;
height: 2px;
Expand Down Expand Up @@ -166,7 +168,8 @@ export default class Editor extends React.Component {
pointer-events: none;
}
.disabled:after, .disabled:before {
.disabled:after,
.disabled:before {
display: none;
}
`}</style>
Expand Down
4 changes: 2 additions & 2 deletions renderer/components/editor/options/left.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ class LeftOptions extends React.Component {
input {
height: 24px;
background: hsla(0,0%,100%,.1);
background: hsla(0, 0%, 100%, 0.1);
text-align: center;
font-size: 12px;
box-sizing: border-box;
Expand All @@ -64,7 +64,7 @@ class LeftOptions extends React.Component {
input:focus, input:hover {
outline: none;
background: hsla(0,0%,100%,.2);
background: hsla(0, 0%, 100%, 0.2);
}
.option {
Expand Down
4 changes: 2 additions & 2 deletions renderer/components/editor/options/right.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ class RightOptions extends React.Component {
.button {
padding: 4px 8px;
background: hsla(0,0%,100%,.1);
background: hsla(0, 0%, 100%, 0.1);
font-size: 12px;
color: white;
height: 24px;
Expand All @@ -59,7 +59,7 @@ class RightOptions extends React.Component {
}
.button:hover {
background: hsla(0,0%,100%,.2);
background: hsla(0, 0%, 100%, 0.2);
}
`}</style>
</div>
Expand Down
Loading

0 comments on commit 2273854

Please sign in to comment.