-
Notifications
You must be signed in to change notification settings - Fork 1
スポンサーリストを追加 #26
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
Open
masakurapa
wants to merge
10
commits into
main
Choose a base branch
from
feature/sponsors
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
スポンサーリストを追加 #26
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
1201b5f
スポンサーリストを追加
masakurapa ee480f9
fix style
masakurapa 1f8f1fc
add Dialog
masakurapa 41205d9
fix Sponsor type
masakurapa 4eaabb0
fix Dialog layout
masakurapa a97d2b1
URLの色を変更
masakurapa e03fcc0
add image title
masakurapa b856227
Merge branch 'main' into feature/sponsors
masakurapa 8ac0b1d
fix: スポンサーページを英語対応
mochi-yu 55db2b3
Merge pull request #36 from GoCon/feat/sponsors-i18n
masakurapa File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,127 @@ | ||
| --- | ||
| import SectionTitle from "../ui/SectionTitle.astro"; | ||
| import SponsorList from "./sponsor/SponsorList.astro"; | ||
| import GopherList from "./sponsor/GopherList.astro"; | ||
| import { | ||
| goldSponsors, | ||
| silverSponsors, | ||
| drinkSponsors, | ||
| lunchSponsors, | ||
| bronzeSponsors, | ||
| gopherSponsors, | ||
| toolSponsors, | ||
| } from "./sponsors"; | ||
|
|
||
| const currentLocale = Astro.currentLocale || "ja"; | ||
|
|
||
| if ( | ||
| goldSponsors.length === 0 && | ||
| silverSponsors.length === 0 && | ||
| drinkSponsors.length === 0 && | ||
| lunchSponsors.length === 0 && | ||
| bronzeSponsors.length === 0 && | ||
| gopherSponsors.length === 0 && | ||
| toolSponsors.length === 0 | ||
| ) { | ||
| return null; | ||
| } | ||
| --- | ||
|
|
||
| <section id="sponsors"> | ||
| <SectionTitle> | ||
| { | ||
| currentLocale === "en" ? ( | ||
| <span class="section-title"> | ||
| <span style="color: var(--text-accent);">S</span>ponsors | ||
| </span> | ||
| ) : ( | ||
| <span class="section-title"> | ||
| <span style="color: var(--text-accent);">ス</span>ポンサー | ||
| </span> | ||
| ) | ||
| } | ||
| </SectionTitle> | ||
|
|
||
| <SponsorList | ||
| size="learge" | ||
| sponsors={goldSponsors} | ||
| dialogSectionTitle={currentLocale === "ja" | ||
| ? "Goルドスポンサー" | ||
| : "Gold Sponsor"} | ||
| > | ||
| { | ||
| currentLocale === "ja" ? ( | ||
| <> | ||
| <span style="color: var(--text-accent);">Go</span>ルド | ||
| </> | ||
| ) : ( | ||
| <> | ||
| <span style="color: var(--text-accent);">Go</span>ld | ||
| </> | ||
| ) | ||
| } | ||
| </SponsorList> | ||
| <SponsorList | ||
| size="medium" | ||
| sponsors={silverSponsors} | ||
| dialogSectionTitle={currentLocale === "ja" | ||
| ? "シルバースポンサー" | ||
| : "Silver Sponsor"} | ||
| > | ||
| {currentLocale === "ja" ? "シルバー" : "Silver"} | ||
| </SponsorList> | ||
| <SponsorList | ||
| size="medium" | ||
| sponsors={drinkSponsors} | ||
| dialogSectionTitle={currentLocale === "ja" | ||
| ? "ドリンクスポンサー" | ||
| : "Drink Sponsor"} | ||
| > | ||
| {currentLocale === "ja" ? "ドリンク" : "Drink"} | ||
| </SponsorList> | ||
| <SponsorList | ||
| size="medium" | ||
| sponsors={lunchSponsors} | ||
| dialogSectionTitle={currentLocale === "ja" | ||
| ? "ランチスポンサー" | ||
| : "Lunch Sponsor"} | ||
| > | ||
| {currentLocale === "ja" ? "ランチ" : "Lunch"} | ||
| </SponsorList> | ||
| <SponsorList size="small" sponsors={bronzeSponsors}> | ||
| {currentLocale === "ja" ? "ブロンズ" : "Bronze"} | ||
| </SponsorList> | ||
| <GopherList sponsors={gopherSponsors}>Gopher</GopherList> | ||
| <SponsorList size="learge" sponsors={toolSponsors}> | ||
| {currentLocale === "ja" ? "ツールスポンサー" : "Tool Sponsor"} | ||
| </SponsorList> | ||
| </section> | ||
|
|
||
| <style> | ||
| section { | ||
| max-width: 1200px; | ||
| margin: 0 auto; | ||
| padding: var(--space-l) var(--space-m); | ||
| display: flex; | ||
| flex-direction: column; | ||
| gap: var(--space-s); | ||
| align-items: center; | ||
| } | ||
|
|
||
| .section-title { | ||
| word-break: keep-all; | ||
| overflow-wrap: anywhere; | ||
| text-align: center; | ||
| } | ||
|
|
||
| .sponsor-section { | ||
| text-align: center; | ||
| } | ||
|
|
||
| @media screen and (max-width: 768px) { | ||
| section { | ||
| padding: var(--space-m) var(--space-s); | ||
| gap: var(--space-s); | ||
| } | ||
| } | ||
| </style> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,135 @@ | ||
| --- | ||
| import { Image } from "astro:assets"; | ||
| import type { Sponsor } from "../sponsors"; | ||
| import Tag from "../../ui/Tag.astro"; | ||
| import TextLink from "../../ui/TextLink.astro"; | ||
|
|
||
| import CloseIcon from "../../../assets/icons/close.svg"; | ||
|
|
||
| interface Props { | ||
| openId: string; | ||
| sponsorSectionTitle: string; | ||
| sponsor: Sponsor; | ||
| } | ||
|
|
||
| const { openId, sponsorSectionTitle, sponsor } = Astro.props; | ||
| --- | ||
|
|
||
| <style> | ||
| .sponsor-dialog { | ||
| padding: 0; | ||
| border-radius: 32px; | ||
| border: none; | ||
| } | ||
|
|
||
| .sponsor-dialog-close { | ||
| width: 48px; | ||
| height: 48px; | ||
| display: flex; | ||
| align-items: center; | ||
| justify-content: center; | ||
| background-color: var(--surface-secondary-dark); | ||
| color: var(--text-on-fill); | ||
| border-radius: 50%; | ||
| font-weight: 700; | ||
| position: absolute; | ||
| right: 32px; | ||
| top: 32px; | ||
| cursor: pointer; | ||
| } | ||
|
|
||
| .close-icon { | ||
| display: inline; | ||
| fill: var(--text-on-fill); | ||
| width: 32px; | ||
| height: 32px; | ||
| } | ||
|
|
||
| h4 { | ||
| margin: 0; | ||
| } | ||
|
|
||
| .sponsor-dialog-content { | ||
| display: flex; | ||
| flex-direction: column; | ||
| align-items: center; | ||
| justify-content: center; | ||
| width: 600px; | ||
| } | ||
|
|
||
| .sponsor-dialog-header { | ||
| display: flex; | ||
| justify-content: space-between; | ||
| flex-direction: column; | ||
| align-items: center; | ||
| gap: var(--space-xxs); | ||
| padding: var(--space-m); | ||
| } | ||
|
|
||
| .sponsor-dialog-body { | ||
| text-align: center; | ||
| padding: var(--space-m); | ||
| background-color: var(--surface-secondary); | ||
| } | ||
|
|
||
| @media screen and (max-width: 768px) { | ||
| .sponsor-dialog-header { | ||
| padding: var(--space-m) var(--space-xs); | ||
| } | ||
|
|
||
| .sponsor-dialog-content { | ||
| width: 358px; | ||
| } | ||
|
|
||
| .sponsor-logo { | ||
| width: 326px; | ||
| height: 120px; | ||
| } | ||
|
|
||
| .sponsor-dialog-close { | ||
| right: 16px; | ||
| top: 16px; | ||
| } | ||
| } | ||
| </style> | ||
|
|
||
| <dialog id={openId} class="sponsor-dialog"> | ||
| <div class="sponsor-dialog-content"> | ||
| <div class="sponsor-dialog-header"> | ||
| <Tag text={sponsorSectionTitle} /> | ||
| <div | ||
| class="sponsor-dialog-close" | ||
| onclick={`document.getElementById('${openId}').close()`} | ||
| > | ||
| <CloseIcon class="close-icon" /> | ||
| </div> | ||
| <Image | ||
| src={sponsor.imageSrc} | ||
| alt={sponsor.name} | ||
| width={520} | ||
| height={120} | ||
| loading="lazy" | ||
| class="sponsor-logo" | ||
| /> | ||
| <h4 class="text-h4">{sponsor.name}</h4> | ||
| { | ||
| sponsor.dialog?.link && ( | ||
| <div> | ||
| <TextLink | ||
| href={sponsor.dialog.link} | ||
| text={sponsor.dialog.link} | ||
| isAccentColor | ||
| /> | ||
| </div> | ||
| ) | ||
| } | ||
| </div> | ||
| { | ||
| sponsor.dialog?.description !== "" && ( | ||
| <div class="sponsor-dialog-body text-body-medium"> | ||
| <span>{sponsor.dialog?.description}</span> | ||
| </div> | ||
| ) | ||
| } | ||
| </div> | ||
| </dialog> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,90 @@ | ||
| --- | ||
| import { Image } from "astro:assets"; | ||
| import type { Sponsor } from "../sponsors"; | ||
|
|
||
| interface Props { | ||
| sponsors: Sponsor[]; | ||
| } | ||
|
|
||
| const { sponsors } = Astro.props; | ||
|
|
||
| if (sponsors.length === 0) { | ||
| return null; | ||
| } | ||
| --- | ||
|
|
||
| <div class="sponsor-section"> | ||
| <h4 class="text-h4"> | ||
| <slot /> | ||
| </h4> | ||
| <ul> | ||
| { | ||
| sponsors.map((sponsor) => ( | ||
| <li> | ||
| <Image | ||
| src={sponsor.imageSrc} | ||
| alt={sponsor.name} | ||
| width={96} | ||
| height={96} | ||
| loading="lazy" | ||
| priority | ||
| /> | ||
| <div>{sponsor.name}</div> | ||
| </li> | ||
| )) | ||
| } | ||
| </ul> | ||
| </div> | ||
|
|
||
| <style> | ||
| .sponsor-section { | ||
| text-align: center; | ||
| } | ||
|
|
||
| ul { | ||
| display: grid; | ||
| grid-template-columns: repeat(5, auto); | ||
| list-style: none; | ||
| text-align: center; | ||
| padding: 0; | ||
| gap: 40px; | ||
| width: fit-content; | ||
| max-width: 100%; | ||
| margin: 0 auto; | ||
| } | ||
|
|
||
| li { | ||
| padding: 24px; | ||
| display: flex; | ||
| flex-direction: column; | ||
| align-items: center; | ||
| justify-content: center; | ||
| gap: 8px; | ||
| } | ||
|
|
||
| img { | ||
| object-fit: contain; | ||
| border-radius: 50%; | ||
| display: block; | ||
| margin: 0 auto; | ||
| } | ||
|
|
||
| @media screen and (max-width: 1150px) { | ||
| ul { | ||
| grid-template-columns: repeat(4, auto); | ||
| } | ||
| } | ||
|
|
||
| @media screen and (max-width: 920px) { | ||
| ul { | ||
| grid-template-columns: repeat(3, auto); | ||
| } | ||
| } | ||
|
|
||
| @media screen and (max-width: 768px) { | ||
| ul { | ||
| grid-template-columns: repeat(2, auto); | ||
| gap: 8px; | ||
| } | ||
| } | ||
| </style> | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
正方形ではない画像の時に見切れそうです。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
coverにすると逆に画像がほとんど見えないケースもありそうなんですよねー
ここは実際のデータ入ってきてから再調整でもいいですかね?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
これってどういうものですかね…?極端に縦長・横長の画像をもらうとかでしょうか?
そういった画像が来る方が珍しい気がして、ベース cover の方がスタイルとしては統一感あるのかな、と思ってしまいますね 🤔
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
そうですねー、去年の見ていただくと分かるかもしれないです(こちらについてはある程度サイズ定義出来ないか確認してみましょうかね)