Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat: Custom colors & filters #60

Open
wants to merge 10 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
84 changes: 82 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,40 @@ Sample preview running the app:

![Preview](.github/preview.png)

<p align="center" id="menu">
<a href="#installation">Instalation</a>&nbsp;•&nbsp;
<a href="#usage">Usage & Settings</a>&nbsp;•&nbsp;
<a href="#contributing">Contributing</a>&nbsp;•&nbsp;
<a href="#author">Contact</a>
</p>

<br>
<br>

# Installation

Download the latest version from [releases page](https://github.com/maykbrito/mini-video-me/releases) and run it.

# Usage & settings
<br>
<br>

<h1 id="usage">Usage & Settings</h1>

After running for the first time you can access the app settings through the tray menu and click on "Settings" to change default shortcuts, camera size, zoom, shapes, etc.
After running for the first time you can access the app settings through the tray menu and click on "Settings" to change default shortcuts, camera size, zoom, shapes, borders, filters etc.

<br>

---

<p align="center" id="custom-settings">
<a href="#default-shortcuts">Shortcuts</a>&nbsp;•&nbsp;
<a href="#adjust-the-border">Border</a>&nbsp;•&nbsp;
<a href="#using-custom-shapes">Shapes</a>&nbsp;•&nbsp;
<a href="#change-size">Size</a>&nbsp;•&nbsp;
<a href="#using-custom-filters">Filters</a>
</p>

---

## Default shortcuts

Expand All @@ -55,6 +82,10 @@ After running for the first time you can access the app settings through the tra
<td>o</td>
<td>Toggle <a href="#using-custom-shapes">custom shapes</a> (window must be focused)</td>
</tr>
<tr>
<td>f</td>
<td>Toggle <a href="#using-custom-filters">custom filters</a> (window must be focused)</td>
</tr>
<tr>
<td>r</td>
<td>Reset zoom (window must be focused)</td>
Expand Down Expand Up @@ -92,6 +123,11 @@ After running for the first time you can access the app settings through the tra

> On macOS you can use Command instead of Ctrl.

<br>
<a href="#custom-settings">^ back to settings menu</a>
<br>
<br>

## Adjust the border

You can **remove border**
Expand All @@ -100,6 +136,11 @@ Open the camera settings in `tray menu > Settings` and change `"borderWith"` pro

Or you can make it thick by changing the value above to `"10px"` for example.

<br>
<a href="#custom-settings">^ back to settings menu</a>
<br>
<br>

## Using custom shapes

You can use custom shapes using the [`clip-path`](https://developer.mozilla.org/en-US/docs/Web/CSS/clip-path)
Expand All @@ -115,6 +156,11 @@ Open the camera settings in `tray menu > Settings` and in the `"shapes"` propert
<img src="https://i.imgur.com/EfTwfr6.png">
</details>

<br>
<a href="#custom-settings">^ back to settings menu</a>
<br>
<br>

## Change size

Open the camera settings in `tray menu > Settings` and change `"screen.initial"` and/or `"screen.large"`'s width and height properties as you wish
Expand All @@ -124,6 +170,30 @@ Open the camera settings in `tray menu > Settings` and change `"screen.initial"`
<img src="https://i.imgur.com/D53cdtr.png">
</details>

<br>
<a href="#custom-settings">^ back to settings menu</a>
<br>
<br>

## Using custom filters

We can apply a custom `CSS filter` as contrast, brightness, grayscale. See all filters [here](https://developer.mozilla.org/en-US/docs/Web/CSS/filter).

We can also use named filter as `blend-` followed by these colors: `blue, red, yellow, orange, green, purple, pink, red-blue, blue-yellow` and, to give more options, you can append `-dark` or `-light` at the end of the name.

So we can have something like these: `blend-blue-dark`, `blend-purple-light`, `blend-orange`, and so on ....
[Based on this project](http://lukyvj.github.io/colofilter.css/) tks [LukyVj](https://github.com/LukyVj)

<details>
<summary>See this gif example</summary>
<img src="https://i.imgur.com/DNQAxLH.gif">
</details>

<br>
<a href="#custom-settings">^ back to settings menu</a>
<br>
<br>

# Contributing

Clone de repository, open its folder and install dependencies with:
Expand All @@ -138,6 +208,11 @@ Run it using:
yarn start
```

<br>
<a href="#menu">^ back to menu</a>
<br>
<br>

# Author

👤 **Mayk Brito**
Expand All @@ -146,6 +221,11 @@ yarn start
- Github: [@maykbrito](https://github.com/maykbrito)
- LinkedIn: [@maykbrito](https://linkedin.com/in/maykbrito)

<br>
<a href="#menu">^ back to menu</a>
<br>
<br>

## Show your support

Give a ⭐️ if this project helped you!
14 changes: 14 additions & 0 deletions electron/store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,12 @@ const userPreferencesSchema: Schema<unknown> = {
type: JSONSchemaType.String,
},
},
filters: {
type: JSONSchemaType.Array,
items: {
type: JSONSchemaType.String,
},
},
flipHorizontal: {
type: JSONSchemaType.Boolean,
},
Expand Down Expand Up @@ -153,6 +159,14 @@ export const userPreferences = new Store({
height: 600,
},
},
filters: [
'initial',
'contrast(0.9) brightness(1.1)',
'grayscale(1)',
'blend-red-blue',
'blend-blue',
'blend-yellow',
],
flipHorizontal: false,
zoom: 1.1,
borderColor: 'linear-gradient(to right, #988BC7, #FF79C6)',
Expand Down
91 changes: 0 additions & 91 deletions index.html

This file was deleted.

2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
"@typescript-eslint/eslint-plugin": "^4.25.0",
"@typescript-eslint/parser": "^4.25.0",
"babel-loader": "^8.2.2",
"css-loader": "^6.5.1",
"electron": "^12.0.2",
"eslint": "^7.27.0",
"eslint-config-prettier": "^8.3.0",
Expand All @@ -46,6 +47,7 @@
"node-loader": "^2.0.0",
"npm-run-all": "^4.1.5",
"prettier": "^2.3.0",
"style-loader": "^3.3.1",
"typescript": "^4.2.4",
"wait-on": "^5.3.0"
},
Expand Down
80 changes: 1 addition & 79 deletions public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,84 +6,6 @@
<meta http-equiv="X-UA-Compatible" content="ie=edge" />

<title>Mini Video Me</title>
<style>
:root {
--border-color: linear-gradient(to right, #988bc7, #ff79c6);
--clip-path: circle(50% at 50% 50%);
--border-width: 5px;
}

body,
#video-grid {
-webkit-app-region: drag;
}

button {
-webkit-app-region: nodrag;
}

body {
margin: 0;
padding: 0;
overflow: hidden;
}

video {
height: 100vh;
pointer-events: none;
background: #121214;
}

#wrapper {
width: 100vw;
height: 100vh;
display: flex;
justify-content: center;

margin: auto;

position: relative;
box-sizing: border-box;

color: #fff;
background: transparent;
background-clip: padding-box;
}

#wrapper:before {
content: '';
position: absolute;
top: 0;
right: 0;
bottom: 0;
left: 0;
z-index: -1;
margin: calc(-1 * var(--border-width));
/* border-radius: inherit; */
}

.video-wrapper {
overflow: hidden;
display: flex;
align-items: center;
justify-content: center;
background: transparent;
}

#wrapper.has-border {
border: solid transparent;
border-width: var(--border-width);
}

#wrapper.has-border:before {
background: var(--border-color);
}

#wrapper.has-clip-path:before,
#wrapper.has-clip-path .video-wrapper {
clip-path: var(--clip-path);
}
</style>

<script>
const global = globalThis
Expand All @@ -92,7 +14,7 @@

<body>
<div id="wrapper">
<div class="video-wrapper">
<div id="video-wrapper">
<video id="video" autoplay muted></video>
</div>
</div>
Expand Down
Loading