From 423f51c8ba2c4dbc9e039ee17c57a2bb6c302ffc Mon Sep 17 00:00:00 2001 From: syui Date: Sat, 23 Mar 2024 15:37:41 +0900 Subject: [PATCH] update --- public | 2 +- scpt/card_number_push.zsh | 16 ----------- scpt/convert.zsh | 23 ++++++++++++--- scpt/convert_origin.zsh | 53 ----------------------------------- scpt/convert_origin2.zsh | 53 ----------------------------------- scpt/convert_s.zsh | 55 ------------------------------------ scpt/gif.zsh | 59 --------------------------------------- scpt/gif_first.zsh | 59 --------------------------------------- scpt/model_gif.zsh | 38 ------------------------- scpt/ogimage.zsh | 5 ++-- src/App.vue | 25 +++++++++++++---- 11 files changed, 42 insertions(+), 346 deletions(-) delete mode 100755 scpt/card_number_push.zsh delete mode 100755 scpt/convert_origin.zsh delete mode 100755 scpt/convert_origin2.zsh delete mode 100755 scpt/convert_s.zsh delete mode 100755 scpt/gif.zsh delete mode 100755 scpt/gif_first.zsh delete mode 100755 scpt/model_gif.zsh diff --git a/public b/public index 431afd6..c130451 160000 --- a/public +++ b/public @@ -1 +1 @@ -Subproject commit 431afd6a3750fdfbc6d99b1e7c2a1d305d47a27c +Subproject commit c130451edb9f2339edeb061b333a15f386cdfb78 diff --git a/scpt/card_number_push.zsh b/scpt/card_number_push.zsh deleted file mode 100755 index e4f1ba8..0000000 --- a/scpt/card_number_push.zsh +++ /dev/null @@ -1,16 +0,0 @@ -#!/bin/zsh -d=${0:a:h} -dd=${0:a:h:h} - -url=https://syui.ai/img - -json=$dd/public/json/card.json -n=`cat $json|jq "length"` -n=`expr $n - 1` - -for ((i=0;i<=14;i++)) -do - sid=`cat $json|jq -r ".[$i].src"` - id=`cat $json|jq -r ".[$i].id"` - curl -sL $url/${sid}.png -o ~/ai/yui/content/img/${id}.png -done diff --git a/scpt/convert.zsh b/scpt/convert.zsh index 6860b93..b39ab2b 100755 --- a/scpt/convert.zsh +++ b/scpt/convert.zsh @@ -2,6 +2,9 @@ d=${0:a:h} dd=${0:a:h:h} +echo "1 : [d]efault(no), [b]lack, [s]ilver" +read + url=syui.ai/img case $OSTYPE in @@ -12,14 +15,27 @@ case $OSTYPE in esac dir=$dd/public/card -static=$dd/static/img +static=$dd/public/static/img json=$dd/public/json/card.json mkdir -p $dir mkdir -p $static n=`cat $json|jq "length"` n=`expr $n - 1` -bg=$static/card_bg.png -br=$static/card_br.png + +case $1 in + silver|s) + bg=$static/card_bg_silver.png + br=$static/card_br.png + ;; + black|b) + bg=$static/card_bg_black.png + br=$static/card_br.png + ;; + default|d|*) + bg=$static/card_bg.png + br=$static/card_br.png + ;; +esac cd $dir export NVM_DIR="$HOME/.nvm" @@ -34,7 +50,6 @@ do s=$static/${sid}.png id=`cat $json|jq -r ".[$i].id"` o=$dir/card_$id.png - gif=$dir/card_$id.gif if [ -f $o ];then continue diff --git a/scpt/convert_origin.zsh b/scpt/convert_origin.zsh deleted file mode 100755 index 9dc3872..0000000 --- a/scpt/convert_origin.zsh +++ /dev/null @@ -1,53 +0,0 @@ -#!/bin/zsh -d=${0:a:h} -dd=${0:a:h:h} - -url=syui.ai/img - -case $OSTYPE in - darwin*) - path_nvm_sh="/opt/homebrew/opt/nvm/nvm.sh";; - linux*) - path_nvm_sh="";; -esac - -dir=$dd/public/card -static=$dd/static/img -json=$dd/public/json/card.json -mkdir -p $dir -mkdir -p $static -n=`cat $json|jq "length"` -n=`expr $n - 1` -bg=$static/card_bg_origin.png -br=$static/card_br.png - -cd $dir -export NVM_DIR="$HOME/.nvm" -[ -s "$path_nvm_sh" ] && \. "$path_nvm_sh" -nvm use 17 -nvm i squoosh-cli - -for ((i=0;i<=$n;i++)) -do - p=`cat $json|jq -r ".[$i].p"` - sid=`cat $json|jq -r ".[$i].src"` - s=$static/${sid}.png - id=`cat $json|jq -r ".[$i].id"` - o=$dir/card_origin_${id}.png - - if [ -f $o ];then - continue - fi - - if [ ! -f $s ];then - curl -sL $url/yui_${sid}.png -o $s - fi - - if [ ! -f $o ] && [ -z "`echo $s|grep ai_model`" ];then - composite -gravity north -geometry +0+160 -compose over $s $bg $o.back - composite -gravity north -geometry +0+0 -compose over $br $o.back $o - squoosh-cli --webp '{"quality":100}' -d ./ --resize '{width:825,height:1080}' $o - rm $o.back - fi - -done diff --git a/scpt/convert_origin2.zsh b/scpt/convert_origin2.zsh deleted file mode 100755 index bad1130..0000000 --- a/scpt/convert_origin2.zsh +++ /dev/null @@ -1,53 +0,0 @@ -#!/bin/zsh -d=${0:a:h} -dd=${0:a:h:h} - -url=syui.ai/img - -case $OSTYPE in - darwin*) - path_nvm_sh="/opt/homebrew/opt/nvm/nvm.sh";; - linux*) - path_nvm_sh="";; -esac - -dir=$dd/public/card -static=$dd/static/img -json=$dd/public/json/card.json -mkdir -p $dir -mkdir -p $static -n=`cat $json|jq "length"` -n=`expr $n - 1` -bg=$static/card_bg_origin2.png -br=$static/card_br.png - -cd $dir -export NVM_DIR="$HOME/.nvm" -[ -s "$path_nvm_sh" ] && \. "$path_nvm_sh" -nvm use 17 -nvm i squoosh-cli - -for ((i=0;i<=$n;i++)) -do - p=`cat $json|jq -r ".[$i].p"` - sid=`cat $json|jq -r ".[$i].src"` - s=$static/${sid}.png - id=`cat $json|jq -r ".[$i].id"` - o=$dir/card_origin2_${id}.png - - if [ -f $o ];then - continue - fi - - if [ ! -f $s ];then - curl -sL $url/yui_${sid}.png -o $s - fi - - if [ ! -f $o ] && [ -z "`echo $s|grep ai_model`" ];then - composite -gravity north -geometry +0+160 -compose over $s $bg $o.back - composite -gravity north -geometry +0+0 -compose over $br $o.back $o - squoosh-cli --webp '{"quality":100}' -d ./ --resize '{width:825,height:1080}' $o - rm $o.back - fi - -done diff --git a/scpt/convert_s.zsh b/scpt/convert_s.zsh deleted file mode 100755 index af726bd..0000000 --- a/scpt/convert_s.zsh +++ /dev/null @@ -1,55 +0,0 @@ -#!/bin/zsh -d=${0:a:h} -dd=${0:a:h:h} - -url=syui.ai/img - -case $OSTYPE in - darwin*) - path_nvm_sh="/opt/homebrew/opt/nvm/nvm.sh";; - linux*) - path_nvm_sh="";; -esac - -dir=$dd/public/card -static=$dd/static/img -json=$dd/public/json/card.json -mkdir -p $dir -mkdir -p $static -n=`cat $json|jq "length"` -n=`expr $n - 1` -bg=$static/card_bg_s.png -br=$static/card_bg_sr.png -for ((i=0;i<=$n;i++)) -do - p=`cat $json|jq -r ".[$i].p"` - sid=`cat $json|jq -r ".[$i].src"` - s=$static/${sid}.png - id=`cat $json|jq -r ".[$i].id"` - o=$dir/test_${id}s.png - - if [ -f $o ];then - continue - fi - - if [ ! -f $s ];then - curl -sL $url/yui_${sid}.png -o $s - fi - - #if [ ! -f $o ];then - composite -gravity north -geometry +0+160 -compose over $s $bg $o.back - composite -gravity north -geometry +0+0 -compose over $br $o.back $o - rm $o.back - #fi - -done - -cd $dir -export NVM_DIR="$HOME/.nvm" -[ -s "$path_nvm_sh" ] && \. "$path_nvm_sh" -nvm use 17 -nvm i squoosh-cli -#rm og_* -squoosh-cli --webp '{"quality":100}' -d ./ --resize '{width:825,height:1080}' *.png - -#mogrify -resize 1620x2160! *.png diff --git a/scpt/gif.zsh b/scpt/gif.zsh deleted file mode 100755 index b7ed6d3..0000000 --- a/scpt/gif.zsh +++ /dev/null @@ -1,59 +0,0 @@ -#!/bin/zsh -d=${0:a:h} -dd=${0:a:h:h} - -url=syui.ai/img - -case $OSTYPE in - darwin*) - path_nvm_sh="/opt/homebrew/opt/nvm/nvm.sh";; - linux*) - path_nvm_sh="";; -esac - -dir=$dd/public/card -static=$dd/static/img -json=$dd/public/json/card.json -mkdir -p $dir -mkdir -p $static -n=`cat $json|jq "length"` -n=`expr $n - 1` -bg=$static/card_bg.png -br=$static/card_br.png - -for ((i=0;i<=$n;i++)) -do - p=`cat $json|jq -r ".[$i].p"` - sid=`cat $json|jq -r ".[$i].src"` - s=$static/${sid}.png - id=`cat $json|jq -r ".[$i].id"` - gif=$dir/card_$id.gif - - if [ -f $gif ];then - continue - fi - - nn=`ls $static/card_bgg_*.png|wc -l` - nn=$((nn - 1)) - - for ((ii=0;ii<=$nn;ii++)) - do - title=$dir/null - o=${title}_${ii}.png - br=$static/card_bgg_${ii}.png - composite -gravity north -geometry +0+160 -compose over $s $bg $o.back - composite -gravity north -geometry +0+0 -compose over $br $o.back $o - rm $o.back - - export NVM_DIR="$HOME/.nvm" - [ -s "$path_nvm_sh" ] && \. "$path_nvm_sh" - nvm use 17 - nvm i squoosh-cli - squoosh-cli --webp '{"quality":100}' -d $dir --resize '{width:400,height:524}' $o - - done - - convert -layers optimize -loop 0 -delay 40 $dir/null_*.webp $gif - rm -f $dir/null_* - -done diff --git a/scpt/gif_first.zsh b/scpt/gif_first.zsh deleted file mode 100755 index 348bbdc..0000000 --- a/scpt/gif_first.zsh +++ /dev/null @@ -1,59 +0,0 @@ -#!/bin/zsh -d=${0:a:h} -dd=${0:a:h:h} - -url=syui.ai/img - -case $OSTYPE in - darwin*) - path_nvm_sh="/opt/homebrew/opt/nvm/nvm.sh";; - linux*) - path_nvm_sh="";; -esac - -dir=$dd/public/card -static=$dd/static/img -json=$dd/public/json/card.json -mkdir -p $dir -mkdir -p $static -n=`cat $json|jq "length"` -n=`expr $n - 1` -bg=$static/card_bg.png -br=$static/card_br.png - -for ((i=0;i<=$n;i++)) -do - p=`cat $json|jq -r ".[$i].p"` - sid=`cat $json|jq -r ".[$i].src"` - s=$static/${sid}.png - id=`cat $json|jq -r ".[$i].id"` - gif=$dir/card_first_$id.gif - - if [ -f $gif ];then - continue - fi - - nn=`ls $static/card_bgg_first_*.png|wc -l` - nn=$((nn - 1)) - - for ((ii=0;ii<=$nn;ii++)) - do - title=$dir/null - o=${title}_first_${ii}.png - br=$static/card_bgg_first_${ii}.png - composite -gravity north -geometry +0+160 -compose over $s $bg $o.back - composite -gravity north -geometry +0+0 -compose over $br $o.back $o - rm $o.back - - export NVM_DIR="$HOME/.nvm" - [ -s "$path_nvm_sh" ] && \. "$path_nvm_sh" - nvm use 17 - nvm i squoosh-cli - squoosh-cli --webp '{"quality":100}' -d $dir --resize '{width:400,height:524}' $o - - done - - convert -layers optimize -loop 0 -delay 40 $dir/null_*.webp $gif - rm -f $dir/null_* - -done diff --git a/scpt/model_gif.zsh b/scpt/model_gif.zsh deleted file mode 100755 index 8c2a389..0000000 --- a/scpt/model_gif.zsh +++ /dev/null @@ -1,38 +0,0 @@ -#!/bin/zsh -inp=mp4 -for i in *.${inp} -do - ffmpeg -i *.${inp} -r 8 %04d.png -done - -inp=png -out=jpg -for i in *.${inp} -do -convert ${i%.*}.${inp} -gravity center -crop 825x1080+0+0 ${i%.*}_crop.${inp} -convert ${i%.*}_crop.${inp} -resize 1620x2160! ${i%.*}.${out} -done - -nn=`ls *.jpg|wc -l` -static=~/ai/card/static/img -bg=$static/card_bg.png -br=$static/card_br.png -for ((ii=1;ii<=$nn;ii++)) - do - s=`ls *.jpg|awk "NR==$ii"` - o=null_${ii}.png - echo $o - if [ -f $b ];then - echo yes - else - echo no - fi - composite -gravity north -geometry +0+160 -compose over $s $bg $o.back - composite -gravity north -geometry +0+0 -compose over $br $o.back $o - rm $o.back -done - -gif=`ls *.mp4|cut -d . -f 1`.gif -convert -layers optimize -loop 0 -delay 40 null_*.png $gif -rm *.jpg -rm *.png diff --git a/scpt/ogimage.zsh b/scpt/ogimage.zsh index 9cdf3f5..d6816bb 100755 --- a/scpt/ogimage.zsh +++ b/scpt/ogimage.zsh @@ -4,8 +4,8 @@ url=https://card.syui.ai d=${0:a:h} dd=${0:a:h:h} dir=$dd/public/card -o_dir=$dd/static/img -static=$dd/static/img +o_dir=$dd/public/static/img +static=$dd/public/static/img json=$dd/public/json/card.json mkdir -p $dir mkdir -p $static @@ -25,6 +25,7 @@ do index=$o_dir/$id/index.html if [ ! -f $oo ];then + echo $oo convert $o -gravity center -extent 8000x4000 $oo fi diff --git a/src/App.vue b/src/App.vue index a7f6bbb..65683d7 100755 --- a/src/App.vue +++ b/src/App.vue @@ -60,7 +60,7 @@
- +
@@ -142,10 +142,19 @@ - + + + + + {{ ii.cp }} + +
+ +
+ @@ -836,7 +845,7 @@

