diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..d32bf79 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +__pycache__/db.cpython-310.pyc diff --git a/__pycache__/app.cpython-310.pyc b/__pycache__/app.cpython-310.pyc index 12fb34b..528922f 100644 Binary files a/__pycache__/app.cpython-310.pyc and b/__pycache__/app.cpython-310.pyc differ diff --git a/__pycache__/app.cpython-39.pyc b/__pycache__/app.cpython-39.pyc new file mode 100644 index 0000000..eaf2a30 Binary files /dev/null and b/__pycache__/app.cpython-39.pyc differ diff --git a/__pycache__/db.cpython-310.pyc b/__pycache__/db.cpython-310.pyc new file mode 100644 index 0000000..04ba1d0 Binary files /dev/null and b/__pycache__/db.cpython-310.pyc differ diff --git a/__pycache__/db.cpython-39.pyc b/__pycache__/db.cpython-39.pyc new file mode 100644 index 0000000..aa12ad7 Binary files /dev/null and b/__pycache__/db.cpython-39.pyc differ diff --git a/__pycache__/scoreboard.cpython-310.pyc b/__pycache__/scoreboard.cpython-310.pyc new file mode 100644 index 0000000..2dd70a3 Binary files /dev/null and b/__pycache__/scoreboard.cpython-310.pyc differ diff --git a/app.py b/app.py index 0f9b550..4f992db 100644 --- a/app.py +++ b/app.py @@ -1,31 +1,211 @@ from datetime import datetime from flask import Flask, render_template, request, redirect, url_for, send_from_directory -from flask_pymongo import pymongo +import db +import scoreboard +from collections import defaultdict + +# from db import day1events, day2events +from flask import g app = Flask(__name__) -# client = pymongo.MongoClient("mongodb+srv://cat-rnsit:parichay2022@cluster0.nol6pxm.mongodb.net/?retryWrites=true&w=majority") -# db = client.test +events = db.events +# events = db.events.sort({'event_id':1}) +# g.events = events.find({}) @app.route('/') def index(): print('Request for index page received') - # return render_template('index.html') - # return redirect("/prefest") - return render_template("prefest.html") + return redirect("/events") @app.route('/prefest') def prefest(): - return render_template('prefest.html') + print('Request for prefest page received') + return redirect("/events") + +@app.route('/admin_control') +def admin_route(): + print("reached admin") + + return '

Admin Page

' + +@app.route('/admin_control/score') +def score_updated(): + print("reached score") + db.update_winner() + return '

score updated

' + +@app.route("/scoreboard") +def scoreboard_display(): + return '

scoreboard

' + +@app.route("/refresh") +def refresh_scoreboard(): + # file1 = open("winner.txt","r+") + # win_count = file1.read() + # if scoreboard.winner_count() > int(win_count): + # file1.write(scoreboard.winner_count()) + # scoreboard.update_score() + + return '

updated scoreboard

