Added Picnic CSS

Fixed spelling errors
This commit is contained in:
Furentes
2019-05-22 13:54:26 +02:00
parent 62e4c56658
commit ba97176e37
14 changed files with 129 additions and 444 deletions

View File

@ -1,340 +1,9 @@
/*! normalize.css v8.0.1 | MIT License | github.com/necolas/normalize.css */
/* Document
========================================================================== */
/**
* 1. Correct the line height in all browsers.
* 2. Prevent adjustments of font size after orientation changes in iOS.
*/
html {
line-height: 1.15;
/* 1 */
-webkit-text-size-adjust: 100%;
/* 2 */
}
/* Sections
========================================================================== */
/**
* Remove the margin in all browsers.
*/
body {
margin: 0;
}
/**
* Render the `main` element consistently in IE.
*/
main {
display: block;
}
/**
* Correct the font size and margin on `h1` elements within `section` and
* `article` contexts in Chrome, Firefox, and Safari.
*/
h1 {
font-size: 2em;
margin: 0.67em 0;
}
/* Grouping content
========================================================================== */
/**
* 1. Add the correct box sizing in Firefox.
* 2. Show the overflow in Edge and IE.
*/
hr {
box-sizing: content-box;
/* 1 */
height: 0;
/* 1 */
overflow: visible;
/* 2 */
}
/**
* 1. Correct the inheritance and scaling of font size in all browsers.
* 2. Correct the odd `em` font sizing in all browsers.
*/
pre {
font-family: monospace, monospace;
/* 1 */
font-size: 1em;
/* 2 */
}
/* Text-level semantics
========================================================================== */
/**
* Remove the gray background on active links in IE 10.
*/
a {
background-color: transparent;
}
/**
* 1. Remove the bottom border in Chrome 57-
* 2. Add the correct text decoration in Chrome, Edge, IE, Opera, and Safari.
*/
abbr[title] {
border-bottom: none;
/* 1 */
text-decoration: underline;
/* 2 */
text-decoration: underline dotted;
/* 2 */
}
/**
* Add the correct font weight in Chrome, Edge, and Safari.
*/
b,
strong {
font-weight: bolder;
}
/**
* 1. Correct the inheritance and scaling of font size in all browsers.
* 2. Correct the odd `em` font sizing in all browsers.
*/
code,
kbd,
samp {
font-family: monospace, monospace;
/* 1 */
font-size: 1em;
/* 2 */
}
/**
* Add the correct font size in all browsers.
*/
small {
font-size: 80%;
}
/**
* Prevent `sub` and `sup` elements from affecting the line height in
* all browsers.
*/
sub,
sup {
font-size: 75%;
line-height: 0;
position: relative;
vertical-align: baseline;
}
sub {
bottom: -0.25em;
}
sup {
top: -0.5em;
}
/* Embedded content
========================================================================== */
/**
* Remove the border on images inside links in IE 10.
*/
img {
border-style: none;
}
/* Forms
========================================================================== */
/**
* 1. Change the font styles in all browsers.
* 2. Remove the margin in Firefox and Safari.
*/
button,
input,
optgroup,
select,
textarea {
font-family: inherit;
/* 1 */
font-size: 100%;
/* 1 */
line-height: 1.15;
/* 1 */
margin: 0;
/* 2 */
}
/**
* Show the overflow in IE.
* 1. Show the overflow in Edge.
*/
button,
input {
/* 1 */
overflow: visible;
}
/**
* Remove the inheritance of text transform in Edge, Firefox, and IE.
* 1. Remove the inheritance of text transform in Firefox.
*/
button,
select {
/* 1 */
text-transform: none;
}
/**
* Correct the inability to style clickable types in iOS and Safari.
*/
button,
[type=button],
[type=reset],
[type=submit] {
-webkit-appearance: button;
}
/**
* Remove the inner border and padding in Firefox.
*/
button::-moz-focus-inner,
[type=button]::-moz-focus-inner,
[type=reset]::-moz-focus-inner,
[type=submit]::-moz-focus-inner {
border-style: none;
padding: 0;
}
/**
* Restore the focus styles unset by the previous rule.
*/
button:-moz-focusring,
[type=button]:-moz-focusring,
[type=reset]:-moz-focusring,
[type=submit]:-moz-focusring {
outline: 1px dotted ButtonText;
}
/**
* Correct the padding in Firefox.
*/
fieldset {
padding: 0.35em 0.75em 0.625em;
}
/**
* 1. Correct the text wrapping in Edge and IE.
* 2. Correct the color inheritance from `fieldset` elements in IE.
* 3. Remove the padding so developers are not caught out when they zero out
* `fieldset` elements in all browsers.
*/
legend {
box-sizing: border-box;
/* 1 */
color: inherit;
/* 2 */
display: table;
/* 1 */
max-width: 100%;
/* 1 */
padding: 0;
/* 3 */
white-space: normal;
/* 1 */
}
/**
* Add the correct vertical alignment in Chrome, Firefox, and Opera.
*/
progress {
vertical-align: baseline;
}
/**
* Remove the default vertical scrollbar in IE 10+.
*/
textarea {
overflow: auto;
}
/**
* 1. Add the correct box sizing in IE 10.
* 2. Remove the padding in IE 10.
*/
[type=checkbox],
[type=radio] {
box-sizing: border-box;
/* 1 */
padding: 0;
/* 2 */
}
/**
* Correct the cursor style of increment and decrement buttons in Chrome.
*/
[type=number]::-webkit-inner-spin-button,
[type=number]::-webkit-outer-spin-button {
height: auto;
}
/**
* 1. Correct the odd appearance in Chrome and Safari.
* 2. Correct the outline style in Safari.
*/
[type=search] {
-webkit-appearance: textfield;
/* 1 */
outline-offset: -2px;
/* 2 */
}
/**
* Remove the inner padding in Chrome and Safari on macOS.
*/
[type=search]::-webkit-search-decoration {
-webkit-appearance: none;
}
/**
* 1. Correct the inability to style clickable types in iOS and Safari.
* 2. Change font properties to `inherit` in Safari.
*/
::-webkit-file-upload-button {
-webkit-appearance: button;
/* 1 */
font: inherit;
/* 2 */
}
/* Interactive
========================================================================== */
/*
* Add the correct display in Edge, IE 10+, and Firefox.
*/
details {
display: block;
}
/*
* Add the correct display in all browsers.
*/
summary {
display: list-item;
}
/* Misc
========================================================================== */
/**
* Add the correct display in IE 10+.
*/
template {
display: none;
}
/**
* Add the correct display in IE 10.
*/
[hidden] {
display: none;
section.main {
text-align: left;
width: 90%;
max-width: 960px;
margin: 0 auto;
padding: 80px 0 0;
}
/*# sourceMappingURL=main.css.map */

View File

@ -1 +1 @@
{"version":3,"sourceRoot":"","sources":["../scss/_normalize.scss"],"names":[],"mappings":"AAAA;AAEA;AAAA;AAGA;AAAA;AAAA;AAAA;AAKC;EACC;AAAmB;EACnB;AAAgC;;;AAGlC;AAAA;AAGA;AAAA;AAAA;AAIA;EACE;;;AAGF;AAAA;AAAA;AAIA;EACE;;;AAGF;AAAA;AAAA;AAAA;AAKA;EACE;EACA;;;AAGF;AAAA;AAGA;AAAA;AAAA;AAAA;AAKA;EACE;AAAyB;EACzB;AAAW;EACX;AAAmB;;;AAGrB;AAAA;AAAA;AAAA;AAKA;EACE;AAAmC;EACnC;AAAgB;;;AAGlB;AAAA;AAGA;A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AA;AAAA;AAIA;EACE;;;AAGF;AAAA;AAAA;AAIA;EACE;;;AAGF;AAAA;AAGA;AAAA;AAAA;AAIA;EACE;;;AAGF;AAAA;AAAA;AAIA;EACE","file":"main.css"}
{"version":3,"sourceRoot":"","sources":["../scss/main.scss"],"names":[],"mappings":"AAAA;EACE;EACA;EACA;EACA;EACA","file":"main.css"}

2
css/picnic.min.css vendored Normal file

File diff suppressed because one or more lines are too long

10
inc/head.php Normal file
View File

@ -0,0 +1,10 @@
<?php
echo '
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>'.$title.' - '. ((defined("SITE_TITLE")) ? SITE_TITLE : "A Bloggr Site").'</title>
<link rel="stylesheet" href="/css/picnic.min.css">
<link rel="stylesheet" href="/css/main.css">
</head>';

39
inc/nav.php Normal file
View File

@ -0,0 +1,39 @@
<nav class="demo">
<a href="/" class="brand">
<span><?= ((defined("SITE_TITLE")) ? SITE_TITLE : "A Bloggr Site") ?></span>
</a>
<!-- responsive-->
<input id="bmenub" type="checkbox" class="show">
<label for="bmenub" class="burger pseudo button">&#8801;</label>
<div class="menu">
<?php
if ($auth->hasRole([ \Bloggr\Roles::ADMIN ])){
?>
<a href="/users.php" class="pseudo button">Benutzer</a>
<a href="/post.php?new" class="pseudo button">Neuer Post</a>
<?php
} elseif($auth->hasRole([ \Bloggr\Roles::AUTHOR ])) {
?>
<a href="/settings.php" class="pseudo button">Einstellungen</a>
<a href="/logout.php" class="button">Logout</a>
<?php
}
?>
<?php
if (!$auth->isLoggedIn()){
?>
<a href="/login.php" class="pseudo button">Login</a>
<a href="/register.php" class="button">Registrieren</a>
<?php
} else {
?>
<a href="/settings.php" class="pseudo button">Einstellungen</a>
<a href="/logout.php" class="button">Logout</a>
<?php
}
?>
</div>
</nav>

View File

@ -5,60 +5,24 @@ $posts = $auth->getAllPosts();
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Home - <?= (defined("SITE_TITLE")) ? SITE_TITLE : 'A Bloggr Site' ?></title>
</head>
<?php
$title = "Home";
require_once(__DIR__."/inc/head.php");
?>
<body>
<?php
if ($auth->hasRole([ \Bloggr\Roles::ADMIN ])) {
?>
<p>
<a href="/users.php">Users</a>
</p>
<?php
}
if ($auth->hasRole([ \Bloggr\Roles::ADMIN, \Bloggr\Roles::AUTHOR ])) {
?>
<p>
<a href="/post.php?new">Neuer Beitrag</a>
</p>
<?php
}
if (!$auth->isLoggedIn()) {
?>
<p>
<a href="/login.php">Login</a>
</p>
<p>
<a href="/register.php">Registrieren</a>
</p>
<?php
} else {
?>
<p>
<a href="/settings.php">Einstellungen</a>
</p>
<p>
<a href="/logout.php">Logout</a>
</p>
<?php
}
?>
<div>
<?php require_once(__DIR__."/inc/nav.php"); ?>
<section class="main">
<h2>Posts</h2>
<?php
if ($posts) {
foreach($posts as $post) {
?>
<p>
<h2>Titel: <a href="/post.php?view=<?= $post['id'] ?>"><?= $post['title'] ?></a></h2>
<h2><a href="/post.php?view=<?= $post['id'] ?>"><?= $post['title'] ?></a></h2>
<p>
Text:
<?= substr($post['text'], 0, 512) ?><?= (substr($post['text'], 0, 512) !== $post['text']) ? '... <br><a href="/post.php?view='.$post["id"].'">Weiterlesen...</a>' : '' ?>
</p>
<p>Author: <?= $post['user'] ?></p>
<p><small>von <?= $post['user'] ?> am <?= date('H:i d.m.Y', $post['created_at']) ?></p>
</p>
<?php
}
@ -66,6 +30,6 @@ $posts = $auth->getAllPosts();
echo 'Noch kein Beitrag vorhanden. :(';
}
?>
</div>
</section>
</body>
</html>

View File

@ -25,7 +25,7 @@ if(!($request_uri == "/setup")) {
$pdo = new \PDO('mysql:dbname='.DB_NAME.';host='.DB_HOST.';charset=utf8mb4', DB_USER, DB_PASS);
$auth = new \Bloggr\Auth($pdo);
if ($auth->isLoggedIn()) {
echo 'Eingeloggt als <b>'.$auth->getUsernameById($auth->getId()).'</b>';
}
// if ($auth->isLoggedIn()) {
// echo 'Eingeloggt als <b>'.$auth->getUsernameById($auth->getId()).'</b>';
// }
}

View File

@ -16,15 +16,13 @@ if (isset($_POST['login'])) {
?>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>Login - <?= (defined("SITE_TITLE")) ? SITE_TITLE : 'A Bloggr Site' ?></title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" type="text/css" media="screen" href="/css/main.css">
</head>
<?php
$title = "Login";
require_once(__DIR__."/inc/head.php");
?>
<body>
<div>
<?php require_once(__DIR__."/inc/nav.php"); ?>
<section class="main">
<h2>Login</h2>
<?php
@ -42,8 +40,8 @@ if (isset($_POST['login'])) {
<input type="text" name="user" id="user" value="<?= (isset($_POST['user'])) ? htmlspecialchars($_POST['user']) : ''; ?>">
<label for="password">Password</label>
<input type="password" name="password" id="password"">
<input type="submit" name="login" value="login" class="float-right">
<input type="submit" name="login" value="Login" class="float-right">
</form>
</div>
</section>
</body>
</html>

View File

@ -70,16 +70,14 @@ if ($action == 'edit') {
?>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>Neuer Beitrag - <?= (defined("SITE_TITLE")) ? SITE_TITLE : 'A Bloggr Site' ?></title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" type="text/css" media="screen" href="/css/main.css">
</head>
<?php
$title = "Neuer Beitrag";
require_once(__DIR__."/inc/head.php");
?>
<body>
<div>
<a href="/">Home</a>
<?php require_once(__DIR__."/inc/nav.php"); ?>
<section class="main">
<a href="/">Zurück</a>
<?php
foreach ($errors as $key=>$value):
?>
@ -93,18 +91,21 @@ if ($action == 'edit') {
echo '<span style="color: green;">Post bearbeitet!</span><br>';
}
if ($action == 'view'):
if ($auth->canEditPost($data["id"]) == true) echo '<a href="post.php?edit='.$data["id"].'">Edit Post</a>';
?>
<h2>Titel: <?= $data['title'] ?></h2>
<p>Text: <?= nl2br($data['text']) ?></p>
<p>Author: <?= $data['user'] ?></p>
<h2><?= $data['title'] ?></h2>
<p><?= nl2br($data['text']) ?></p>
<p><small>von <?= $data['user'] ?> am <?= date('H:i d.m.Y', $data['created_at']) ?><br>
<?php
if($data['updated_by']):
?>
<p>Last edit at <?= date('H:i d.m.Y',$data['updated_at']).' from '.$data['updated_by'] ?></p>
Zuletzt bearbeitet: <?= date('H:i d.m.Y',$data['updated_at']).' von '.$data['updated_by'] ?>
</small>
<?php
endif;
echo '</p>';
if ($auth->canEditPost($data["id"]) == true) echo '<a href="post.php?edit='.$data["id"].'">Edit Post</a>';
?>
<?php
if ($auth->isLoggedIn()) {
?>
<p>
@ -115,12 +116,12 @@ if ($action == 'edit') {
</p>
<?php
}
echo '<h3>Kommentare</h3>';
if(is_array($result_comments)) {
foreach($result_comments as $comment) {
?>
<p>
<b><?= $comment['user']; ?></b> - <?= date('H:i d.m.Y',$comment['created_at']) ?><br>
<b><?= $comment['user']; ?></b> am <?= date('H:i d.m.Y',$comment['created_at']) ?><br>
<?= $comment['comment']; ?>
</p>
<?php
@ -155,6 +156,6 @@ if ($action == 'edit') {
<?php
endif;
?>
</div>
</section>
</body>
</html>

View File

@ -21,15 +21,13 @@ if (isset($_POST['register'])) {
?>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>Register - <?= (defined("SITE_TITLE")) ? SITE_TITLE : 'A Bloggr Site' ?></title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" type="text/css" media="screen" href="/css/main.css">
</head>
<?php
$title = "Account erstellen";
require_once(__DIR__."/inc/head.php");
?>
<body>
<div>
<?php require_once(__DIR__."/inc/nav.php"); ?>
<section class="main">
<h2>Register</h2>
<?php
@ -58,6 +56,6 @@ if (isset($_POST['register'])) {
<input type="submit" name="register" value="Registrieren">
</form>
<?php } ?>
</div>
</section>
</body>
</html>

View File

@ -1 +1,7 @@
@import "_normalize.scss";
section.main {
text-align: left;
width: 90%;
max-width: 960px;
margin: 0 auto;
padding: 80px 0 0;
}

View File

@ -26,15 +26,13 @@ if(isset($_POST['update'])) {
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Home - <?= (defined("SITE_TITLE")) ? SITE_TITLE : 'A Bloggr Site' ?></title>
</head>
<?php
$title = "Einstellungen";
require_once(__DIR__."/inc/head.php");
?>
<body>
<div>
<a href="/">Home</a>
<?php require_once(__DIR__."/inc/nav.php"); ?>
<section class="main">
<h2>Change Password</h2>
<?php
foreach ($errors as $key=>$value):
@ -58,6 +56,6 @@ if(isset($_POST['update'])) {
<input type="password" name="rpassword" id="rpassword"><br>
<input type="submit" name="update" value="Update">
</form>
</div>
</section>
</body>
</html>

View File

@ -95,6 +95,8 @@ if (isset($_POST['check'])) {
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Setup - Bloggr</title>
<link rel="stylesheet" href="/css/picnic.min.css">
<link rel="stylesheet" href="/css/main.css">
</head>
<body>
<p>

View File

@ -27,19 +27,17 @@ $users = $auth->getAllUsers();
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Home - <?= (defined("SITE_TITLE")) ? SITE_TITLE : 'A Bloggr Site' ?></title>
</head>
<?php
$title = "Benutzer";
require_once(__DIR__."/inc/head.php");
?>
<body>
<div>
<a href="/">Home</a>
<?php require_once(__DIR__."/inc/nav.php"); ?>
<section class="main">
<?= ($view) ? '<a href="/users.php">Zurück</a>' : '' ?>
<h2>Users</h2>
<?php
if($view) {
echo '<a href="/users.php">Back</a><br>';
$found = false;
foreach ($users as $key => $value) {
if($value['id'] == $view) {
@ -69,6 +67,6 @@ $users = $auth->getAllUsers();
}
}
?>
</div>
</section>
</body>
</html>