About.js
Raw Code
This is the raw code which will be downloaded at time of building the portfolio.
info
Portfolio Generator will ask you for data which can replace the variables. If you don't enter correct data, then you can change variables manually also.
Data/About.js
let currDate = new Date();
let year = currDate.getFullYear() - [[birthYear]];
let month = currDate.getMonth() - [[birthMonth]];
let date = currDate.getDate() - [[birthDate]];
const givenDate = new Date([[birthYear]], [[birthMonth]] - 1, [[birthDate]]);
const birthday = givenDate
.toLocaleDateString("en-GB", {
day: "numeric",
month: "short",
year: "numeric",
})
.replace(/ /g, "-");
if (month < 0) year -= 1;
else if (month === 0) {
if (date < [[birthDate]]) year -= 1;
}
const about = {
name: "[[name]]",
about: "[[about]]",
bio: "[[shortBio]]",
longBio: "[[longBio]]",
birthday,
city: "[[city]]",
age: year,
degree: "[[degree]]",
};
export default about;
Variables
caution
You can refer this table if you have any kind of confusion regarding adding data into variables. Remember variables are very sensitive respect to their types and data format. Data should be added in the instructed format only.
Variable | Description | Type | Constraint | Example |
---|---|---|---|---|
name | Name of user | Text | Length 3 to 20 | Saksham Bindal |
about | Professions of user | List | Minimum length 1 | ["Frontend Developer","Designer"] |
shortBio | One line about user | Text | Length 40 to 100 | |
birthDate* | Birth Date | Integer | Value 1 to 31 | |
birthMonth* | Birth Month | Integer | Value 1 to 12 | |
birthYear* | Birth Year | Integer | Value upto current year | |
city | City or location of user | Text | Value upto current year | |
degree | Highest degree user have pursued | Text | Value upto current year | UG |
tip
- Some variables are marked as * in above table.
Those variables will not be asked directly in
portfolio-generator
. - Instead a variable named
dob
will be asked. - You are expected to add your complete date of birth in that variable.
Final Code Example
After adding the data, the code will look like:
Data/About.js
let currDate = new Date();
let year = currDate.getFullYear() - 2000;
let month = currDate.getMonth() - 1;
let date = currDate.getDate() - 1;
const givenDate = new Date(2000, 1 - 1, 1);
const birthday = givenDate
.toLocaleDateString("en-GB", {
day: "numeric",
month: "short",
year: "numeric",
})
.replace(/ /g, "-");
if (month < 0) year -= 1;
else if (month === 0) {
if (date < 1) year -= 1;
}
const about = {
name: "Saksham Bindal",
about:
"Full Stack Developer, Flutter App Developer, Blockchain Developer, Competitive Coder, Entrepreneur",
bio: "Pursuing B. Tech at MNIT Jaipur in Computer Science Branch. 3rd Year Student.",
longBio:
"I'm a developer with experience in building full-stack websites for individuals and organizations. I also develop flutter android apps. I am expert in Python, CPP, MERN Stack, Next JS, Flask. I am a competitive coder. I develop Web 3.0 Decentralized apps (DApps) based on blockchain technology & ICP (Internet Computer Protocol)",
birthday,
city: "Hindaun, Rajasthan, India",
age: year,
degree: "UG",
};
export default about;
danger
- Above data is dummy data which will be produced when you run portfolio-project with
--dummy
option. - This data is the personal data of Saksham Bindal
- This data is only for testing purpose. You are not allowed to misuse the data.
- You are not allowed to distribute or publish this data.