Slap that beta and cleanup

This commit is contained in:
Jeremy Zhang 2017-04-05 07:14:29 +00:00
parent 513aa2280b
commit c993a1dcf6
9 changed files with 18 additions and 511 deletions

View File

@ -1,286 +0,0 @@
<!DOCTYPE html>
<html>
<head>
<!--Import Google Icon Font-->
<link href="//fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
<!--Import materialize.css-->
<link type="text/css" rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/materialize/0.98.1/css/materialize.min.css" integrity="sha256-6DQKO56c9MZL0LAc7QNtxqJyqSa3rS9Gq5FVcIhtA+w=" crossorigin="anonymous" media="screen,projection"/>
<style>
html {
background-color: #455a64;
color: white;
}
main {
min-height: calc(100vh - 80px);
}
footer {
position: fixed;
bottom: 0;
left: 0;
right: 0;
height: 50px;
background-color: #37474f;
}
nav {
background-color: #263238;
background: linear-gradient(rgba(38, 50, 56, 1), rgba(255,0,0,0));
box-shadow: none;
}
nav .brand-logo {
font-size: 1.5rem;
}
@media only screen and (min-width: 993px) {
.container {
width: 85%;
}
}
.side-nav {
color: white;
background-color: #607d8b;
}
.side-nav .userView .name {
font-size: 20px;
}
.side-nav li>a {
color: #eceff1;
}
.side-nav .subheader {
color: #cfd8dc;
font-variant: small-caps;
}
.divider {
background-color: #90a4ae;
}
.channel-hash {
font-size: 95%;
color: #b0bec5;
}
.membercircle {
margin-top: 5px;
height: 40px;
}
.membername {
position: absolute;
padding-left: 10px;
}
.chatcontent {
padding-left: 1%;
padding-top: 1%;
padding-bottom: 40px;
}
@media only screen and (min-width: 601px) {
nav a.button-collapse {
display: block;
}
}
.chatusername {
font-weight: bold;
color: #eceff1;
}
.chattimestamp {
font-size: 10px;
color: #90a4ae;
}
.footercontainer {
width: 100%;
position: relative;
margin: 10px;
}
.currentuserchip {
display: inline-block;
position: relative;
top: -6px;
padding: 6px;
padding-right: 9px;
background-color: #455a64;
}
.currentuserimage {
width: 30px;
}
.currentusername {
position: relative;
top: 7px;
left: 5px;
}
.input-field {
position: relative;
top: -19px;
}
.left {
float: left;
}
.modal {
background-color: #546e7a;
}
</style>
<!--Let browser know website is optimized for mobile-->
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
<title>Embed - Titan Embeds for Discord</title>
</head>
<body>
<div class="navbar-fixed">
<nav>
<div class="nav-wrapper">
<a href="#" data-activates="guild-nav" class="button-collapse" id="guild-btn"><i class="material-icons">menu</i></a>
<div class="container">
<a href="#" class="brand-logo"><b>Titan</b>Embeds</a>
</div>
<a href="#" data-activates="members-nav" class="button-collapse right" id="members-btn"><i class="material-icons">person</i></a>
</div>
</nav>
</div>
<main>
<div class="chatcontent">
<p><span title="March 31, 2017 3:30PM" class="chattimestamp">3:30PM</span> <span class="chatusername">EndenDragon#69420</span> Hello everyone!</p>
<p><span title="March 31, 2017 3:30PM" class="chattimestamp">3:30PM</span> <span class="chatusername">EndenDragon#69420</span> Hello everyone!</p>
<p><span title="March 31, 2017 3:30PM" class="chattimestamp">3:30PM</span> <span class="chatusername">EndenDragon#69420</span> Hello everyone!</p>
<p><span title="March 31, 2017 3:30PM" class="chattimestamp">3:30PM</span> <span class="chatusername">EndenDragon#69420</span> Hello everyone!</p>
<p><span title="March 31, 2017 3:30PM" class="chattimestamp">3:30PM</span> <span class="chatusername">EndenDragon#69420</span> Hello everyone!</p>
<p><span title="March 31, 2017 3:30PM" class="chattimestamp">3:30PM</span> <span class="chatusername">EndenDragon#69420</span> Hello everyone!</p>
<p><span title="March 31, 2017 3:30PM" class="chattimestamp">3:30PM</span> <span class="chatusername">EndenDragon#69420</span> Hello everyone!</p>
<p><span title="March 31, 2017 3:30PM" class="chattimestamp">3:30PM</span> <span class="chatusername">EndenDragon#69420</span> Hello everyone!</p>
<p><span title="March 31, 2017 3:30PM" class="chattimestamp">3:30PM</span> <span class="chatusername">EndenDragon#69420</span> adfsadfsdfas</p>
</div>
</main>
<ul id="guild-nav" class="side-nav">
<li>
<div class="userView">
<img class="circle" src="https://cdn.discordapp.com/icons/213459805048668160/14aa7c0ad94e3c80d2eeef3a83cae1c1.jpg">
<span class="name">Guild Name</span>
</div>
</li>
<li><a class="subheader">Actions</a></li>
<li><a href="#!" class="waves-effect">Manage Guild Embed</a></li>
<li><a href="#!" class="waves-effect">Open Server on Discordapp</a></li>
<li><div class="divider"></div></li>
<li><a class="subheader">Channels</a></li>
<li><a class="waves-effect truncate" href="#!"><span class="channel-hash">#</span> channel-1</a></li>
<li><a class="waves-effect truncate" href="#!"><span class="channel-hash">#</span> channel-2</a></li>
<li><a class="waves-effect truncate" href="#!"><span class="channel-hash">#</span> channel-3</a></li>
</ul>
<ul id="members-nav" class="side-nav">
<li><a class="subheader">Online Server Members</a></li>
<li><a class="waves-effect truncate" href="#!"><img class="circle membercircle" src="https://cdn.discordapp.com/icons/213459805048668160/14aa7c0ad94e3c80d2eeef3a83cae1c1.jpg"> <span class="membername">EndenDragon</span></a></li>
<li><a class="waves-effect truncate" href="#!"><img class="circle membercircle" src="https://cdn.discordapp.com/icons/213459805048668160/14aa7c0ad94e3c80d2eeef3a83cae1c1.jpg"> <span class="membername">EndenDragon</span></a></li>
<li><a class="waves-effect truncate" href="#!"><img class="circle membercircle" src="https://cdn.discordapp.com/icons/213459805048668160/14aa7c0ad94e3c80d2eeef3a83cae1c1.jpg"> <span class="membername">EndenDragon</span></a></li>
<li><div class="divider"></div></li>
<li><a class="subheader">Authenticated Embed Users</a></li>
<li><a class="waves-effect truncate" href="#!"><img class="circle membercircle" src="https://cdn.discordapp.com/icons/213459805048668160/14aa7c0ad94e3c80d2eeef3a83cae1c1.jpg"> <span class="membername">EndenDragon</span></a></li>
<li><a class="waves-effect truncate" href="#!"><img class="circle membercircle" src="https://cdn.discordapp.com/icons/213459805048668160/14aa7c0ad94e3c80d2eeef3a83cae1c1.jpg"> <span class="membername">EndenDragon</span></a></li>
<li><a class="waves-effect truncate" href="#!"><img class="circle membercircle" src="https://cdn.discordapp.com/icons/213459805048668160/14aa7c0ad94e3c80d2eeef3a83cae1c1.jpg"> <span class="membername">EndenDragon</span></a></li>
<li><a class="subheader">Guest Embed Users</a></li>
<li><a class="waves-effect truncate" href="#!"><span class="membername">EndenDragon#6969</span></a></li>
<li><a class="waves-effect truncate" href="#!"><span class="membername">EndenDragon#1234</span></a></li>
<li><a class="waves-effect truncate" href="#!"><span class="membername">EndenDragon#3333</span></a></li>
</ul>
<div id="loginmodal" class="modal">
<div class="modal-content">
<h4>Let's get to know each other! My name is Titan, what's yours?</h4>
<p class="flow-text">Please choose one of the following methods to login!</p>
<div class="row">
<div class="col s1 m4">
<a class="waves-effect waves-light btn-large">Login with Discord</a>
</div>
<div class="col s1 m8">
<p>Of course, you also have the option to login by picking a temporary username.</p>
<input id="custom_username_field" type="text">
<label class="active" for="custom_username_field">Username</label>
</div>
</div>
</div>
</div>
<footer class="footer">
<div class="footercontainer">
<div class="currentuserchip left" id="nameplate">
<div class="left"><img src="https://cdn.discordapp.com/icons/213459805048668160/14aa7c0ad94e3c80d2eeef3a83cae1c1.jpg" class="circle left currentuserimage"></div>
<div class="currentusername left">EndenDragon#4151</div>
</div>
<div id="messageboxouter" class="input-field inline"><textarea placeholder="Enter message" id="messagebox" type="text" class="materialize-textarea"></textarea></div>
</div>
</footer>
<!--Import jQuery before materialize.js-->
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.2.1/jquery.min.js" integrity="sha256-hwg4gsxgFZhOsEEamdOYGBf13FyQuiTwlAQgxVSNgt4=" crossorigin="anonymous"></script>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/materialize/0.98.1/js/materialize.min.js" integrity="sha256-ToPQhpo/E89yaCd7+V8LUCjobNRkjilRXfho6x3twLU=" crossorigin="anonymous"></script>
<script>
function resize_messagebox() {
var namebox_width = $("#nameplate").outerWidth(true);
var screen_width = $(document).width();
$("#messageboxouter").width(screen_width - namebox_width - 40);
}
$(function(){
resize_messagebox()
$("#loginmodal").modal({
dismissible: false, // Modal can be dismissed by clicking outside of the modal
opacity: .5, // Opacity of modal background
inDuration: 300, // Transition in duration
outDuration: 200, // Transition out duration
startingTop: '4%', // Starting top style attribute
endingTop: '10%', // Ending top style attribute
}
);
$('#loginmodal').modal('open');
});
$(window).resize(function() {
resize_messagebox()
});
$('#guild-btn').sideNav({
menuWidth: 300, // Default is 300
edge: 'left', // Choose the horizontal origin
closeOnClick: true, // Closes side-nav on <a> clicks, useful for Angular/Meteor
draggable: true // Choose whether you can drag to open on touch screens
}
);
$('#members-btn').sideNav({
menuWidth: 300, // Default is 300
edge: 'right', // Choose the horizontal origin
draggable: true // Choose whether you can drag to open on touch screens
}
);
</script>
</body>
</html>

