Skip to content

Commit

Permalink
Merge pull request #50 from tokyorubykaigi12/terfno/tt
Browse files Browse the repository at this point in the history
publish timetable
  • Loading branch information
Terfno authored Jan 14, 2025
2 parents 8e69007 + 3b79b73 commit 8bcdaf1
Show file tree
Hide file tree
Showing 18 changed files with 1,060 additions and 12 deletions.
2 changes: 1 addition & 1 deletion src/components/Layouts/Header/Hamburger.astro
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import CloseIcon from "../../icons/close.svg"
.hamburger {
height: 48px;
}
@media screen and (width > 700px) {
@media screen and (width > 720px) {
.hamburger {
display: none;
}
Expand Down
2 changes: 1 addition & 1 deletion src/components/Layouts/Header/Nav.astro
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import NavItems from './NavItems.astro'
nav {
height: 24px;
}
@media screen and (width <= 700px) {
@media screen and (width <= 720px) {
nav {
display: none;
}
Expand Down
10 changes: 5 additions & 5 deletions src/components/Layouts/Header/NavItems.astro
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ const { mobile } = Astro.props;
list-style-type: none;
font-size: 16px;
}
@media screen and (width <= 700px) {
@media screen and (width <= 720px) {
nav ul {
gap: 12px;
}
Expand All @@ -40,12 +40,12 @@ const { mobile } = Astro.props;
</style>

<ul class="navitems">
<li>
<a href={`${import.meta.env.BASE_URL}/talks`}>Talks</a>
</li>
<!-- <li>
<a href={`${import.meta.env.BASE_URL}/schedule/`}>Schedule</a>
<a href={`${import.meta.env.BASE_URL}/talks`}>Talks</a>
</li> -->
<li>
<a href={`${import.meta.env.BASE_URL}/schedule/`}>Schedule</a>
</li>
<li>
<a href={`${import.meta.env.BASE_URL}/news/`}>News</a>
</li>
Expand Down
2 changes: 1 addition & 1 deletion src/components/Layouts/Panel.astro
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ const { title } = Astro.props;

.inner {
width: 100%;
max-width: 960px;
max-width: 1128px;
margin: 0 auto;
}
</style>
Expand Down
32 changes: 32 additions & 0 deletions src/components/schedule/ScrollSync.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
import type { ComponentChildren, FunctionComponent } from 'preact';
import { useEffect } from 'preact/hooks';

type Props = {
'client:only': boolean;
stick: ComponentChildren;
body: ComponentChildren;
}

const ScrollSync:FunctionComponent<Props> = (props) => {
useEffect(()=>{
const stick = document.getElementById("stick");
const body = document.getElementById("body");

stick?.addEventListener("scroll", () => {
if(body){body.scrollLeft = stick.scrollLeft}
});

body?.addEventListener("scroll", () => {
if(stick){stick.scrollLeft = body.scrollLeft}
});
}, [])

return (
<>
{props.stick}
{props.body}
</>
)
}

export default ScrollSync;
36 changes: 36 additions & 0 deletions src/components/schedule/TabToggle.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
.tabs {
width: 100%;
display: flex;
justify-content: center;
gap: 24px;

button {
text-align: center;

font-family: "Futura", "Jost", sans-serif;
font-weight: 500;
font-size: 20px;
line-height: 27px;

border-radius: 4px;
border: none;
padding: 16px 32px;
}

.default {
background-color: #aeaeb2;
color: #fff;
}

.selected {
background-color: #000;
color: #fff;
}
}
@media screen and (width <= 720px) {
.tabs {
button {
font-size: 15px;
}
}
}
51 changes: 51 additions & 0 deletions src/components/schedule/TabToggle.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
import type { ComponentChildren, FunctionComponent } from 'preact';
import {useStore} from '@nanostores/preact';
import { selectedTabStore, type Tab } from './tabStore';
import './TabToggle.css';

// for astro syntax
type Props = {
'client:only': boolean;
main: ComponentChildren;
zenyasai: ComponentChildren;
}

const Schedule:FunctionComponent<Props> = (props) => {
const $tab = useStore(selectedTabStore);

const isSelected = (tabName: Tab) => {
return $tab === tabName;
}

const handleClick = (tabName: Tab) => {
selectedTabStore.set(tabName);
}

return (
<>
<div class="tabs">
<button
type="button"
onClick={() => handleClick('fri')}
className={isSelected('fri') ? 'selected' : 'default'}
>
前夜祭 2025.1.17
</button>
<button
type="button"
onClick={() => handleClick('sat')}
className={isSelected('sat') ? 'selected' : 'default'}
>
2025.1.18
</button>
</div>
{$tab === 'sat' ? (
<>{props.main}</>
) : (
<>{props.zenyasai}</>
)}
</>
)
}

export default Schedule;
186 changes: 186 additions & 0 deletions src/components/schedule/Talk.astro
Original file line number Diff line number Diff line change
@@ -0,0 +1,186 @@
---
type Speaker = {
name: string;
ImageSrc: string;
XId?: string;
GitHubId?: string;
}
type Session = {
keynote?: boolean;
id: number;
title: string;
}
export type TalkType = {
speaker: Speaker;
session: Session;
}
interface Props {
id: number;
talks: TalkType[];
}
const {id, talks} = Astro.props;
import GitHubMarkImage from "../../imgs/github-mark.png";
import XLogoBlackImage from '../../imgs/x-logo-black.png';
---
<style>
.talk {
display: flex;
flex-direction: row;
gap: 32px;

.speaker-icon {
img {
border-radius: 12px;
height: auto;
width: 160px;
}
}
@media screen and (width <= 720px) {
.speaker-icon {
img {
width: 80px;
}
}
}

.description {
width: 100%;

.keynote {
span {
background: #FCECE8;
padding: 2px 8px;
border-radius: 2px;

font-family: "Futura", "Jost", sans-serif;
font-size: 12px;
font-weight: 400;
line-height: 18px;
}

margin-bottom: 10px;
}

.session-title {
font-size: 20px;
line-height: 30px;
font-weight: 600;

margin-bottom: 16px;
}

.speaker-name {
font-family: "Futura", "Jost", sans-serif;
font-size: 16px;
font-weight: 500;

margin-bottom: 16px;
}

.speaker-socials {
display: flex;
flex-wrap: wrap;
gap: 16px 24px;

a {
font-size: 16px;
font-weight: 500;
line-height: 21px;
text-decoration: none;
vertical-align: top;
}
@media screen and (width <= 480px) {
a {
font-size: 16px;
}
}

.social-x,
.social-github {
display: flex;
align-items: center;
}

.social-x {
img {
width: 24px;
height: 24px;
margin: 0 8px 0 0;
}
@media screen and (width <= 480px) {
img {
width: 16px;
height: 16px;
}
}
}

.social-github {
img {
width: 30px;
height: 30px;
margin: 0 8px 0 0;
}
@media screen and (width <= 480px) {
img {
width: 18px;
height: 18px;
}
}
}
}
}
}
@media screen and (width <= 720px) {
.talk {
flex-direction: column;
align-items: center;
/* todo: try to fit align up side */
}
}
</style>

{talks.filter((entry)=>entry.session.id === id).map((talk)=>{
const session =talk.session
const speaker =talk.speaker
return (
<div class="talk">
<div class="speaker-icon">
<img src={speaker.ImageSrc} alt="Speaker" />
</div>
<div class="description">
{session.keynote && <div class="keynote">
<span>Keynote</span>
</div>}
<h3 class="session-title">
{/* <a href={`tokyo12/talks/${session.id}`}></a> */}
{session.title}
</h3>
<h4 class="speaker-name">{speaker.name}</h4>
<div class="speaker-socials">
{speaker.GitHubId && (
<div class="social-github">
<img src={GitHubMarkImage.src} alt="github logo"/>
<a href={`https://github.com/${speaker.GitHubId}`}>
@{speaker.GitHubId}
</a>
</div>
)}
{speaker.XId && (
<div class="social-x">
<img src={XLogoBlackImage.src} alt="x logo"/>
<a href={`https://x.com/${speaker.XId}`}>
@{speaker.XId}
</a>
</div>
)}
</div>
</div>
</div>
)
})}
Loading

0 comments on commit 8bcdaf1

Please sign in to comment.