some stuff
parent
90663f3bfe
commit
cb992c955a
File diff suppressed because it is too large
Load Diff
@ -1,13 +0,0 @@
|
||||
import { lazy } from "solid-js";
|
||||
import { Routes, Route, Link } from "solid-app-router";
|
||||
|
||||
function App() {
|
||||
return (
|
||||
<div>
|
||||
<h2>App</h2>
|
||||
<p>Some other stuff</p>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
export default App;
|
@ -0,0 +1,17 @@
|
||||
import type { Component } from "solid-js";
|
||||
import { useRoutes, useLocation } from "solid-app-router";
|
||||
|
||||
import { routes } from "./routes"
|
||||
|
||||
const App: Component = () => {
|
||||
const location = useLocation();
|
||||
const Route = useRoutes(routes);
|
||||
document.title += location.pathname
|
||||
return (
|
||||
<div>
|
||||
<Route />
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
export default App;
|
@ -0,0 +1,18 @@
|
||||
import axios from "axios";
|
||||
|
||||
const API_URL = "/api/auth"
|
||||
|
||||
const register = async (username: string, email: string, password: string) => {
|
||||
axios.post(API_URL + "/register", {
|
||||
username,
|
||||
email,
|
||||
password
|
||||
}).then(
|
||||
responce => {
|
||||
if (responce.data.username) {
|
||||
|
||||
}
|
||||
return responce
|
||||
}
|
||||
);
|
||||
}
|
@ -0,0 +1,23 @@
|
||||
import { Component, ComponentProps, JSX } from 'solid-js';
|
||||
|
||||
interface burgerProps extends ComponentProps<'span'> {
|
||||
datatarget: string
|
||||
}
|
||||
|
||||
const handelClick: JSX.EventHandler<HTMLSpanElement, MouseEvent> = (e) => {
|
||||
var menu = document.querySelector("#" + e.currentTarget.dataset.target);
|
||||
e.currentTarget.classList.toggle("is-active");
|
||||
menu?.classList.toggle("is-active");
|
||||
}
|
||||
|
||||
const Burger: Component<burgerProps> = (props: burgerProps) => {
|
||||
return (
|
||||
<span onClick={handelClick} class="navbar-burger burger" data-target={props.datatarget} >
|
||||
<span></span>
|
||||
<span></span>
|
||||
<span></span>
|
||||
</span>
|
||||
)
|
||||
}
|
||||
|
||||
export default Burger;
|
@ -0,0 +1,54 @@
|
||||
import { Component } from 'solid-js';
|
||||
import { Link } from "solid-app-router";
|
||||
import Burger from './burger';
|
||||
|
||||
const Navbar: Component = () => {
|
||||
return (
|
||||
<nav class="navbar" role="navigation" aria-label="main navigation">
|
||||
<div class="container">
|
||||
<div class="navbar-brand">
|
||||
<a class="navbar-item" href="/">
|
||||
<h1 class="is-size-2">WOK ABLE</h1>
|
||||
</a>
|
||||
<Burger datatarget='navbarMenu' />
|
||||
</div>
|
||||
<div id="navbarMenu" class="navbar-menu">
|
||||
<div class="navbar-start">
|
||||
<Link class="navbar-item" href="/">
|
||||
<span class="icon">
|
||||
<i class="fa fa-home"></i>
|
||||
</span>
|
||||
<span>Home</span>
|
||||
</Link>
|
||||
<a class="navbar-item" href='https://spahl.ddns.net/jasper'>
|
||||
<span class="icon">
|
||||
<i class="fa-brands fa-git-alt"></i>
|
||||
</span>
|
||||
<span>View Source</span>
|
||||
</a>
|
||||
</div>
|
||||
<div class="navbar-end">
|
||||
<span class="navbar-item">
|
||||
<Link class="button is-dark" href="/register">
|
||||
<span class="icon">
|
||||
<i class="fa fa-user-plus"></i>
|
||||
</span>
|
||||
<span>Register</span>
|
||||
</Link>
|
||||
</span>
|
||||
<span class="navbar-item">
|
||||
<Link class="button is-info" href="/login">
|
||||
<span class="icon">
|
||||
<i class="fa fa-arrow-right-to-bracket"></i>
|
||||
</span>
|
||||
<span>Login</span>
|
||||
</Link>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</nav>
|
||||
)
|
||||
}
|
||||
|
||||
export default Navbar;
|
@ -1,13 +0,0 @@
|
||||
body {
|
||||
margin: 0;
|
||||
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen",
|
||||
"Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue",
|
||||
sans-serif;
|
||||
-webkit-font-smoothing: antialiased;
|
||||
-moz-osx-font-smoothing: grayscale;
|
||||
}
|
||||
|
||||
code {
|
||||
font-family: source-code-pro, Menlo, Monaco, Consolas, "Courier New",
|
||||
monospace;
|
||||
}
|
@ -0,0 +1,10 @@
|
||||
@charset "utf-8";
|
||||
|
||||
body {
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
@import "../node_modules/bulma/bulma.sass";
|
||||
|
||||
$schema-main: $white;
|
||||
$schema-inverted: $black;
|
@ -0,0 +1,16 @@
|
||||
.coolbg {
|
||||
background: linear-gradient(
|
||||
rgba(0, 0, 0, 0.5),
|
||||
rgba(0, 0, 0, 0.5)
|
||||
), url('https://unsplash.it/1200/900?random') no-repeat center center fixed;
|
||||
-webkit-background-size: cover;
|
||||
-moz-background-size: cover;
|
||||
-o-background-size: cover;
|
||||
background-size: cover;
|
||||
}
|
||||
.isomatrix {
|
||||
position: relative;
|
||||
transform-style: preserve-3d;
|
||||
-webkit-transform-style: preserve-3d;
|
||||
transform: rotate(-30deg) skew(30deg)
|
||||
}
|
@ -0,0 +1,8 @@
|
||||
.hero .nav, .hero.is-success .nav {
|
||||
-webkit-box-shadow: none;
|
||||
box-shadow: none;
|
||||
}
|
||||
.hero .subtitle {
|
||||
padding: 3rem 0;
|
||||
line-height: 1.5;
|
||||
}
|
@ -0,0 +1,29 @@
|
||||
import { Link } from 'solid-app-router';
|
||||
import { Component } from 'solid-js';
|
||||
import Navbar from "../componets/navbar";
|
||||
import styles from "./home.module.scss";
|
||||
import "./home.scss";
|
||||
|
||||
const Home: Component = () => {
|
||||
return (
|
||||
<>
|
||||
<section class={`hero is-info ${styles.coolbg}`}>
|
||||
<div class={`hero-body`}>
|
||||
<div class="container has-text-centered">
|
||||
<div class="column is-6 is-offset-3">
|
||||
<h1 class="title">
|
||||
Wok Able
|
||||
</h1>
|
||||
<h2 class="subtitle">
|
||||
The easy to use vacabulary learing system
|
||||
</h2>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
<Navbar />
|
||||
</>
|
||||
)
|
||||
}
|
||||
|
||||
export default Home;
|
@ -1,15 +0,0 @@
|
||||
import { Component, ComponentProps } from 'solid-js';
|
||||
|
||||
interface indexProps extends ComponentProps<any> {
|
||||
// add props here
|
||||
}
|
||||
|
||||
const index: Component<indexProps> = (props: indexProps) => {
|
||||
return (
|
||||
<div>
|
||||
<h2>index</h2>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
export default index;
|
@ -0,0 +1,11 @@
|
||||
import { lazy } from "solid-js";
|
||||
import type { RouteDefinition } from "solid-app-router";
|
||||
|
||||
import Home from "./pages/home"
|
||||
|
||||
export const routes: RouteDefinition[] = [
|
||||
{
|
||||
path: "/",
|
||||
component: Home
|
||||
}
|
||||
]
|
@ -0,0 +1,9 @@
|
||||
import { createEffect } from "solid-js";
|
||||
import { Store, SetStoreFunction, createStore } from "solid-js/store"
|
||||
|
||||
export function createLocalStore<T>(initState: T, name: string): [Store<T>, SetStoreFunction<T>] {
|
||||
const [state, setState] = createStore(initState);
|
||||
if (localStorage[name]) setState(JSON.parse(localStorage[name]))
|
||||
createEffect(() => (localStorage[name] = JSON.stringify(state)))
|
||||
return [state, setState]
|
||||
}
|
Loading…
Reference in New Issue