initial commit

This commit is contained in:
Luke Ogburn
2019-03-30 23:03:43 -04:00
commit 3d9e0c7717
29 changed files with 740 additions and 0 deletions

64
res/global.css Normal file
View File

@@ -0,0 +1,64 @@
/* Defining vars */
:root {
/* ----------- COLORS ----------- */
/* The two dark colors, lighter one second */
--main-dark-color: #151515;
--main-back-color: #3a3a3a;
/*The orange-ish pink color*/
--main-theme-color: #f66e50;
/* Text color, etc */
--main-light-color: #dfdfdf;
/* ----------- OTHERS ----------- */
--border-radius: 0.2em;
}
body{
font-family: sans-serif;
margin: 0;
background-color: var(--main-dark-color);
color: var(--main-light-color);
}
a{
color: var(--main-theme-color);
}
button{
margin-top: 1em;
background-color: var(--main-theme-color);
color: white;
border: none;
border-radius: var(--border-radius);
padding: 0.5em 1em;
cursor: pointer;
}
button[disabled]{
opacity: 0.6;
cursor: not-allowed;
}
.hoverColor{
color: var(--main-back-color);
text-decoration: none;
}
.hoverColor:hover{
color: var(--main-theme-color);
}
/* Top bar */
#top{
display: grid;
grid-template-columns: 5fr repeat(3, 1fr);
background-color: var(--main-theme-color);
}
.topLink{
text-align: center;
cursor: pointer;
color: white;
text-transform: uppercase;
text-decoration: none;
padding: 0.7em 0;
}

11
res/head.php Normal file
View File

@@ -0,0 +1,11 @@
<meta charset=utf-8>
<title><?=$title?> | 500 Words</title>
<link rel=icon href=\i\favicon.ico type=image/x-icon>
<link rel=stylesheet href=/500/res/global.css type=text/css>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<?php
$css = is_array($css)?$css:array($css);
foreach($css as $file){
echo "<link rel=stylesheet href=".$file.".css type=text/css>\n";
}
?>

28
res/read.php Normal file
View File

@@ -0,0 +1,28 @@
<?php
require "enc.php";
require "conn.php";
conn();
$pid = $_GET["post"];
$usr = 4;
$stmt = $conn->prepare("SELECT * FROM posts WHERE id = :pid AND user_id = :uid");
$stmt->bindParam(":pid", $pid);
$stmt->bindParam(":uid", $usr);
$stmt->execute();
$post = $stmt->fetch(PDO::FETCH_OBJ);
//make sure the post belongs to the current user
$stmt = $conn->prepare("SELECT * FROM dec_info WHERE posts_id = :pid");
$stmt->bindParam(":pid", $pid);
$stmt->execute();
$dec_info = $stmt->fetch(PDO::FETCH_OBJ);
$text = $post->text;
$key = $dec_info->enc_key;
$iv = $dec_info->iv;
$tag = $dec_info->tag;
echo decrypt($text, $key, $iv, $tag);
?>

16
res/skelly.php Normal file
View File

@@ -0,0 +1,16 @@
<?php
require "/home/lukeuxao/public_html/500/global.php";
?>
<!DOCTYPE html>
<html>
<head>
<?php
$title = "";
$css = "";
require $root."/res/head.php";
?>
</head>
<body>
<?php require $root."/res/top.php"; ?>
</body>
</html>

6
res/top.php Normal file
View File

@@ -0,0 +1,6 @@
<div id=top>
<div></div>
<a class=topLink href=/500/write><div>Write</div></a>
<a class=topLink href=/500/read><div>Read</div></a>
<a class=topLink href=/500/user><div>Settings</div></a>
</div>