7 | I know this page is very interesting for you, especially for your special day but.
8 | You need to be patience until the time has come, right ?
9 |
`,
10 | };
11 |
12 | export const late = {
13 | title: "See you next time...",
14 | body: `
15 |
The party was over
16 |
17 |
18 | Yes, my gift for you is kinda simple, cheap, and weird ? 😖
19 | B-but. It's only for you. 💖
20 |
21 | `,
22 | };
23 |
--------------------------------------------------------------------------------
/docs/attributions.md:
--------------------------------------------------------------------------------
1 | # Atributions
2 |
3 | - Pattern vector created by mokoland - www.freepik.com
4 | - Christmas vector created by freepik - www.freepik.com
5 | - Background vector created by brgfx - www.freepik.com
6 | - Halloween vector created by vectorpouch - www.freepik.com
7 |
8 | - The favicon was generated using the following graphics from Twitter Twemoji:
9 |
10 | - Graphics Title: 1f382.svg
11 | - [Graphics Author: Copyright 2020 Twitter, Inc and other contributors](https://github.com/twitter/twemoji)
12 | - Graphics Source: [https://github.com/twitter/twemoji/blob/master/assets/svg/1f382.svg](https://github.com/twitter/twemoji/blob/master/assets/svg/1f382.svg)
13 | - [Graphics License: CC-BY 4.0](https://creativecommons.org/licenses/by/4.0/)
14 |
15 | ---
16 |
17 |
Made with 💖 by Anshuman Mahato
18 |
--------------------------------------------------------------------------------
/src/scss/_layout.scss:
--------------------------------------------------------------------------------
1 | .content {
2 | height: 100vh;
3 | overflow: hidden;
4 | position: absolute;
5 |
6 | display: grid;
7 | grid-template-columns:
8 | [flag-cl-start balloon-l-start] 1fr
9 | [flag-cl-end balloon-l-end flag-l-start frame-start] 1fr
10 | [flag-l-end flag-r-start] 1fr
11 | [flag-r-end flag-cr-start balloon-r-start frame-end] 1fr [flag-cr-end balloon-r-end];
12 | grid-template-rows: 30vh 70vh;
13 |
14 | & > * {
15 | width: 100%;
16 | }
17 |
18 | @media only screen and (max-width: 800px) {
19 | grid-template-columns:
20 | [flag-l-start balloon-l-start frame-start] 1fr
21 | [balloon-l-end flag-l-end flag-r-start balloon-r-start ] 1fr [flag-r-end balloon-r-end frame-end];
22 | }
23 | }
24 |
25 | .frame {
26 | grid-row: 2/3;
27 | grid-column: frame-start / frame-end;
28 |
29 | display: none;
30 | opacity: 0;
31 | flex-direction: column;
32 | justify-content: space-evenly;
33 | align-items: center;
34 | text-align: center;
35 | }
36 |
37 | .page-404 {
38 | background-color: #413f42;
39 | text-align: center;
40 | }
41 |
--------------------------------------------------------------------------------
/local/sample-scroll.txt:
--------------------------------------------------------------------------------
1 | Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.
2 |
3 |
4 | It is a long established fact that a reader will be distracted by the readable content of a page when looking at its layout. The point of using Lorem Ipsum is that it has a more-or-less normal distribution of letters, as opposed to using 'Content here, content here', making it look like readable English. Many desktop publishing packages and web page editors now use Lorem Ipsum as their default model text, and a search for 'lorem ipsum' will uncover many web sites still in their infancy. Various versions have evolved over the years, sometimes by accident, sometimes on purpose (injected humour and the like).
5 |
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "happy-birthday-card",
3 | "version": "3.0.2",
4 | "description": "A birthday card template",
5 | "main": "index.js",
6 | "default": "index.html",
7 | "targets": {
8 | "main": false
9 | },
10 | "browserslist": "last 10 versions, not dead",
11 | "scripts": {
12 | "watch:parcel": "parcel src/index.html",
13 | "build:parcel": "parcel build src/index.html",
14 | "init-index-local": "node builder/init.js --local",
15 | "init-index-remote": "node builder/init.js --remote",
16 | "watch": "npm-run-all init-index-local watch:parcel",
17 | "build": "npm-run-all init-index-remote build:parcel"
18 | },
19 | "repository": {
20 | "type": "git",
21 | "url": "git+https://github.com/AnshumanMahato/Happy-Birthday-Card.git"
22 | },
23 | "keywords": [
24 | "happy-birthday",
25 | "birthday-card"
26 | ],
27 | "author": "Anshuman Mahato",
28 | "license": "ISC",
29 | "bugs": {
30 | "url": "https://github.com/AnshumanMahato/Happy-Birthday-Card/issues"
31 | },
32 | "homepage": "https://github.com/AnshumanMahato/Happy-Birthday-Card#readme",
33 | "devDependencies": {
34 | "@parcel/packager-raw-url": "^2.6.2",
35 | "@parcel/transformer-sass": "^2.6.2",
36 | "@parcel/transformer-webmanifest": "^2.6.2",
37 | "parcel": "^2.6.2",
38 | "sass": "^1.53.0"
39 | },
40 | "dependencies": {
41 | "axios": "^0.27.2",
42 | "dotenv": "^7.0.0",
43 | "npm-run-all": "^4.1.5",
44 | "sharp": "^0.30.7"
45 | }
46 | }
47 |
--------------------------------------------------------------------------------
/src/scss/_animations.scss:
--------------------------------------------------------------------------------
1 | @keyframes fade {
2 | 0% {
3 | opacity: 1;
4 | }
5 | 100% {
6 | opacity: 0;
7 | }
8 | }
9 |
10 | @keyframes read {
11 | 0% {
12 | opacity: 0;
13 | }
14 |
15 | 25% {
16 | opacity: 1;
17 | }
18 |
19 | 75% {
20 | opacity: 1;
21 | }
22 |
23 | 100% {
24 | opacity: 0;
25 | }
26 | }
27 |
28 | @keyframes heart-beat {
29 | 0% {
30 | transform: translate(-50%, -50%) scale(1, 1);
31 | }
32 |
33 | 50% {
34 | transform: translate(-50%, -50%) scale(1.25, 1.25);
35 | }
36 |
37 | 100% {
38 | transform: translate(-50%, -50%) scale(1, 1);
39 | }
40 | }
41 |
42 | @keyframes balloon-move {
43 | 0% {
44 | transform: translateY(0) rotate(0);
45 | }
46 | 25% {
47 | transform: translateY(5%) rotate(3deg);
48 | }
49 | 50% {
50 | transform: translateY(0) rotate(0);
51 | }
52 | 75% {
53 | transform: translateY(-5%) rotate(-3deg);
54 | }
55 | 100% {
56 | transform: translateY(0) rotate(0);
57 | }
58 | }
59 |
60 | @keyframes move-up {
61 | 0% {
62 | transform: translateY(0);
63 | }
64 |
65 | 100% {
66 | transform: translateY(-100%);
67 | }
68 | }
69 |
70 | // Dynamic Classes
71 |
72 | .hidden {
73 | display: none;
74 | }
75 | .fade-in {
76 | animation: fade 2s ease-in 0s;
77 | }
78 |
79 | .appear {
80 | animation: fade 2s linear 0s 1 reverse;
81 | }
82 |
83 | .read {
84 | animation: read 4s linear 0s;
85 | }
86 |
87 | .move-up {
88 | animation: move-up var(--readTime) linear 3s;
89 | }
90 |
--------------------------------------------------------------------------------
/src/resources/img/flag-left.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/src/resources/img/flag-right.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/docs/customizations.md:
--------------------------------------------------------------------------------
1 | # Customizations
2 |
3 | Following are some of the customizations that can be added to the card.
4 |
5 | ## The Scrolling Message
6 |
7 | The scrolling message is a customization that you can enable in the card. Once enabled, a custom message can be displayed to the user before rendering the actual card.
8 |
9 | Check it out in this [sample deployment](https://hbd-card.netlify.app/) to see this feature.
10 |
11 | ### in Remote Deployment
12 |
13 | 1. For this, we create a telegraph Article with our message. Go to [Telegraph](https://telegra.ph) and publish an article with your message in it.
14 |
15 | Here is a sample for you - https://telegra.ph/Bday-07-24.
16 |
17 | 2. Copy the url of the published article. In my case, it is this `https://telegra.ph/Bday-07-24`.
18 |
19 | 3. Add `SCROLL_MSG` environment variable to your deployed site with the above url as its value.
20 |
21 | ### in Local Build
22 |
23 | 1. Create a 'filename.txt' file in the `./local` directory with your message in it.
24 |
25 | 2. Add environment variable `SCROLL_MSG=filename.txt`.
26 |
27 | ## Custom Happy BDay Text
28 |
29 | Instead of the predefined 'Wish you a very happy birthday' text in the card, one can add a custom hbd message by specifying it in the `HBD_MSG` environment variable.
30 |
31 | ## Live only for a specific day
32 |
33 | The card can be set to be visible only for a specific day. On other days, it will show a different page depending upon whether it is accessed before or after the specified date.
34 |
35 | To set this, specify the date in `YYYY-MM-DD` format as `OPEN_DATE` environment variable.
36 |
37 | ---
38 |
39 | ## Note
40 |
41 | For the customizations to take effect, one must redeploy/rebuild the project.
42 |
43 | ---
44 |
45 |
Made with 💖 by Anshuman Mahato
46 |
--------------------------------------------------------------------------------
/docs/variables.md:
--------------------------------------------------------------------------------
1 | # Environment Variables
2 |
3 | Following is the list of all the environment variables that are used in this project.
4 |
5 | ```sh
6 | # Mandatory Variables
7 | NAME
8 | PIC
9 |
10 | # Optional Variables
11 | NICKNAME
12 | HBD_MSG
13 | SCROLL_MSG
14 | OPEN_DATE
15 | ```
16 |
17 | - The `NAME` and `NICKNAME` are self explainatory. `NICKNAME` is optional. If no nickname is provided, then value of name will be used in its place.
18 |
19 | - `PIC` is the image that will appear on the card.
20 |
21 | - For local building, one needs to add the image file to the `./local` directory and add the name of the file as its value.
22 |
23 | - For remote deployment, it is the web address of image file. If don't have the image hosted somewhere, you may publish a [telegra.ph article](https://telegra.ph) with your image and copy the image address from there.
24 |
25 | NOTE: Picture must be in 1:1 ratio or it will get cropped.
26 |
27 | - `HBD_MSG` is an optional variable that adds a custom HBD greeting. It takes the custom message as value. Check [Customizations](./customizations.md#custom-happy-bday-text) to know how to set up.
28 |
29 | - `SCROLL_MSG` is an optional variable to specify a custom scrolling message that appears before the card.
30 |
31 | - For local building, one needs to add a `.txt` file with the message, to the `./local` directory and add the name of the file as its value.
32 |
33 | - For remote deployment, it is the url of the telegra.ph article.
34 |
35 | Check [Customizations](./customizations.md#the-scrolling-message) to know how to set up.
36 |
37 | - `OPEN_DATE` is an optional variable to specify the active date for the webpage. It the takes the date in `YYYY-MM-DD` format as value. Used to setup the Live Date feature. Check [Customizations](./customizations.md#live-only-for-a-specific-day) to know how to set up.
38 |
39 | ---
40 |
41 |
Made with 💖 by Anshuman Mahato
42 |
--------------------------------------------------------------------------------
/src/resources/img/bulb.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Happy Birthday Card
2 |
3 | A Customizable Web based birthday card to wish your friends and family in a unique way.
4 |
5 | Check out the Previews -
6 |
7 | - [Without Scroll Message](https://happy-birthday-card.vercel.app/)
8 | - [With Scroll Message](https://hbd-card.netlify.app/)
9 |
10 | If you liked it, please consider giving it star a 🤩⭐.
11 |
12 | ---
13 |
14 | ## How to setup
15 |
16 | Here are the methods to set it up for yourself.
17 |
18 | ### Remote Deployment
19 |
20 | - Vercel Deploy
21 |
22 | [](https://vercel.com/new/clone?repository-url=https%3A%2F%2Fgithub.com%2FAnshumanMahato%2FHappy-Birthday-Card&env=NAME,PIC&envDescription=NAME%20-%3E%20Name%20of%20the%20Receiver%20%7C%20PIC%20-%3E%20web%20url%20of%20a%20picture%20of%20the%20receiver&envLink=https%3A%2F%2Fgithub.com%2FAnshumanMahato%2FHappy-Birthday-Card%2Fblob%2Fmain%2Fdocs%2Fvariables.md&project-name=happy-birthday-card&repo-name=happy-birthday-card&demo-title=Happy%20Birthday%20Card&demo-description=This%20is%20a%20web%20based%20interactive%20birthday%20card.&demo-url=https%3A%2F%2Fhappy-birthday-card.vercel.app%2F&demo-image=https%3A%2F%2Ftelegra.ph%2Ffile%2Fac886529ccc3843552f81.png)
23 |
24 | - Netlify Deploy
25 |
26 | [](https://app.netlify.com/start/deploy?repository=https://github.com/AnshumanMahato/Happy-Birthday-Card)
27 |
28 | Remote deployment will require you to specify some mandatory Evironment Variables,
29 |
30 | - NAME: Name of the receiver.
31 |
32 | - PIC: Url of the pic to be loaded in the card. If don't have the image hosted somewhere, you may publish a [telegra.ph article](https://telegra.ph) with your image and copy the image address from there.
33 |
34 | To know more about the environment variables, check [References](#references).
35 |
36 | ### For Local Building
37 |
38 | 1. Clone the repository
39 |
40 | ```sh
41 | git clone https://github.com/AnshumanMahato/Happy-Birthday-Card
42 | ```
43 |
44 | 2. Install dependencies
45 |
46 | ```sh
47 | npm install
48 | ```
49 |
50 | 3. Add a pic of the receiver, in the `./local` directory. Ensure that the image is of 1:1 ratio or it might get cropped and squished.
51 |
52 | 4. Create a `.env` file in root directory, and add the following lines.
53 |
54 | ```env
55 | NAME='Name of the Receiever'
56 | PIC='name-of-image.extension'
57 | ```
58 |
59 | 5. Execute the following commands in order.
60 |
61 | ```sh
62 | npm run init-index-local
63 | npm run build:parcel
64 | ```
65 |
66 | 6. Upon Successful execution, your built files will be ready in the `./dist` directory. Open `./dist/index.html` to see the card.
67 |
68 | For further customization, checkout [here](./docs/customizations.md).
69 |
70 | ---
71 |
72 | ## References
73 |
74 | - [Environment Variables](./docs/variables.md)
75 |
76 | - [Attributions](./docs/attributions.md)
77 |
78 | ---
79 |
80 | ## Support
81 |
82 | If you have any queries or need some help in deployment, you may contact me here
83 |
84 |
85 |
86 |
87 |
88 |
89 | Made with 💖 by Anshuman Mahato
90 |
91 |