-
Couldn't load subscription status.
- Fork 0
My/feat/homepage #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
Merged
Merged
My/feat/homepage #26
Changes from 8 commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
ce074d2
feat: home banner
amphikapha aebd4ad
fix: home banner responsive
amphikapha 1354381
feat: announcement and organization
amphikapha f8fcaa2
feat: banner image No.1 in Thailand
amphikapha e00bf40
feat: 3 main organizations in Chula
amphikapha 3187c57
feat: pagination dot for Announcement card mobile, fix shadow for mob…
amphikapha 7bc289b
Merge branch 'dev' into my/feat/homepage
amphikapha e796d45
fix: lint
amphikapha ab53c0d
Merge branch 'dev' into my/feat/homepage
amphikapha d5b82a3
refactor: change mock data path
amphikapha cc2f66b
fix: delete unused className and snap snap
amphikapha 33ccd0f
refactor: change root path
amphikapha 8391cee
refactor: change png to webp
amphikapha 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
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
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
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,225 @@ | ||
| <script lang="ts"> | ||
| import { typography } from '../../styles/tailwind/typography'; | ||
| import { cn } from '../../lib/utils/cn'; | ||
| import Button from '../../lib/components/Button.svelte'; | ||
| import sucuHomeBanner1 from '../../lib/assets/images/sucuHomeBanner1.png'; | ||
| import sucuHomeBanner2 from '../../lib/assets/images/sucuHomeBanner2.png'; | ||
| import sucuHomeBanner3 from '../../lib/assets/images/sucuHomeBanner3.png'; | ||
| import AnnouncementCard from '$lib/components/AnnouncementCard/AnnouncementCard.svelte'; | ||
| import OrganizationCard from '$lib/components/OrganizationCard/OrganizationCard.svelte'; | ||
| import thumbnail from '../../lib/assets/images/thumbnail.png'; | ||
| import { onMount } from 'svelte'; | ||
| const announcementCard = Array(6).fill({ | ||
| imageURL: thumbnail, | ||
| title: | ||
| 'ประกาศจุฬาลงกรณ์มหาวิทยาลัย เรื่อง การไปต่างประเทศหรือการเข้ามาในประเทศเพื่อศึกษา อบรม วิจัย หรือปฏิบัติงาน ในสถานการณ์ปัจจุบัน ลงวันที่ 22 พฤศจิกายน 2565', | ||
| createdAt: '2024-07-04', | ||
| createdBy: 'สภานิสิต', | ||
| linkHref: 'https://www.google.com' | ||
| }); | ||
| announcementCard.push({ | ||
| imageURL: '', | ||
| title: 'ประกาศรับสมัครคณะกรรมาธิการวิสามัญพิจารณางบประมาณสโมสรนิสิตฯ', | ||
| createdAt: '2024-07-04', | ||
| createdBy: 'สภานิสิต', | ||
| linkHref: 'https://www.google.com' | ||
| }); | ||
amphikapha marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| let container: HTMLDivElement; | ||
| let activeSlide = 0; | ||
| function handleScroll() { | ||
| const scrollLeft = container.scrollLeft; | ||
| const cardWidth = 140; | ||
| const cardCount = announcementCard.length; | ||
| const cardGap = 2.5; | ||
| const threshold = (cardWidth + cardGap) / 3; | ||
| const currentCardIndex = Math.floor((scrollLeft + threshold) / (cardWidth + cardGap)); | ||
| activeSlide = Math.min(currentCardIndex, cardCount - 1); | ||
| } | ||
| onMount(() => { | ||
| container.addEventListener('scroll', handleScroll); | ||
| }); | ||
| </script> | ||
|
|
||
| <div> | ||
| <div | ||
| class="w-full h-[500px] max-md:h-[246px] flex items-center justify-center text-center bg-cover bg-center" | ||
| style="background-image: url({sucuHomeBanner1});" | ||
| > | ||
| <div | ||
| class="w-[650px] h-[263px] max-md:h-[160px] flex flex-col items-center justify-center justify-between" | ||
| > | ||
| <div | ||
| class="w-full h-[192px] max-md:h-[120px] p-2.5 flex flex-col gap-2.5 max-md:gap-1 text-sucu-gray-dark" | ||
| > | ||
| <div | ||
| class={cn( | ||
| typography({ variant: 'heading1' }), | ||
| 'tracking-tight leading-none', | ||
| 'max-md:text-3xl max-md:font-semibold' | ||
| )} | ||
| > | ||
| สโมสรนิสิต | ||
| </div> | ||
| <div | ||
| class={cn( | ||
| typography({ variant: 'heading1' }), | ||
| 'tracking-tight leading-none', | ||
| 'max-md:text-3xl max-md:font-semibold' | ||
| )} | ||
| > | ||
| จุฬาลงกรณ์มหาวิทยาลัย | ||
| </div> | ||
| <div | ||
| class={cn( | ||
| typography({ variant: 'body-large' }), | ||
| 'font-semibold leading-6', | ||
| 'max-md:text-xs max-md:leading-3' | ||
| )} | ||
| > | ||
| Student Union, Chulalongkorn University | ||
| </div> | ||
| </div> | ||
| <Button | ||
| color="white" | ||
| size="sm" | ||
| class={cn( | ||
| typography({ variant: 'body-medium' }), | ||
| 'font-semibold px-9 py-2 leading-5', | ||
| 'max-md:text-xs max-md:leading-3 max-md:px-3 max-md:py-1.5' | ||
| )} | ||
| > | ||
| รู้จักกับสโมสรนิติฯ | ||
| </Button> | ||
| </div> | ||
| </div> | ||
|
|
||
| <div | ||
| class="flex w-full h-[642px] py-[72px] px-[120px] gap-12 items-center text-sucu-gray-dark bg-white max-md:hidden" | ||
| > | ||
| <div | ||
| class="flex flex-col w-[297px] h-[208px] min-w-[297px] min-h-[208px] justify-between text-end" | ||
| > | ||
| <div class={cn(typography({ variant: 'heading1' }), 'tracking-tight leading-none')}> | ||
| ประกาศ | ||
| </div> | ||
| <div class={cn(typography({ variant: 'body-medium' }), 'tracking-tight leading-7')}> | ||
| ประกาศล่าสุดของสโมสรนิสิตจุฬาฯ อบจ. และสภานิสิตจุฬาฯ | ||
| </div> | ||
| <div class="flex justify-end"> | ||
| <Button | ||
| size="sm" | ||
| class={cn( | ||
| typography({ variant: 'body-medium' }), | ||
| 'font-semibold px-9 py-2 leading-5 bg-sucu-pink-01 hover:bg-sucu-pink-02', | ||
| 'max-md:text-xs max-md:leading-3 max-md:px-3 max-md:py-1.5' | ||
| )} | ||
| > | ||
| ดูประกาศเพิ่มเติม | ||
| </Button> | ||
| </div> | ||
| </div> | ||
| <div | ||
| class="flex overflow-auto p-6 gap-6 scrollbar-thin scrollbar-thumb-sucu-gray-light scrollbar-track-white" | ||
| > | ||
| {#each announcementCard as card} | ||
| <AnnouncementCard | ||
| imageURL={card.imageURL} | ||
| title={card.title} | ||
| createdAt={card.createdAt} | ||
| createdBy={card.createdBy} | ||
| linkHref={card.linkHref} | ||
| /> | ||
| {/each} | ||
| </div> | ||
| </div> | ||
| <div class="flex flex-col h-[483px] p-[26px] gap-4 text-sucu-gray-dark bg-white md:hidden"> | ||
| <div class="flex flex-col h-[76px] gap-3"> | ||
| <div class={cn(typography({ variant: 'heading2' }), 'tracking-tight leading-none')}> | ||
| ประกาศ | ||
| </div> | ||
| <div class={cn(typography({ variant: 'body-normal' }), 'tracking-tight leading-none')}> | ||
| ประกาศล่าสุดของสโมสรนิสิตจุฬาฯ อบจ. และสภานิสิตจุฬาฯ | ||
| </div> | ||
| </div> | ||
| <div | ||
| bind:this={container} | ||
| class="flex h-[257px] px-2.5 gap-2.5 overflow-x-auto items-center scrollbar-none snap-x snap-proximity" | ||
amphikapha marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| > | ||
| {#each announcementCard as card} | ||
| <AnnouncementCard | ||
| imageURL={card.imageURL} | ||
| title={card.title} | ||
| createdAt={card.createdAt} | ||
| createdBy={card.createdBy} | ||
| linkHref={card.linkHref} | ||
| className="snap-start" | ||
| /> | ||
| {/each} | ||
| </div> | ||
| <div class="flex justify-center gap-2"> | ||
| {#each announcementCard as _, index} | ||
| <div | ||
| class={`w-[5px] h-[5px] rounded-full ${index === activeSlide ? 'bg-sucu-gray-dark' : 'bg-sucu-gray'}`} | ||
| ></div> | ||
| {/each} | ||
| </div> | ||
| <div class="flex justify-center"> | ||
| <Button | ||
| size="sm" | ||
| class={cn( | ||
| typography({ variant: 'body-normal' }), | ||
| 'font-semibold px-3 py-1.5 leading-6 bg-sucu-pink-01 hover:bg-sucu-pink-02' | ||
| )} | ||
| > | ||
| ดูประกาศทั้งหมด | ||
| </Button> | ||
| </div> | ||
| </div> | ||
|
|
||
| <img src={sucuHomeBanner2} alt="banner" class="w-full h-auto bg-cover max-md:hidden" /> | ||
| <img src={sucuHomeBanner3} alt="banner" class="w-full h-auto bg-cover md:hidden" /> | ||
amphikapha marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| <div class="flex flex-col w-full h-auto items-center justify-center text-sucu-gray-dark relative"> | ||
| <div | ||
| class="w-full h-[180px] bg-[#FFF7F6] max-md:h-[98px] 2xl:h-[160px] max-2xl:h-[130px] max-lg:h-[100px]" | ||
| ></div> | ||
| <div | ||
| class="w-full h-[105px] max-md:h-[98px] max-2xl:h-[90px] max-lg:h-[65px] bg-sucu-pink-05" | ||
| ></div> | ||
| <div | ||
| class="w-full h-[105px] max-md:h-[98px] max-2xl:h-[90px] max-lg:h-[65px] bg-sucu-pink-04" | ||
| ></div> | ||
| <div | ||
| class="w-full h-[105px] max-md:h-[98px] max-2xl:h-[90px] max-lg:h-[65px] bg-sucu-pink-03" | ||
| ></div> | ||
| <div | ||
| class="w-full h-[105px] max-md:h-[98px] max-2xl:h-[90px] max-lg:h-[65px] bg-sucu-pink-02" | ||
| ></div> | ||
| <div | ||
| class="w-full h-[105px] max-md:h-[98px] max-2xl:h-[90px] max-lg:h-[65px] bg-sucu-pink-01" | ||
| ></div> | ||
|
|
||
| <div | ||
| class="absolute z-10 flex flex-col justify-between h-full w-full gap-[32px] py-[72px] 2xl:py-20 xl:py-14 lg:py-[72px] md:py-12" | ||
| > | ||
| <div | ||
| class={cn( | ||
| typography({ variant: 'heading1' }), | ||
| 'tracking-tight leading-none font-bold text-center', | ||
| 'max-md:text-3xl' | ||
| )} | ||
| > | ||
| 3 องค์กรหลักในจุฬาฯ | ||
| </div> | ||
| <div class="mt-auto"> | ||
| <OrganizationCard /> | ||
| </div> | ||
| </div> | ||
| </div> | ||
| </div> | ||
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
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.
Uh oh!
There was an error while loading. Please reload this page.