diff --git a/app/Http/Controllers/ProfileController.php b/app/Http/Controllers/ProfileController.php index bf0b1c3ecc..abe09e8afa 100755 --- a/app/Http/Controllers/ProfileController.php +++ b/app/Http/Controllers/ProfileController.php @@ -50,6 +50,7 @@ class ProfileController extends Controller $user->skin = $request->input('skin'); $user->phone = $request->input('phone'); $user->enable_sounds = $request->input('enable_sounds', false); + $user->enable_confetti = $request->input('enable_confetti', false); if (! config('app.lock_passwords')) { $user->locale = $request->input('locale', 'en-US'); diff --git a/database/migrations/2024_08_15_111816_add_confetti_to_users.php b/database/migrations/2024_08_15_111816_add_confetti_to_users.php new file mode 100644 index 0000000000..a3aa85d4f4 --- /dev/null +++ b/database/migrations/2024_08_15_111816_add_confetti_to_users.php @@ -0,0 +1,28 @@ +boolean('enable_confetti')->default(false); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::table('users', function (Blueprint $table) { + $table->dropColumn('enable_confetti'); + }); + } +}; diff --git a/package-lock.json b/package-lock.json index afe7b5f7ce..d71c3f9fdd 100644 --- a/package-lock.json +++ b/package-lock.json @@ -16,6 +16,7 @@ "bootstrap-datepicker": "^1.10.0", "bootstrap-less": "^3.3.8", "bootstrap-table": "1.23.0", + "canvas-confetti": "^1.9.3", "chart.js": "^2.9.4", "clipboard": "^2.0.11", "css-loader": "^5.0.0", @@ -4098,6 +4099,15 @@ ], "license": "CC-BY-4.0" }, + "node_modules/canvas-confetti": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/canvas-confetti/-/canvas-confetti-1.9.3.tgz", + "integrity": "sha512-rFfTURMvmVEX1gyXFgn5QMn81bYk70qa0HLzcIOSVEyl57n6o9ItHeBtUSWdvKAPY0xlvBHno4/v3QPrT83q9g==", + "funding": { + "type": "donate", + "url": "https://www.paypal.me/kirilvatev" + } + }, "node_modules/canvg": { "version": "3.0.10", "license": "MIT", diff --git a/package.json b/package.json index 95ccf94f84..468c6c2891 100644 --- a/package.json +++ b/package.json @@ -36,6 +36,7 @@ "bootstrap-datepicker": "^1.10.0", "bootstrap-less": "^3.3.8", "bootstrap-table": "1.23.0", + "canvas-confetti": "^1.9.3", "chart.js": "^2.9.4", "clipboard": "^2.0.11", "css-loader": "^5.0.0", diff --git a/public/js/build/app.js b/public/js/build/app.js index 66bbc638c6..c5c6a5cd6b 100644 Binary files a/public/js/build/app.js and b/public/js/build/app.js differ diff --git a/public/js/dist/all.js b/public/js/dist/all.js index 4869d7ca33..f82e4d678c 100644 Binary files a/public/js/dist/all.js and b/public/js/dist/all.js differ diff --git a/public/mix-manifest.json b/public/mix-manifest.json index 934c1d82b6..568d8a0bb5 100644 --- a/public/mix-manifest.json +++ b/public/mix-manifest.json @@ -1,5 +1,5 @@ { - "/js/build/app.js": "/js/build/app.js?id=da3f7fee4a180ba924f6a3920c94eb71", + "/js/build/app.js": "/js/build/app.js?id=5030f4cb69d0d0b87b7fe6ba1b9eece9", "/css/dist/skins/skin-black-dark.css": "/css/dist/skins/skin-black-dark.css?id=f0b08873a06bb54daeee176a9459f4a9", "/css/dist/skins/_all-skins.css": "/css/dist/skins/_all-skins.css?id=f4397c717b99fce41a633ca6edd5d1f4", "/css/build/overrides.css": "/css/build/overrides.css?id=a759aa24710e294392877c5139fda40e", @@ -111,5 +111,5 @@ "/css/dist/bootstrap-table.css": "/css/dist/bootstrap-table.css?id=8abbb6aea625ec64cd7ebdad77ebf6e5", "/js/build/vendor.js": "/js/build/vendor.js?id=c1c24b883f48dc3d16b817aed0b457cc", "/js/dist/bootstrap-table.js": "/js/dist/bootstrap-table.js?id=859e11e4e6b05c84e4b7302de29bac5e", - "/js/dist/all.js": "/js/dist/all.js?id=ea6fb4f01f01c2194310403dafc1658f" + "/js/dist/all.js": "/js/dist/all.js?id=05654cea82a7a1b78cb20e449d004268" } diff --git a/resources/lang/en-US/account/general.php b/resources/lang/en-US/account/general.php index 967a9de570..7f9e2f848e 100644 --- a/resources/lang/en-US/account/general.php +++ b/resources/lang/en-US/account/general.php @@ -13,4 +13,5 @@ return array( 'profile_updated' => 'Account successfully updated', 'no_tokens' => 'You have not created any personal access tokens.', 'enable_sounds' => 'Enable sound effects', + 'enable_confetti' => 'Enable confetti effects', ); diff --git a/resources/views/account/profile.blade.php b/resources/views/account/profile.blade.php index 4f2c7aa55f..a1d9e2b080 100755 --- a/resources/views/account/profile.blade.php +++ b/resources/views/account/profile.blade.php @@ -89,15 +89,24 @@ -
+
-
+
+
+ +
+
+
+@include ('partials.confetti-js') @endif @@ -44,6 +45,7 @@ {!! $message !!} + @include ('partials.confetti-js') @endif diff --git a/resources/views/partials/confetti-js.blade.php b/resources/views/partials/confetti-js.blade.php new file mode 100644 index 0000000000..733d96d1b4 --- /dev/null +++ b/resources/views/partials/confetti-js.blade.php @@ -0,0 +1,25 @@ +@if (auth()->user() && auth()->user()->enable_confetti=='1') + +@endif \ No newline at end of file diff --git a/webpack.mix.js b/webpack.mix.js index fee66acfb2..f4e0e69d5d 100644 --- a/webpack.mix.js +++ b/webpack.mix.js @@ -65,6 +65,7 @@ mix [ "./resources/assets/js/snipeit.js", //this is the actual Snipe-IT JS - require()s bootstrap.js "./resources/assets/js/snipeit_modals.js", + "./node_modules/canvas-confetti/dist/confetti.browser.js", ], "./public/js/build/app.js" //because of compiling - this does not work very well :( )