testing workflows #32

Merged
SinusFox merged 16 commits from GitHub-Pages into testing 2024-09-24 15:41:24 +00:00
4 changed files with 85 additions and 9 deletions
Showing only changes of commit 312e4ae1f5 - Show all commits
+21 -2
View File
@@ -54,8 +54,16 @@ body {
}
.button {
border: 2px solid #101010;
background-color: #101010;
border: 2px solid #5353535c;
background-color: #1010105c;
border-radius: 20px;
margin: 10px;
padding: 10px;
}
.button:hover {
border: 2px solid #5353535c;
background-color: #5353535c;
border-radius: 20px;
margin: 10px;
padding: 10px;
@@ -139,3 +147,14 @@ body {
font-size: 10;
height: fit-content 100%;
}
.popup_bg {
width: 2000px;
padding: 20px;
box-shadow: 0 2px 10px #7c7c7c;
background: black;
}
.popup-overlay {
background: rgba(0, 0, 0, 0.5);
}
+36 -3
View File
@@ -1,4 +1,5 @@
import { MouseEventHandler } from "react";
import Popup from "reactjs-popup";
export function Box({title, placeholder, id}:
{title:string; placeholder:string; id:string}) {
@@ -12,7 +13,7 @@ export function Box({title, placeholder, id}:
className="body_box"
id={id}
wrap="soft"
required
rows={6}
placeholder={placeholder}
></textarea>
</div>
@@ -21,13 +22,12 @@ export function Box({title, placeholder, id}:
}
export function Button({title, className, onClickFunc}:
{title:string; className:string; onClickFunc: MouseEventHandler}) {
{title:string; className:string|undefined; onClickFunc: MouseEventHandler}) {
return(
<button
className={className}
onClick={onClickFunc}
type="submit"
>
{title}
</button>
@@ -35,6 +35,39 @@ export function Button({title, className, onClickFunc}:
);
}
export function Popup_Button({title, className}:
{title:string; className:string|undefined;}) {
return(
<Popup
trigger={<button
className={className}>
{title}
</button>}
position="right center"
modal
nested>
{close => (
<div className="popup_bg">
<button onClick={close}>
&times;
</button>
<div className="header"> {title} </div>
<div className="content">
This is a popup example.
</div>
<div className="actions">
<button className="button" onClick={close}>
Cancel</button>
</div>
</div>
)}
</Popup>
);
}
export function Output({id, text}:
{id:string; text:string}) {
+14 -3
View File
@@ -1,7 +1,7 @@
'use client'
import { Box, Button, Output } from "./modules.tsx";
import { test, calculate } from "./scripts.ts"
import { Box, Button, Output, Popup_Button } from "./modules.tsx";
import { calculate_click, import_click, export_click } from "./scripts.ts"
export default function Home() {
return (
@@ -28,10 +28,21 @@ export default function Home() {
<Button
title={"Calculate"}
className={"button_green"}
onClickFunc={calculate} />
onClickFunc={calculate_click} />
<Popup_Button
title={"Import"}
className={"button"} />
<Popup_Button
title={"Export"}
className={"button"} />
<br></br>
<Output
id="out"
text={"Ergebnis"}/>
<Popup_Button
title="Popup"
className="button"
/>
</>
);
+14 -1
View File
@@ -2,16 +2,29 @@ export function test() {
console.log("Dies ist die Testfunktion.");
}
export function calculate() {
export function calculate_click() {
console.log("Calculating...");
let functions:string = document.getElementById('funcs').value;
let variables:string = document.getElementById('vars').value;
let funcs:string[] = functions.split(/; */);
let vars:string[] = variables.split(/; */);
// Irgend ein Interface
// document.getElementById('out').innerHTML = funcs;
// output.innerHTML = functions.innerHTML;
}
export function import_click() {
console.log("Importing...");
}
export function export_click() {
console.log("Exporting...");
}