invite keys + profile badges

yep
This commit is contained in:
Conkley 2022-06-28 11:48:03 +10:00
parent c4758d42f8
commit 93480ca25b
26 changed files with 828 additions and 384 deletions

View File

@ -5,9 +5,11 @@ namespace App\Http\Controllers\Auth;
use App\Http\Controllers\Controller;
use App\Providers\RouteServiceProvider;
use App\Models\User;
use App\Models\InviteKey;
use Illuminate\Foundation\Auth\RegistersUsers;
use Illuminate\Support\Facades\Hash;
use Illuminate\Support\Facades\Validator;
use Illuminate\Validation\ValidationException;
class RegisterController extends Controller
{
@ -54,7 +56,6 @@ class RegisterController extends Controller
'email' => ['required', 'string', 'email', 'max:255', 'unique:users', 'confirmed', 'email:rfc,dns'],
'dob' => ['required', 'date_format:Y-m-d', 'before:today', 'after:01/01/1970'],
'password' => ['required', 'string', 'min:8', 'regex:/^(?=.*?[A-Z])(?=.*?[a-z])(?=.*?[0-9])(?=.*?[#?!@$%^&*-]).{6,}$/'],
'key' => ['required', 'string', 'in:verysecretkeylmao'],
]);
}
@ -66,11 +67,51 @@ class RegisterController extends Controller
*/
protected function create(array $data)
{
$this->verifyKey($data['key']);
$invited_by = $this->getInviter($data['key']);
$this->updateKeyTable($data['key']);
return User::create([
'name' => $data['name'],
'email' => $data['email'],
'dob' => $data['dob'],
'password' => Hash::make($data['password']),
'badges' => [3],
'invited_by' => $invited_by,
]);
}
protected function verifyKey($key)
{
$fetchKey = InviteKey::where('key', $key)->orderBy('id', 'desc')->first();
if (empty($fetchKey) || !$fetchKey->active) {
throw ValidationException::withMessages(['key' => 'Incorrect invite key']);
} else {
return true;
}
}
protected function getInviter($key)
{
$fetchKey = InviteKey::where('key', $key)->orderBy('id', 'desc')->first();
return $fetchKey->created_by;
}
protected function updateKeyTable($key) : void
{
if (!User::exists()) {
$newId = 0;
} else {
$newId = User::orderBy('id', 'desc')->first()->id;
}
$updateDetails = [
'user_invited' => ++$newId,
'active' => false,
];
InviteKey::where('key', $key)->orderBy('id', 'desc')->first()->update($updateDetails);
}
}

View File

@ -0,0 +1,56 @@
<?php
namespace App\Http\Controllers;
use Carbon\Carbon;
use Illuminate\Support\Facades\Auth;
use Illuminate\Http\Request;
use Webpatser\Uuid\Uuid;
use App\Models\InviteKey;
use App\Models\User;
class KeyController extends Controller
{
public function index()
{
$fetchKeys = InviteKey::where('created_by', Auth::id())->orderBy('id', 'desc')->get();
$activeKey = InviteKey::where('created_by', Auth::id())->orderBy('id', 'desc')->first();
if (!$fetchKeys->isEmpty()) {
if ($activeKey->created_at->addWeek()->gt(Carbon::now())) {
$canCreate = false;
} else {
$canCreate = true;
}
} else {
$canCreate = true;
}
$data = [
'canCreate' => $canCreate,
'fetchKeys' => $fetchKeys,
];
return view('invite.index')->with('data', $data);
}
public function create()
{
$fetchKeys = InviteKey::where('created_by', Auth::id())->orderBy('id', 'desc')->get();
$activeKey = InviteKey::where('created_by', Auth::id())->orderBy('id', 'desc')->first();
// Validation
if (!$fetchKeys->isEmpty() && $activeKey->created_at->addWeek()->gt(Carbon::now())) {
if (!User::isAdmin())
abort(404);
}
$key = new InviteKey;
$key->key = Uuid::generate()->string;
$key->created_by = Auth::id();
$key->user_invited = 0;
$key->save();
return redirect()->route('key_index');
}
}

View File

@ -27,12 +27,18 @@ class PageController extends Controller
public function profile($id)
{
$user = User::find($id);
$badges = DB::table('badges')->get();
if (!$user) {
abort(404);
}
return view('pages.profile')->with('user', $user);
$data = [
'user' => $user,
'badges' => $badges
];
return view('pages.profile')->with('data', $data);
}
public function users(Request $request)
@ -45,4 +51,9 @@ class PageController extends Controller
return view('pages.users')->with('users', $users);
}
public function settings()
{
return view('misc.settings');
}
}

View File

@ -4,6 +4,7 @@ namespace App\Http\Middleware;
use Closure;
use Carbon\Carbon;
use App\Models\User;
use Illuminate\Support\Facades\Auth;
use Illuminate\Support\Facades\Cache;
use Illuminate\Http\Request;
@ -23,8 +24,7 @@ class UserLastActivity
$expireTime = Carbon::now()->addMinute(2); // keep online for 2 min
Cache::put('is_online_' . Auth::user()->id, true, $expireTime);
/*Last Seen
User::where('id', Auth::user()->id)->update(['last_seen' => Carbon::now()]);*/
User::where('id', Auth::user()->id)->update(['last_seen' => Carbon::now()]);
}
return $next($request);
}

23
app/Models/InviteKey.php Normal file
View File

@ -0,0 +1,23 @@
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
class InviteKey extends Model
{
use HasFactory;
/**
* The attributes that are mass assignable.
*
* @var array<int, string>
*/
protected $fillable = [
'key',
'created_by',
'user_invited',
'active',
];
}

View File

