From 06cc18565ee4b8b1e1d39e9571f91d034f6e0319 Mon Sep 17 00:00:00 2001 From: MitarashiDango Date: Sat, 7 Sep 2019 19:57:44 +0900 Subject: [PATCH] =?UTF-8?q?=E3=83=81=E3=82=A7=E3=83=83=E3=82=AF=E3=82=A4?= =?UTF-8?q?=E3=83=B3=E3=81=AB=E5=AF=BE=E3=81=97=E3=81=A6=E3=82=BB=E3=83=B3?= =?UTF-8?q?=E3=82=B7=E3=83=86=E3=82=A3=E3=83=96=E3=83=95=E3=83=A9=E3=82=B0?= =?UTF-8?q?=E3=82=92=E4=BB=98=E4=B8=8E=E5=8F=AF=E8=83=BD=E3=81=A8=E3=81=99?= =?UTF-8?q?=E3=82=8B=E5=AF=BE=E5=BF=9C=E3=82=92=E5=AE=9F=E6=96=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Ejaculation.php | 2 +- .../Controllers/EjaculationController.php | 9 ++++-- app/Http/Controllers/UserController.php | 2 ++ ...0_add_is_too_sensitive_to_ejaculations.php | 32 +++++++++++++++++++ resources/assets/js/app.js | 6 ++++ .../assets/sass/components/_link-card.scss | 21 ++++++++++++ .../views/components/ejaculation.blade.php | 2 +- .../views/components/link-card.blade.php | 7 +++- resources/views/ejaculation/checkin.blade.php | 6 ++++ resources/views/ejaculation/edit.blade.php | 6 ++++ resources/views/ejaculation/show.blade.php | 2 +- resources/views/user/profile.blade.php | 2 +- 12 files changed, 89 insertions(+), 8 deletions(-) create mode 100644 database/migrations/2019_09_07_164200_add_is_too_sensitive_to_ejaculations.php diff --git a/app/Ejaculation.php b/app/Ejaculation.php index 24f7e46..adeaff5 100644 --- a/app/Ejaculation.php +++ b/app/Ejaculation.php @@ -15,7 +15,7 @@ class Ejaculation extends Model protected $fillable = [ 'user_id', 'ejaculated_date', 'note', 'geo_latitude', 'geo_longitude', 'link', - 'is_private' + 'is_private', 'is_too_sensitive' ]; protected $dates = [ diff --git a/app/Http/Controllers/EjaculationController.php b/app/Http/Controllers/EjaculationController.php index 13ef8c4..cf11294 100644 --- a/app/Http/Controllers/EjaculationController.php +++ b/app/Http/Controllers/EjaculationController.php @@ -21,7 +21,8 @@ class EjaculationController extends Controller 'link' => $request->input('link', ''), 'tags' => $request->input('tags', ''), 'note' => $request->input('note', ''), - 'is_private' => $request->input('is_private', 0) == 1 + 'is_private' => $request->input('is_private', 0) == 1, + 'is_too_sensitive' => $request->input('is_too_sensitive', 0) == 1 ]; return view('ejaculation.checkin')->with('defaults', $defaults); @@ -56,7 +57,8 @@ class EjaculationController extends Controller 'ejaculated_date' => Carbon::createFromFormat('Y/m/d H:i', $inputs['date'] . ' ' . $inputs['time']), 'note' => $inputs['note'] ?? '', 'link' => $inputs['link'] ?? '', - 'is_private' => $request->has('is_private') ?? false + 'is_private' => $request->has('is_private') ?? false, + 'is_too_sensitive' => $request->has('is_too_sensitive') ?? false ]); $tagIds = []; @@ -137,7 +139,8 @@ class EjaculationController extends Controller 'ejaculated_date' => Carbon::createFromFormat('Y/m/d H:i', $inputs['date'] . ' ' . $inputs['time']), 'note' => $inputs['note'] ?? '', 'link' => $inputs['link'] ?? '', - 'is_private' => $request->has('is_private') ?? false + 'is_private' => $request->has('is_private') ?? false, + 'is_too_sensitive' => $request->has('is_too_sensitive') ?? false ])->save(); $tagIds = []; diff --git a/app/Http/Controllers/UserController.php b/app/Http/Controllers/UserController.php index 86e8571..99c4b98 100644 --- a/app/Http/Controllers/UserController.php +++ b/app/Http/Controllers/UserController.php @@ -30,6 +30,7 @@ id, ejaculated_date, note, is_private, +is_too_sensitive, link, to_char(lead(ejaculated_date, 1, NULL) OVER (ORDER BY ejaculated_date DESC), 'YYYY/MM/DD HH24:MI') AS before_date, to_char(ejaculated_date - (lead(ejaculated_date, 1, NULL) OVER (ORDER BY ejaculated_date DESC)), 'FMDDD日 FMHH24時間 FMMI分') AS ejaculated_span @@ -151,6 +152,7 @@ id, ejaculated_date, note, is_private, +is_too_sensitive, link, to_char(lead(ejaculated_date, 1, NULL) OVER (ORDER BY ejaculated_date DESC), 'YYYY/MM/DD HH24:MI') AS before_date, to_char(ejaculated_date - (lead(ejaculated_date, 1, NULL) OVER (ORDER BY ejaculated_date DESC)), 'FMDDD日 FMHH24時間 FMMI分') AS ejaculated_span diff --git a/database/migrations/2019_09_07_164200_add_is_too_sensitive_to_ejaculations.php b/database/migrations/2019_09_07_164200_add_is_too_sensitive_to_ejaculations.php new file mode 100644 index 0000000..d897a39 --- /dev/null +++ b/database/migrations/2019_09_07_164200_add_is_too_sensitive_to_ejaculations.php @@ -0,0 +1,32 @@ +boolean('is_too_sensitive')->default(false); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::table('ejaculations', function (Blueprint $table) { + $table->dropColumn('is_too_sensitive'); + }); + } +} diff --git a/resources/assets/js/app.js b/resources/assets/js/app.js index bf79d54..629d2dc 100644 --- a/resources/assets/js/app.js +++ b/resources/assets/js/app.js @@ -92,4 +92,10 @@ $(() => { }); } }); + + $(document).on('click', '.card-spoiler-overlay', function (event) { + const $this = $(this); + $this.siblings(".card-link").removeClass("card-spoiler"); + $this.remove(); + }); }); \ No newline at end of file diff --git a/resources/assets/sass/components/_link-card.scss b/resources/assets/sass/components/_link-card.scss index a154454..4e5d660 100644 --- a/resources/assets/sass/components/_link-card.scss +++ b/resources/assets/sass/components/_link-card.scss @@ -30,4 +30,25 @@ .card-text { white-space: pre-line; } + + .card-spoiler-overlay { + position: absolute; + z-index: 1000; + display: flex; + align-items: center; + justify-content: center; + width: 100%; + height: 100%; + + .warning-text { + padding: 10px; + background-color: rgba(240, 240, 240, 0.8); + border-radius: 5px; + } + } + + .card-spoiler { + z-index: 1; + filter: blur(15px) grayscale(100%); + } } diff --git a/resources/views/components/ejaculation.blade.php b/resources/views/components/ejaculation.blade.php index cda134b..c0650d9 100644 --- a/resources/views/components/ejaculation.blade.php +++ b/resources/views/components/ejaculation.blade.php @@ -19,7 +19,7 @@ @if (!empty($ejaculation->link))
- @component('components.link-card', ['link' => $ejaculation->link]) + @component('components.link-card', ['link' => $ejaculation->link, 'is_too_sensitive' => $ejaculation->is_too_sensitive]) @endcomponent