View File

@ -1,113 +0,0 @@
<!DOCTYPE html>
<html>
<head>
<!--Import Google Icon Font-->
<link href="http://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
<!--Import materialize.css-->
<link type="text/css" rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/materialize/0.98.1/css/materialize.min.css" integrity="sha256-6DQKO56c9MZL0LAc7QNtxqJyqSa3rS9Gq5FVcIhtA+w=" crossorigin="anonymous" media="screen,projection"/>
<style>
html {
background-color: #7986cb;
color: white;
}
body {
display: flex;
min-height: 100vh;
flex-direction: column;
}
main {
flex: 1 0 auto;
}
nav {
background-color: #3f51b5;
background: linear-gradient(rgba(63, 81, 181, 1), rgba(255,0,0,0));
box-shadow: none;
}
.page-footer {
background-color: transparent;
}
@media only screen and (max-width: 992px) {
nav .brand-logo {
left: 10%;
}
}
.btn {
background-color: #303f9f;
}
.btn:hover {
background-color: #3f51b5;
}
.btn:focus {
background-color: #536dfe;
}
.avatar_menu {
background-size: contain;
}
.center_content {
display: block;
margin-left: auto;
margin-right: auto;
}
</style>
<!--Let browser know website is optimized for mobile-->
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
<title>Index - Titan Embeds for Discord</title>
</head>
<body>
<main>
<ul id="menu_dropdown" class="dropdown-content">
<li><a href="#!">Servers</a></li>
<li class="divider"></li>
<li><a href="#!">Logout</a></li>
</ul>
<nav>
<div class="nav-wrapper container">
<a href="#" class="brand-logo"><b>Titan</b>Embeds</a>
<ul id="nav-mobile" class="right">
<li><a href="#" class="waves-effect btn z-depth-3">Visit Us!</a></li>
<li><a href="#" class="waves-effect btn z-depth-3">Login</a></li>
<li><a id="menu_drop" data-activates="menu_dropdown" class="waves-effect btn z-depth-3 btn-floating dropdown-button avatar_menu" style='background-image: url("https://cdn.discordapp.com/attachments/213843114123722752/292181315665657857/unknown.png")'></a></li>
</ul>
</div>
</nav>
<div class="container">
<h1 class="center-align">Embed Discord chats like a <br>true Titan</h1>
<p class="flow-text center-align">Add <strong>Titan</strong> to your discord server to create your own personalized chat embed!</p>
<a class="waves-effect waves-light btn btn-large center_content">Start here!</a>
<br /><br />
<div style="display: flex;align-items: center;">
<video preload="true" loop="" style="width:100%; border-radius: 10px;">
<source src="http://mee6.xyz/static/mee6.mp4" type="video/mp4">
<source src="http://mee6.xyz/static/mee6.webm" type="video/webm; codecs=vp8, vorbis">
<source type="video/ogg; codecs=theora, vorbis" src="http://mee6.xyz/static/mee6.ogg">
Your browser does not support the video tag.
</video>
</div>
</div>
</main>
<footer class="page-footer">
<div class="footer-copyright">
<div class="container">
A project by EndenDragon
<a class="grey-text text-lighten-4 right" href="https://github.com/EndenDragon/Titan">GitHub Repo</a>
</div>
</div>
</footer>
<!--Import jQuery before materialize.js-->
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.2.1/jquery.min.js" integrity="sha256-hwg4gsxgFZhOsEEamdOYGBf13FyQuiTwlAQgxVSNgt4=" crossorigin="anonymous"></script>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/materialize/0.98.1/js/materialize.min.js" integrity="sha256-ToPQhpo/E89yaCd7+V8LUCjobNRkjilRXfho6x3twLU=" crossorigin="anonymous"></script>
</body>
</html>

