new start page
This commit is contained in:
3
NP_Root_Startpage/.gitignore
vendored
Normal file
3
NP_Root_Startpage/.gitignore
vendored
Normal file
@ -0,0 +1,3 @@
|
||||
node_modules/
|
||||
dist/
|
||||
.cache/
|
||||
1
NP_Root_Startpage/CNAME
Normal file
1
NP_Root_Startpage/CNAME
Normal file
@ -0,0 +1 @@
|
||||
root.reyes.cool
|
||||
21
NP_Root_Startpage/LICENSE
Normal file
21
NP_Root_Startpage/LICENSE
Normal file
@ -0,0 +1,21 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2020 Jorge Reyes
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
63
NP_Root_Startpage/README.md
Normal file
63
NP_Root_Startpage/README.md
Normal file
@ -0,0 +1,63 @@
|
||||

|
||||
|
||||
### Root is a start-page aimed to simplicity and elegance
|
||||
|
||||
This project is blazing fast :zap:, it only contains an html, css and javascript files.
|
||||
|
||||
## Customizing
|
||||
|
||||
Root was created to be lightweight, fast and easy to customize.
|
||||
|
||||
### Changin Colors
|
||||
|
||||
To change the colors used in the startpage edit `styles.css`.
|
||||
|
||||
```css
|
||||
:root {
|
||||
--primary: #dd2e44;
|
||||
--text-light: #eeeeee;
|
||||
--background: #1e1c21;
|
||||
--background-light: #333138;
|
||||
}
|
||||
```
|
||||
|
||||
### Changin Name and Adding Custom Cards
|
||||
|
||||
> This project uses [Remix Icons](https://remixicon.com/).
|
||||
|
||||
To change the default name and edit the cards, edit `app.js`. It should look something like this:
|
||||
|
||||
```js
|
||||
const NAME = "John Doe";
|
||||
|
||||
const CARDS = [
|
||||
{
|
||||
name: "Twitter",
|
||||
icon: "ri-twitter-fill",
|
||||
link: "https://twitter.com",
|
||||
},
|
||||
{
|
||||
name: "Github",
|
||||
icon: "ri-github-fill",
|
||||
link: "https://github.com/",
|
||||
},
|
||||
];
|
||||
```
|
||||
|
||||
To add a new card, just append a new object to the `CARDS` constant. The object should look something like this:
|
||||
|
||||
```js
|
||||
{
|
||||
name: "<Webpage Name>",
|
||||
icon: "<Icon Class-Name>",
|
||||
link: "<Webpage Link>"
|
||||
},
|
||||
```
|
||||
|
||||
> To get the icon class-name, just go to [Remix Icons](https://remixicon.com/), select the desired icon. You should see something like this: `<i class="this-is-the-class-name"></i>`.
|
||||
|
||||
To use 24 hour time simply change the time section of `app.js` to
|
||||
```
|
||||
// Update the Time
|
||||
currentTime.innerHTML = `${currentHour}:${currentMinute}`;
|
||||
```
|
||||
164
NP_Root_Startpage/app.js
Normal file
164
NP_Root_Startpage/app.js
Normal file
@ -0,0 +1,164 @@
|
||||
/*****************/
|
||||
/* EDITABLE INFO */
|
||||
/*****************/
|
||||
|
||||
/* -------------------------------------------------------- */
|
||||
|
||||
const NAME = "Reyes";
|
||||
|
||||
const CARDS = [
|
||||
{
|
||||
name: "Apple Music",
|
||||
icon: "ri-music-2-fill",
|
||||
link: "https://music.apple.com/us/browse",
|
||||
},
|
||||
{
|
||||
name: "Reddit",
|
||||
icon: "ri-reddit-fill",
|
||||
link: "https://www.reddit.com/",
|
||||
},
|
||||
{
|
||||
name: "Figma",
|
||||
icon: "ri-palette-fill",
|
||||
link: "https://www.figma.com/",
|
||||
},
|
||||
{
|
||||
name: "Github",
|
||||
icon: "ri-github-fill",
|
||||
link: "https://github.com/",
|
||||
},
|
||||
{
|
||||
name: "Twitter",
|
||||
icon: "ri-twitter-fill",
|
||||
link: "https://twitter.com",
|
||||
},
|
||||
{
|
||||
name: "Dribbble",
|
||||
icon: "ri-dribbble-fill",
|
||||
link: "https://dribbble.com/",
|
||||
},
|
||||
{
|
||||
name: "Hashnode",
|
||||
icon: "ri-hashtag",
|
||||
link: "https://hashnode.com/",
|
||||
},
|
||||
{
|
||||
name: "CodeSandbox",
|
||||
icon: "ri-cloud-fill",
|
||||
link: "https://codesandbox.io/dashboard/",
|
||||
},
|
||||
{
|
||||
name: "YouTube",
|
||||
icon: "ri-youtube-fill",
|
||||
link: "https://www.youtube.com/",
|
||||
},
|
||||
{
|
||||
name: "LinkedIn",
|
||||
icon: "ri-linkedin-fill",
|
||||
link: "https://www.linkedin.com/",
|
||||
},
|
||||
{
|
||||
name: "Gmail",
|
||||
icon: "ri-google-fill",
|
||||
link: "https://mail.google.com/",
|
||||
},
|
||||
];
|
||||
|
||||
/* -------------------------------------------------------- */
|
||||
|
||||
/******************/
|
||||
/* CLOCK FUNCTION */
|
||||
/******************/
|
||||
|
||||
const DAYS = [
|
||||
"Sunday",
|
||||
"Monday",
|
||||
"Tuesday",
|
||||
"Wednesday",
|
||||
"Thursday",
|
||||
"Friday",
|
||||
"Saturday",
|
||||
];
|
||||
|
||||
const MONTHS = [
|
||||
"January",
|
||||
"February",
|
||||
"March",
|
||||
"April",
|
||||
"May",
|
||||
"June",
|
||||
"July",
|
||||
"August",
|
||||
"September",
|
||||
"October",
|
||||
"November",
|
||||
"December",
|
||||
];
|
||||
|
||||
const updateDate = () => {
|
||||
// Create a new Date object and get the complete Date/Time information
|
||||
const completeDate = new Date();
|
||||
|
||||
// Time Variables
|
||||
let currentHour = formatDigit(completeDate.getHours());
|
||||
let currentMinute = formatDigit(completeDate.getMinutes());
|
||||
|
||||
// Date Variables
|
||||
let currentDay = completeDate.getDay();
|
||||
let currentNumber = completeDate.getDate();
|
||||
let currentMonth = completeDate.getMonth();
|
||||
let currentYear = completeDate.getFullYear();
|
||||
|
||||
// Update the Time
|
||||
currentTime.innerHTML = `${
|
||||
currentHour % 12 == 0 ? "12" : currentHour % 12
|
||||
}:${currentMinute} ${currentHour > 11 ? "PM" : "AM"}`;
|
||||
|
||||
// Update the Date
|
||||
currentDate.innerHTML = `${DAYS[currentDay]} ${currentNumber}, ${MONTHS[currentMonth]} ${currentYear}`;
|
||||
|
||||
// Create a Loop
|
||||
setTimeout(() => {
|
||||
updateDate();
|
||||
}, 1000);
|
||||
};
|
||||
|
||||
const formatDigit = (digit) => {
|
||||
return digit > 9 ? `${digit}` : `0${digit}`;
|
||||
};
|
||||
|
||||
/******************/
|
||||
/* CARDS FUNCTION */
|
||||
/******************/
|
||||
|
||||
const printCards = () => {
|
||||
for (const card of CARDS) {
|
||||
let currentCard = document.createElement("a");
|
||||
let currentCardText = document.createElement("p");
|
||||
currentCardText.appendChild(document.createTextNode(card.name));
|
||||
let currentCardIcon = document.createElement("i");
|
||||
currentCardIcon.classList.add(card.icon);
|
||||
|
||||
// Style the Card Element
|
||||
currentCard.classList.add("card");
|
||||
currentCard.href = card.link;
|
||||
|
||||
// Style the Icon
|
||||
currentCardIcon.classList.add("card__icon");
|
||||
|
||||
// Style the Text
|
||||
currentCardText.classList.add("card__name");
|
||||
|
||||
currentCard.append(currentCardIcon);
|
||||
currentCard.append(currentCardText);
|
||||
cardContainer.appendChild(currentCard);
|
||||
}
|
||||
};
|
||||
|
||||
/****************/
|
||||
/* STARTER CODE */
|
||||
/****************/
|
||||
|
||||
userName.innerHTML = NAME;
|
||||
printCards();
|
||||
updateDate();
|
||||
BIN
NP_Root_Startpage/assets/header.png
Normal file
BIN
NP_Root_Startpage/assets/header.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 144 KiB |
32
NP_Root_Startpage/index.html
Normal file
32
NP_Root_Startpage/index.html
Normal file
@ -0,0 +1,32 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<link
|
||||
href="https://cdn.jsdelivr.net/npm/remixicon@2.5.0/fonts/remixicon.css"
|
||||
rel="stylesheet"
|
||||
/>
|
||||
|
||||
<title>root: ~#</title>
|
||||
<link rel="preconnect" href="https://fonts.googleapis.com" />
|
||||
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
|
||||
<link
|
||||
href="https://fonts.googleapis.com/css2?family=Inter:wght@400;600&display=swap"
|
||||
rel="stylesheet"
|
||||
/>
|
||||
<link rel="stylesheet" href="./styles.css" />
|
||||
</head>
|
||||
<body>
|
||||
<header class="header">
|
||||
<div>
|
||||
<h1>Hello there, <span id="userName">John Doe</span>.</h1>
|
||||
<p>Today is <span id="currentDate">Monday 1, January 2000</span>.</p>
|
||||
</div>
|
||||
<p id="currentTime">00:00 PM</p>
|
||||
</header>
|
||||
<main id="cardContainer"></main>
|
||||
<script src="./app.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
143
NP_Root_Startpage/styles.css
Normal file
143
NP_Root_Startpage/styles.css
Normal file
@ -0,0 +1,143 @@
|
||||
/* Custom Variables | Color Scheme */
|
||||
|
||||
:root {
|
||||
--primary: #FFC759;
|
||||
--text-light: #eeeeee;
|
||||
--background: #191E29;
|
||||
--background-light: #202633;
|
||||
}
|
||||
|
||||
*,
|
||||
*::before,
|
||||
*::after {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
box-sizing: inherit;
|
||||
}
|
||||
|
||||
body {
|
||||
color: var(--text-light);
|
||||
font-family: 'Inter', sans-serif;
|
||||
|
||||
padding: 2rem 4rem;
|
||||
|
||||
background-color: var(--background);
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
h1 {
|
||||
font-size: 4rem;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
h1 > span {
|
||||
color: var(--primary);
|
||||
}
|
||||
|
||||
main {
|
||||
margin-top: 4rem;
|
||||
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.header {
|
||||
font-weight: 400;
|
||||
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
#currentDate {
|
||||
color: var(--primary);
|
||||
}
|
||||
|
||||
#currentTime {
|
||||
font-size: 4rem;
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
@media screen and (max-width: 1250px) {
|
||||
h1 {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.header {
|
||||
flex-direction: column-reverse;
|
||||
}
|
||||
|
||||
#currentTime {
|
||||
font-size: 3rem;
|
||||
margin-bottom: 1rem;
|
||||
}
|
||||
|
||||
#fullDate {
|
||||
text-align: center;
|
||||
}
|
||||
}
|
||||
|
||||
.card:link,
|
||||
.card:visited {
|
||||
color: white;
|
||||
text-decoration: none;
|
||||
|
||||
margin: 1.2rem;
|
||||
padding: 4rem 8rem;
|
||||
|
||||
background-color: var(--background-light);
|
||||
border-radius: 15px;
|
||||
border: 1px solid rgba(255,255,255,.05);
|
||||
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
|
||||
overflow: hidden;
|
||||
cursor: pointer;
|
||||
position: relative;
|
||||
|
||||
outline: none;
|
||||
transition: 0.1s;
|
||||
}
|
||||
|
||||
.card:hover,
|
||||
.card:focus {
|
||||
border-color: var(--primary);
|
||||
color: var(--primary);
|
||||
|
||||
transform: scale(1.02);
|
||||
}
|
||||
|
||||
.card:focus > .card__name {
|
||||
bottom: 0;
|
||||
}
|
||||
|
||||
.card:hover > .card__name {
|
||||
bottom: 0;
|
||||
}
|
||||
|
||||
.card__icon {
|
||||
font-size: 2rem;
|
||||
|
||||
padding: 1rem;
|
||||
|
||||
background-color: rgba(255, 255, 255, 0.05);
|
||||
border-radius: 50%;
|
||||
|
||||
display: grid;
|
||||
place-items: center;
|
||||
}
|
||||
|
||||
.card__name {
|
||||
font-weight: 400;
|
||||
|
||||
transform: translate(-50%, -50%);
|
||||
|
||||
position: absolute;
|
||||
bottom: -25%;
|
||||
left: 50%;
|
||||
|
||||
transition: 0.1s;
|
||||
}
|
||||
Reference in New Issue
Block a user