Add info box

master
omame 2 years ago
parent d4b1c961ae
commit 1a5027eeb6
Signed by untrusted user: omame
GPG Key ID: B8B8157B11168D28
  1. 28
      public/images/hamburger-dark.svg
  2. 28
      public/images/hamburger-light.svg
  3. BIN
      public/images/preview_light.png
  4. 4
      src/App.tsx
  5. 0
      src/assets/images/cyber-logo.svg
  6. 0
      src/assets/images/preview.png
  7. 2
      src/components/CustomGlobalStyles.ts
  8. 4
      src/components/Footer.tsx
  9. 15
      src/components/Index.tsx
  10. 7
      src/components/Navbar.tsx
  11. 24
      src/components/index/Index.tsx
  12. 31
      src/components/index/InfoBox.tsx
  13. 6
      tailwind.config.js
  14. 9
      webpack.config.js

@ -1,28 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" width="256" height="256" viewBox="0 0 67.733332 67.733335" version="1.1" id="svg8" inkscape:version="1.0.2 (e86c870879, 2021-01-15)" sodipodi:docname="hamburger.svg">
<defs id="defs2" />
<sodipodi:namedview id="base" pagecolor="#ffffff" bordercolor="#666666" borderopacity="1.0" inkscape:pageopacity="0.0" inkscape:pageshadow="2" inkscape:zoom="1.3068441" inkscape:cx="95.50416" inkscape:cy="132.903" inkscape:document-units="mm" inkscape:current-layer="layer1" inkscape:document-rotation="0" showgrid="false" units="px" inkscape:snap-bbox="false" inkscape:snap-midpoints="true" inkscape:window-width="1366" inkscape:window-height="675" inkscape:window-x="0" inkscape:window-y="0" inkscape:window-maximized="1">
<sodipodi:guide position="0,33.866669" orientation="0,127.99999" id="guide71" />
<sodipodi:guide position="33.866665,33.866669" orientation="-127.99999,0" id="guide73" />
</sodipodi:namedview>
<metadata id="metadata5">
<rdf:RDF>
<cc:Work rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title></dc:title>
</cc:Work>
</rdf:RDF>
</metadata>
<g inkscape:label="Layer 1" inkscape:groupmode="layer" id="layer1">
<rect style="fill:#ffffff;stroke:none;stroke-width:0.0698019" id="rect18" width="52.916668" height="6.6145835" x="7.4083309" y="13.229167" />
<rect style="fill:#ffffff;stroke:none;stroke-width:0.0698019" id="rect18-3" width="52.916668" height="6.6145835" x="7.4083314" y="30.559372" />
<rect style="fill:#ffffff;stroke:none;stroke-width:0.0698019" id="rect18-6" width="52.916668" height="6.6145835" x="7.4083333" y="47.095833" />
</g>
</svg>

Before

Width:  |  Height:  |  Size: 2.1 KiB

@ -1,28 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" width="256" height="256" viewBox="0 0 67.733332 67.733335" version="1.1" id="svg8" inkscape:version="1.0.2 (e86c870879, 2021-01-15)" sodipodi:docname="hamburger.svg">
<defs id="defs2" />
<sodipodi:namedview id="base" pagecolor="#ffffff" bordercolor="#666666" borderopacity="1.0" inkscape:pageopacity="0.0" inkscape:pageshadow="2" inkscape:zoom="1.3068441" inkscape:cx="95.50416" inkscape:cy="132.903" inkscape:document-units="mm" inkscape:current-layer="layer1" inkscape:document-rotation="0" showgrid="false" units="px" inkscape:snap-bbox="false" inkscape:snap-midpoints="true" inkscape:window-width="1366" inkscape:window-height="675" inkscape:window-x="0" inkscape:window-y="0" inkscape:window-maximized="1">
<sodipodi:guide position="0,33.866669" orientation="0,127.99999" id="guide71" />
<sodipodi:guide position="33.866665,33.866669" orientation="-127.99999,0" id="guide73" />
</sodipodi:namedview>
<metadata id="metadata5">
<rdf:RDF>
<cc:Work rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title></dc:title>
</cc:Work>
</rdf:RDF>
</metadata>
<g inkscape:label="Layer 1" inkscape:groupmode="layer" id="layer1">
<rect style="fill:#000000;stroke:none;stroke-width:0.0698019" id="rect18" width="52.916668" height="6.6145835" x="7.4083309" y="13.229167" />
<rect style="fill:#000000;stroke:none;stroke-width:0.0698019" id="rect18-3" width="52.916668" height="6.6145835" x="7.4083314" y="30.559372" />
<rect style="fill:#000000;stroke:none;stroke-width:0.0698019" id="rect18-6" width="52.916668" height="6.6145835" x="7.4083333" y="47.095833" />
</g>
</svg>

Before

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 MiB

