diff --git a/app/Http/Controllers/Auth/RegisterController.php b/app/Http/Controllers/Auth/RegisterController.php index b76a724..7c9d0c0 100644 --- a/app/Http/Controllers/Auth/RegisterController.php +++ b/app/Http/Controllers/Auth/RegisterController.php @@ -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); + } } diff --git a/app/Http/Controllers/KeyController.php b/app/Http/Controllers/KeyController.php new file mode 100644 index 0000000..fd24dee --- /dev/null +++ b/app/Http/Controllers/KeyController.php @@ -0,0 +1,56 @@ +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'); + } +} diff --git a/app/Http/Controllers/PageController.php b/app/Http/Controllers/PageController.php index 4901b0d..464d104 100644 --- a/app/Http/Controllers/PageController.php +++ b/app/Http/Controllers/PageController.php @@ -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'); + } } diff --git a/app/Http/Middleware/UserLastActivity.php b/app/Http/Middleware/UserLastActivity.php index 25a81ef..88a0618 100644 --- a/app/Http/Middleware/UserLastActivity.php +++ b/app/Http/Middleware/UserLastActivity.php @@ -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); } diff --git a/app/Models/InviteKey.php b/app/Models/InviteKey.php new file mode 100644 index 0000000..6c12aeb --- /dev/null +++ b/app/Models/InviteKey.php @@ -0,0 +1,23 @@ + + */ + protected $fillable = [ + 'key', + 'created_by', + 'user_invited', + 'active', + ]; +} diff --git a/app/Models/User.php b/app/Models/User.php index 4b42355..bd99ad6 100644 --- a/app/Models/User.php +++ b/app/Models/User.php @@ -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; + } + } } diff --git a/composer.json b/composer.json index 83c4de6..acb389a 100644 --- a/composer.json +++ b/composer.json @@ -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", diff --git a/composer.lock b/composer.lock index 1ca1649..ec7ac36 100644 --- a/composer.lock +++ b/composer.lock @@ -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", diff --git a/database/migrations/2014_10_12_000000_create_users_table.php b/database/migrations/2014_10_12_000000_create_users_table.php index 57c45f1..fd20798 100644 --- a/database/migrations/2014_10_12_000000_create_users_table.php +++ b/database/migrations/2014_10_12_000000_create_users_table.php @@ -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'); }); } diff --git a/database/migrations/2022_06_26_010916_create_badges_table.php b/database/migrations/2022_06_26_010916_create_badges_table.php new file mode 100644 index 0000000..ed1f2d4 --- /dev/null +++ b/database/migrations/2022_06_26_010916_create_badges_table.php @@ -0,0 +1,33 @@ +id(); + $table->string('title'); + $table->string('description'); + $table->string('img'); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::dropIfExists('badges'); + } +} diff --git a/database/migrations/2022_06_27_063019_create_invite_keys_table.php b/database/migrations/2022_06_27_063019_create_invite_keys_table.php new file mode 100644 index 0000000..4d19201 --- /dev/null +++ b/database/migrations/2022_06_27_063019_create_invite_keys_table.php @@ -0,0 +1,35 @@ +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'); + } +} diff --git a/public/css/app.css b/public/css/app.css index f8dacaa..0470edb 100644 --- a/public/css/app.css +++ b/public/css/app.css @@ -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; diff --git a/public/img/badges/1.png b/public/img/badges/1.png new file mode 100644 index 0000000..ec65576 Binary files /dev/null and b/public/img/badges/1.png differ diff --git a/public/img/badges/2.png b/public/img/badges/2.png new file mode 100644 index 0000000..45782ba Binary files /dev/null and b/public/img/badges/2.png differ diff --git a/public/img/badges/3.png b/public/img/badges/3.png new file mode 100644 index 0000000..c33ee4e Binary files /dev/null and b/public/img/badges/3.png differ diff --git a/resources/css/app.css b/resources/css/app.css index 9ca4f76..0470edb 100644 --- a/resources/css/app.css +++ b/resources/css/app.css @@ -1,297 +1,333 @@ @keyframes animatedbackground { - from {background-position-x: 0px; animation-timing-function: linear;} - to {background-position-x: 2000px; animation-timing-function: linear;} - } - #alert { - height: fit-content; - margin: 0px; - position: fixed; - top: 72px; - padding-top: 2px; - padding-bottom: 2px; - padding-right: 5px; - padding-left: 5px; - width: 100%; - text-align: center; - background: linear-gradient(#f07575 10%, #e13b3b 49%, #d22 50%, #de2323 100%); - } - .navbar { - height: 40px; - margin: 0px; - padding-right: 5px; - padding-left: 5px; - padding-top: 2px; - position: fixed; - top: 0px; - padding-bottom: 2px; - color: white; - line-height: normal; - display: inline-flex; - vertical-align: middle; - width: 100%; - background: linear-gradient(#759CF0 10%, #3B72E1 49%, #2260DD 50%, #2362DE 100%); - } - .navbarbuttoncontainer, .smallnavbarbuttoncontainer, .navbarlogincontainer { - padding-left: 5px; - display: table-cell; - vertical-align: middle; - } - #navbarlogincontainer, #navbarsignedincontainer { - position: relative; - padding-right: 10px; - margin-right: 3%; - margin-left: auto; - float: inline-end; - top: 11px; - } - #profilefriendscontainer p, #profilefriendscontainer a { - display: inline; - } - #profiletopcontainer { - margin-bottom: 30px; - display: block; - width: 100%; - } - .onlinestatus_website { - color: #2260DD; - } - .onlinestatus_ingame { - color: green; - } - .onlinestatus_offline { - color: black; - } - #yes, #no { - width: 50%; - } - #FeedBox { - width: 100%; - height: 22px; - } - #FeedButton { - width: 100%; - height: 22px; - } - #logo_signup, #logo-signup p { - margin: auto; - text-align: center; - width: 200px; - } - #feed, #profileleftcontainer { - text-align: center; - padding-left: 5px; - padding-right: 5px; - width: 50%; - } - #gamesframe, #profilerightcontainer { - text-align: center; - padding-left: 5px; - padding-right: 5px; - width: 50%; - } - .FeedContainerBox, .ProfileContainerBox { - border-radius: 1px; - text-align: left; - width: 100%; - vertical-align: top; - display: inline-flex; - border: 1px solid #000000; - border-width: 1px; - } - #btncontainer { - margin-left: 75%; - } - .navbarbutton { - position: relative; - top: 10px; - text-align: center; - font-size: 18px; - } - .smallnavbarbutton { - position: relative; - text-align: center; - font-size: 15px; - } - .smallnav { - height: 25px; - margin: 0px; - padding-left: 5px; - padding-right: 5px; - position: fixed; - top: 43px; - padding-top: 2px; - padding-bottom: 2px; - display: inline-table; - vertical-align: middle; - width: 100%; - line-height: normal; - color: rgb(255, 255, 255); - text-size-adjust: auto; - text-align: left; - background-color: black; - } - .invisible, #invisible { - display: none !important; - } - html { - margin: 0px; - font-family: "Helvetica"; - src: url('Helvetica.ttf') format('truetype'),; - font-style: normal; - background-color: rgb(49, 107, 223); - color: white; - animation-name: animatedbackground; - animation-duration: 50s; - animation-iteration-count: infinite; - background-image: url('../img/animated.png'); - background-position: center 100%; - background-repeat: repeat-x; - background-attachment: fixed; - } - body { - margin-left: 0px; - margin-right: 0px; - margin-top: 0px; - margin-bottom: 35px; - padding-bottom: 0px; - } - .content_special, #content_special { - display: inline-flex; - width: 100%; - flex-wrap: nowrap; - flex-direction: row; - align-content: center; - justify-content: flex-start; - align-items: flex-start; - } - .content { - color: black; - max-width: 1000px; - margin: auto; - margin-top: 105px; - padding-left: 5px; - padding-right: 5px; - min-height: 300px; - background-color: rgba(255, 255, 255, 0.8); - padding-bottom: 5px; - padding-top: 5px; - } - .content_signup { - color: black; - max-width: 500px; - margin: auto; - margin-top: 30px; - padding-left: 5px; - padding-right: 5px; - background-color: rgba(255, 255, 255, 0.8); - padding-bottom: 5px; - padding-top: 5px; - } - .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 { - color: black - } - #footer { - text-align: center; - max-width: 1000px; - margin: auto; - padding-left: 5px; - padding-right: 5px; - padding-bottom: 5px; - padding-top: 5px; - background-color: rgba(172, 172, 172, 0.8); - min-height: fit-content; - } - button { - font-weight: 400; + from {background-position-x: 0px; animation-timing-function: linear;} + to {background-position-x: 2000px; animation-timing-function: linear;} +} +#alert { + height: fit-content; + margin: 0px; + position: fixed; + top: 72px; + padding-top: 2px; + padding-bottom: 2px; + padding-right: 5px; + padding-left: 5px; + width: 100%; text-align: center; - border-radius: 3px; +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; - 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%); - 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%); - cursor: pointer; - } - 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%); - cursor: pointer; - } - 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%); - cursor: pointer; - } - button:disabled.greenbutton { - background: linear-gradient(#75f094 10%, #39d746 49%, #21b71c 50%, #137a32 100%); - opacity: 0.5; - cursor: not-allowed; - } - #footer_signup { - text-align: center; - max-width: 500px; - margin: auto; - padding-left: 5px; - padding-right: 5px; - padding-bottom: 5px; - 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 { - color: black; - } - p,h1,h2,h3,h4,h5,h6 { - margin: 0px; - } - a, #navbarusername { - color: white; - text-decoration: none; - font-weight: bolder; - } - .nonbolded { - font-weight: normal !important; - } - .logoutframe { - color: black; - max-width: fit-content; - margin: auto; - padding-left: 5px; - padding-right: 5px; - background-color: rgba(255, 255, 255, 0.3); - padding-bottom: 5px; - padding-top: 5px; - } \ No newline at end of file +} +.navbar { + height: 40px; + margin: 0px; + padding-right: 5px; + padding-left: 5px; + padding-top: 2px; + position: fixed; + top: 0px; + padding-bottom: 2px; + color: white; + line-height: normal; + display: inline-flex; + vertical-align: middle; + width: 100%; + background: linear-gradient(#759CF0 10%, #3B72E1 49%, #2260DD 50%, #2362DE 100%); +} +.navbarbuttoncontainer, .smallnavbarbuttoncontainer, .navbarlogincontainer { + padding-left: 5px; + display: table-cell; + vertical-align: middle; +} +#navbarlogincontainer, #navbarsignedincontainer { + position: relative; + padding-right: 10px; + margin-right: 3%; + margin-left: auto; + float: inline-end; + top: 11px; +} +#profilefriendscontainer p, #profilefriendscontainer a { + display: inline; +} +#profiletopcontainer { + margin-bottom: 30px; + display: block; + width: 100%; +} +.onlinestatus_website { + color: #2260DD; +} +.onlinestatus_ingame { + color: green; +} +.onlinestatus_offline { + color: black; +} +#yes, #no { + width: 50%; +} +#FeedBox { + width: 100%; + height: 22px; +} +#FeedButton { + width: 100%; + height: 22px; +} +#logo_signup, #logo-signup p { + margin: auto; + text-align: center; + width: 200px; +} +#feed, #profileleftcontainer { + text-align: center; + padding-left: 5px; + padding-right: 5px; + width: 50%; +} +#gamesframe, #profilerightcontainer { + text-align: center; + padding-left: 5px; + padding-right: 5px; + width: 50%; +} +.FeedContainerBox, .ProfileContainerBox { + border-radius: 1px; + text-align: left; + width: 100%; + vertical-align: top; + display: inline-flex; + border: 1px solid #000000; + border-width: 1px; + margin-bottom: 5px; +} +#btncontainer { + margin-left: 75%; +} +.navbarbutton { + position: relative; + top: 10px; + text-align: center; + font-size: 18px; +} +.smallnavbarbutton { + position: relative; + text-align: center; + font-size: 15px; +} +.smallnav { + height: 25px; + margin: 0px; + padding-left: 5px; + padding-right: 5px; + position: fixed; + top: 43px; + padding-top: 2px; + padding-bottom: 2px; + display: inline-table; + vertical-align: middle; + width: 100%; + line-height: normal; + color: rgb(255, 255, 255); + text-size-adjust: auto; + text-align: left; + background-color: black; +} +.invisible, #invisible { + display: none !important; +} +html { + margin: 0px; + font-family: "Helvetica"; + src: url('Helvetica.ttf') format('truetype'),; + font-style: normal; + background-color: rgb(49, 107, 223); + color: white; + animation-name: animatedbackground; + animation-duration: 50s; + animation-iteration-count: infinite; + background-image: url('../img/animated.png'); + background-position: center 100%; + background-repeat: repeat-x; + background-attachment: fixed; +} +body { + margin-left: 0px; + margin-right: 0px; + margin-top: 0px; + margin-bottom: 35px; + padding-bottom: 0px; +} +.content_special, #content_special { + display: inline-flex; + width: 100%; + flex-wrap: nowrap; + flex-direction: row; + align-content: center; + justify-content: flex-start; + align-items: flex-start; +} +.content { + color: black; + max-width: 1000px; + margin: auto; + margin-top: 105px; + padding-left: 5px; + padding-right: 5px; + min-height: 300px; + background-color: rgba(255, 255, 255, 0.8); + padding-bottom: 5px; + padding-top: 5px; +} +.content_signup { + color: black; + max-width: 500px; + margin: auto; + margin-top: 30px; + padding-left: 5px; + padding-right: 5px; + background-color: rgba(255, 255, 255, 0.8); + padding-bottom: 5px; + padding-top: 5px; +} +.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 { + color: black +} +#footer { + text-align: center; + max-width: 1000px; + margin: auto; + padding-left: 5px; + padding-right: 5px; + padding-bottom: 5px; + padding-top: 5px; + background-color: rgba(172, 172, 172, 0.8); + min-height: fit-content; +} +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%); + cursor: pointer; +} +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%); + cursor: pointer; +} +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%); + cursor: pointer; +} +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%); + cursor: pointer; +} +button:disabled.greenbutton { +background: linear-gradient(#75f094 10%, #39d746 49%, #21b71c 50%, #137a32 100%); + opacity: 0.5; + cursor: not-allowed; +} +#footer_signup { + text-align: center; + max-width: 500px; + margin: auto; + padding-left: 5px; + padding-right: 5px; + padding-bottom: 5px; + 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 { + color: black; +} +p,h1,h2,h3,h4,h5,h6 { + margin: 0px; +} +a, #navbarusername { + color: white; + text-decoration: none; + font-weight: bolder; +} +.nonbolded { + font-weight: normal !important; +} +.logoutframe { + color: black; + max-width: fit-content; + margin: auto; + padding-left: 5px; + padding-right: 5px; + 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; +} \ No newline at end of file diff --git a/resources/views/auth/login.blade.php b/resources/views/auth/login.blade.php index d3232cd..ae9a3e2 100644 --- a/resources/views/auth/login.blade.php +++ b/resources/views/auth/login.blade.php @@ -3,18 +3,21 @@ Login - {{ env('APP_NAME') }} - + + - - + + + + + - - - + + diff --git a/resources/views/auth/register.blade.php b/resources/views/auth/register.blade.php index 2b8b09f..acbde00 100644 --- a/resources/views/auth/register.blade.php +++ b/resources/views/auth/register.blade.php @@ -3,18 +3,21 @@ Register - {{ env('APP_NAME') }} - + + - - + + + + + - - - + + diff --git a/resources/views/index.blade.php b/resources/views/index.blade.php index 8e8f294..5bae5c8 100644 --- a/resources/views/index.blade.php +++ b/resources/views/index.blade.php @@ -3,18 +3,21 @@ {{ env('APP_NAME') }} - It's MORBLOX time. - + + - - + + + - + + - - + + diff --git a/resources/views/invite/index.blade.php b/resources/views/invite/index.blade.php new file mode 100644 index 0000000..aaac8dc --- /dev/null +++ b/resources/views/invite/index.blade.php @@ -0,0 +1,43 @@ +@extends('layouts.app') +@section('title') + + Create Invite - {{ env('APP_NAME') }} +@endsection + +@section('content') +

Create a Key

+ @if ($data['canCreate'] || App\Models\User::isAdmin()) +

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 +

+ @else +

You cannot create a new key because 1 week hasn't passed since creating your last key. You can find your + key(s) below.

+ @endif +
+ @if ($data['canCreate'] || App\Models\User::isAdmin()) +
+ @csrf + +
+
+ @endif + @foreach ($data['fetchKeys'] as $fKey) +
+
+

Invite Key - @if (!$fKey->active) + You Invited: {{ App\Models\User::find($fKey->user_invited)->name }} + - + @endif Created {{ $fKey->created_at->format('d/m/Y') }}

+ @if ($fKey->active) +
Status: Active
+ @else +
Status: Inactive
+ @endif +
{{ $fKey->key }}
+
+
+ @endforeach + @endsection diff --git a/resources/views/layouts/app.blade.php b/resources/views/layouts/app.blade.php index 14e7138..72af7b5 100644 --- a/resources/views/layouts/app.blade.php +++ b/resources/views/layouts/app.blade.php @@ -32,7 +32,7 @@ Build Forum Profile - Settings + Settings @guest