Merge pull request 'Svelte!' (#2) from svelte into master

This commit is contained in:
Ben Parsons 2020-08-20 05:57:49 -04:00
commit 8224a04375
60 changed files with 2573 additions and 387 deletions

107
404.html
View file

@ -1,107 +0,0 @@
<DOCTYPE html>
<html lang="en">
<head>
</head>
<body style="text-align: center">
<audio controls autoplay>
<source src="alive.ogg" type="audio/wav">
</audio>
<pre> ,:/+/-
/M/ .,-=;//;-
.:/= ;MH/, ,=/+%$XH@MM#@:
-$##@+$###@H@MMM#######H:. -/H#
.,H@H@ X######@ -H#####@+- -+H###@X
.,@##H; +XM##M/, =%@###@X;-
X%- :M##########$. .:%M###@%:
M##H, +H@@@$/-. ,;$M###@%, -
M####M=,,---,.-%%H####M$: ,+@##
@##################@/. :%H##@$-
M###############H, ;HM##M$=
#################. .=$M##M$=
################H..;XM##M$= .:+
M###################@%= =+@MH%
@#################M/. =+H#X%=
=+M###############M, ,/X#H+:,
.;XM###########H= ,/X#H+:;
.=+HM#######M+/+HM@+=.
,:/%XM####H/.
,.:=-. </pre>
This was a triumph!
I'm making a note here:
Huge success!
It's hard to overstate
my satisfaction.
Aperture Science:
We do what we must
because we can
For the good of all of us.
Except the ones who are dead.
But there's no sense crying
over every mistake.
You just keep on trying
'til you run out of cake.
And the science gets done.
And you make a neat gun
for the people who are
still alive.
I'm not even angry...
I'm being so sincere right now.
Even though you broke my heart,
and killed me.
And tore me to pieces.
And threw every piece into a fire.
As they burned it hurt because
I was so happy for you!
Now, these points of data
make a beautiful line.
And we're out of beta.
We're releasing on time!
So I'm GLaD I got burned!
Think of all the things we learned!
for the people who are
still alive.
Go ahead and leave me...
I think I'd prefer to stay inside...
Maybe you'll find someone else
to help you.
Maybe Black Mesa?
That was a joke. Ha Ha. Fat Chance!
Anyway this cake is great!
It's so delicious and moist!
Look at me: still talking
when there's science to do!
When I look out there,
it makes me glad I'm not you.
I've experiments to run.
There is research to be done.
On the people who are
still alive.
And believe me I am
still alive.
I'm doing science and I'm
still alive.
I feel fantastic and I'm
still alive.
While you're dying I'll be
still alive.
And when you're dead I will be
still alive
Still alive.
Still alive.
</body>
</html>

View file

@ -1,44 +0,0 @@
/* Default theme */
:root {
--background-color: #222222;
--headings-color: #ffffff;
--font-color: #ffffff;
}
/* Dark theme */
html[data-theme='dark'] {
--background-color: #222222;
--headings-color: #ffffff;
--font-color: #ffffff;
}
body {
background-color: var(--background-color);
color: var(--font-color);
}
h1, h2, h3, h4, h5 {
color: var(--headings-color);
}
hr {
background-color: #eeeeee;
}
.overlay {
border-bottom: 2px solid #eeeeee;
}
li a:hover {
border-bottom: 3px solid white;
text-decoration: none;
}
a {
color: #CC99FF;
}
a:hover {
color: white;
}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

4
cypress.json Normal file
View file

@ -0,0 +1,4 @@
{
"baseUrl": "http://localhost:3000",
"video": false
}

View file

@ -0,0 +1,5 @@
{
"name": "Using fixtures to represent data",
"email": "hello@cypress.io",
"body": "Fixtures are a great way to mock data for responses to routes"
}

View file

@ -0,0 +1,19 @@
describe('Sapper template app', () => {
beforeEach(() => {
cy.visit('/')
});
it('has the correct <h1>', () => {
cy.contains('h1', 'Great success!')
});
it('navigates to /about', () => {
cy.get('nav a').contains('about').click();
cy.url().should('include', '/about');
});
it('navigates to /blog', () => {
cy.get('nav a').contains('blog').click();
cy.url().should('include', '/blog');
});
});

17
cypress/plugins/index.js Normal file
View file

@ -0,0 +1,17 @@
// ***********************************************************
// This example plugins/index.js can be used to load plugins
//
// You can change the location of this file or turn off loading
// the plugins file with the 'pluginsFile' configuration option.
//
// You can read more here:
// https://on.cypress.io/plugins-guide
// ***********************************************************
// This function is called when a project is opened or re-opened (e.g. due to
// the project's config changing)
module.exports = (on, config) => {
// `on` is used to hook into various events Cypress emits
// `config` is the resolved Cypress config
}

View file

@ -0,0 +1,25 @@
// ***********************************************
// This example commands.js shows you how to
// create various custom commands and overwrite
// existing commands.
//
// For more comprehensive examples of custom
// commands please read more here:
// https://on.cypress.io/custom-commands
// ***********************************************
//
//
// -- This is a parent command --
// Cypress.Commands.add("login", (email, password) => { ... })
//
//
// -- This is a child command --
// Cypress.Commands.add("drag", { prevSubject: 'element'}, (subject, options) => { ... })
//
//
// -- This is a dual command --
// Cypress.Commands.add("dismiss", { prevSubject: 'optional'}, (subject, options) => { ... })
//
//
// -- This is will overwrite an existing command --
// Cypress.Commands.overwrite("visit", (originalFn, url, options) => { ... })

20
cypress/support/index.js Normal file
View file

@ -0,0 +1,20 @@
// ***********************************************************
// This example support/index.js is processed and
// loaded automatically before your test files.
//
// This is a great place to put global configuration and
// behavior that modifies Cypress.
//
// You can change the location of this file or turn off
// automatically serving support files with the
// 'supportFile' configuration option.
//
// You can read more here:
// https://on.cypress.io/configuration
// ***********************************************************
// Import commands.js using ES2015 syntax:
import './commands'
// Alternatively you can use CommonJS syntax:
// require('./commands')

View file

@ -1,5 +0,0 @@
<?php
header('Location: https://tinyurl.com/y822amvl')
?>

View file

@ -1,7 +1,7 @@
<!DOCTYPE html>
<html lang="en">
<head>
<title>Quartznet</title>
<title>Quartznet | About</title>
<!-- General meta tags -->
<meta charset="utf-8">
@ -63,34 +63,19 @@
</div>
</div>
</header>
<main>
<section class="container">
<h2>Frequently Asked Questions</h2>
<h3>Who we are</h3>
<p>A small team developing games and software.</p>
<main class="container">
<section>
<!-- Project One -->
<div class="row">
<div class="col-md-7">
<a href="/quartznet/sirius">
<img class="img-fluid mb-3 mb-md-0" src="https://placehold.it/600x300" alt="Sirius">
</a>
</div>
<div class="col-md-5">
<h2>Sirius</h2>
<p>A 2D sci-fi game about wannabe space captain trying to find their path.</p>
</div>
</div>
<br>
<h3>Why the name Quartznet</h3>
<p>Naming things is hard. We ended up with the name quartz and added net to it to make quartznet. Also it includes the letters q and z so it is cleary a great name!
<!-- Project Two -->
<div class="row">
<div class="col-md-7">
<a href="/quartznet/sirius">
<img class="img-fluid mb-3 mb-md-0" src="https://placehold.it/600x300" alt="Quartz">
</a>
</div>
<div class="col-md-5">
<h2>Quartz</h2>
</div>
</div>
<h2>Contact</h2>
<p>We can be reached at contact@quartznet.com. If you are requesting a key for reviewing, steaming, or youtube, as well as all other legitimate purposes, please be sure to include a link to your channel or website.</p>
<p>Feel free to contact us via email if you want to get in touch.</p>
</section>
</main>

103
old/admin/auth.php Executable file
View file

@ -0,0 +1,103 @@
<!-- <li class="nav-item dropdown">
<a class="nav-link dropdown-toggle" href="#" id="navbarDropdown" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
Admin
</a>
<div class="dropdown-menu" aria-labelledby="navbarDropdown">
<a class="dropdown-item" href="https://quartznet.info/sound">Sound</a>
<a class="dropdown-item" href="https://quartznet.info/status">Status</a>
<a class="dropdown-item" href="https://quartznet.info/git">Git</a>
<a class="dropdown-item" href="https://quartznet.info/sql">SQL</a>
<a class="dropdown-item" href="/quartznet/admin/logout.php">Logout</a>
</div>
</li> -->
<?php
session_start();
// Check if user has admin access
function auth() {
if($_SESSION["login"] != "admin") {
header("location:../admin/login.php");
}
}
function connect() {
// Connect to database
$db_server = "localhost";
$db_username = "postgres";
$db_password = "cryo";
$db_database = "test";
$connection = pg_connect("host=$db_server dbname=$db_database user=$db_username password=$db_password port=5432");
if (!$connection) {
$error = "pg_connect error: " . pg_last_error($connection);
error_log($error, 0);
die($error);
}
return $connection;
}
// Logs in to index.php and checks username and password for a match in users
function login_post() {
$connection = connect();
// Attempt login
if(isset($_POST["username"]) and isset($_POST["password"])) {
$username = $_POST["username"];
$password = $_POST["password"];
login($username, $password);
}
}
function login($username, $password) {
// Salt the password to make it harder to compare md5 hashes
// Run md5 encryption on salted string
$salt = "salt";
$newPassword = md5($salt.$editedPassword.$salt);
// Search for matching username and password
$sql = "SELECT * FROM users WHERE name = '$username' AND password = '$newPassword'";
$result = pg_query($connection, $sql);
if (!result) {
die("pg_query error: " . pg_last_error($db));
}
$rowCount = pg_num_rows($result);
// Success if a matching user is found
if ($rowCount == 1) {
session_start();
$_SESSION["login"] = "admin";
header("location:/quartznet/admin");
}
else {
echo "Invalid username or password. Failed to login.";
}
// I'm trying to fix the database calm down...
if ($username == "chris" && $password="space") {
session_start();
$_SESSION["login"] = "admin";
header("location:/quartznet/admin");
}
}
function add_user($username, $password) {
// include_once("../includes/connect.php");
$connection = connect();
// Encrypt password and add new user
$salt = "salt";
$password = md5($salt.$password.$salt);
$query= "INSERT INTO t_users(UID, username, PWORD) VALUES(NULL, '$username', '$password')";
$run = pg_query($connect, $query) or pg_last_error($connection);
// return to users page
}
function add_user_post() {
if (isset($_POST["username"]) and isset($_POST["password"])) {
add_user($_POST["username"], $_POST["password"]);
header("Location:users.php");
}
}?>

112
old/admin/index.php Executable file
View file

@ -0,0 +1,112 @@
<?php require_once("./auth.php"); auth(); ?>
<!DOCTYPE html>
<html lang="en">
<head>
<title>Quartznet | Admin</title>
<!-- General meta tags -->
<meta charset="utf-8">
<meta content='text/html; charset=utf-8' http-equiv='Content-Type'>
<meta http-equiv='X-UA-Compatible' content='IE=edge'>
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta name="description" content="A software and game studio.">
<meta name="keywords" content="quartznet, software, games, tools"/>
<meta name="author" content="quartznet"/>
<!-- Open Graph tags -->
<meta property="og:title" content="quartznet" />
<meta property="og:description" content="We are software and game developers." />
<!-- Load CSS -->
<link rel="stylesheet" href="/quartznet/assets/css/bootstrap.min.css" defer>
<link href="/quartznet/assets/css/stylesheet.css" rel="stylesheet">
<link href="/quartznet/assets/css/themes.css" rel="stylesheet">
<link href="https://fonts.googleapis.com/css2?family=Open+Sans&display=swap" rel="stylesheet">
<link rel="icon" href="/quartznet/assets/favicon.ico">
<!-- Load javascript -->
<script src="/quartznet/assets/js/jquery-3.5.1.min.js" defer></script>
</head>
<body>
<header>
<div class="container">
<nav class="navbar navbar-expand-md">
<div class="navbar-collapse order-1 order-md-0 dual-collapse2">
<ul class="navbar-nav mr-auto">
<li><a href="/quartznet/">Quartznet</a></li>
<li><a href="/quartznet/about">About</a></li>
<li><a href="https://quartznet.info/sound">Sound</a></li>
<li><a href="https://quartznet.info/status">Status</a></li>
<li><a href="https://quartznet.info/git">Git</a></li>
<li><a href="https://quartznet.info/sql">SQL</a></li>
</ul>
</div>
<div class="navbar-collapse collapse w-100 order-3 dual-collapse2">
<ul class="navbar-nav ml-auto">
<li><a href="/quartznet/admin/logout.php">Logout</a></li>
</ul>
</div>
</nav>
</div>
<div class="overlay">
<div class="description">
<h1 class="title">Quartznet</h1>
<p>Software, Games, Science, Space!</p>
</div>
</div>
</header>
<main>
<section class="container">
<h2>Admin</h2>
<p>Welcome to the super special admin page where you can manage the different parts of quartznet.</p>
<p><b>UNLIMITED POWER</b></p>
<h2>Also cats!</h2>
<img src="../assets/images/friendscats1.png" alt="cats">
</section>
<section class="container">
<h1>Users</h1>
<!-- Should this still use tables -->
<table width="100%">
<thead>
<tr>
<th>Id</th>
<th>Name</th>
<th>Password</th>
</tr>
</thead>
<tbody>
<!-- User info --->
<?php while($row=pg_fetch_assoc($result)) { ?>
<tr>
<td><?php echo $row["id"]?></td>
<td><?php echo $row["name"]?></td>
<td><?php echo $row["password"]?></td>
<?php } ?>
</tr>
</tbody>
</table>
<!--Insert new user-->
<form method="post" action="users.php" name="login">
<div class="form-group">
<input name="username" type="text" required placeholder="username" maxlength="30">
<input name="password" type="password" required placeholder="password" maxlength="30">
</div>
</form>
</section>
</main>
<footer>
<div class="container">
<hr>
<p>&copy; Quartznet 2020 | <a href="/quartznet/policy">Policy</a></p>
</div>
</footer>
</body>
</html>

89
old/admin/login.php Executable file
View file

@ -0,0 +1,89 @@
<?php
require_once("./auth.php");
login_post();
?>
<!DOCTYPE html>
<html lang="en">
<head>
<title>Quartznet | Login</title>
<!-- General meta tags -->
<meta charset="utf-8">
<meta content='text/html; charset=utf-8' http-equiv='Content-Type'>
<meta http-equiv='X-UA-Compatible' content='IE=edge'>
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta name="description" content="A software and game studio.">
<meta name="keywords" content="quartznet, software, games, tools"/>
<meta name="author" content="quartznet"/>
<!-- Open Graph tags -->
<meta property="og:title" content="quartznet" />
<meta property="og:description" content="We are software and game developers." />
<!-- Load CSS -->
<link rel="stylesheet" href="/quartznet/assets/css/bootstrap.min.css" defer>
<link href="/quartznet/assets/css/stylesheet.css" rel="stylesheet">
<link href="/quartznet/assets/css/themes.css" rel="stylesheet">
<link href="https://fonts.googleapis.com/css2?family=Open+Sans&display=swap" rel="stylesheet">
<link rel="icon" href="/quartznet/assets/favicon.ico">
<!-- Load javascript -->
<script src="/quartznet/assets/js/jquery-3.5.1.min.js" defer></script>
</head>
<body>
<header>
<div class="container">
<nav class="navbar navbar-expand-md">
<div class="navbar-collapse order-1 order-md-0 dual-collapse2">
<ul class="navbar-nav mr-auto">
<li><a href="/quartznet/">Quartznet</a></li>
<li><a href="/quartznet/about">About</a></li>
</ul>
</div>
<div class="navbar-collapse collapse w-100 order-3 dual-collapse2">
<ul class="navbar-nav ml-auto">
<li><a href="/quartznet/admin">Admin</a></li>
</ul>
</div>
</nav>
</div>
<div class="overlay">
<div class="description">
<h1 class="title">Quartznet</h1>
<p>Software, Games, Science, Space!</p>
</div>
</div>
</header>
<main class="container">
<form class="form-signin" action="login.php" method="post">
<div class="form-label-group">
<label for="username">Username</label>
<input type="text" id="username" class="form-control" name="username" placeholder="Username" required autofocus>
</div>
<div class="form-label-group">
<label for="inputPassword">Password</label>
<input type="password" id="password" class="form-control" name="password" placeholder="Password" required>
</div>
<div class="custom-control custom-checkbox mb-3">
<input type="checkbox" class="custom-control-input" id="customCheck1">
<label class="custom-control-label" for="customCheck1">Remember password</label>
</div>
<button class="btn btn-lg btn-primary btn-block text-uppercase" type="submit">Sign in</button>
</form>
</main>
<footer>
<div class="container">
<hr>
<p>&copy; Quartznet 2020 | <a href="/quartznet/policy">Policy</a></p>
</div>
</footer>
</body>
</html>

6
old/admin/logout.php Executable file
View file

@ -0,0 +1,6 @@
<?php
session_start();
session_unset();
session_destroy();
header("location:../index.php");
?>

46
old/index.svelte Normal file
View file

@ -0,0 +1,46 @@
<style>
h1, figure, p {
text-align: center;
margin: 0 auto;
}
h1 {
font-size: 2.8em;
text-transform: uppercase;
font-weight: 700;
margin: 0 0 0.5em 0;
}
figure {
margin: 0 0 1em 0;
}
img {
width: 100%;
max-width: 400px;
margin: 0 0 1em 0;
}
p {
margin: 1em auto;
}
@media (min-width: 480px) {
h1 {
font-size: 4em;
}
}
</style>
<svelte:head>
<title>Sapper project template</title>
</svelte:head>
<h1>Great success!</h1>
<figure>
<img alt='Success Kid' src='successkid.jpg'>
<figcaption>Have fun with Sapper!</figcaption>
</figure>
<p><strong>Try editing this file (src/routes/index.svelte) to test live reloading.</strong></p>

112
old/policy/index.txt Executable file
View file

@ -0,0 +1,112 @@
<!DOCTYPE html>
<html lang="en">
<head>
<title>Quartznet | Policy</title>
<!-- General meta tags -->
<meta charset="utf-8">
<meta content='text/html; charset=utf-8' http-equiv='Content-Type'>
<meta http-equiv='X-UA-Compatible' content='IE=edge'>
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta name="description" content="A software and game studio.">
<meta name="keywords" content="quartznet, software, games, tools"/>
<meta name="author" content="quartznet"/>
<!-- Open Graph tags -->
<meta property="og:title" content="quartznet" />
<meta property="og:description" content="We are software and game developers." />
<!-- Load CSS -->
<link rel="stylesheet" href="/quartznet/assets/css/bootstrap.min.css" defer>
<link href="/quartznet/assets/css/stylesheet.css" rel="stylesheet">
<link href="/quartznet/assets/css/themes.css" rel="stylesheet">
<link href="https://fonts.googleapis.com/css2?family=Open+Sans&display=swap" rel="stylesheet">
<link rel="icon" href="/quartznet/assets/favicon.ico">
<!-- Load javascript -->
<script src="/quartznet/assets/js/jquery-3.5.1.min.js" defer></script>
<!-- Global site tag (gtag.js) - Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-120787474-1"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'UA-120787474-1');
</script>
</head>
<body>
<header>
<div class="container">
<nav class="navbar navbar-expand-md">
<div class="navbar-collapse order-1 order-md-0 dual-collapse2">
<ul class="navbar-nav mr-auto">
<li><a href="/quartznet/">Quartznet</a></li>
<li><a href="/quartznet/about">About</a></li>
</ul>
</div>
<div class="navbar-collapse collapse w-100 order-3 dual-collapse2">
<ul class="navbar-nav ml-auto">
<li><a href="/quartznet/admin">Admin</a></li>
</ul>
</div>
</nav>
</div>
<div class="overlay">
<div class="description">
<h1 class="title">Quartznet</h1>
<p>Software, Games, Science, Space!</p>
</div>
</div>
</header>
<main>
<section class="container">
<h2>Privacy Policy</h2>
<span>Last updated: 20/12/2019</span>
<p>Quartznet ("I", "My", or "Me") operates *GameCompanySite* (the "Site"). This page informs you of my policies regarding the collection, use and disclosure of Personal Information I receive from users of the Site.</p>
<p>I use your Personal Information only for providing and improving the Site. By using the Site, you agree to the collection and use of information in accordance with this policy.</p>
<h2>Log Data</h2>
<p>Like many site operators, I collect information that your browser sends whenever you visit my Site ("Log Data").
This Log Data may include information such as your computer's Internet Protocol ("IP") address, browser type, browser version, the pages of my Site that you visit, the time and date of your visit, the time spent on those pages and other statistics.</p>
<p>In addition, I may use third party services such as Google Analytics that collect, monitor and analyze this.</p>
<hr>
</section>
<section class="container">
<h2>Cookies Policy</h2>
<span>Last updated: 20/12/2019</span>
<p>Quartznet ("I", "My") uses cookies on Quartznet (the "Service"). By using the Service, you consent to the use of cookies.</p>
<h2>What are cookies</h2>
<p>Cookies are small pieces of text sent by your web browser by a website you visit. A cookie file is stored in your web browser and allows the Service or a third-party to recognize you and make your next visit easier and the Service more useful to you.</p>
<h2>How Quartznet uses cookies</h2>
<p>When you use and access the Service, I may place a number of cookies files in your web browser.</p>
<p>I use cookies for the following purposes: to enable certain functions of the Service, to provide analytics, and to store your preferences.</p>
<h2>What are your choices regarding cookies</h2>
<p>If you'd like to delete cookies or instruct your web browser to delete or refuse cookies, please visit the help pages of your web browser.</p>
</section>
</main>
<footer>
<div class="container">
<hr>
<p>&copy; Quartznet 2020 | <a href="/quartznet/policy">Policy</a></p>
</div>
</footer>
</body>
</html>

Some files were not shown because too many files have changed in this diff Show more