View File

@ -23,15 +23,6 @@ app.register_blueprint(blueprints.api.api, url_prefix="/api", template_folder="/
app.register_blueprint(blueprints.user.user, url_prefix="/user", template_folder="/templates")
app.register_blueprint(blueprints.embed.embed, url_prefix="/embed", template_folder="/templates")
@app.route("/set_username/<guildid>/<channelid>", methods=["GET"])
def get_set_username(guildid, channelid):
return render_template("set_username.html")
@app.route("/set_username/<guildid>/<channelid>", methods=["POST"])
def post_set_username(guildid, channelid):
session['username'] = request.form.get('username')
return redirect(url_for("embed_get", guildid=guildid, channelid=channelid))
@app.route("/")
def index():
return render_template("index.html.j2")

View File

@ -128,3 +128,9 @@ float: left;
.modal {
background-color: #546e7a;
}
.betatag {
font-variant: small-caps;
font-size: 15px;
color: #eceff1;
}

View File

@ -50,3 +50,11 @@ nav {
margin-left: auto;
margin-right: auto;
}
.betatag {
font-variant: small-caps;
font-size: 25px;
border-radius: 50px;
border: 2px solid #37474f;
color: #eceff1;
}

View File

@ -1,78 +0,0 @@
<!DOCTYPE html>
<html>
<head>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script>
<script>
function escapeHTML(unsafe) {
return unsafe
.replace(/&/g, "&amp;")
.replace(/</g, "&lt;")
.replace(/>/g, "&gt;")
.replace(/"/g, "&quot;")
.replace(/'/g, "&#039;");
}
var lastSnowflake = undefined
function updateMessages(channelid, aftersnowflake=null) {
setTimeout(function() {
$.ajax({
url: "/api/Get_Channel_Messages",
data: {
channel_id: channelid,
after: aftersnowflake
},
dataType: "json",
success: function(data, status){
data = data['j']
for (i = data.length-1; i >= 0; i--) {
item = data[i]
$("#messagesview").append("<p>"+item['id'] + " " + item['timestamp'] + " " + item['author']['username'] + " " + escapeHTML(item['content']) + "</p>")
lastSnowflake = item['id']
if($("#messagesview").scrollTop() + $("#messagesview").innerHeight() >= $("#messagesview")[0].scrollHeight - 160) {
$('#messagesview').scrollTop($('#messagesview').prop("scrollHeight"));
}
}
},
complete: function() {
updateMessages("140252024666062848", lastSnowflake)
}
});
}, 5000);
}
updateMessages("140252024666062848")
</script>
</head>
<body>
<div style="height: 95vh; overflow-y: auto;" id="messagesview"></div>
<div style="height: 5vh;">
<input type="text" id="messagebox" style="height:100%; width:100%; font-size:15px;">
</div>
<script>
var channelid = "140252024666062848"
$('#messagebox').bind("enterKey",function(e){
var content = $('#messagebox').val();
$('#messagebox').val('')
$.ajax({
url: "/api/Create_Message",
method: "post",
data: {
channel_id: channelid,
content: content
},
dataType: "json"
})
});
$('#messagebox').keyup(function(e){
if(e.keyCode == 13)
{
var content = $('#messagebox').val();
if (/\S/.test(content)) {
$(this).trigger("enterKey");
}
}
});
</script>
</body>
</html>

View File

@ -18,7 +18,7 @@
<div class="nav-wrapper">
<a href="#" data-activates="guild-nav" class="button-collapse" id="guild-btn"><i class="material-icons">menu</i></a>
<div class="container">
<a href="#" class="brand-logo"><b>Titan</b>Embeds</a>
<a href="{{ url_for("index") }}" target="_blank" class="brand-logo"><b>Titan</b>Embeds <span class="betatag">BETA</span></a>
</div>
<a href="#" data-activates="members-nav" class="button-collapse right" id="members-btn"><i class="material-icons">person</i></a>
</div>
@ -85,7 +85,7 @@
<footer class="footer">
<div class="footercontainer">
<div class="currentuserchip left" id="nameplate">
<div class="left"><img id="currentuserimage" src="https://cdn.discordapp.com/icons/213459805048668160/14aa7c0ad94e3c80d2eeef3a83cae1c1.jpg" class="circle left currentuserimage" style="display: none;"></div>
<div class="left"><img id="currentuserimage" src="" class="circle left currentuserimage" style="display: none;"></div>
<div id="currentusername" class="currentusername left">Titan#0001</div>
</div>
<div id="messageboxouter" class="input-field inline"><textarea placeholder="Enter message" id="messagebox" type="text" class="materialize-textarea" rows="1"></textarea></div>

View File

@ -1,21 +0,0 @@
<!DOCTYPE html>
<html>
<head>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script>
</head>
<body>
<form method="post">
<h1>Set username:<h1>
<input type="text" name="username" id="username" required>
</form>
<script>
$("input").keypress(function(event) {
var content = $('#username').val();
if (event.which == 13 && /\S/.test(content)) {
event.preventDefault();
$("form").submit();
}
});
</script>
<body>
</html>

View File

@ -24,9 +24,9 @@
<nav>
<div class="nav-wrapper container">
<a href="/" class="brand-logo"><b>Titan</b>Embeds</a>
<a href="/" class="brand-logo"><b>Titan</b>Embeds <span class="betatag">BETA</span></a>
<ul id="nav-mobile" class="right">
<li><a href="#" class="waves-effect btn z-depth-3">Visit Us!</a></li> <!-- TODO: Add discord guild invite -->
<li><a href="{{url_for("embed.guild_embed", guild_id="295085744249110529")}}" class="waves-effect btn z-depth-3">Visit Us!</a></li> <!-- TODO: Add discord guild invite -->
{% if session['unauthenticated'] is defined and not session['unauthenticated'] %}
<li><a id="menu_drop" data-activates="menu_dropdown" class="waves-effect btn z-depth-3 btn-floating dropdown-button avatar_menu" style='background-image: url(" {{ session['avatar'] }} ")'></a></li>
{% else %}