Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

level #57

Merged
merged 1 commit into from
Feb 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/funcs/handle_profession.go
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,8 @@ func getFinalProfession(profession string, rank string, route string) string {
default:
finalProfession = profession // ランクが指定外の場合は基本職業をそのまま使用
}

fmt.Println("final: ", finalProfession)
return finalProfession
}

Expand Down
3 changes: 3 additions & 0 deletions src/funcs/judge_rank.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@ func JudgeRank(languages []LanguageStat, stats UserStats) (string, int) {
total := stats.TotalStars + stats.ContributedTo + stats.TotalIssues + stats.TotalPRs + stats.TotalCommits

level := int(math.Sqrt(float64(total)))
if level > 100 {
level = 100
}

rank := ""

Expand Down
2 changes: 1 addition & 1 deletion src/funcs/merge_all.go
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ func Merge_all(nameImg, statsImg, characterImg, languageImg, dateImg, filepath s

// 合成した画像を保存
saveImage(backgroundImage, filepath)
ResizeImage("result.png", 700, 0)
ResizeImage(filepath, 700, 0)
}

// 画像を保存する関数
Expand Down
Binary file modified src/images/background.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified src/images/commits_history.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified src/images/gauge.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified src/images/generate_character.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified src/images/language.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified src/images/stats.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 5 additions & 3 deletions src/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -152,15 +152,17 @@

//対象のキャラの画像を取得
img := funcs.DispatchPictureBasedOnProfession(profession)

Check failure on line 155 in src/main.go

View workflow job for this annotation

GitHub Actions / lint

File is not `gofmt`-ed with `-s` (gofmt)
// コミットカレンダー画像の生成
filePath := fmt.Sprintf("characterImages/%s", img)

// 背景画像の生成
funcs.DrawBackground(username, "Lv."+strconv.Itoa(level), profession)

// キャラクター画像の生成
funcs.CreateCharacterImg(img, "images/gauge.png", total, level)
funcs.CreateCharacterImg(filePath, "images/gauge.png", total, level)


// コミットカレンダー画像の生成

_, dailyCommits, maxCommits, err := funcs.GetCommitHistory(username)
if err != nil {
Expand Down Expand Up @@ -200,7 +202,7 @@
// http.HandleFunc("/background", getBackgroundHandler)
http.HandleFunc("/create", createHandler)
fmt.Println("Hello, World!")
err := http.ListenAndServe(":8080", nil)
err := http.ListenAndServe(":8000", nil)
if err != nil {
log.Fatalf("HTTP server failed: %v", err)
}
Expand Down
Loading