@ -2,6 +2,7 @@
namespace App\Models;
use Illuminate\Support\Facades\Auth;
use Illuminate\Contracts\Auth\MustVerifyEmail;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Foundation\Auth\User as Authenticatable;
@ -22,6 +23,8 @@ class User extends Authenticatable
'email',
'dob',
'password',
'badges',
'invited_by',
];
/**
@ -41,5 +44,15 @@ class User extends Authenticatable
*/
protected $casts = [
'email_verified_at' => 'datetime',
'badges' => 'array'
];
public static function isAdmin()
{
if (Auth::guest() || !Auth::user()->admin) {
return false;
} else {
return true;
}
}
}

View File

@ -11,7 +11,8 @@
"laravel/framework": "^8.75",
"laravel/sanctum": "^2.11",
"laravel/tinker": "^2.5",
"laravel/ui": "^3.4"
"laravel/ui": "^3.4",
"webpatser/laravel-uuid": "^4.0"
},
"require-dev": {
"facade/ignition": "^2.5",

140
composer.lock generated
View File

@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
"content-hash": "cf14086919a839fe740e00554e4baff6",
"content-hash": "25ae453eae609a277c5bbd141f21342f",
"packages": [
{
"name": "asm89/stack-cors",
@ -959,16 +959,16 @@
},
{
"name": "laravel/framework",
"version": "v8.83.16",
"version": "v8.83.17",
"source": {
"type": "git",
"url": "https://github.com/laravel/framework.git",
"reference": "6be5abd144faf517879af7298e9d79f06f250f75"
"reference": "2cf142cd5100b02da248acad3988bdaba5635e16"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/laravel/framework/zipball/6be5abd144faf517879af7298e9d79f06f250f75",
"reference": "6be5abd144faf517879af7298e9d79f06f250f75",
"url": "https://api.github.com/repos/laravel/framework/zipball/2cf142cd5100b02da248acad3988bdaba5635e16",
"reference": "2cf142cd5100b02da248acad3988bdaba5635e16",
"shasum": ""
},
"require": {
@ -1128,7 +1128,7 @@
"issues": "https://github.com/laravel/framework/issues",
"source": "https://github.com/laravel/framework"
},
"time": "2022-06-07T15:09:06+00:00"
"time": "2022-06-21T14:38:31+00:00"
},
{
"name": "laravel/sanctum",
@ -2995,16 +2995,16 @@
},
{
"name": "symfony/console",
"version": "v5.4.9",
"version": "v5.4.10",
"source": {
"type": "git",
"url": "https://github.com/symfony/console.git",
"reference": "829d5d1bf60b2efeb0887b7436873becc71a45eb"
"reference": "4d671ab4ddac94ee439ea73649c69d9d200b5000"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/console/zipball/829d5d1bf60b2efeb0887b7436873becc71a45eb",
"reference": "829d5d1bf60b2efeb0887b7436873becc71a45eb",
"url": "https://api.github.com/repos/symfony/console/zipball/4d671ab4ddac94ee439ea73649c69d9d200b5000",
"reference": "4d671ab4ddac94ee439ea73649c69d9d200b5000",
"shasum": ""
},
"require": {
@ -3074,7 +3074,7 @@
"terminal"
],
"support": {
"source": "https://github.com/symfony/console/tree/v5.4.9"
"source": "https://github.com/symfony/console/tree/v5.4.10"
},
"funding": [
{
@ -3090,7 +3090,7 @@
"type": "tidelift"
}
],
"time": "2022-05-18T06:17:34+00:00"
"time": "2022-06-26T13:00:04+00:00"
},
{
"name": "symfony/css-selector",
@ -3525,16 +3525,16 @@
},
{
"name": "symfony/http-foundation",
"version": "v5.4.9",
"version": "v5.4.10",
"source": {
"type": "git",
"url": "https://github.com/symfony/http-foundation.git",
"reference": "6b0d0e4aca38d57605dcd11e2416994b38774522"
"reference": "e7793b7906f72a8cc51054fbca9dcff7a8af1c1e"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/http-foundation/zipball/6b0d0e4aca38d57605dcd11e2416994b38774522",
"reference": "6b0d0e4aca38d57605dcd11e2416994b38774522",
"url": "https://api.github.com/repos/symfony/http-foundation/zipball/e7793b7906f72a8cc51054fbca9dcff7a8af1c1e",
"reference": "e7793b7906f72a8cc51054fbca9dcff7a8af1c1e",
"shasum": ""
},
"require": {
@ -3578,7 +3578,7 @@
"description": "Defines an object-oriented layer for the HTTP specification",
"homepage": "https://symfony.com",
"support": {
"source": "https://github.com/symfony/http-foundation/tree/v5.4.9"
"source": "https://github.com/symfony/http-foundation/tree/v5.4.10"
},
"funding": [
{
@ -3594,20 +3594,20 @@
"type": "tidelift"
}
],
"time": "2022-05-17T15:07:29+00:00"
"time": "2022-06-19T13:13:40+00:00"
},
{
"name": "symfony/http-kernel",
"version": "v5.4.9",
"version": "v5.4.10",
"source": {
"type": "git",
"url": "https://github.com/symfony/http-kernel.git",
"reference": "34b121ad3dc761f35fe1346d2f15618f8cbf77f8"
"reference": "255ae3b0a488d78fbb34da23d3e0c059874b5948"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/http-kernel/zipball/34b121ad3dc761f35fe1346d2f15618f8cbf77f8",
"reference": "34b121ad3dc761f35fe1346d2f15618f8cbf77f8",
"url": "https://api.github.com/repos/symfony/http-kernel/zipball/255ae3b0a488d78fbb34da23d3e0c059874b5948",
"reference": "255ae3b0a488d78fbb34da23d3e0c059874b5948",
"shasum": ""
},
"require": {
@ -3690,7 +3690,7 @@
"description": "Provides a structured process for converting a Request into a Response",
"homepage": "https://symfony.com",
"support": {
"source": "https://github.com/symfony/http-kernel/tree/v5.4.9"
"source": "https://github.com/symfony/http-kernel/tree/v5.4.10"
},
"funding": [
{
@ -3706,20 +3706,20 @@
"type": "tidelift"
}
],
"time": "2022-05-27T07:09:08+00:00"
"time": "2022-06-26T16:57:59+00:00"
},
{
"name": "symfony/mime",
"version": "v5.4.9",
"version": "v5.4.10",
"source": {
"type": "git",
"url": "https://github.com/symfony/mime.git",
"reference": "2b3802a24e48d0cfccf885173d2aac91e73df92e"
"reference": "02265e1e5111c3cd7480387af25e82378b7ab9cc"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/mime/zipball/2b3802a24e48d0cfccf885173d2aac91e73df92e",
"reference": "2b3802a24e48d0cfccf885173d2aac91e73df92e",
"url": "https://api.github.com/repos/symfony/mime/zipball/02265e1e5111c3cd7480387af25e82378b7ab9cc",
"reference": "02265e1e5111c3cd7480387af25e82378b7ab9cc",
"shasum": ""
},
"require": {
@ -3773,7 +3773,7 @@
"mime-type"
],
"support": {
"source": "https://github.com/symfony/mime/tree/v5.4.9"
"source": "https://github.com/symfony/mime/tree/v5.4.10"
},
"funding": [
{
@ -3789,7 +3789,7 @@
"type": "tidelift"
}
],
"time": "2022-05-21T10:24:18+00:00"
"time": "2022-06-09T12:22:40+00:00"
},
{
"name": "symfony/polyfill-ctype",
@ -4845,16 +4845,16 @@
},
{
"name": "symfony/string",
"version": "v5.4.9",
"version": "v5.4.10",
"source": {
"type": "git",
"url": "https://github.com/symfony/string.git",
"reference": "985e6a9703ef5ce32ba617c9c7d97873bb7b2a99"
"reference": "4432bc7df82a554b3e413a8570ce2fea90e94097"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/string/zipball/985e6a9703ef5ce32ba617c9c7d97873bb7b2a99",
"reference": "985e6a9703ef5ce32ba617c9c7d97873bb7b2a99",
"url": "https://api.github.com/repos/symfony/string/zipball/4432bc7df82a554b3e413a8570ce2fea90e94097",
"reference": "4432bc7df82a554b3e413a8570ce2fea90e94097",
"shasum": ""
},
"require": {
@ -4911,7 +4911,7 @@
"utf8"
],
"support": {
"source": "https://github.com/symfony/string/tree/v5.4.9"
"source": "https://github.com/symfony/string/tree/v5.4.10"
},
"funding": [
{
@ -4927,7 +4927,7 @@
"type": "tidelift"
}
],
"time": "2022-04-19T10:40:37+00:00"
"time": "2022-06-26T15:57:47+00:00"
},
{
"name": "symfony/translation",
@ -5457,6 +5457,64 @@
"source": "https://github.com/webmozarts/assert/tree/1.11.0"
},
"time": "2022-06-03T18:03:27+00:00"
},
{
"name": "webpatser/laravel-uuid",
"version": "4.0.1",
"source": {
"type": "git",
"url": "https://github.com/webpatser/laravel-uuid.git",
"reference": "df92ebbc5ea71ee9e0d6e2861178be42ef7eb330"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/webpatser/laravel-uuid/zipball/df92ebbc5ea71ee9e0d6e2861178be42ef7eb330",
"reference": "df92ebbc5ea71ee9e0d6e2861178be42ef7eb330",
"shasum": ""
},
"require": {
"php": "^7.0|^8.0"
},
"require-dev": {
"fakerphp/faker": "^1.9.1",
"phpunit/phpunit": "^9.3.3"
},
"type": "library",
"extra": {
"laravel": {
"providers": [
"Webpatser\\Uuid\\UuidServiceProvider"
],
"aliases": {
"Uuid": "Webpatser\\Uuid\\Uuid"
}
}
},
"autoload": {
"psr-4": {
"Webpatser\\Uuid\\": "src/Webpatser/Uuid/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Christoph Kempen",
"email": "christoph@downsized.nl"
}
],
"description": "Laravel package to generate and to validate a universally unique identifier (UUID) according to the RFC 4122 standard. Support for version 1, 3, 4 and 5 UUIDs are built-in.",
"homepage": "https://github.com/webpatser/laravel-uuid",
"keywords": [
"UUID RFC4122"
],
"support": {
"issues": "https://github.com/webpatser/laravel-uuid/issues",
"source": "https://github.com/webpatser/laravel-uuid"
},
"time": "2021-03-09T07:19:24+00:00"
}
],
"packages-dev": [
@ -5917,16 +5975,16 @@
},
{
"name": "laravel/sail",
"version": "v1.14.10",
"version": "v1.14.11",
"source": {
"type": "git",
"url": "https://github.com/laravel/sail.git",
"reference": "0ea5d683af4d189071efcdb9e83946c10dab82c3"
"reference": "6edf45a247b3688e0d07e149570a62fd9bc11c73"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/laravel/sail/zipball/0ea5d683af4d189071efcdb9e83946c10dab82c3",
"reference": "0ea5d683af4d189071efcdb9e83946c10dab82c3",
"url": "https://api.github.com/repos/laravel/sail/zipball/6edf45a247b3688e0d07e149570a62fd9bc11c73",
"reference": "6edf45a247b3688e0d07e149570a62fd9bc11c73",
"shasum": ""
},
"require": {
@ -5973,7 +6031,7 @@
"issues": "https://github.com/laravel/sail/issues",
"source": "https://github.com/laravel/sail"
},
"time": "2022-06-09T07:10:28+00:00"
"time": "2022-06-13T18:32:48+00:00"
},
{
"name": "mockery/mockery",

View File

@ -3,6 +3,7 @@
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
use Carbon\Carbon;
class CreateUsersTable extends Migration
{
@ -25,6 +26,9 @@ class CreateUsersTable extends Migration
$table->string('blurb')->default('Hello!');
$table->rememberToken();
$table->timestamps();
$table->string('last_seen')->default(Carbon::now());
$table->json('badges');
$table->integer('invited_by');
});
}

View File

@ -0,0 +1,33 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateBadgesTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('badges', function (Blueprint $table) {
$table->id();
$table->string('title');
$table->string('description');
$table->string('img');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('badges');
}
}

View File

@ -0,0 +1,35 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateInviteKeysTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('invite_keys', function (Blueprint $table) {
$table->id();
$table->string('key', 36)->unique();
$table->integer('created_by');
$table->integer('user_invited');
$table->boolean('active')->default(true);
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('invite_keys');
}
}

View File

@ -15,6 +15,33 @@
text-align: center;
background: linear-gradient(#f07575 10%, #e13b3b 49%, #d22 50%, #de2323 100%);
}
.warningtext {
color: red;
}
.popupcontainer {
top: 0%;
position: fixed;
background-color: rgba(0,0,0,0.5);
width: 100%;
height: 100%;
z-index: 100000000;
}
.popup {
color:#000000;
text-align: center;
position: fixed;
top: 50%;
left: 50%;
padding-top: 5px;
padding-bottom: 5px;
padding-left: 5px;
padding-right: 5px;
transform: translate(-50%, -50%);
width: max-content;
border-radius: 3px;
border: 1px solid #3D414A;
background: linear-gradient(#cacbcc 10%, #99999a 49%, #747474 50%, #2d2d2d 100%);
}
.navbar {
height: 40px;
margin: 0px;

BIN
public/img/badges/1.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 37 KiB

BIN
public/img/badges/2.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 65 KiB

BIN
public/img/badges/3.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 60 KiB

View File

@ -1,8 +1,8 @@
@keyframes animatedbackground {
from {background-position-x: 0px; animation-timing-function: linear;}
to {background-position-x: 2000px; animation-timing-function: linear;}
}
#alert {
}
#alert {
height: fit-content;
margin: 0px;
position: fixed;
@ -13,9 +13,36 @@
padding-left: 5px;
width: 100%;
text-align: center;
background: linear-gradient(#f07575 10%, #e13b3b 49%, #d22 50%, #de2323 100%);
}
.navbar {
background: linear-gradient(#f07575 10%, #e13b3b 49%, #d22 50%, #de2323 100%);
}
.warningtext {
color: red;
}
.popupcontainer {
top: 0%;
position: fixed;
background-color: rgba(0,0,0,0.5);
width: 100%;
height: 100%;
z-index: 100000000;
}
.popup {
color:#000000;
text-align: center;
position: fixed;
top: 50%;
left: 50%;
padding-top: 5px;
padding-bottom: 5px;
padding-left: 5px;
padding-right: 5px;
transform: translate(-50%, -50%);
width: max-content;
border-radius: 3px;
border: 1px solid #3D414A;
background: linear-gradient(#cacbcc 10%, #99999a 49%, #747474 50%, #2d2d2d 100%);
}
.navbar {
height: 40px;
margin: 0px;
padding-right: 5px;
@ -30,66 +57,66 @@
vertical-align: middle;
width: 100%;
background: linear-gradient(#759CF0 10%, #3B72E1 49%, #2260DD 50%, #2362DE 100%);
}
.navbarbuttoncontainer, .smallnavbarbuttoncontainer, .navbarlogincontainer {
}
.navbarbuttoncontainer, .smallnavbarbuttoncontainer, .navbarlogincontainer {
padding-left: 5px;
display: table-cell;
vertical-align: middle;
}
#navbarlogincontainer, #navbarsignedincontainer {
}
#navbarlogincontainer, #navbarsignedincontainer {
position: relative;
padding-right: 10px;
margin-right: 3%;
margin-left: auto;
float: inline-end;
top: 11px;
}
#profilefriendscontainer p, #profilefriendscontainer a {
}
#profilefriendscontainer p, #profilefriendscontainer a {
display: inline;
}
#profiletopcontainer {
}
#profiletopcontainer {
margin-bottom: 30px;
display: block;
width: 100%;
}
.onlinestatus_website {
}
.onlinestatus_website {
color: #2260DD;
}
.onlinestatus_ingame {
}
.onlinestatus_ingame {
color: green;
}
.onlinestatus_offline {
}
.onlinestatus_offline {
color: black;
}
#yes, #no {
}
#yes, #no {
width: 50%;
}
#FeedBox {
}
#FeedBox {
width: 100%;
height: 22px;
}
#FeedButton {
}
#FeedButton {
width: 100%;
height: 22px;
}
#logo_signup, #logo-signup p {
}
#logo_signup, #logo-signup p {
margin: auto;
text-align: center;
width: 200px;
}
#feed, #profileleftcontainer {
}
#feed, #profileleftcontainer {
text-align: center;
padding-left: 5px;
padding-right: 5px;
width: 50%;
}
#gamesframe, #profilerightcontainer {
}
#gamesframe, #profilerightcontainer {
text-align: center;
padding-left: 5px;
padding-right: 5px;
width: 50%;
}
.FeedContainerBox, .ProfileContainerBox {
}
.FeedContainerBox, .ProfileContainerBox {
border-radius: 1px;
text-align: left;
width: 100%;
@ -97,22 +124,23 @@
display: inline-flex;
border: 1px solid #000000;
border-width: 1px;
}
#btncontainer {
margin-bottom: 5px;
}
#btncontainer {
margin-left: 75%;
}
.navbarbutton {
}
.navbarbutton {
position: relative;
top: 10px;
text-align: center;
font-size: 18px;
}
.smallnavbarbutton {
}
.smallnavbarbutton {
position: relative;
text-align: center;
font-size: 15px;
}
.smallnav {
}
.smallnav {
height: 25px;
margin: 0px;
padding-left: 5px;
@ -129,11 +157,11 @@
text-size-adjust: auto;
text-align: left;
background-color: black;
}
.invisible, #invisible {
}
.invisible, #invisible {
display: none !important;
}
html {
}
html {
margin: 0px;
font-family: "Helvetica";
src: url('Helvetica.ttf') format('truetype'),;
@ -147,15 +175,15 @@
background-position: center 100%;
background-repeat: repeat-x;
background-attachment: fixed;
}
body {
}
body {
margin-left: 0px;
margin-right: 0px;
margin-top: 0px;
margin-bottom: 35px;
padding-bottom: 0px;
}
.content_special, #content_special {
}
.content_special, #content_special {
display: inline-flex;
width: 100%;
flex-wrap: nowrap;
@ -163,8 +191,8 @@
align-content: center;
justify-content: flex-start;
align-items: flex-start;
}
.content {
}
.content {
color: black;
max-width: 1000px;
margin: auto;
@ -175,8 +203,8 @@
background-color: rgba(255, 255, 255, 0.8);
padding-bottom: 5px;
padding-top: 5px;
}
.content_signup {
}
.content_signup {
color: black;
max-width: 500px;
margin: auto;
@ -186,14 +214,14 @@
background-color: rgba(255, 255, 255, 0.8);
padding-bottom: 5px;
padding-top: 5px;
}
.content_signup input, .content_signup button {
}
.content_signup input, .content_signup button {
width: 90%;
}
.content p a, .content a, .content_signup p a, .content_signup a, .content_special p a, .content_special a {
}
.content p a, .content a, .content_signup p a, .content_signup a, .content_special p a, .content_special a {
color: black
}
#footer {
}
#footer {
text-align: center;
max-width: 1000px;
margin: auto;
@ -203,64 +231,64 @@
padding-top: 5px;
background-color: rgba(172, 172, 172, 0.8);
min-height: fit-content;
}
button {
font-weight: 400;
text-align: center;
}
button {
font-weight: 400;
text-align: center;
border-radius: 3px;
border: 1px solid #3D414A;
font-family: "Helvetica";
color: #fff;
}
button.bluebutton {
background: linear-gradient(#759CF0 10%, #3B72E1 49%, #2260DD 50%, #2362DE 100%);
}
button:hover.bluebutton {
background: linear-gradient(#7ca1ef 10%, #4a7de4 49%, #396fdb 50%, #3168d6 100%);
border: 1px solid #3D414A;
font-family: "Helvetica";
color: #fff;
}
button.bluebutton {
background: linear-gradient(#759CF0 10%, #3B72E1 49%, #2260DD 50%, #2362DE 100%);
}
button:hover.bluebutton {
background: linear-gradient(#7ca1ef 10%, #4a7de4 49%, #396fdb 50%, #3168d6 100%);
cursor: pointer;
}
button:disabled.bluebutton {
background: linear-gradient(#759CF0 10%, #3B72E1 49%, #2260DD 50%, #2362DE 100%);
}
button:disabled.bluebutton {
background: linear-gradient(#759CF0 10%, #3B72E1 49%, #2260DD 50%, #2362DE 100%);
opacity: 0.5;
cursor: not-allowed;
}
button.greybutton {
background: linear-gradient(#cacbcc 10%, #99999a 49%, #747474 50%, #2d2d2d 100%);
}
button:hover.greybutton {
background: linear-gradient(#d1d8e6 10%, #b3b8c2 49%, #868a91 50%, #393b3e 100%);
}
button.greybutton {
background: linear-gradient(#cacbcc 10%, #99999a 49%, #747474 50%, #2d2d2d 100%);
}
button:hover.greybutton {
background: linear-gradient(#d1d8e6 10%, #b3b8c2 49%, #868a91 50%, #393b3e 100%);
cursor: pointer;
}
button:disabled.greybutton {
background: linear-gradient(#cacbcc 10%, #99999a 49%, #747474 50%, #2d2d2d 100%);
}
button:disabled.greybutton {
background: linear-gradient(#cacbcc 10%, #99999a 49%, #747474 50%, #2d2d2d 100%);
opacity: 0.5;
cursor: not-allowed;
}
button.redbutton {
background: linear-gradient(#e65a5a 10%, #e13535 49%, #d92c2c 50%, #df1818 100%);
}
button:hover.redbutton {
background: linear-gradient(#e56c6c 10%, #dd4e4e 49%, #d14343 50%, #da2e2e 100%);
}
button.redbutton {
background: linear-gradient(#e65a5a 10%, #e13535 49%, #d92c2c 50%, #df1818 100%);
}
button:hover.redbutton {
background: linear-gradient(#e56c6c 10%, #dd4e4e 49%, #d14343 50%, #da2e2e 100%);
cursor: pointer;
}
button:disabled.redbutton {
background: linear-gradient(#e65a5a 10%, #e13535 49%, #d92c2c 50%, #df1818 100%);
}
button:disabled.redbutton {
background: linear-gradient(#e65a5a 10%, #e13535 49%, #d92c2c 50%, #df1818 100%);
opacity: 0.5;
cursor: not-allowed;
}
button.greenbutton {
background: linear-gradient(#5acf77 10%, #3abc44 49%, #359c32 50%, #1a5c2e 100%);
}
button:hover.greenbutton {
background: linear-gradient(#75f094 10%, #39d746 49%, #21b71c 50%, #137a32 100%);
}
button.greenbutton {
background: linear-gradient(#5acf77 10%, #3abc44 49%, #359c32 50%, #1a5c2e 100%);
}
button:hover.greenbutton {
background: linear-gradient(#75f094 10%, #39d746 49%, #21b71c 50%, #137a32 100%);
cursor: pointer;
}
button:disabled.greenbutton {
background: linear-gradient(#75f094 10%, #39d746 49%, #21b71c 50%, #137a32 100%);
}
button:disabled.greenbutton {
background: linear-gradient(#75f094 10%, #39d746 49%, #21b71c 50%, #137a32 100%);
opacity: 0.5;
cursor: not-allowed;
}
#footer_signup {
}
#footer_signup {
text-align: center;
max-width: 500px;
margin: auto;
@ -270,22 +298,22 @@
padding-top: 5px;
background-color: rgba(172, 172, 172, 0.8);
min-height: fit-content;
}
#footer p, #footer a, #footer_signup p, #footer_signup a {
}
#footer p, #footer a, #footer_signup p, #footer_signup a {
color: black;
}
p,h1,h2,h3,h4,h5,h6 {
}
p,h1,h2,h3,h4,h5,h6 {
margin: 0px;
}
a, #navbarusername {
}
a, #navbarusername {
color: white;
text-decoration: none;
font-weight: bolder;
}
.nonbolded {
}
.nonbolded {
font-weight: normal !important;
}
.logoutframe {
}
.logoutframe {
color: black;
max-width: fit-content;
margin: auto;
@ -294,4 +322,12 @@
background-color: rgba(255, 255, 255, 0.3);
padding-bottom: 5px;
padding-top: 5px;
}
}
.w-5 {
display: none;
}
.flex {
display: table;
margin-right: auto;
margin-left: auto;
}

View File

@ -3,18 +3,21 @@
<head>
<title>Login - {{ env('APP_NAME') }}</title>
<meta content="morblox.us - Log In" property="og:title" />
<meta charset="utf-8">
<meta content="Login - Morblox" property="og:title" />
<meta content="MORBLOX is a work in progress revival." property="og:description" />
<meta content="https://thomasluigi07.github.io/MORBLOX-WEBSITE/" property="og:url" />
<meta content="https://thomasluigi07.github.io/MORBLOX-WEBSITE/MORBLOXlogo.png" property="og:image" />
<meta content="https://morblox.us" property="og:url" />
<meta content="https://morblox.us/img/MORBLOXlogo.png" property="og:image" />
<meta content="#4b4b4b" data-react-helmet="true" name="theme-color" />
<meta name="csrf-token" content="{{ csrf_token() }}">
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="apple-mobile-web-app-status-bar-style" content="black" />
<link rel="apple-touch-icon" href="{{ asset('img/MORBLOX.png') }}" />
<link rel="apple-touch-startup-image" href="{{ asset('img/MORBLOXsplash.png') }}" />
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="apple-touch-icon" href="MORBLOX.png" />
<link rel="apple-touch-startup-image" href="MORBLOXSplash.png" />
<link rel="icon" type="image/x-icon" href="{{ asset('favicon.ico') }}">
<link rel="stylesheet" href="{{ asset('css/app.css') }}">
<link href="{{ asset('css/app.css') }}" rel="stylesheet">
<script src="{{ asset('js/main.js') }}"></script>
</head>
<body>

View File

@ -3,18 +3,21 @@
<head>
<title>Register - {{ env('APP_NAME') }}</title>
<meta content="morblox.us - Sign Up" property="og:title" />
<meta charset="utf-8">
<meta content="Register - Morblox" property="og:title" />
<meta content="MORBLOX is a work in progress revival." property="og:description" />
<meta content="https://thomasluigi07.github.io/MORBLOX-WEBSITE/" property="og:url" />
<meta content="https://thomasluigi07.github.io/MORBLOX-WEBSITE/MORBLOXlogo.png" property="og:image" />
<meta content="https://morblox.us" property="og:url" />
<meta content="https://morblox.us/img/MORBLOXlogo.png" property="og:image" />
<meta content="#4b4b4b" data-react-helmet="true" name="theme-color" />
<meta name="csrf-token" content="{{ csrf_token() }}">
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="apple-mobile-web-app-status-bar-style" content="black" />
<link rel="apple-touch-icon" href="{{ asset('img/MORBLOX.png') }}" />
<link rel="apple-touch-startup-image" href="{{ asset('img/MORBLOXsplash.png') }}" />
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="apple-touch-icon" href="MORBLOX.png" />
<link rel="apple-touch-startup-image" href="MORBLOXSplash.png" />
<link rel="icon" type="image/x-icon" href="{{ asset('favicon.ico') }}">
<link rel="stylesheet" href="{{ asset('css/app.css') }}">
<link href="{{ asset('css/app.css') }}" rel="stylesheet">
<script src="{{ asset('js/main.js') }}"></script>
</head>
<body>

View File

@ -3,18 +3,21 @@
<head>
<title>{{ env('APP_NAME') }} - It's MORBLOX time.</title>
<meta content="It's MORBLOX time." property="og:title" />
<meta charset="utf-8">
<meta content="Morblox" property="og:title" />
<meta content="MORBLOX is a work in progress revival." property="og:description" />
<meta content="https://thomasluigi07.github.io/MORBLOX-WEBSITE/" property="og:url" />
<meta content="https://thomasluigi07.github.io/MORBLOX-WEBSITE/MORBLOXlogo.png" property="og:image" />
<meta content="https://morblox.us" property="og:url" />
<meta content="https://morblox.us/img/MORBLOXlogo.png" property="og:image" />
<meta content="#4b4b4b" data-react-helmet="true" name="theme-color" />
<meta name="csrf-token" content="{{ csrf_token() }}">
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="apple-mobile-web-app-status-bar-style" content="black" />
<link rel="apple-touch-icon" href="MORBLOX.png" />
<link rel="apple-touch-icon" href="{{ asset('img/MORBLOX.png') }}" />
<link rel="apple-touch-startup-image" href="{{ asset('img/MORBLOXsplash.png') }}" />
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="apple-touch-startup-image" href="MORBLOXSplash.png" />
<link rel="icon" type="image/x-icon" href="{{ asset('favicon.ico') }}">
<link rel="stylesheet" href="{{ asset('css/app.css') }}">
<link href="{{ asset('css/app.css') }}" rel="stylesheet">
<script src="{{ asset('js/main.js') }}"></script>
</head>
<body>

View File

@ -0,0 +1,43 @@
@extends('layouts.app')
@section('title')
<title>
Create Invite - {{ env('APP_NAME') }}</title>
@endsection
@section('content')
<h1 id="usernameframe">Create a Key</h1>
@if ($data['canCreate'] || App\Models\User::isAdmin())
<p>You may create @if ($data['fetchKeys']->isEmpty()) your first key below!
@else
@if (App\Models\User::isAdmin()) as many keys as you wish because you're an admin. @else a new key because it's been 1 week since creating your last key. @endif @endif
</p>
@else
<p>You cannot create a new key because 1 week hasn't passed since creating your last key. You can find your
key(s) below.</p>
@endif
<br>
@if ($data['canCreate'] || App\Models\User::isAdmin())
<form method="POST" action="{{ route('key_create') }}">
@csrf
<button class="bluebutton" type="submit">Create Invite Key</button>
</form>
<br>
@endif
@foreach ($data['fetchKeys'] as $fKey)
<div class="FeedContainerBox" id="FeedContainerBox1">
<div id="ProfileContainerBox1TextContainer">
<h3>Invite Key - @if (!$fKey->active)
You Invited: <a href="{{ route('profile', App\Models\User::find($fKey->user_invited)->id) }}"
style="font-weight:normal;color:blue">{{ App\Models\User::find($fKey->user_invited)->name }}</a>
-
@endif Created {{ $fKey->created_at->format('d/m/Y') }}</h3>
@if ($fKey->active)
<h5 style="color:green">Status: Active</h5>
@else
<h5 style="color:red">Status: Inactive</h5>
@endif
<address>{{ $fKey->key }}</address>
</div>
</div>
@endforeach
@endsection

View File

@ -32,7 +32,7 @@
<a class="navbarbutton" id="smallbtn0" href="build.html">Build</a>
<a class="navbarbutton" id="smallbtn1" href="forum.html">Forum</a>
<a class="navbarbutton" id="smallbtn2" href="@guest {{ route('login') }} @else {{ route('profile', Auth::id()) }} @endguest">Profile</a>
<a class="navbarbutton" id="smallbtn3" href="forum.html">Settings</a>
<a class="navbarbutton" id="smallbtn3" href="{{ route('settings') }}">Settings</a>
</div>
@guest
<div id="navbarlogincontainer">

View File

@ -2,18 +2,20 @@
<html lang="en-us">
<head>
<title>Privacy Policy - {{ env('APP_NAME') }}</title>
<meta content="morblox.us - Privacy Policy" property="og:title"/>
<meta content="MORBLOX is a work in progress revival." property="og:description"/>
<meta content="https://thomasluigi07.github.io/MORBLOX-WEBSITE/" property="og:url"/>
<meta content="https://thomasluigi07.github.io/MORBLOX-WEBSITE/MORBLOXlogo.png" property="og:image"/>
<meta content="#4b4b4b" data-react-helmet="true" name="theme-color"/>
<meta charset="utf-8">
<meta content="Morblox" property="og:title" />
<meta content="MORBLOX is a work in progress revival." property="og:description" />
<meta content="https://morblox.us" property="og:url" />
<meta content="https://morblox.us/img/MORBLOXlogo.png" property="og:image" />
<meta content="#4b4b4b" data-react-helmet="true" name="theme-color" />
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="apple-mobile-web-app-status-bar-style" content="black" />
<link rel="apple-touch-icon" href="{{ asset('img/MORBLOX.png') }}" />
<link rel="apple-touch-startup-image" href="{{ asset('img/MORBLOXsplash.png') }}" />
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="apple-mobile-web-app-capable" content="yes"/>
<meta name="apple-mobile-web-app-status-bar-style" content="black"/>
<link rel="apple-touch-icon" href="MORBLOX.png"/>
<link rel="apple-touch-startup-image" href="MORBLOXSplash.png"/>
<link rel="icon" type="image/x-icon" href="{{ asset('favicon.ico') }}">
<link rel="stylesheet" href="{{ asset('css/app.css') }}">
<link href="{{ asset('css/app.css') }}" rel="stylesheet">
<script src="{{ asset('js/main.js') }}"></script>
</head>
<body>
<ul></ul>

View File

@ -0,0 +1,36 @@
@extends('layouts.app')
@section('title')
<title>Settings - {{ env('APP_NAME') }}</title>
@endsection
@section('content')
<h1>Settings</h1>
<div class="content_special" style="align-content: flex-end; align-items: flex-start;">
<div class="content_special" style="flex-wrap: wrap; flex-direction: column; width: 50%;">
<h3>Bio</h3>
<textarea style="resize: none; width: 100%; height: 75px;" placeholder="Hello!"></textarea>
<button class="bluebutton">Save</button>
<br>
</div>
<div class="content_special" style="flex-wrap: wrap; flex-direction: column; width: 50%; text-align: end;">
<p>Username: OnlyTwentyCharacters <button class="bluebutton">Edit</button></p>
<p>E-Mail: t****@ex********.com <button class="bluebutton">Edit</button></p>
<p>Date of Birth: 01/01/01 <button class="bluebutton">Edit</button></p>
<p>Password: ******** <button class="bluebutton">Edit</button></p>
<p>Date Display Preference: D/M/YY <button class="bluebutton">Edit</button></p>
<p>Time Display Preference: 12 Hour <button class="bluebutton">Edit</button></p>
</div>
</div>
<div>
<h3>Invite Keys</h3>
<p>You can only create 1 invite every week. <br>Manage your keys and key history below.</p>
<p><button class="bluebutton"><a href="{{ route('key_index') }}" style="font-weight:normal;color:#fff">Create Invite Key</a></button></p>
</div>
<br>
<div style="flex-wrap: wrap; flex-direction: column;">
<h3>DANGER ZONE - These are inactive for now</h3>
<p>These buttons can fully delete data. Use with caution!</p>
<p><button class="redbutton" disabled>Delete Account</button> <button class="redbutton" disabled>Delete All Places</button> <button
class="redbutton" disabled>Delete All Avatar Items</button></p>
</div>
@endsection

View File

@ -2,18 +2,20 @@
<html lang="en-us">
<head>
<title>Terms of Service - {{ env('APP_NAME') }}</title>
<meta content="morblox.us - Terms of Service" property="og:title"/>
<meta content="MORBLOX is a work in progress revival." property="og:description"/>
<meta content="https://thomasluigi07.github.io/MORBLOX-WEBSITE/" property="og:url"/>
<meta content="https://thomasluigi07.github.io/MORBLOX-WEBSITE/MORBLOXlogo.png" property="og:image"/>
<meta content="#4b4b4b" data-react-helmet="true" name="theme-color"/>
<meta name="apple-mobile-web-app-capable" content="yes"/>
<meta name="apple-mobile-web-app-status-bar-style" content="black"/>
<link rel="apple-touch-icon" href="MORBLOX.png"/>
<link rel="apple-touch-startup-image" href="MORBLOXSplash.png"/>
<meta charset="utf-8">
<meta content="Morblox" property="og:title" />
<meta content="MORBLOX is a work in progress revival." property="og:description" />
<meta content="https://morblox.us" property="og:url" />
<meta content="https://morblox.us/img/MORBLOXlogo.png" property="og:image" />
<meta content="#4b4b4b" data-react-helmet="true" name="theme-color" />
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="apple-mobile-web-app-status-bar-style" content="black" />
<link rel="apple-touch-icon" href="{{ asset('img/MORBLOX.png') }}" />
<link rel="apple-touch-startup-image" href="{{ asset('img/MORBLOXsplash.png') }}" />
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="icon" type="image/x-icon" href="{{ asset('favicon.ico') }}">
<link rel="stylesheet" href="{{ asset('css/app.css') }}">
<link href="{{ asset('css/app.css') }}" rel="stylesheet">
<script src="{{ asset('js/main.js') }}"></script>
</head>
<body>
<ul></ul>

View File

@ -1,12 +1,12 @@
@extends('layouts.app')
@section('title')
<title>{{ $user->name }} - {{ env('APP_NAME') }}</title>
<title>{{ $data['user']->name }} - {{ env('APP_NAME') }}</title>
@endsection
@section('content')
<div id="profiletopcontainer">
<h1 id="usernameframe">{{ $user->name }}</h1>
@if (Cache::has('is_online_' . $user->id))
<h1 id="usernameframe">{{ $data['user']->name }}</h1>
@if (Cache::has('is_online_' . $data['user']->id))
<p id="onlinestatus" class="onlinestatus_website">Website</p>
@else
<p id="onlinestatus" class="onlinestatus_offline">Offline</p>
@ -16,16 +16,27 @@
<div id="profileleftcontainer">
<p id="status">"I'm new to MORBLOX!"</p>
<img alt="profile image" src="{{ asset('img/reviewpending.png') }}" width="75%">
<p id="bio">{{ $user->blurb }}</p>
<p id="bio">{{ $data['user']->blurb }}</p>
<ul></ul>
<div id="stats">
<h3>Joined: {{ $user->created_at->format('d/m/Y') }}</h3>
<h3>Joined: {{ $data['user']->created_at->format('d/m/Y') }}</h3>
<p>(day/month/year)</p>
<h3>Place Visits: 0</h3>
</div>
<ul></ul>
<h2>MORBLOX Badges</h2>
<p>This user has not collected any MORBLOX badges yet!</p>
<div style="white-space:nowrap">
@foreach ($data['badges'] as $badge)
@foreach ($data['user']->badges as $user_badge)
@if ($badge->id == $user_badge)
<div style="width:120px;display:inline-block">
<img src="/img/badges/{{ $badge->id }}.png" width="75px" height="75px" />
<h3>{{ $badge->title }}</h3>
</div>
@endif
@endforeach
@endforeach
</div>
<ul></ul>
<h2>Game Badges</h2>
<p>This user has not collected any game badges yet!</p>

View File

@ -29,4 +29,7 @@ Route::middleware(['auth'])->group(function () {
Route::get('/home', [App\Http\Controllers\HomeController::class, 'home'])->name('home');
Route::get('/users', [App\Http\Controllers\PageController::class, 'users'])->name('users');
Route::post('/users', [App\Http\Controllers\PageController::class, 'users'])->name('users');
Route::get('/my/settings', [App\Http\Controllers\PageController::class, 'settings'])->name('settings');
Route::get('/my/invites', [App\Http\Controllers\KeyController::class, 'index'])->name('key_index');
Route::post('/my/invites', [App\Http\Controllers\KeyController::class, 'create'])->name('key_create');
});