' + +@app.route('/events') +def events(): + + + events = db.events + department = db.department + winners = db.winners + + event_list = events.find( + {}, + { + "_id": 0, + "event_id": 1, + "event_name": 1, + "date": 1, + "time_begin": 1, + "time_end": 1, + "venue": 1, + "max_points": 1, + "google_form_link": 1, + "start_hour" : 1 + }, + ) + + day1events = [] + day2events = [] + + day1 = datetime(2022, 5, 23, 18, 30) + day2 = datetime(2022, 5, 24, 18, 30) + for event in event_list: + if event["date"] == day1: + day1events.append(event) + else: + day2events.append(event) + + day1events = sorted(day1events, key=lambda d: int(d['start_hour'])) + day2events = sorted(day2events, key=lambda d: int(d['start_hour'])) + + + + return render_template('events.html', d1 = day1events, d2 = day2events) +@app.route('/score') +def score(): + winners = db.winners + winner_list = winners.find( + {}, + { + "_id": 0, + "dept_id": 1, + "event_id": 1, + "position": 1, + "points_scored": 1, + "winner_name": 1, + }, + ) + + for winner in winner_list: + print(winner) + + departments = db.department + department_list = departments.find( + {}, + { + "_id":1, + "dept_name":1 + }, + ) + + # id_to_name = {} + # for entry in department_list: + # id_to_name[entry['_id']] = entry['dept_name'] + winner_list = winners.find( + {}, + { + "_id": 0, + "dept_id": 1, + "event_id": 1, + "position": 1, + "points_scored": 1, + "winner_name": 1, + }, + ) + dept_scores = defaultdict(int) + for winner in winner_list: + # print(winner) + dept_scores[winner['dept_id']] += int(winner['points_scored']) + + print(dept_scores) + + score = [] + for entry in department_list: + score.append([entry['dept_name'], dept_scores[entry['_id']]]) + # print(entry) + + print(score) + + score.sort(key=lambda x:x[0], reverse=False) + score.sort(key=lambda x:x[1], reverse=True) + + + + return render_template('score.html', dept_points = score) + +@app.route('/admin', methods=['GET', 'POST']) +def admin(): + if request.method == 'GET': + + events = db.events + department = db.department + winners = db.winners + + event_list = events.find( + {}, + { + "_id": 0, + "event_id": 1, + "event_name": 1, + "date": 1, + "time_begin": 1, + "time_end": 1, + "venue": 1, + "max_points": 1, + "google_form_link": 1, + "start_hour" : 1 + }, + ) + dept_list = department.find( + {}, + { + "_id": 0, + "dept_id": 1, + "dept_name": 1, + }, + ) + + + return render_template('admin.html', events = event_list, depart = dept_list) + else: + password = request.form.get("password") + points = request.form.get("points") + winner_name = request.form.get("winner_name") + event = request.form.get("event") + position = request.form.get("position") + dept = request.form.get("dept") + + print(password, points, winner_name, event, position, dept) + + if password != "asswin": + return "Fuck off" + + + db.update_winner(event, dept, position, points, winner_name) + return "Winner Updated" + + -# @app.route('/events') -# def events(): -# return redirect("https://drive.google.com/file/d/1pe8VSO1KZaiY-mx959LKLnhtJULHw0sc/view") -# @app.route('/events') -# def events(): -# print('Request for events page received') -# return render_template('events.html') if __name__ == '__main__': diff --git a/db.py b/db.py new file mode 100644 index 0000000..d7bcd63 --- /dev/null +++ b/db.py @@ -0,0 +1,197 @@ +import collections +from sqlite3 import Date +from flask_pymongo import pymongo +from datetime import datetime + +client = pymongo.MongoClient( + "mongodb+srv://cat-rnsit:parichay2022@cluster0.cwu4w3u.mongodb.net/?retryWrites=true&w=majority" +) +db = client.get_database("parichay") + +events = db.events +department = db.department +winners = db.winners + +dep_list = department.find({}) + + +# depart = [ +# { +# 'dept_id': 1, +# 'dept_name': 'Computer Science', +# 'logo_img': 'image' +# }, +# { +# 'dept_id': 2, +# 'dept_name': 'Data Science', +# 'logo_img': 'image' +# }, +# { +# 'dept_id': 3, +# 'dept_name': 'AI ML', +# 'logo_img': 'image' +# }, +# { +# 'dept_id': 4, +# 'dept_name': 'Mechanical', +# 'logo_img': 'image' +# }, +# { +# 'dept_id': 5, +# 'dept_name': 'MCA', +# 'logo_img': 'image' +# }, +# { +# 'dept_id': 6, +# 'dept_name': 'Civil', +# 'logo_img': 'image' +# }, +# { +# 'dept_id': 7, +# 'dept_name': 'Electronics and Communication', +# 'logo_img': 'image' +# }, +# { +# 'dept_id': 8, +# 'dept_name': 'Electronics and Instrumentation', +# 'logo_img': 'image' +# }, +# { +# 'dept_id': 9, +# 'dept_name': 'Electrical and Electronics', +# 'logo_img': 'image' +# }, +# { +# 'dept_id': 10, +# 'dept_name': 'Information Science', +# 'logo_img': 'image' +# }, +# ] + +# department_insert = db.department.insert_many(depart) + + + +def update_winner(event_id, dept_id, position, points, winner_name): + print("updated winner") + + event_list = events.find( + {}, + { + '_id' : 1, + 'event_id' : 1 + }) + dep_list = department.find( + {}, + { + '_id' : 1, + 'dept_id': 1 + } + ) + # print(dep_list[1]) + + event_dict = {} + dep_dict = {} + + for event in event_list: + event_dict[str(event['event_id'])] = event['_id'] + + for dep in dep_list: + dep_dict[str(dep['dept_id'])] = dep['_id'] + + dept_id = dep_dict[dept_id] + event_id = event_dict[event_id] + pos = position + scored = points + winner_name = winner_name + + ins = [dept_id,event_id,pos,scored,winner_name] + + + record = { + 'dept_id': ins[0], + 'event_id': ins[1], + 'position': ins[2], + 'points_scored': ins[3], + 'winner_name': ins[4] + } + winner_update = db.winners.insert_one(record) + +# update_winner() + +# """command for printing all the document within event""" + +# event_list_all = events.find({}) +# for event in event_list_all: +# print(event,end="\n\n") + + +# printing list of events with their respective date + +# event_list = events.find( +# {}, +# { +# "_id": 0, +# "event_id": 1, +# "event_name": 1, +# "date": 1, +# "time_begin": 1, +# "time_end": 1, +# "venue": 1, +# "max_points": 1, +# "google_form_link": 1, +# }, +# ) + +# day1events = [] +# day2events = [] + +# day1 = datetime(2022, 5, 23, 18, 30) +# day2 = datetime(2022, 5, 24, 18, 30) +# for event in event_list: +# # print(f"{event['event_name']} is on {event['date']}") +# # e_l.append(f" {event['event_id']} {event['event_name']} is on {event['date']}") +# if event["date"] == day1: +# day1events.append(event) +# else: +# day2events.append(event) + +# day1events = sorted(day1events, key=lambda d: d['time_begin']) +# day2events = sorted(day2events, key=lambda d: d['time_begin']) + + + +# print(len(day1events)) +# print(len(day2events)) + +# print(day1events[0]) +# print(day2events[0]) + + +""" +Parichay + +format of database + +events: + event_id + date + time_begin + time_end + venue + event_name + max_points + google_form_link + +department: + dept_id + department_name + logo_img + +winners: + dept_id + event_id + position(1st, 2nd or 3rd) + points_scored + +""" diff --git a/scoreboard.py b/scoreboard.py new file mode 100644 index 0000000..beaad73 --- /dev/null +++ b/scoreboard.py @@ -0,0 +1,79 @@ +import db + +departments = db.department +winner_doc = db.winners + +dep_list = departments.find( + {}, + { + '_id':1, + 'dept_name':1 + } + ) + +dep_dict = {} + +for dep in dep_list: + dep_dict[str(dep['_id'])] = dep['dept_name'] + +board = { + 'Computer Science': 0, + 'Data Science': 0, + 'AI ML': 0, + 'Mechanical': 0, + 'MCA': 0, 'Civil': 0, + 'Electronics and Communication': 0, + 'Electronics and Instrumentation': 0, + 'Electrical and Electronics': 0, + 'Information Science': 0 + } + +def winner_count() -> int: + winner_list = winner_doc.find({}) + win_count = 0 + for win in winner_list: + win_count+=1 + return win_count + +def update_score(): + doc = winner_doc.find( + {}, + { + '_id':0, + 'dept_id':1, + 'points_scored':1 + } + ).sort("_id",-1).limit(1) + + concerned_department_id = doc[0]['dept_id'] + score_to_be_updated = doc[0]['points_scored'] + department_name = dep_dict[str(concerned_department_id)] + board[str(department_name)] += score_to_be_updated + print(board) + + + + + + + + + + + + + + +""" +we only need to change the score after the winner is announced, score of the department increases in winner branch, +retrieve recent score change +update the score of the respective branch +reflect change + +""" + + + + + + diff --git a/static/css/admin.css b/static/css/admin.css new file mode 100644 index 0000000..21c3fa1 --- /dev/null +++ b/static/css/admin.css @@ -0,0 +1,178 @@ +@import url('https://fonts.googleapis.com/css?family=Raleway:400,700'); + +* { + box-sizing: border-box; + margin: 0; + padding: 0; + font-family: Raleway, sans-serif; +} + +body { + background: linear-gradient(90deg, #C7C5F4, #776BCC); +} + +.container { + display: flex; + align-items: center; + justify-content: center; + min-height: 100vh; +} + +.screen { + background: linear-gradient(90deg, #5D54A4, #7C78B8); + position: relative; + height: 600px; + width: 360px; + box-shadow: 0px 0px 24px #5C5696; +} + +.screen__content { + z-index: 1; + position: relative; + height: 100%; +} + +.screen__background { + position: absolute; + top: 0; + left: 0; + right: 0; + bottom: 0; + z-index: 0; + -webkit-clip-path: inset(0 0 0 0); + clip-path: inset(0 0 0 0); +} + +.screen__background__shape { + transform: rotate(45deg); + position: absolute; +} + +.screen__background__shape1 { + height: 520px; + width: 520px; + background: #FFF; + top: -50px; + right: 120px; + border-radius: 0 72px 0 0; +} + +.screen__background__shape2 { + height: 220px; + width: 220px; + background: #6C63AC; + top: -172px; + right: 0; + border-radius: 32px; +} + +.screen__background__shape3 { + height: 540px; + width: 190px; + background: linear-gradient(270deg, #5D54A4, #6A679E); + top: -24px; + right: 0; + border-radius: 32px; +} + +.screen__background__shape4 { + height: 400px; + width: 200px; + background: #7E7BB9; + top: 420px; + right: 50px; + border-radius: 60px; +} + +.login { + width: 320px; + padding: 30px; + padding-top: 156px; +} + +.login__field { + padding: 20px 0px; + position: relative; +} + +.login__icon { + position: absolute; + top: 30px; + color: #7875B5; +} + +.login__input { + border: none; + border-bottom: 2px solid #D1D1D4; + background: none; + padding: 10px; + padding-left: 24px; + font-weight: 700; + width: 75%; + transition: .2s; +} + +.login__input:active, +.login__input:focus, +.login__input:hover { + outline: none; + border-bottom-color: #6A679E; +} + +.login__submit { + background: #fff; + font-size: 14px; + margin-top: 30px; + padding: 16px 20px; + border-radius: 26px; + border: 1px solid #D4D3E8; + text-transform: uppercase; + font-weight: 700; + display: flex; + align-items: center; + width: 100%; + color: #4C489D; + box-shadow: 0px 2px 2px #5C5696; + cursor: pointer; + transition: .2s; +} + +.login__submit:active, +.login__submit:focus, +.login__submit:hover { + border-color: #6A679E; + outline: none; +} + +.button__icon { + font-size: 24px; + margin-left: auto; + color: #7875B5; +} + +.social-login { + position: absolute; + height: 140px; + width: 160px; + text-align: center; + bottom: 0px; + right: 0px; + color: #fff; +} + +.social-icons { + display: flex; + align-items: center; + justify-content: center; +} + +.social-login__icon { + padding: 20px 10px; + color: #fff; + text-decoration: none; + text-shadow: 0px 0px 8px #7875B5; +} + +.social-login__icon:hover { + transform: scale(1.5); +} \ No newline at end of file diff --git a/static/css/prefest.css b/static/css/prefest.css index b9bf23d..02137a9 100644 --- a/static/css/prefest.css +++ b/static/css/prefest.css @@ -1,292 +1,426 @@ /* Import */ @font-face { - font-family: 'Chivo'; - font-style: italic; - font-weight: 300; - src: url(https://fonts.gstatic.com/s/chivo/v17/va9D4kzIxd1KFrBteUp9gK_uQQ.ttf) format('truetype'); - } - @font-face { - font-family: 'Chivo'; - font-style: italic; - font-weight: 400; - src: url(https://fonts.gstatic.com/s/chivo/v17/va9G4kzIxd1KFrBtceFfkA.ttf) format('truetype'); - } - @font-face { - font-family: 'Chivo'; - font-style: italic; - font-weight: 700; - src: url(https://fonts.gstatic.com/s/chivo/v17/va9D4kzIxd1KFrBteVp6gK_uQQ.ttf) format('truetype'); - } - @font-face { - font-family: 'Chivo'; - font-style: italic; - font-weight: 900; - src: url(https://fonts.gstatic.com/s/chivo/v17/va9D4kzIxd1KFrBteWJ4gK_uQQ.ttf) format('truetype'); - } - @font-face { - font-family: 'Chivo'; - font-style: normal; - font-weight: 300; - src: url(https://fonts.gstatic.com/s/chivo/v17/va9F4kzIxd1KFrjDY_Z4sKg.ttf) format('truetype'); - } - @font-face { - font-family: 'Chivo'; - font-style: normal; - font-weight: 400; - src: url(https://fonts.gstatic.com/s/chivo/v17/va9I4kzIxd1KFrBoQeY.ttf) format('truetype'); - } - @font-face { - font-family: 'Chivo'; - font-style: normal; - font-weight: 700; - src: url(https://fonts.gstatic.com/s/chivo/v17/va9F4kzIxd1KFrjTZPZ4sKg.ttf) format('truetype'); - } - @font-face { - font-family: 'Chivo'; - font-style: normal; - font-weight: 900; - src: url(https://fonts.gstatic.com/s/chivo/v17/va9F4kzIxd1KFrjrZvZ4sKg.ttf) format('truetype'); - } - @font-face { - font-family: 'Saira'; - font-style: normal; - font-weight: 100; - font-stretch: normal; - src: url(https://fonts.gstatic.com/s/saira/v13/memWYa2wxmKQyPMrZX79wwYZQMhsyuShhKMjjbU9uXuA71rDks8xkw.ttf) format('truetype'); - } - @font-face { - font-family: 'Saira'; - font-style: normal; - font-weight: 200; - font-stretch: normal; - src: url(https://fonts.gstatic.com/s/saira/v13/memWYa2wxmKQyPMrZX79wwYZQMhsyuShhKMjjbU9uXuA79rCks8xkw.ttf) format('truetype'); - } - @font-face { - font-family: 'Saira'; - font-style: normal; + font-family: 'Chivo'; + font-style: italic; + font-weight: 300; + src: url(https://fonts.gstatic.com/s/chivo/v17/va9D4kzIxd1KFrBteUp9gK_uQQ.ttf) format('truetype'); +} +@font-face { + font-family: 'Chivo'; + font-style: italic; + font-weight: 400; + src: url(https://fonts.gstatic.com/s/chivo/v17/va9G4kzIxd1KFrBtceFfkA.ttf) format('truetype'); +} +@font-face { + font-family: 'Chivo'; + font-style: italic; + font-weight: 700; + src: url(https://fonts.gstatic.com/s/chivo/v17/va9D4kzIxd1KFrBteVp6gK_uQQ.ttf) format('truetype'); +} +@font-face { + font-family: 'Chivo'; + font-style: italic; + font-weight: 900; + src: url(https://fonts.gstatic.com/s/chivo/v17/va9D4kzIxd1KFrBteWJ4gK_uQQ.ttf) format('truetype'); +} +@font-face { + font-family: 'Chivo'; + font-style: normal; + font-weight: 300; + src: url(https://fonts.gstatic.com/s/chivo/v17/va9F4kzIxd1KFrjDY_Z4sKg.ttf) format('truetype'); +} +@font-face { + font-family: 'Chivo'; + font-style: normal; + font-weight: 400; + src: url(https://fonts.gstatic.com/s/chivo/v17/va9I4kzIxd1KFrBoQeY.ttf) format('truetype'); +} +@font-face { + font-family: 'Chivo'; + font-style: normal; + font-weight: 700; + src: url(https://fonts.gstatic.com/s/chivo/v17/va9F4kzIxd1KFrjTZPZ4sKg.ttf) format('truetype'); +} +@font-face { + font-family: 'Chivo'; + font-style: normal; + font-weight: 900; + src: url(https://fonts.gstatic.com/s/chivo/v17/va9F4kzIxd1KFrjrZvZ4sKg.ttf) format('truetype'); +} +@font-face { + font-family: 'Saira'; + font-style: normal; + font-weight: 100; + font-stretch: normal; + src: url(https://fonts.gstatic.com/s/saira/v13/memWYa2wxmKQyPMrZX79wwYZQMhsyuShhKMjjbU9uXuA71rDks8xkw.ttf) format('truetype'); +} +@font-face { + font-family: 'Saira'; + font-style: normal; + font-weight: 200; + font-stretch: normal; + src: url(https://fonts.gstatic.com/s/saira/v13/memWYa2wxmKQyPMrZX79wwYZQMhsyuShhKMjjbU9uXuA79rCks8xkw.ttf) format('truetype'); +} +@font-face { + font-family: 'Saira'; + font-style: normal; + font-weight: 300; + font-stretch: normal; + src: url(https://fonts.gstatic.com/s/saira/v13/memWYa2wxmKQyPMrZX79wwYZQMhsyuShhKMjjbU9uXuA7wTCks8xkw.ttf) format('truetype'); +} +@font-face { + font-family: 'Saira'; + font-style: normal; + font-weight: 400; + font-stretch: normal; + src: url(https://fonts.gstatic.com/s/saira/v13/memWYa2wxmKQyPMrZX79wwYZQMhsyuShhKMjjbU9uXuA71rCks8xkw.ttf) format('truetype'); +} +@font-face { + font-family: 'Saira'; + font-style: normal; + font-weight: 500; + font-stretch: normal; + src: url(https://fonts.gstatic.com/s/saira/v13/memWYa2wxmKQyPMrZX79wwYZQMhsyuShhKMjjbU9uXuA72jCks8xkw.ttf) format('truetype'); +} +@font-face { + font-family: 'Saira'; + font-style: normal; + font-weight: 600; + font-stretch: normal; + src: url(https://fonts.gstatic.com/s/saira/v13/memWYa2wxmKQyPMrZX79wwYZQMhsyuShhKMjjbU9uXuA74TFks8xkw.ttf) format('truetype'); +} +@font-face { + font-family: 'Saira'; + font-style: normal; + font-weight: 700; + font-stretch: normal; + src: url(https://fonts.gstatic.com/s/saira/v13/memWYa2wxmKQyPMrZX79wwYZQMhsyuShhKMjjbU9uXuA773Fks8xkw.ttf) format('truetype'); +} +@font-face { + font-family: 'Saira'; + font-style: normal; + font-weight: 800; + font-stretch: normal; + src: url(https://fonts.gstatic.com/s/saira/v13/memWYa2wxmKQyPMrZX79wwYZQMhsyuShhKMjjbU9uXuA79rFks8xkw.ttf) format('truetype'); +} +@font-face { + font-family: 'Saira Extra Condensed'; + font-style: normal; + font-weight: 100; + src: url(https://fonts.gstatic.com/s/sairaextracondensed/v11/-nFsOHYr-vcC7h8MklGBkrvmUG9rbpkisrTri3j2_Co.ttf) format('truetype'); +} +@font-face { + font-family: 'Saira Extra Condensed'; + font-style: normal; + font-weight: 200; + src: url(https://fonts.gstatic.com/s/sairaextracondensed/v11/-nFvOHYr-vcC7h8MklGBkrvmUG9rbpkisrTrJ2nh2wpk.ttf) format('truetype'); +} +@font-face { + font-family: 'Saira Extra Condensed'; + font-style: normal; + font-weight: 300; + src: url(https://fonts.gstatic.com/s/sairaextracondensed/v11/-nFvOHYr-vcC7h8MklGBkrvmUG9rbpkisrTrQ2rh2wpk.ttf) format('truetype'); +} +@font-face { + font-family: 'Saira Extra Condensed'; + font-style: normal; + font-weight: 400; + src: url(https://fonts.gstatic.com/s/sairaextracondensed/v11/-nFiOHYr-vcC7h8MklGBkrvmUG9rbpkisrTj6Ejx.ttf) format('truetype'); +} +@font-face { + font-family: 'Saira Extra Condensed'; + font-style: normal; + font-weight: 500; + src: url(https://fonts.gstatic.com/s/sairaextracondensed/v11/-nFvOHYr-vcC7h8MklGBkrvmUG9rbpkisrTrG2vh2wpk.ttf) format('truetype'); +} +@font-face { + font-family: 'Saira Extra Condensed'; + font-style: normal; + font-weight: 600; + src: url(https://fonts.gstatic.com/s/sairaextracondensed/v11/-nFvOHYr-vcC7h8MklGBkrvmUG9rbpkisrTrN2zh2wpk.ttf) format('truetype'); +} +@font-face { + font-family: 'Saira Extra Condensed'; + font-style: normal; + font-weight: 700; + src: url(https://fonts.gstatic.com/s/sairaextracondensed/v11/-nFvOHYr-vcC7h8MklGBkrvmUG9rbpkisrTrU23h2wpk.ttf) format('truetype'); +} +@font-face { + font-family: 'Saira Extra Condensed'; + font-style: normal; + font-weight: 800; + src: url(https://fonts.gstatic.com/s/sairaextracondensed/v11/-nFvOHYr-vcC7h8MklGBkrvmUG9rbpkisrTrT27h2wpk.ttf) format('truetype'); +} + + + +/* ------------------------------------------------------------ */ +/* Variables */ +/* Base */ + +.gradient { + background: linear-gradient(269deg, #f96167, #fee66d); + background-size: 400% 400%; + animation: AnimationName 12s ease infinite; +} + +@keyframes AnimationName { + 0%{background-position:0% 50%} + 50%{background-position:100% 50%} + 100%{background-position:0% 50%} +} +.nav-tabs .nav-item.show .nav-link, .nav-tabs .nav-link.active { + color: #495057; + background: orange; + border-color: orange; +} +.navbar{ + position: sticky; + top:0; + z-index: 10; +} +.prefestbody { + font-size: 26px; + /* white-space: pre-line; */ +} +.prefestbody #timeline-content .timeline .event p { + font-weight: 300; + width: max-content; +} +.prefestbody #timeline-content .timeline .event a { + color: #ffffff; + text-decoration: none; + text-transform: uppercase; + display: block; + letter-spacing: 0.3em; + font-size: 0.6em; + font-weight: 400; + background: #fc4300; + padding: 0.3rem 1rem; + margin: 1.9rem 0 0 0; + transition: 0.3s; + border-bottom: 0.35em solid black; + + /* float: right; */ +} +.prefestbody #timeline-content .timeline .event a:hover { + color: white; + background: #ffc400; + border-bottom: 0.35em solid black; +} +.prefestbody #timeline-content h1{ + font-family: 'Saira', sans-serif; + letter-spacing: 1.5px; + color: white; + font-weight: 700; + font-size: 2.4em; +} +.prefestbody #timeline-content h3{ + font-family: 'Saira', sans-serif; + letter-spacing: 1.5px; + color: white; + font-weight: 800; + font-size: 1.4em; +} +/* Timeline */ +#timeline-content{ + margin-top: 50px; + text-align: center; +} +.timeline { + border-left: 4px solid #ffffff; + border-bottom-right-radius: 4px; + border-top-right-radius: 4px; + background: rgba(255, 255, 255, 0.03); + color: rgba(255, 255, 255, 0.8); + font-family: 'Chivo', sans-serif; + margin: 50px auto; + letter-spacing: 0.5px; + position: relative; + line-height: 1.4em; + font-size: 1.03em; + padding: 50px; + list-style: none; + text-align: left; + font-weight: 500; + max-width: 30%; +} +.timeline h1 { + font-family: 'Saira', sans-serif; + letter-spacing: 1.5px; + font-weight: 500; + font-size: 1.4em; +} +.timeline h2, +.timeline h3 { + font-family: 'Saira', sans-serif; + letter-spacing: 1.5px; + font-weight: 400; + font-size: 1.4em; +} +.timeline .event { + border-bottom: 1px dashed rgba(255, 255, 255, 0.1); + padding-bottom: 25px; + margin-bottom: 50px; + position: relative; +} +.timeline .event:last-of-type { + padding-bottom: 0; + margin-bottom: 0; + border: none; +} +.timeline .event:before, +.timeline .event:after { + position: absolute; + display: block; + top: 0; +} +.timeline .event:before { + left: -217.5px; + color: rgb(255, 255, 255); + content: attr(data-date); + text-align: right; + font-weight: 800; + font-size: 0.9em; + min-width: 120px; + font-family: 'Saira', sans-serif; +} +.timeline .event:after { + box-shadow: 0 0 0 4px #fc5800; + left: -57.85px; + background: #313534; + border-radius: 50%; + height: 11px; + width: 11px; + content: ""; + top: 5px; +} +footer{ + bottom: 0; +} +.merch-content{ + text-align: center; +} + .merch-content h1 { + font-family: 'Saira', sans-serif; + letter-spacing: 1.5px; + color: white; + font-weight: 700; + font-size: 2.4em; +} +.merch-content a { + color: #ffffff; + text-decoration: none; + text-transform: uppercase; + display: block; + letter-spacing: 0.3em; + font-size: 0.6em; + font-weight: 400; + background: #252727; + padding: 0.3rem 1rem; + margin: 1.9rem 0 0 0; +} +.merch-content a:hover{ + color: white; + background: #fc4300; + border-bottom: 0.35em solid black; +} +.nav-tabs { + border-bottom: 1px solid #fee66d; +} +/* --------------------------------------------------------------------- */ + + + +/* responsiveness */ +@media screen and (max-width : 680px) { + .prefestbody #timeline-content .timeline .event p { font-weight: 300; - font-stretch: normal; - src: url(https://fonts.gstatic.com/s/saira/v13/memWYa2wxmKQyPMrZX79wwYZQMhsyuShhKMjjbU9uXuA7wTCks8xkw.ttf) format('truetype'); - } - @font-face { - font-family: 'Saira'; - font-style: normal; - font-weight: 400; - font-stretch: normal; - src: url(https://fonts.gstatic.com/s/saira/v13/memWYa2wxmKQyPMrZX79wwYZQMhsyuShhKMjjbU9uXuA71rCks8xkw.ttf) format('truetype'); - } - @font-face { - font-family: 'Saira'; - font-style: normal; - font-weight: 500; - font-stretch: normal; - src: url(https://fonts.gstatic.com/s/saira/v13/memWYa2wxmKQyPMrZX79wwYZQMhsyuShhKMjjbU9uXuA72jCks8xkw.ttf) format('truetype'); - } - @font-face { - font-family: 'Saira'; - font-style: normal; - font-weight: 600; - font-stretch: normal; - src: url(https://fonts.gstatic.com/s/saira/v13/memWYa2wxmKQyPMrZX79wwYZQMhsyuShhKMjjbU9uXuA74TFks8xkw.ttf) format('truetype'); - } - @font-face { - font-family: 'Saira'; - font-style: normal; - font-weight: 700; - font-stretch: normal; - src: url(https://fonts.gstatic.com/s/saira/v13/memWYa2wxmKQyPMrZX79wwYZQMhsyuShhKMjjbU9uXuA773Fks8xkw.ttf) format('truetype'); - } - @font-face { - font-family: 'Saira'; - font-style: normal; - font-weight: 800; - font-stretch: normal; - src: url(https://fonts.gstatic.com/s/saira/v13/memWYa2wxmKQyPMrZX79wwYZQMhsyuShhKMjjbU9uXuA79rFks8xkw.ttf) format('truetype'); - } - @font-face { - font-family: 'Saira Extra Condensed'; - font-style: normal; - font-weight: 100; - src: url(https://fonts.gstatic.com/s/sairaextracondensed/v11/-nFsOHYr-vcC7h8MklGBkrvmUG9rbpkisrTri3j2_Co.ttf) format('truetype'); + font-size: 0.6em; + width: 170px; } - @font-face { - font-family: 'Saira Extra Condensed'; - font-style: normal; - font-weight: 200; - src: url(https://fonts.gstatic.com/s/sairaextracondensed/v11/-nFvOHYr-vcC7h8MklGBkrvmUG9rbpkisrTrJ2nh2wpk.ttf) format('truetype'); + .prefestbody #timeline-content .timeline .event a { + display: flex; + font-size: 0.5em; + padding: 0.1rem 2.5rem 0.1rem 7.0rem; + flex-direction: row; + align-content: center; + justify-content: flex-end; } - @font-face { - font-family: 'Saira Extra Condensed'; - font-style: normal; - font-weight: 300; - src: url(https://fonts.gstatic.com/s/sairaextracondensed/v11/-nFvOHYr-vcC7h8MklGBkrvmUG9rbpkisrTrQ2rh2wpk.ttf) format('truetype'); - } - @font-face { - font-family: 'Saira Extra Condensed'; - font-style: normal; - font-weight: 400; - src: url(https://fonts.gstatic.com/s/sairaextracondensed/v11/-nFiOHYr-vcC7h8MklGBkrvmUG9rbpkisrTj6Ejx.ttf) format('truetype'); + .prefestbody #timeline-content h1{ + font-size: 1.4em; } - @font-face { - font-family: 'Saira Extra Condensed'; - font-style: normal; - font-weight: 500; - src: url(https://fonts.gstatic.com/s/sairaextracondensed/v11/-nFvOHYr-vcC7h8MklGBkrvmUG9rbpkisrTrG2vh2wpk.ttf) format('truetype'); + .prefestbody #timeline-content h3{ + font-size: 0.9em; } - @font-face { - font-family: 'Saira Extra Condensed'; - font-style: normal; - font-weight: 600; - src: url(https://fonts.gstatic.com/s/sairaextracondensed/v11/-nFvOHYr-vcC7h8MklGBkrvmUG9rbpkisrTrN2zh2wpk.ttf) format('truetype'); + /* Timeline */ + #timeline-content{ + margin-left: 10px; + margin-right: 10px; } - @font-face { - font-family: 'Saira Extra Condensed'; - font-style: normal; - font-weight: 700; - src: url(https://fonts.gstatic.com/s/sairaextracondensed/v11/-nFvOHYr-vcC7h8MklGBkrvmUG9rbpkisrTrU23h2wpk.ttf) format('truetype'); + .timeline { + max-width: 36%; } - @font-face { - font-family: 'Saira Extra Condensed'; - font-style: normal; - font-weight: 800; - src: url(https://fonts.gstatic.com/s/sairaextracondensed/v11/-nFvOHYr-vcC7h8MklGBkrvmUG9rbpkisrTrT27h2wpk.ttf) format('truetype'); + .timeline h1 { + font-size: 1.4em; } - /* Variables */ - /* Base */ - - .gradient { - background: linear-gradient(269deg, #f96167, #fee66d); - background-size: 400% 400%; - - animation: AnimationName 12s ease infinite; + .timeline h2, + .timeline h3 { + font-size: 1.4em; } - - @keyframes AnimationName { - 0%{background-position:0% 50%} - 50%{background-position:100% 50%} - 100%{background-position:0% 50%} + .timeline .event:before { + left: -200.5px; + text-align: right; + font-size: 0.5em; + min-width: 120px; } - - - - body { - background: #252827; - font-size: 26px; - /* white-space: pre-line; */ + .merch-content h1 { + font-size: 1.4em; } - p { +} +@media screen and (max-width:350px) { + .prefestbody #timeline-content .timeline .event p { font-weight: 300; - } - a { - color: #ffffff; - text-decoration: none; - text-transform: uppercase; - display: block; - letter-spacing: 0.3em; font-size: 0.6em; - font-weight: 400; - background: #fc4300; - padding: 0.3rem 1rem; - margin: 1.9rem 0 0 0; - transition: 0.3s; - border-bottom: 0.35em solid black; - - /* float: right; */ + width: fit-content; } - a:hover { - color: white; - background: #ffc400; - border-bottom: 0.35em solid black; + .prefestbody #timeline-content .timeline .event a { + display: flex; + font-size: 0.4em; + padding: 0.1rem 2.5rem 0.1rem 6rem; + flex-direction: row; + align-content: center; + justify-content: flex-end; + margin-left: -15px; } - strong { - font-weight: 600; + .prefestbody #timeline-content h1{ + font-size: 1.2em; } - h1{ - font-family: 'Saira', sans-serif; - letter-spacing: 1.5px; - color: white; - font-weight: 700; - font-size: 2.4em; + .prefestbody #timeline-content h3{ + font-size: 0.7em; } - - h3{ - font-family: 'Saira', sans-serif; - letter-spacing: 1.5px; - color: white; - font-weight: 400; + .merch-content h1 { font-size: 1.4em; } - #timeline-content { - margin-top: 50px; - text-align: center; - } /* Timeline */ + #timeline-content{ + margin-left: 10px; + margin-right: 10px; + } .timeline { - border-left: 4px solid #ffffff; - border-bottom-right-radius: 4px; - border-top-right-radius: 4px; - background: rgba(255, 255, 255, 0.03); - color: rgba(255, 255, 255, 0.8); - font-family: 'Chivo', sans-serif; - margin: 50px auto; - letter-spacing: 0.5px; - position: relative; - line-height: 1.4em; - font-size: 1.03em; - padding: 50px; - list-style: none; - text-align: left; - font-weight: 500; - max-width: 30%; + max-width: 36%; } .timeline h1 { - font-family: 'Saira', sans-serif; - letter-spacing: 1.5px; - font-weight: 500; - font-size: 1.4em; + font-size: 1.2em; } .timeline h2, .timeline h3 { - font-family: 'Saira', sans-serif; - letter-spacing: 1.5px; - font-weight: 400; - font-size: 1.4em; - } - .timeline .event { - border-bottom: 1px dashed rgba(255, 255, 255, 0.1); - padding-bottom: 25px; - margin-bottom: 50px; - position: relative; - } - .timeline .event:last-of-type { - padding-bottom: 0; - margin-bottom: 0; - border: none; - } - .timeline .event:before, - .timeline .event:after { - position: absolute; - display: block; - top: 0; + font-size: 1.2em; } .timeline .event:before { - left: -270.5px; - width:200px; - color: rgb(255, 255, 255); - content: attr(data-date); + left: -189.5px; text-align: right; - font-weight: 800; - font-size: 0.9em; + font-size: 0.3em; min-width: 120px; - font-family: 'Saira', sans-serif; } - .timeline .event:after { - box-shadow: 0 0 0 4px #fc5800; - left: -57.85px; - background: #313534; - border-radius: 50%; - height: 11px; - width: 11px; - content: ""; - top: 5px; - } \ No newline at end of file +} \ No newline at end of file diff --git a/static/css/score.css b/static/css/score.css new file mode 100644 index 0000000..d28cdb2 --- /dev/null +++ b/static/css/score.css @@ -0,0 +1,136 @@ +/* + * Reference - https://codepen.io/supah/pen/WwrJpw + */ + +/* basic */ +*, +*:before, +*:after { + box-sizing: border-box; +} + +html, +body { + height: 100%; +} + +body { + font: 16px/1.2 "Roboto", sans-serif; + color: #333; +} + +a { + display: inline-block; + color: #333; + text-decoration: none; +} + +.blog { + font-size: 14px; + font-weight: bold; + text-align: center; + position: absolute; + bottom: 15px; + left: 50%; + transform: translateX(-50%); + z-index: 1; +} + +/* container */ +.container { + width: 300px; + height: auto; + border-radius: 10px; + background-color: white; + box-shadow: rgba(0, 0, 0, 0.35) 0px 5px 15px; + position: absolute; + top: 50%; + left: 50%; + transform: translate(-50%, -50%); + z-index: 1; + overflow: hidden; +} + +/* leaderboard */ +.leaderboard { + background: linear-gradient(to bottom, #3a404d, #181c26); +} + +/* head */ +.leaderboard .head { + padding: 20px 16px; + color: snow; + font-size: 20px; + text-align: center; +} + +.leaderboard .head h1 { + display: inline-block; + margin-left: 4px; +} + +/* body */ +.leaderboard .body { + color: snow; + font-size: 16px; +} + +.leaderboard ol { + counter-reset: number; + /* 定義和初始化計數器 */ +} + +.leaderboard li { + padding: 16px; + display: flex; +} + +.leaderboard li mark { + flex-grow: 1; + color: snow; + background-color: transparent; +} + +.leaderboard li:before { + counter-increment: number; + /* 遞增計數器 */ + content: counter(number) "."; + /* 顯示計數器 */ + margin-right: 4px; +} + +.leaderboard li:nth-child(1) { + background: #fa6855; +} + +.leaderboard li:nth-child(2) { + background: #e0574f; +} + +.leaderboard li:nth-child(3) { + background: #d7514d; +} + +.leaderboard li:nth-child(4) { + background: #cd4b4b; +} + +.leaderboard li:nth-child(5) { + background: #c24448; +} + +.leaderboard li:nth-child(6) { + background: #bb4044; +} + +.leaderboard li:nth-child(7) { + background: rgb(172, 61, 64); +} + +.leaderboard li:nth-child(8) { + background: rgb(158, 55, 58); +} + +.leaderboard li:nth-child(9) { + background: rgb(150, 52, 55); +} \ No newline at end of file diff --git a/static/css/table.css b/static/css/table.css new file mode 100644 index 0000000..11199a0 --- /dev/null +++ b/static/css/table.css @@ -0,0 +1,98 @@ +*{ + + margin: 0; + + padding: 0; + + font-family: arial; + + box-sizing: border-box; + +} + +body{ + + height: 100vh; + + display: grid; + + place-items: center; + + background: linear-gradient(rgba(0,0,0,0),rgba(0,0,0,0.6)), url(image.jpg); + + background-size: 100% 100%; + + background-repeat: no-repeat; + +} + +table{ + + width: 600px; + + box-shadow: -1px 12px 12px -6px rgba(0,0,0,0.5); + +} + +table, td, th{ + + padding: 20px; + + border: 1px solid lightgray; + + border-collapse: collapse; + + text-align: center; + + cursor: pointer; + +} + +td{ + + font-size: 18px; + +} + +th{ + + background-color: blue; + + color: white; + +} + +tr:nth-child(odd){ + + background-color: lightblue; + +} + +tr:nth-child(odd):hover{ + + background-color: dodgerblue; + + color: white; + + transform: scale(1.5); + + transition: transform 300ms ease-in; + +} + +tr:nth-child(even){ + + background-color: #ededed; + +} + +tr:nth-child(even):hover{ + + background-color: lightgray; + + transform: scale(1.5); + + transition: transform 300ms ease-in; + + +} \ No newline at end of file diff --git a/static/images/sponsor.png b/static/images/sponsor.png new file mode 100644 index 0000000..515ffe4 Binary files /dev/null and b/static/images/sponsor.png differ diff --git a/templates/admin.html b/templates/admin.html new file mode 100644 index 0000000..e48802e --- /dev/null +++ b/templates/admin.html @@ -0,0 +1,67 @@ + + + + + + + +
+
+
+ +
+
+ + + + +
+
+
+ + + \ No newline at end of file diff --git a/templates/events.html b/templates/events.html index 8d5c863..05b07d5 100644 --- a/templates/events.html +++ b/templates/events.html @@ -1,434 +1,241 @@ + - - - - - - - PARICHAY 2022 - + + + + + + + + + Events + - + + + - -