forked from phc/website
chore: minor refactor into some components and updated favicon
This commit is contained in:
Binary file not shown.
|
After Width: | Height: | Size: 2.0 KiB |
@@ -0,0 +1,15 @@
|
||||
---
|
||||
import type { AstroBuiltinProps } from 'astro'
|
||||
import type { AstroComponentFactory } from 'astro/runtime/server/index.js'
|
||||
|
||||
type Props = {
|
||||
large?: boolean
|
||||
style?: string
|
||||
}
|
||||
|
||||
const { large, ...props } = Astro.props
|
||||
---
|
||||
|
||||
<div class:list={['card', large && 'large']} {...props}>
|
||||
<slot />
|
||||
</div>
|
||||
@@ -0,0 +1,26 @@
|
||||
---
|
||||
type Props = {
|
||||
color: string
|
||||
}
|
||||
|
||||
const { color } = Astro.props
|
||||
|
||||
const patternId = 'zig-zag-' + color.slice(1)
|
||||
---
|
||||
|
||||
<div class="zig-zag">
|
||||
<svg
|
||||
width="100%"
|
||||
height="2rem"
|
||||
viewBox="0 0 1 1"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
preserveAspectRatio="xMinYMid meet"
|
||||
>
|
||||
<defs>
|
||||
<pattern id={patternId} x="0" y="0" width="2" height="1" patternUnits="userSpaceOnUse">
|
||||
<path fill={color} d="M 0,1 L 1,0 L 2,1 L 0,1"></path>
|
||||
</pattern>
|
||||
</defs>
|
||||
<rect fill={`url(#${patternId})`} x="0" y="0" width="1000" height="1"></rect>
|
||||
</svg>
|
||||
</div>
|
||||
@@ -0,0 +1,24 @@
|
||||
---
|
||||
// Card.astro
|
||||
export interface Props {
|
||||
title: string
|
||||
href: string
|
||||
|
||||
imgSrc?: string
|
||||
style?: string
|
||||
}
|
||||
|
||||
const { href, imgSrc, style, title } = Astro.props
|
||||
---
|
||||
|
||||
<a target="_blank" href={href} style={style}>
|
||||
<div class="project">
|
||||
<div class="image">
|
||||
{imgSrc ? <img src={imgSrc} alt={'logo for ' + title.toLowerCase()} /> : <div class="box" />}
|
||||
</div>
|
||||
<div class="title">{title}</div>
|
||||
<div class="description">
|
||||
<slot />
|
||||
</div>
|
||||
</div>
|
||||
</a>
|
||||
@@ -20,6 +20,8 @@ type Props = {
|
||||
pageTags?: string | string[]
|
||||
}
|
||||
|
||||
import phcIcon from '../assets/icon.png'
|
||||
|
||||
const { title, description, thumbnail, pageTags } = Astro.props
|
||||
---
|
||||
|
||||
@@ -36,7 +38,7 @@ const { title, description, thumbnail, pageTags } = Astro.props
|
||||
<meta property="og:url" content="https://phc.dm.unipi.it/" />
|
||||
{thumbnail && <meta property="og:image" content={thumbnail} />}
|
||||
|
||||
<link rel="icon" type="image/png" sizes="512x512" href="/favicon.svg" />
|
||||
<link rel="icon" type="image/png" sizes="512x512" href={phcIcon.src} />
|
||||
|
||||
<script>
|
||||
import renderMathInElement from 'katex/contrib/auto-render'
|
||||
|
||||
+92
-157
@@ -1,8 +1,11 @@
|
||||
---
|
||||
import { getCollection } from 'astro:content'
|
||||
import PageLayout from '../layouts/PageLayout.astro'
|
||||
import { Content as WhatPhcContent, frontmatter as whatsPhcFrontmatter } from '../content/meta/whats-phc.md'
|
||||
import PageLayout from '@/layouts/PageLayout.astro'
|
||||
import { Content as WhatPhcContent, frontmatter as whatsPhcFrontmatter } from '@/content/meta/whats-phc.md'
|
||||
import { Image } from 'astro:assets'
|
||||
import ProjectCard from '@/components/ProjectCard.astro'
|
||||
import HomepageZigZag from '@/components/HomepageZigZag.astro'
|
||||
import Card from '@/components/Card.astro'
|
||||
|
||||
const news = await getCollection('news')
|
||||
|
||||
@@ -34,30 +37,16 @@ const galleryCollage = await Astro.glob('@/assets/gallery/*.jpg')
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section class="news">
|
||||
<div class="zig-zag">
|
||||
<svg
|
||||
width="100%"
|
||||
height="2rem"
|
||||
viewBox="0 0 1 1"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
preserveAspectRatio="xMinYMid meet"
|
||||
>
|
||||
<defs>
|
||||
<pattern id="zig-zag-1" x="0" y="0" width="2" height="1" patternUnits="userSpaceOnUse">
|
||||
<path fill="#C2A8EB" d="M 0,1 L 1,0 L 2,1 L 0,1"></path>
|
||||
</pattern>
|
||||
</defs>
|
||||
<rect fill="url(#zig-zag-1)" x="0" y="0" width="1000" height="1"></rect>
|
||||
</svg>
|
||||
</div>
|
||||
<HomepageZigZag color="#C2A8EB" />
|
||||
|
||||
<div class="title">Ultime Notizie</div>
|
||||
|
||||
<div class="card-list">
|
||||
{
|
||||
news.map(newsItem => (
|
||||
<div class="card">
|
||||
<Card>
|
||||
<a href={`/notizie/${newsItem.slug}`} class="title">
|
||||
{newsItem.data.title}
|
||||
</a>
|
||||
@@ -69,153 +58,98 @@ const galleryCollage = await Astro.glob('@/assets/gallery/*.jpg')
|
||||
})}
|
||||
</div>
|
||||
<div class="text">{newsItem.data.description}</div>
|
||||
</div>
|
||||
</Card>
|
||||
))
|
||||
}
|
||||
</div>
|
||||
|
||||
<a class="primary" href="/notizie" role="button">Vai all'Archivio</a>
|
||||
</section>
|
||||
|
||||
<section class="projects" id="projects">
|
||||
<div class="zig-zag">
|
||||
<svg
|
||||
width="100%"
|
||||
height="2rem"
|
||||
viewBox="0 0 1 1"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
preserveAspectRatio="xMinYMid meet"
|
||||
>
|
||||
<defs>
|
||||
<pattern id="zig-zag-2" x="0" y="0" width="2" height="1" patternUnits="userSpaceOnUse">
|
||||
<path fill="#f5f2cc" d="M 0,1 L 1,0 L 2,1 L 0,1"></path>
|
||||
</pattern>
|
||||
</defs>
|
||||
<rect fill="url(#zig-zag-2)" x="0" y="0" width="1000" height="1"></rect>
|
||||
</svg>
|
||||
</div>
|
||||
<HomepageZigZag color="#f5f2cc" />
|
||||
|
||||
<div class="title">Progetti</div>
|
||||
|
||||
<div class="project-list">
|
||||
<a target="_blank" href="https://git.phc.dm.unipi.it/" style="--masonry-height: 2;">
|
||||
<div class="project" style="--card-bg: rgb(150, 197, 150);">
|
||||
<div class="image">
|
||||
<img
|
||||
src="https://upload.wikimedia.org/wikipedia/commons/b/bb/Gitea_Logo.svg"
|
||||
alt="logo Gitea"
|
||||
/>
|
||||
</div>
|
||||
<div class="title">Gitea</div>
|
||||
<div class="description">
|
||||
<p>
|
||||
Gitea è un servizio di hosting per progetti software, come GitHub ma autogestito.
|
||||
</p>
|
||||
<p>
|
||||
Qui puoi trovare i progetti del PHC, e accedendo con un account di Ateneo potrai
|
||||
crearne di nuovi.
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</a>
|
||||
<!-- <a href="#" style="--masonry-height: 2;">
|
||||
<div class="project">
|
||||
<div class="image">
|
||||
<div class="box"></div>
|
||||
</div>
|
||||
<div class="title">PHC-Bot</div>
|
||||
<div class="description">
|
||||
Un bot con cui chattare per chiedere informazioni o supporto tecnico.
|
||||
</div>
|
||||
</div>
|
||||
</a> -->
|
||||
<a target="_blank" href="https://lab.phc.dm.unipi.it/orario/" style="--masonry-height: 1;">
|
||||
<div class="project" style="--card-bg: #75ca75;">
|
||||
<div class="image">
|
||||
<img src="https://lab.phc.dm.unipi.it/orario/icon.png" alt="Logo Orario" />
|
||||
</div>
|
||||
<div class="title">Orario</div>
|
||||
<div class="description">
|
||||
Questo sito permette di visualizzare il proprio orario delle lezioni, con informazioni
|
||||
sui docenti e le aule.
|
||||
</div>
|
||||
</div>
|
||||
</a>
|
||||
<a target="_blank" href="https://lab.phc.dm.unipi.it/problemi/" style="--masonry-height: 2;">
|
||||
<div class="project" style="--card-bg: #aa88c0;">
|
||||
<div class="image">
|
||||
<img
|
||||
src="https://lab.phc.dm.unipi.it/problemi/favicon/android-chrome-512x512.png"
|
||||
alt="logo Problemi"
|
||||
/>
|
||||
</div>
|
||||
<div class="title">Problemi</div>
|
||||
<div class="description">
|
||||
<p>
|
||||
Bacheca di problemi di Matematica da risolvere, inviandone le soluzioni in LaTeX.
|
||||
</p>
|
||||
|
||||
<p>Di sera, puoi leggere i problemi sullo schermo del Dipartimento in atrio.</p>
|
||||
</div>
|
||||
</div>
|
||||
</a>
|
||||
<a href="http://steffe.cs.dm.unipi.it/" style="--masonry-height: 2;">
|
||||
<div class="project">
|
||||
<div class="image cover">
|
||||
<img src="https://steffe.lb.cs.dm.unipi.it/assets/img/logo.png" alt="Logo Cluster" />
|
||||
</div>
|
||||
<div class="title">Cluster "Steffè"</div>
|
||||
<div class="description">
|
||||
Cluster progettato ed assemblato durante il progetto speciale per la didattica
|
||||
"Calcolo Parallelo dall'Infrastruttura alla Matematica".
|
||||
</div>
|
||||
</div>
|
||||
</a>
|
||||
<a target="_blank" href="https://seminarietti.phc.dm.unipi.it/" style="--masonry-height: 2;">
|
||||
<div class="project" style="--card-bg: #bd9fec;">
|
||||
<div class="image">
|
||||
<img src="https://seminarietti.phc.dm.unipi.it/favicon.png" alt="Logo Seminarietti" />
|
||||
</div>
|
||||
<div class="title">Seminarietti</div>
|
||||
<div class="description">
|
||||
Varie conferenze del PHC su argomenti di informatica, matematica e tecnologia.
|
||||
</div>
|
||||
</div>
|
||||
</a>
|
||||
<a target="_blank" href="https://tutorato.phc.dm.unipi.it/" style="--masonry-height: 2;">
|
||||
<div class="project" style="--card-bg: #c55;">
|
||||
<div class="image">
|
||||
<img src="https://tutorato.phc.dm.unipi.it/favicon.svg" alt="Logo Tutorato" />
|
||||
</div>
|
||||
<div class="title">Tutorato</div>
|
||||
<div class="description">
|
||||
Un sito con tutte le informazioni sui tutorati di Matematica, con tanto di archivio
|
||||
degli anni passati.
|
||||
</div>
|
||||
</div>
|
||||
</a>
|
||||
<ProjectCard
|
||||
title="Gitea"
|
||||
href="https://git.phc.dm.unipi.it/"
|
||||
imgSrc="https://upload.wikimedia.org/wikipedia/commons/b/bb/Gitea_Logo.svg"
|
||||
style="--card-bg: rgb(150, 197, 150); --masonry-height: 2;"
|
||||
>
|
||||
<p>Gitea è un servizio di hosting per progetti software, come GitHub ma autogestito.</p>
|
||||
<p>
|
||||
Qui puoi trovare i progetti del PHC, e accedendo con un account di Ateneo potrai crearne
|
||||
di nuovi.
|
||||
</p>
|
||||
</ProjectCard>
|
||||
<!-- <ProjectCard
|
||||
title="PHC-Bot"
|
||||
href="#"
|
||||
style="--card-bg: #c55; --masonry-height: 1;"
|
||||
>
|
||||
<p>Un bot con cui chattare per chiedere informazioni o supporto tecnico.</p>
|
||||
</ProjectCard> -->
|
||||
<ProjectCard
|
||||
title="Orario"
|
||||
href="https://lab.phc.dm.unipi.it/orario/"
|
||||
style="--card-bg: #75ca75; --masonry-height: 1;"
|
||||
imgSrc="https://lab.phc.dm.unipi.it/orario/icon.png"
|
||||
>
|
||||
<p>
|
||||
Questo sito permette di visualizzare il proprio orario delle lezioni, con informazioni sui
|
||||
docenti e le aule.
|
||||
</p>
|
||||
</ProjectCard>
|
||||
<ProjectCard
|
||||
title="Problemi"
|
||||
href="https://lab.phc.dm.unipi.it/problemi/"
|
||||
style="--card-bg: #aa88c0; --masonry-height: 2;"
|
||||
imgSrc="https://lab.phc.dm.unipi.it/problemi/favicon/android-chrome-512x512.png"
|
||||
>
|
||||
<p>Bacheca di problemi di Matematica da risolvere, inviandone le soluzioni in LaTeX.</p>
|
||||
<p>Di sera, puoi leggere i problemi sullo schermo del Dipartimento in atrio.</p>
|
||||
</ProjectCard>
|
||||
<ProjectCard
|
||||
title='Cluster "Steffè"'
|
||||
href="http://steffe.cs.dm.unipi.it/"
|
||||
style="--masonry-height: 2;"
|
||||
imgSrc="https://steffe.lb.cs.dm.unipi.it/assets/img/logo.png"
|
||||
>
|
||||
<p>
|
||||
Cluster progettato ed assemblato durante il progetto speciale per la didattica "Calcolo
|
||||
Parallelo dall'Infrastruttura alla Matematica".
|
||||
</p>
|
||||
</ProjectCard>
|
||||
<ProjectCard
|
||||
title="Seminarietti"
|
||||
href="https://seminarietti.phc.dm.unipi.it/"
|
||||
style="--card-bg: #bd9fec; --masonry-height: 2;"
|
||||
imgSrc="https://seminarietti.phc.dm.unipi.it/favicon.png"
|
||||
>
|
||||
<p>Varie conferenze del PHC su argomenti di informatica, matematica e tecnologia.</p>
|
||||
</ProjectCard>
|
||||
<ProjectCard
|
||||
title="Tutorato"
|
||||
href="https://tutorato.phc.dm.unipi.it/"
|
||||
style="--card-bg: #c55; --masonry-height: 2;"
|
||||
imgSrc="https://tutorato.phc.dm.unipi.it/favicon.svg"
|
||||
>
|
||||
<p>
|
||||
Un sito con tutte le informazioni sui tutorati di Matematica, con tanto di archivio degli
|
||||
anni passati.
|
||||
</p>
|
||||
</ProjectCard>
|
||||
</div>
|
||||
</section>
|
||||
<section class="wanna-be-macchinista">
|
||||
<div class="zig-zag">
|
||||
<svg
|
||||
width="100%"
|
||||
height="2rem"
|
||||
viewBox="0 0 1 1"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
preserveAspectRatio="xMinYMid meet"
|
||||
>
|
||||
<defs>
|
||||
<pattern id="zig-zag-3" x="0" y="0" width="2" height="1" patternUnits="userSpaceOnUse">
|
||||
<path fill="#888" d="M 0,1 L 1,0 L 2,1 L 0,1"></path>
|
||||
</pattern>
|
||||
</defs>
|
||||
<rect fill="url(#zig-zag-3)" x="0" y="0" width="1000" height="1"></rect>
|
||||
</svg>
|
||||
</div>
|
||||
<span></span>
|
||||
<span></span>
|
||||
<div class="card large" style="--card-base: #ddd;">
|
||||
<div class="title">E cosa si fa in PHC?</div>
|
||||
<HomepageZigZag color="#888" />
|
||||
|
||||
<div class="title"></div>
|
||||
|
||||
<Card large style="--card-base: #ddd;">
|
||||
<div class="title" title="recentemente, anche il caffè">E cosa si fa in PHC?</div>
|
||||
<div class="text">
|
||||
<p>Nessuno lo sa di preciso, ma facciamo molte cose:</p>
|
||||
<ul>
|
||||
@@ -232,7 +166,7 @@ const galleryCollage = await Astro.glob('@/assets/gallery/*.jpg')
|
||||
e condividere la passione per la tecnologia.
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</Card>
|
||||
<div class="gallery-collage">
|
||||
{
|
||||
galleryCollage.map((module, i) => {
|
||||
@@ -248,14 +182,15 @@ const galleryCollage = await Astro.glob('@/assets/gallery/*.jpg')
|
||||
: [1, 1]
|
||||
|
||||
return (
|
||||
<div class="card" style={`--rows: ${rows}; --cols: ${cols};`}>
|
||||
<Card style={`--rows: ${rows}; --cols: ${cols};`}>
|
||||
<Image src={module.default} alt={`gallery image ${i}`} />
|
||||
</div>
|
||||
</Card>
|
||||
)
|
||||
})
|
||||
}
|
||||
</div>
|
||||
<div class="card large" style="--card-base: #ddd;">
|
||||
|
||||
<Card large style="--card-base: #ddd;">
|
||||
<div class="title">Vuoi diventare macchinista?</div>
|
||||
<div class="text">
|
||||
<p>
|
||||
@@ -268,6 +203,6 @@ const galleryCollage = await Astro.glob('@/assets/gallery/*.jpg')
|
||||
tutti gli effetti.
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</Card>
|
||||
</section>
|
||||
</PageLayout>
|
||||
|
||||
@@ -241,14 +241,8 @@
|
||||
}
|
||||
|
||||
img {
|
||||
object-fit: cover;
|
||||
width: 4rem;
|
||||
height: 4rem;
|
||||
}
|
||||
|
||||
&.cover {
|
||||
img {
|
||||
object-fit: cover;
|
||||
}
|
||||
}
|
||||
|
||||
// &.auto {
|
||||
|
||||
Reference in New Issue
Block a user