{{ $ejaculation->link }} diff --git a/resources/views/components/link-card.blade.php b/resources/views/components/link-card.blade.php index f0d7de3..57eda2d 100644 --- a/resources/views/components/link-card.blade.php +++ b/resources/views/components/link-card.blade.php @@ -1,5 +1,10 @@

diff --git a/resources/views/ejaculation/edit.blade.php b/resources/views/ejaculation/edit.blade.php index 2e5984e..dd9cdd8 100644 --- a/resources/views/ejaculation/edit.blade.php +++ b/resources/views/ejaculation/edit.blade.php @@ -86,6 +86,12 @@ このチェックインを非公開にする
+
+ is_too_sensitive) ? 'checked' : '' }}> + +
diff --git a/resources/views/ejaculation/show.blade.php b/resources/views/ejaculation/show.blade.php index e5dc595..2f24075 100644 --- a/resources/views/ejaculation/show.blade.php +++ b/resources/views/ejaculation/show.blade.php @@ -47,7 +47,7 @@ @if (!empty($ejaculation->link))
- @component('components.link-card', ['link' => $ejaculation->link]) + @component('components.link-card', ['link' => $ejaculation->link, 'is_too_sensitive' => $ejaculation->is_too_sensitive]) @endcomponent

{{ $ejaculation->link }} diff --git a/resources/views/user/profile.blade.php b/resources/views/user/profile.blade.php index 7276548..2c36e3d 100644 --- a/resources/views/user/profile.blade.php +++ b/resources/views/user/profile.blade.php @@ -53,7 +53,7 @@ @if (!empty($ejaculation->link))

- @component('components.link-card', ['link' => $ejaculation->link]) + @component('components.link-card', ['link' => $ejaculation->link, 'is_too_sensitive' => $ejaculation->is_too_sensitive]) @endcomponent

{{ $ejaculation->link }}