[{{ ii.ten }}] {{ ii.h }} / {{ ii.id }}00

-
+

[{{ ii.ten }}] {{ ii.h }} / {{ ii.id }}00

@@ -849,7 +858,6 @@

/ten h : ヘルプ

/ten start : 7ターンまでに文字をそろえる

-

はカードを持ってる人しか出せない

ACEHIKMOSTUWYZ
@@ -925,6 +933,7 @@ export default { card: null, cards: null, loc: window.location.pathname.split('/').slice(-1)[0], + username: null, id: null, model: null, record: null, @@ -956,6 +965,7 @@ export default { model_attack: null, model_critical: null, model_critical_d: null, + game: null, game_lv: null, api_url: null, bsky_mode: false, @@ -963,6 +973,7 @@ export default { card_origin_status: false, useragent: window.navigator.userAgent.toLowerCase(), iframe_status: false, + term_status: false, sort_key: null, } }, @@ -1007,18 +1018,20 @@ export default { axios.get(url,{ crossdomain: true }) .then(response => { this.record = response; + this.username = this.record.data.find((v) => v.username == loc).username; this.id = this.record.data.find((v) => v.username == loc).id; this.model = this.record.data.find((v) => v.username == loc).model; this.did = this.record.data.find((v) => v.username == loc).did; this.aiten = this.record.data.find((v) => v.username == loc).aiten; this.bsky_mode = this.record.data.find((v) => v.username == loc).bsky; this.user_fav = this.record.data.find((v) => v.username == loc).fav; + this.game = this.record.data.find((v) => v.username == loc).game; this.game_lv = this.record.data.find((v) => v.username == loc).game_lv; this.model_attack = this.record.data.find((v) => v.username == loc).model_attack; this.model_critical = this.record.data.find((v) => v.username == loc).model_critical; this.model_critical_d = this.record.data.find((v) => v.username == loc).model_critical_d; this.user_room = this.record.data.find((v) => v.username == loc).room; - let url = this.api_url + "users/" + this.id + "/card?itemsPerPage=3000"; + let url = this.api_url + "users/" + this.id + "/card?itemsPerPage=4000"; axios .get("/json/card.json") .then(response => (this.rcards = response)); @@ -1823,7 +1836,7 @@ span.glb { blockquote.did { background-color: #fff; color: #000; - text-align: left; } +