2020-08-30 13:43:00 -05:00
< div align = "center" >
2020-10-22 16:04:01 -05:00
< h1 > Bento< / h1 >
< b > 🍱 A Clean and Simple Startpage< / b >
2020-08-30 13:43:00 -05:00
< / div >
2020-08-14 13:04:38 -05:00
2020-10-04 22:11:51 -05:00
< p align = "center" >
< img src = "https://github.com/MiguelRAvila/Bento/blob/master/assets/preview.png" >
< / p >
2020-08-14 13:04:38 -05:00
2020-10-10 20:41:14 -05:00
## Index
2020-08-31 23:12:44 -05:00
- [Bento ](# )
- [Features ](#features )
- [Usage ](#usage )
2020-10-10 20:48:16 -05:00
- [Home Page ](#as-home-page )
- [New Tab ](#as-new-tab )
2020-08-31 23:12:44 -05:00
- [Customization ](#customization )
2020-10-10 20:48:16 -05:00
- [Links ](#links )
- [Colors ](#colors )
2020-10-16 20:28:24 -05:00
- [Theme Depending at the time ](#theme-depending-at-the-time )
2020-10-10 20:48:16 -05:00
- [Image Background ](#image-background )
- [Greetings ](#greetings )
2020-10-10 22:29:38 -05:00
- [Weather Info ](#weather-info )
2020-10-10 20:48:16 -05:00
- [Weather Icons ](#weather-icons )
2020-10-10 20:38:58 -05:00
### Features:
2020-08-14 13:04:38 -05:00
2020-10-10 20:17:02 -05:00
- **Dark/Light** mode, you can toggle them and It'll be saved in local store
2020-08-22 20:17:31 -05:00
- **Clock and Date** format can be set to 24 hour (default) or 12 hour
- **Greetings** are easy to change and modify
2020-09-30 23:31:23 -05:00
- **Variables** for custom colors and font sizes in the `css` code
2020-10-10 20:17:02 -05:00
- **Icons** all icons are from Feather Icons (Some others I made them with the Feather icons as a base)
2020-08-14 13:04:38 -05:00
- **Modular** javascript files for an easy read
2020-10-10 20:41:14 -05:00
## Usage:
2020-08-14 13:04:38 -05:00
2020-08-31 23:12:44 -05:00
#### As Home Page:
2020-10-10 20:48:16 -05:00
2020-08-14 13:04:38 -05:00
1. Fork this repo
2. Enable the Github Pages service `Settings > GitHub Pages > Source [master branch] > Save`
3. Set it as Home Page:
- Click the menu button. and select Options. Preferences.
- Click the Home panel.
2020-08-14 13:07:16 -05:00
- Click the menu next to Homepage and new windows and choose to show custom URLs and add your `Github Pages link`
2020-08-26 22:04:36 -05:00
2020-08-31 23:13:38 -05:00
#### As New Tab:
2020-10-10 20:48:16 -05:00
2020-08-31 23:12:44 -05:00
1. You can use different Add-ons/Extensions for it
2020-10-10 20:48:16 -05:00
- If you use Firefox: [Custom New Tab Page ](https://addons.mozilla.org/en-US/firefox/addon/custom-new-tab-page/?src=search )
- If you use Chromium (Brave, Vivaldi, Chrome): [Custom New Tab URL ](https://chrome.google.com/webstore/detail/custom-new-tab-url/mmjbdbjnoablegbkcklggeknkfcjkjia )
2020-10-10 20:39:56 -05:00
2020-10-10 20:41:14 -05:00
## Customization
2020-08-31 23:12:44 -05:00
2020-09-14 22:23:06 -05:00
> All the code is using variables and is comented, It's easy to customize the project to your own, and this sections are the principal customizable elements in the Startpage:
2020-10-10 20:41:14 -05:00
### Links
2020-09-14 22:23:06 -05:00
2020-10-10 20:48:16 -05:00
You can change the links (and the icons too) in the HTML Code:
2020-09-14 22:23:06 -05:00
2020-10-10 20:48:16 -05:00
```html
2020-10-16 20:28:24 -05:00
< a href = "https://github.com/" target = "blank" class = "qlink__link qlink__link-1" >
2020-10-10 20:48:16 -05:00
< i class = "qlink__icon" data-feather = "github" > < / i >
2020-10-16 20:28:24 -05:00
< / a >
2020-10-10 20:48:16 -05:00
```
2020-09-14 22:23:06 -05:00
2020-10-10 20:48:16 -05:00
Change the link in the `href` property with the link you want. (The `target="blank"` makes the link to open a new tab with the link you choose).
The Project uses [Feather icons ](https://feathericons.com/ ) for the icons, and you can change them in the `data-feather=""` property with the name of the icon.
2020-09-14 22:23:06 -05:00
2020-10-10 20:41:14 -05:00
### Colors
2020-10-10 20:48:16 -05:00
2020-08-31 23:12:44 -05:00
In the CSS code you can always change the variables for both themes (Dark and Light)
2020-08-26 22:06:55 -05:00
2020-10-10 20:26:19 -05:00
```css
2020-10-10 20:48:16 -05:00
/* Light theme */
2020-10-10 20:26:19 -05:00
:root {
--accent: #186efdaa ;
--bg: #f5f5f5 ;
--sbg: #e4e6e6 ;
--fg: #3a3a3a ;
--imgcol: linear-gradient(
rgba(255, 255, 255, 0.7),
rgba(255, 255, 255, 0.7)
);
}
2020-10-10 20:48:16 -05:00
/* Dark theme */
2020-10-10 20:26:19 -05:00
.darktheme {
--accent: #186efd60 ;
--bg: #1e1f21 ;
--sbg: #2c2d31 ;
--fg: #d8dee9 ;
--imgcol: linear-gradient(rgba(0, 0, 0, 0.7), rgba(0, 0, 0, 0.7));
}
```
2020-10-16 20:28:24 -05:00
### Theme Depending at the time
In the `theme.js` file there's a section about changing the theme depending in the time. You have to 'Uncomment' that section to enable it:
```js
const today = new Date();
const Hr = today.getHours();
if (Hr >= 19 || Hr < 5 ) {
enableDark();
} else {
disableDark();
}
```
2020-10-10 20:41:14 -05:00
### Image Background
2020-09-06 18:42:26 -05:00
2020-10-10 20:48:16 -05:00
You can set your own background image with the variable `--imgbg` and set the route to the image you want It's disable by default. If you uncomment the variable, it has by default this image:
2020-10-10 20:09:25 -05:00
< p align = "center" >
< img src = "https://github.com/MiguelRAvila/Bento/blob/master/assets/previewbg.png" >
< / p >
2020-09-06 18:42:26 -05:00
2020-10-10 20:09:25 -05:00
It has a black filter by default in `--imgcol` , and it'ts value is: `rgba(255, 255, 255, 0.7)` and `rgba(0, 0, 0, 0.7)` for the dark theme. You can change them and the opacity for a better experience with your image.
2020-09-11 19:23:13 -05:00
2020-10-10 20:41:14 -05:00
### Greetings
2020-10-10 20:48:16 -05:00
2020-09-16 12:27:55 -05:00
You can put your name and change the greetings.
```js
2020-10-10 20:48:16 -05:00
var name = 'John Doe';
2020-09-16 12:27:55 -05:00
var lateTxt = 'Go to Sleep! ';
var morningTxt = 'Good morning! ';
var afterTxt = 'Good afternoon ';
var evenTxt = 'Good evening ';
```
It'll change in order of the hour.
2020-10-10 20:41:14 -05:00
### Weather Info
2020-09-11 19:23:13 -05:00
2020-10-10 20:48:16 -05:00
For setting up the Weather widget you're going to need an API Key in: `https://openweathermap.org/` . Once you have your Key you'll need to set yourlatitude and longitude, you can use: `https://www.latlong.net/` to get them. Once you have the data, you'll need to set them in the `weather.js` in the **js** folder. The code is
2020-10-10 20:09:25 -05:00
> If you don't like to have your API Key public, you can make the repo into a private one. You can still use the Github Pages service.
2020-10-10 20:41:14 -05:00
### Weather Icons
2020-10-10 20:09:25 -05:00
2020-10-10 20:52:47 -05:00
< p align = "center" >
< img src = "https://github.com/MiguelRAvila/Bento/blob/master/assets/previewico.png" >
< / p >
2020-10-10 20:09:25 -05:00
The icons by themselves have now 4 different color schemes:
2020-10-10 20:52:47 -05:00
- **Nord** Using the Nord Color Scheme and easy-to-eyes colors
- **OneDark** (Default one) Using the One Dark Pro color scheme
2020-10-10 20:48:16 -05:00
- **Dark** For White theme only users that want a minimalist look
- **White** For Dark theme only users that want a minimalist look
2020-09-11 19:23:13 -05:00
2020-10-10 20:48:16 -05:00
You set the icon theme changing this two lines of code in the `index.html` and `weather.js` files:
2020-10-10 20:09:25 -05:00
2020-10-10 20:52:47 -05:00
- If you want the Dark icon theme, change the `OneDark` to `Dark`
- If you want the White icon theme, change the `OneDark` to `White`
- If you want the Nord icon theme, change the `OneDark` to `Nord`
2020-10-10 20:09:25 -05:00
For example if I'd like to use the `Dark` icon theme:
```html
< div class = "weather-icon" >
2020-10-10 20:52:47 -05:00
< img src = "icons/OneDark/unknown.png" / >
2020-10-10 20:09:25 -05:00
< / div >
<!-- Change it to: -->
< div class = "weather-icon" >
< img src = "icons/Dark/unknown.png" / >
< / div >
```
```js
function displayWeather() {
2020-10-10 20:52:47 -05:00
iconElement.innerHTML = `<img src="icons/OneDark/${weather.iconId}.png"/>` ;
2020-10-10 20:09:25 -05:00
tempElement.innerHTML = `${weather.temperature.value}°<span class="darkfg">${tempUnit}</span>` ;
descElement.innerHTML = weather.description;
}
//Change it to:
function displayWeather() {
iconElement.innerHTML = `<img src="icons/Dark/${weather.iconId}.png"/>` ;
tempElement.innerHTML = `${weather.temperature.value}°<span class="darkfg">${tempUnit}</span>` ;
descElement.innerHTML = weather.description;
}
2020-10-10 20:48:16 -05:00
```