diff --git a/resources/assets/js/checkin.js b/resources/assets/js/checkin.js
new file mode 100644
index 0000000..5682915
--- /dev/null
+++ b/resources/assets/js/checkin.js
@@ -0,0 +1,51 @@
+function updateTags() {
+ $('input[name=tags]').val(
+ $('#tags')
+ .find('li')
+ .map(function () {
+ return $(this).data('value');
+ })
+ .get()
+ .join(' ')
+ );
+}
+
+function insertTag(value) {
+ $('#tags').append('
' + value + ' | x');
+}
+
+var initTags = $('input[name=tags]').val();
+if (initTags.trim() !== '') {
+ initTags.split(' ').forEach(function (value) {
+ insertTag(value);
+ });
+}
+
+$('#tagInput').on('keydown', function (ev) {
+ var $this = $(this);
+ if ($this.val().trim() !== '') {
+ switch (ev.key) {
+ case 'Tab':
+ case 'Enter':
+ case ' ':
+ insertTag($this.val().trim());
+ $this.val('');
+ updateTags();
+ ev.preventDefault();
+ break;
+ }
+ } else if (ev.key === 'Enter') {
+ // 誤爆防止
+ ev.preventDefault();
+ }
+});
+
+$('#tags')
+ .on('click', 'li', function (ev) {
+ $(this).remove();
+ updateTags();
+ })
+ .parent()
+ .on('click', function (ev) {
+ $('#tagInput').focus();
+ });
\ No newline at end of file
diff --git a/resources/views/ejaculation/checkin.blade.php b/resources/views/ejaculation/checkin.blade.php
index 1639110..669b9cf 100644
--- a/resources/views/ejaculation/checkin.blade.php
+++ b/resources/views/ejaculation/checkin.blade.php
@@ -99,54 +99,5 @@
@endsection
@push('script')
-
+
@endpush
\ No newline at end of file
diff --git a/resources/views/ejaculation/edit.blade.php b/resources/views/ejaculation/edit.blade.php
index ee1c387..8bae248 100644
--- a/resources/views/ejaculation/edit.blade.php
+++ b/resources/views/ejaculation/edit.blade.php
@@ -100,54 +100,5 @@
@endsection
@push('script')
-
+
@endpush
\ No newline at end of file
diff --git a/webpack.mix.js b/webpack.mix.js
index 0b600f5..c8f632c 100644
--- a/webpack.mix.js
+++ b/webpack.mix.js
@@ -13,6 +13,7 @@ let mix = require('laravel-mix');
mix.js('resources/assets/js/app.js', 'public/js')
.js('resources/assets/js/home.js', 'public/js')
+ .js('resources/assets/js/checkin.js', 'public/js')
.js('resources/assets/js/user/stats.js', 'public/js/user')
.js('resources/assets/js/setting/privacy.js', 'public/js/setting')
.sass('resources/assets/sass/app.scss', 'public/css')