Skip to content

Commit

Permalink
update & submit-1: style, tt, README
Browse files Browse the repository at this point in the history
  • Loading branch information
LJBL22 committed Dec 29, 2023
1 parent 289e2de commit 0e41391
Show file tree
Hide file tree
Showing 8 changed files with 287 additions and 210 deletions.
8 changes: 5 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,15 @@
- To assist users in calculating the appropriate amount for a red packet, taking into account various factors.
- Review the checking records.

### Background:
### Idea Background:

#### Taiwanese Wedding Red Packet Etiquette

For guests attending weddings, the customary red envelope gift typically starts at 600 NTD. When estimating a total gift amount of less than 10,000 NTD, it is advisable to steer clear of the numbers 4 and 8. This caution stems from cultural nuances, where the number 4 is associated with the word for "death," and the number 8, while considered “wealth” in many contexts, sounds similar to the word for "separation." Thus, it may not be deemed suitable for inclusion in wedding gift amounts. Additionally, one should avoid having an odd digit or the digit 0 in the hundreds place.
A red packet or a red envelope is a monetary gift given during holidays or for special occasions such as a wedding. ---[Wikipedia](https://en.wikipedia.org/wiki/Red_envelope)

Interestingly, the amount of 9,900 NTD is considered especially auspicious. This is due to its homophonic sound "長長久久" in Chinese, symbolising a heartfelt wish for enduring marital happiness.
In Taiwan, for guests attending weddings, the customary red envelope gift typically starts at NTD 600. When estimating a total gift amount of less than 10,000 NTD, it is advisable to steer clear of the numbers 4 and 8. This caution stems from cultural nuances, where the number 4 is associated with the word for "death," and the number 8, while considered “wealth” in many contexts, sounds similar to the word for "separation." Thus, it may not be deemed suitable for inclusion in wedding gift amounts. Additionally, one should avoid having an odd digit, which related to funerals, or the digit 0 in the hundreds place, following established conventions.

Interestingly, the amount of NTD 9,900 is considered especially auspicious. This is due to its homophonic sound "jiu-jiu" in Mandarin, symbolising a heartfelt wish for enduring marital happiness.

In the event that the gift amount exceeds 10,000 NTD, it is recommended to minimise the presence of two or more odd digits and to avoid the numbers 4 and 8 whenever possible.

Expand Down
14 changes: 6 additions & 8 deletions app.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from cs50 import SQL
from flask import Flask, render_template, request
from flask import Flask, render_template, redirect, request

# Configure application
app = Flask(__name__)
Expand All @@ -25,7 +25,6 @@
def index():
return render_template("index.html")


@app.route("/calculator", methods=["GET", "POST"])
def calculator():
venues = db.execute("SELECT * FROM venues")
Expand All @@ -34,7 +33,6 @@ def calculator():

if request.method == "POST":
relationship_option = request.form.get("relationship")
print(relationship_option)
if not (relationship_option):
return render_template("error.html", error_msg = "Please choose a RELATION option")
showup_option = request.form.get("showup")
Expand Down Expand Up @@ -95,9 +93,9 @@ def replace_digit(number):
return number

###### DEV ONLY
original_number = 9000
modified_number = replace_digit(original_number)
print(f"{original_number} becomes {modified_number}")
# original_number = 9000
# modified_number = replace_digit(original_number)
# print(f"{original_number} becomes {modified_number}")

@app.route("/records", methods=["GET", "POST"])
def records():
Expand All @@ -109,7 +107,7 @@ def records():

def ntd(value):
"""Format value as NTD."""
return f"NTD${value:,}"
return f"NTD {value:,}"

# Custom filter
app.jinja_env.filters["ntd"] = ntd
app.jinja_env.filters["ntd"] = ntd
Binary file modified price.db
Binary file not shown.
30 changes: 29 additions & 1 deletion static/style.css
Original file line number Diff line number Diff line change
@@ -1,3 +1,31 @@
@import url('https://fonts.googleapis.com/css2?family=Quicksand&family=Roboto+Slab:wght@400;700&display=swap');

* {
font-family: 'Quicksand', sans-serif;
}

.article-title {
position: relative;
}

.article-title img {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
object-fit: cover;
opacity: 0.5;
}

.article-title {
color: red;
font-size: 3rem;
font-family: 'Roboto Slab', serif;
position: relative;
z-index: 1;
}

.white {
color: white;
color: white;
}
Loading

0 comments on commit 0e41391

Please sign in to comment.