Skip to content

Commit

Permalink
add landing page
Browse files Browse the repository at this point in the history
  • Loading branch information
rohitner committed Aug 23, 2020
1 parent 01cb44c commit 92025a6
Show file tree
Hide file tree
Showing 7 changed files with 153 additions and 3 deletions.
9 changes: 7 additions & 2 deletions bot.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import random
import os, gc
from flask import Flask, request
from flask import Flask, request, render_template
from pymessenger.bot import Bot
from generate import generateVideoClip
from threading import Thread, enumerate
Expand All @@ -12,8 +12,13 @@
bot = Bot(ACCESS_TOKEN)


@app.route("/", methods=['GET'])
def landing_page():
return render_template('landing.html')


# We will receive messages that Facebook sends our bot at this endpoint
@app.route("/", methods=['GET', 'POST'])
@app.route("/bot", methods=['GET', 'POST'])
def receive_message():
if request.method == 'GET':
"""Before allowing people to message your bot, Facebook has implemented a verify token
Expand Down
2 changes: 1 addition & 1 deletion generate.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ def generateVideoClip(url, clip_duration):
musicClip = AudioFileClip(get_music_path(text))

# append intro : dont concat image with text, causes pixelation
introClip = ImageClip('assets/newzery.png').resize(width=WIDTH, height=HEIGHT).set_pos(
introClip = ImageClip('static/newzery.png').resize(width=WIDTH, height=HEIGHT).set_pos(
('center', 'center')).set_duration(total_duration + INTRO_TIMEOUT).fadein(FADE_TIMEOUT)

finalClip = CompositeVideoClip([introClip, textClip.set_start(
Expand Down
File renamed without changes
File renamed without changes
File renamed without changes
Binary file added static/text.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
145 changes: 145 additions & 0 deletions templates/landing.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,145 @@
<!DOCTYPE html>
<html lang="en">

<head>
<meta charset="UTF-8">
<title>Newzery</title>
<style>
body {
overflow-x: hidden;
margin: 0;
}

.logocon {
display: flex;
justify-content: center;
align-items: center;
width: 100vw;
height: 100vh;
background: #e61919;
animation: color 30s linear infinite;
user-select: none;
position: fixed;
top: 0;
z-index: 3;
}

.logo {
font: 300 150px Comfortaa;
color: #fff;
cursor: default;
}

.hint {
position: fixed;
z-index: 4;
bottom: 10vh;
width: 100vw;
text-align: center;
color: rgba(255, 255, 255, 0.6);
font: 300 30px Comfortaa;
}

.content {
padding: 30px;
position: relative;
top: 20vh;
height: 200vh;
font: 16px Ubuntu;
}

@-moz-keyframes color {
0% {
background: #e61919;
}

25% {
background: #7f19e6;
}

50% {
background: #19e5e6;
}

75% {
background: #80e619;
}

100% {
background: #e61919;
}
}

@-webkit-keyframes color {
0% {
background: #e61919;
}

25% {
background: #7f19e6;
}

50% {
background: #19e5e6;
}

75% {
background: #80e619;
}

100% {
background: #e61919;
}
}

@-o-keyframes color {
0% {
background: #e61919;
}

25% {
background: #7f19e6;
}

50% {
background: #19e5e6;
}

75% {
background: #80e619;
}

100% {
background: #e61919;
}
}

@keyframes color {
0% {
background: #e61919;
}

25% {
background: #7f19e6;
}

50% {
background: #19e5e6;
}

75% {
background: #80e619;
}

100% {
background: #e61919;
}
}
</style>
</head>

<body>
<div class="logocon"><img src="/static/text.png"></div>
</body>

</html>

0 comments on commit 92025a6

Please sign in to comment.