Reworked
This commit is contained in:
38
src/assets/icons/samples.svg
Normal file
38
src/assets/icons/samples.svg
Normal file
@@ -0,0 +1,38 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- Uploaded to: SVG Repo, www.svgrepo.com, Generator: SVG Repo Mixer Tools -->
|
||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||
<svg version="1.1" id="Capa_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"
|
||||
viewBox="0 0 297.5 297.5" xml:space="preserve">
|
||||
<g id="XMLID_40_">
|
||||
<g>
|
||||
<path style="fill:#ACBFC7;" d="M277.71,158.52v85.7H19.79v-85.7h6.53v40.54c0,16.98,13.81,30.78,30.78,30.78
|
||||
s30.78-13.8,30.78-30.78v-40.54h30.09v40.54c0,16.98,13.81,30.78,30.78,30.78c16.98,0,30.78-13.8,30.78-30.78v-40.54h30.1v40.54
|
||||
c0,16.98,13.8,30.78,30.78,30.78c16.97,0,30.78-13.8,30.78-30.78v-40.54H277.71z"/>
|
||||
<rect x="218.66" y="53.28" style="fill:#CDD9DD;" width="43.49" height="10.53"/>
|
||||
<rect x="229.17" y="83.35" style="fill:#CDD9DD;" width="22.48" height="23.92"/>
|
||||
<rect x="137.51" y="83.35" style="fill:#CDD9DD;" width="22.48" height="23.92"/>
|
||||
<rect x="127.01" y="53.28" style="fill:#CDD9DD;" width="43.49" height="10.53"/>
|
||||
<rect x="35.35" y="53.28" style="fill:#CDD9DD;" width="43.49" height="10.53"/>
|
||||
<rect x="45.86" y="83.35" style="fill:#CDD9DD;" width="22.48" height="23.92"/>
|
||||
<path style="fill:#FF4855;" d="M251.65,126.81v72.25c0,6.2-5.05,11.24-11.24,11.24c-6.2,0-11.24-5.04-11.24-11.24v-72.25H251.65z"
|
||||
/>
|
||||
<path style="fill:#D61616;" d="M68.34,126.81v72.25c0,6.2-5.04,11.24-11.24,11.24s-11.24-5.04-11.24-11.24v-72.25H68.34z"/>
|
||||
<path style="fill:#FFD63F;" d="M159.99,126.81v72.25c0,6.2-5.04,11.24-11.24,11.24s-11.24-5.04-11.24-11.24v-72.25H159.99z"/>
|
||||
<path d="M297.25,148.75v105.24c0,5.4-4.37,9.77-9.77,9.77H10.02c-5.39,0-9.77-4.37-9.77-9.77V148.75c0-5.4,4.38-9.77,9.77-9.77
|
||||
h16.3V83.35h-0.74c-5.39,0-9.77-4.38-9.77-9.77V43.51c0-5.4,4.38-9.77,9.77-9.77h63.03c5.4,0,9.77,4.37,9.77,9.77v30.07
|
||||
c0,5.39-4.37,9.77-9.77,9.77h-0.73v55.63h30.09V83.35h-0.73c-5.4,0-9.77-4.38-9.77-9.77V43.51c0-5.4,4.37-9.77,9.77-9.77h63.03
|
||||
c5.39,0,9.77,4.37,9.77,9.77v30.07c0,5.39-4.38,9.77-9.77,9.77h-0.74v55.63h30.1V83.35h-0.74c-5.39,0-9.77-4.38-9.77-9.77V43.51
|
||||
c0-5.4,4.38-9.77,9.77-9.77h63.03c5.4,0,9.77,4.37,9.77,9.77v30.07c0,5.39-4.37,9.77-9.77,9.77h-0.73v55.63h16.29
|
||||
C292.88,138.98,297.25,143.35,297.25,148.75z M277.71,244.22v-85.7h-6.52v40.54c0,16.98-13.81,30.78-30.78,30.78
|
||||
c-16.98,0-30.78-13.8-30.78-30.78v-40.54h-30.1v40.54c0,16.98-13.8,30.78-30.78,30.78c-16.97,0-30.78-13.8-30.78-30.78v-40.54
|
||||
H87.88v40.54c0,16.98-13.81,30.78-30.78,30.78s-30.78-13.8-30.78-30.78v-40.54h-6.53v85.7H277.71z M262.15,63.81V53.28h-43.49
|
||||
v10.53H262.15z M251.65,199.06v-72.25h-22.48v72.25c0,6.2,5.04,11.24,11.24,11.24C246.6,210.3,251.65,205.26,251.65,199.06z
|
||||
M251.65,107.27V83.35h-22.48v23.92H251.65z M170.5,63.81V53.28h-43.49v10.53H170.5z M159.99,199.06v-72.25h-22.48v72.25
|
||||
c0,6.2,5.04,11.24,11.24,11.24S159.99,205.26,159.99,199.06z M159.99,107.27V83.35h-22.48v23.92H159.99z M78.84,63.81V53.28H35.35
|
||||
v10.53H78.84z M68.34,199.06v-72.25H45.86v72.25c0,6.2,5.04,11.24,11.24,11.24S68.34,205.26,68.34,199.06z M68.34,107.27V83.35
|
||||
H45.86v23.92H68.34z"/>
|
||||
</g>
|
||||
<g>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
After Width: | Height: | Size: 3.1 KiB |
@@ -1,29 +0,0 @@
|
||||
[[links]]
|
||||
id = "jupyterhub"
|
||||
icon = "https://jupyter.org/assets/homepage/main-logo.svg"
|
||||
|
||||
[links.config]
|
||||
title = "Jupyter Hub"
|
||||
link = "`${window.location.origin}/jupyter`"
|
||||
description = "The main System build on top of Docker"
|
||||
tags = [ "Teaching", "Docker" ]
|
||||
|
||||
[[links]]
|
||||
id = "ifnwebsite"
|
||||
icon = "https://www.tu-braunschweig.de/fileadmin/Logos_Einrichtungen/Institute_FK5/logo_IFN.svg"
|
||||
|
||||
[links.config]
|
||||
title = "IFN Website"
|
||||
link = "https://www.tu-braunschweig.de/ifn"
|
||||
description = "All about the Institut"
|
||||
tags = [ "Info" ]
|
||||
|
||||
[[links]]
|
||||
id = "course-prog"
|
||||
icon = "https://www.tu-braunschweig.de/fileadmin/Logos_Einrichtungen/Institute_FK5/logo_IFN.svg"
|
||||
|
||||
[links.config]
|
||||
title = "Course Site"
|
||||
link = "https://www.tu-braunschweig.de/ifn/edu/ws/einfuehrung-in-die-programmierung-fuer-nicht-informatiker"
|
||||
description = "Stuff about Einführung in die Programmierung für NichtInformatiker*innen"
|
||||
tags = [ "Info", "Teaching" ]
|
1
src/assets/links.toml
Symbolic link
1
src/assets/links.toml
Symbolic link
@@ -0,0 +1 @@
|
||||
links.toml
|
@@ -1,7 +1,6 @@
|
||||
import './style.css';
|
||||
|
||||
const Tag = ({ tag }) => {
|
||||
console.log(tag)
|
||||
return (
|
||||
<div class="link-tag">
|
||||
{tag}
|
||||
@@ -11,8 +10,6 @@ const Tag = ({ tag }) => {
|
||||
|
||||
const LinkItem = ({ linkData }) => {
|
||||
const { config, icon } = linkData;
|
||||
const fullUrl = `${window.location.origin}${config.link}`;
|
||||
console.log(config.tags)
|
||||
return (
|
||||
<a
|
||||
href={config.link}
|
||||
|
@@ -5,7 +5,7 @@
|
||||
}
|
||||
|
||||
.link-item {
|
||||
width: 95%;
|
||||
width: 100%;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
padding: 20px;
|
||||
|
@@ -1,5 +1,7 @@
|
||||
import { useState, useEffect } from 'preact/hooks';
|
||||
import './style.css';
|
||||
import tomlContent from '../../../links.toml?raw';
|
||||
import toml from 'toml';
|
||||
|
||||
// Components
|
||||
|
||||
@@ -35,42 +37,7 @@ for link in links:
|
||||
plt.show()
|
||||
`
|
||||
|
||||
const getMockLinks = () => {
|
||||
return [
|
||||
{
|
||||
id: 'jupyterhub',
|
||||
config: {
|
||||
title: 'Jupyter Hub',
|
||||
link: `${window.location.origin}/jupyter`,
|
||||
description: 'The main System build on top of Docker',
|
||||
tags: ['Teaching', 'Docker']
|
||||
},
|
||||
icon: 'https://jupyter.org/assets/homepage/main-logo.svg'
|
||||
},
|
||||
{
|
||||
id: 'ifnwebsite',
|
||||
config: {
|
||||
title: 'IFN Website',
|
||||
link: 'https://www.tu-braunschweig.de/ifn',
|
||||
description: 'All about the institut',
|
||||
tags: ['Info']
|
||||
},
|
||||
icon: 'https://www.tu-braunschweig.de/fileadmin/Logos_Einrichtungen/Institute_FK5/logo_IFN.svg'
|
||||
},
|
||||
{
|
||||
id: 'course-prog',
|
||||
config: {
|
||||
title: 'Lehrseite',
|
||||
link: 'https://www.tu-braunschweig.de/ifn/edu/ws/einfuehrung-in-die-programmierung-fuer-nicht-informatiker',
|
||||
description: 'Useful Stuff about the course',
|
||||
tags: ['Info', 'Teaching']
|
||||
},
|
||||
icon: 'https://www.tu-braunschweig.de/fileadmin/Logos_Einrichtungen/Institute_FK5/logo_IFN.svg'
|
||||
},
|
||||
];
|
||||
};
|
||||
|
||||
|
||||
const linksData = toml.parse(tomlContent);
|
||||
|
||||
export default function Home() {
|
||||
const [links, setLinks] = useState([]);
|
||||
@@ -79,7 +46,9 @@ export default function Home() {
|
||||
useEffect(() => {
|
||||
const delay = 500 + Math.random() * 1500;
|
||||
const timer = setTimeout(() => {
|
||||
setLinks(getMockLinks())
|
||||
//const links = parseToml('../../assets/links.toml');
|
||||
console.log(linksData.links);
|
||||
setLinks(linksData.links);
|
||||
setLoading(false);
|
||||
}, delay)
|
||||
|
||||
|
Reference in New Issue
Block a user