@ -1,6 +1,6 @@
import React from 'react'
import { HashRouter, Route, Switch } from 'react-router-dom'
import Index from '@/components/Index'
import Index from '@/components/index/Index'
import tw from 'twin.macro'
import Navbar from '@/components/Navbar'
import Footer from '@/components/Footer'
@ -10,7 +10,7 @@ const App = (): JSX.Element => {
<HashRouter>
<div>
<Navbar />
<div css={tw`mx-4 my-24`}>
<div>
<Switch>
<Route path="/" exact>
<Index/>

Before

Width:  |  Height:  |  Size: 3.2 KiB

After

Width:  |  Height:  |  Size: 3.2 KiB

Before

Width:  |  Height:  |  Size: 1.3 MiB

After

Width:  |  Height:  |  Size: 1.3 MiB

@ -3,7 +3,7 @@ import tw from 'twin.macro'
export default createGlobalStyle`
body {
${tw`w-full overflow-hidden bg-light-bg-primary dark:bg-dark-bg-primary text-light-text-default dark:text-dark-text-default`};
${tw`w-full bg-light-bg-primary dark:bg-dark-bg-primary text-light-text-default dark:text-dark-text-default`};
height: 100vh;
}

@ -4,9 +4,9 @@ import tw from 'twin.macro'
const Footer = (): JSX.Element => {
return (
<div
css={tw`w-full bg-light-bg-secondary dark:bg-dark-bg-secondary py-4 text-center`}
css={tw`w-full bg-light-bg-tertiary dark:bg-dark-bg-tertiary py-4 text-center`}
>
Copyleft 🄯 Copyright © CyberOS Team 20202021
Copyright &copy; CyberOS Team 20202021
<br />
<span css={tw`italic`}>
Psst, this website is a work-in-progress. You can help by{' '}

@ -1,15 +0,0 @@
import React from 'react'
import tw from 'twin.macro'
const Index = (): JSX.Element => {
return (
<div css={tw`max-w-5xl mx-auto`}>
<p css={tw`text-4xl my-4 text-center`}>
A Linux distribution built with Qt Quick and Arch Linux.
</p>
<img css={tw`rounded-lg`} src="./images/preview_light.png"></img>
</div>
)
}
export default Index

@ -1,19 +1,20 @@
import React from 'react'
import styled from 'styled-components'
import tw from 'twin.macro'
import Logo from '@/assets/images/cyber-logo.svg'
const NavbarLink = styled.a`${tw`m-2 inline-block no-underline hover:underline`}`
const Navbar = (): JSX.Element => {
return (
<div
css={tw`w-full absolute top-0 bg-light-bg-secondary dark:bg-dark-bg-secondary flex justify-evenly items-center h-20`}
css={tw`w-full sticky top-0 bg-light-bg-tertiary dark:bg-dark-bg-tertiary flex justify-around items-center h-20`}
>
<a href="#/" css={tw`flex text-3xl items-center `}>
<img
css={tw`w-14 h-14 mr-2`}
css={tw`w-14 h-14 mx-4`}
alt="CyberOS"
src="./images/cyber-logo.svg"
src={Logo}
/>
CyberOS
</a>

@ -0,0 +1,24 @@
import React from 'react'
import tw from 'twin.macro'
import Preview from '@/assets/images/preview.png'
import InfoBox from './InfoBox'
const Index = (): JSX.Element => {
return (
<div>
<p css={tw`text-4xl my-4 text-center px-8`}>
A Linux distribution built with Qt Quick and Arch Linux.
</p>
<div css={tw`w-full flex justify-center px-8 mb-8`}>
<img css={tw`rounded-lg max-w-5xl w-full`} src={Preview}/>
</div>
<div css={tw`w-full`}>
<InfoBox header="An experience you have never seen before." description="insert text here" iconPath=""/>
<InfoBox reverse header="Insert title here" description="more text" iconPath=""/>
</div>
</div>
)
}
export default Index

@ -0,0 +1,31 @@
import React from 'react'
import tw from 'twin.macro'
export type InfoBoxProps = {
header: string,
description: string,
iconPath: string,
reverse?: boolean
}
const InfoBox = (props: InfoBoxProps): JSX.Element => {
return (
<div css={[tw`w-full flex justify-evenly items-center p-8`, !props.reverse ? tw`bg-light-bg-secondary dark:bg-dark-bg-secondary` : {}]}>
{props.reverse ? <>
<div css={tw`w-full max-w-xl`}>
<p css={tw`text-light-text-disabled dark:text-dark-text-disabled text-xl md:text-2xl`}>{props.header}</p>
<p>{props.description}</p>
</div>
<img src={props.iconPath} css={tw`w-24 md:w-48 h-24 md:h-48`}/>
</> : <>
<img src={props.iconPath} css={tw`w-24 md:w-48 h-24 md:h-48`}/>
<div css={tw`text-right w-full max-w-xl`}>
<p css={tw`text-light-text-disabled dark:text-dark-text-disabled text-xl md:text-2xl`}>{props.header}</p>
<p>{props.description}</p>
</div>
</>}
</div>
)
}
export default InfoBox

@ -11,7 +11,8 @@ module.exports = {
light: {
bg: {
primary: '#ffffff',
secondary: '#f5f5f5',
secondary: '#ededed',
tertiary: '#d9d9d9'
},
text: {
default: '#171a20',
@ -22,7 +23,8 @@ module.exports = {
dark: {
bg: {
primary: '#252525',
secondary: '#151515',
secondary: '#202020',
tertiary: '#1c1c1c'
},
text: {
default: '#ffffff',

@ -37,6 +37,12 @@ module.exports = {
use: {
loader: 'url-loader'
}
},
{
test: /\.svg$/,
use: {
loader: 'svg-url-loader'
}
}
]
},
@ -50,6 +56,7 @@ module.exports = {
devServer: {
contentBase: './public',
compress: true,
port: 9000
port: 9000,
overlay: true
}
}

Loading…
Cancel
Save