Skip to content

Commit

Permalink
Merge pull request #51 from kadoshita/add-new-toppage
Browse files Browse the repository at this point in the history
Add new toppage
  • Loading branch information
kadoshita authored Jan 26, 2020
2 parents f6c8307 + b19cf41 commit e7a6f8a
Show file tree
Hide file tree
Showing 10 changed files with 162 additions and 27 deletions.
37 changes: 37 additions & 0 deletions ClientApp/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions ClientApp/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@
"version": "0.1.0",
"private": true,
"dependencies": {
"@fortawesome/fontawesome-svg-core": "^1.2.26",
"@fortawesome/free-brands-svg-icons": "^5.12.0",
"@fortawesome/free-solid-svg-icons": "^5.12.0",
"@fortawesome/react-fontawesome": "^0.1.8",
"@material-ui/core": "^4.8.1",
"@material-ui/icons": "^4.5.1",
"@microsoft/signalr": "^3.1.0",
Expand Down
4 changes: 2 additions & 2 deletions ClientApp/public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@
<meta property="og:type" content="website">
<meta property="og:url" content="https://live-share-editor.azurewebsites.net">
<meta property="og:image" content="https://live-share-editor.azurewebsites.net/logo.png">
<meta property="og:description" content="リアルタイムでソースコードを共有するオンラインエディタ - Live Share Editor">
<meta property="og:description" content="ソースコードをリアルタイムで共有できるオンラインエディタ - Live Share Editor">
<meta name="twitter:card" content="summary">
<meta name="twitter:site" content="@lz650sss">
<meta name="twitter:title" content="Live Share Editor">
<meta name="twitter:description" content="リアルタイムでソースコードを共有するオンラインエディタ - Live Share Editor">
<meta name="twitter:description" content="ソースコードをリアルタイムで共有できるオンラインエディタ - Live Share Editor">
<meta name="twitter:image" content="https://live-share-editor.azurewebsites.net/logo.png">
<meta name="twitter:url" content="https://live-share-editor.azurewebsites.net" />
<!--
Expand Down
Binary file added ClientApp/public/screenshot.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion ClientApp/src/components/Editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ export class Editor extends Component {
<p>行:{this.state.cursorRow} 列:{this.state.cursorCol} 文字数:{this.state.code.length}</p>
</Grid>
<Grid item xs={2}>
<Button fullWidth color='primary' variant='contained' onClick={() => this.togglInputDialogBinded(true)} disabled={this.state.isRunning}>▶ 実行</Button>
<Button fullWidth color='secondary' variant='contained' onClick={() => this.togglInputDialogBinded(true)} disabled={this.state.isRunning}>▶ 実行</Button>
<InputDialog show={this.state.showInputDialog} togglOpen={this.togglInputDialogBinded} setStdin={this.setStdinBinded} stdin={this.state.stdin}></InputDialog>
</Grid>
</Grid>
Expand Down
92 changes: 75 additions & 17 deletions ClientApp/src/components/Home.js
Original file line number Diff line number Diff line change
@@ -1,26 +1,84 @@
import React, { Component } from 'react';
import { Grid, Button, Paper, Fade } from '@material-ui/core';
import { Link } from 'react-router-dom';
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
import { faGithub, faTwitter } from '@fortawesome/free-brands-svg-icons';
import { faShareSquare, faCode, faTerminal } from '@fortawesome/free-solid-svg-icons';

export class Home extends Component {
static displayName = Home.name;
constructor(props) {
super(props);
this.state = {
isHoverItem1: false,
isHoverItem2: false,
isHoverItem3: false
};
}

render () {
render() {
return (
<div>
<h1>Hello, world!</h1>
<p>Welcome to your new single-page application, built with:</p>
<ul>
<li><a href='https://get.asp.net/'>ASP.NET Core</a> and <a href='https://msdn.microsoft.com/en-us/library/67ef8sbd.aspx'>C#</a> for cross-platform server-side code</li>
<li><a href='https://facebook.github.io/react/'>React</a> for client-side code</li>
<li><a href='http://getbootstrap.com/'>Bootstrap</a> for layout and styling</li>
</ul>
<p>To help you get started, we have also set up:</p>
<ul>
<li><strong>Client-side navigation</strong>. For example, click <em>Counter</em> then <em>Back</em> to return here.</li>
<li><strong>Development server integration</strong>. In development mode, the development server from <code>create-react-app</code> runs in the background automatically, so your client-side resources are dynamically built on demand and the page refreshes when you modify any file.</li>
<li><strong>Efficient production builds</strong>. In production mode, development-time features are disabled, and your <code>dotnet publish</code> configuration produces minified, efficiently bundled JavaScript files.</li>
</ul>
<p>The <code>ClientApp</code> subdirectory is a standard React application based on the <code>create-react-app</code> template. If you open a command prompt in that directory, you can run <code>npm</code> commands such as <code>npm test</code> or <code>npm install</code>.</p>
</div>
<Grid container spacing={4}>
<Grid item xs={12} style={{ textAlign: 'center' }}>
<h1 style={{ color: '#55B2B8' }}>Live Share Editor</h1>
<h2>ソースコードをリアルタイムで共有できるオンラインエディタ</h2>
<Link to='/editor'>
<Button variant='outlined' color='primary'>作業を始める</Button>
</Link>
</Grid>
<Grid item xs={12}>
<Paper elevation={4}>
<img src='screenshot.png' alt='logo' style={{ width: '100%', height: 'auto', border: '2px solid #F8BBD0' }}></img>
</Paper>
</Grid>
<Grid item xs={12}>
<Grid container spacing={2} style={{ textAlign: 'center' }}>
<Grid item xs={4}>
<Paper elevation={4} onMouseOver={() => this.setState({ isHoverItem1: true })} onMouseLeave={() => this.setState({ isHoverItem1: false })}>
<h3>コーディングをリアルタイムで配信・共有</h3>
<div className='hover-item-parent'>
<FontAwesomeIcon icon={faShareSquare} color='#55B2B8' className='hover-item-icon' fixedWidth size='9x'></FontAwesomeIcon>
<Fade in={this.state.isHoverItem1} className='hover-item-fade'>
<div><p>ASP.NET Core SignalRにより、低遅延でコーディングを配信・共有できます。</p></div>
</Fade>
</div>
</Paper>
</Grid>
<Grid item xs={4}>
<Paper elevation={4} onMouseOver={() => this.setState({ isHoverItem2: true })} onMouseLeave={() => this.setState({ isHoverItem2: false })}>
<h3>12言語・10カラーテーマに対応</h3>
<div className='hover-item-parent'>
<FontAwesomeIcon icon={faCode} color='#F8BBD0' className='hover-item-icon' fixedWidth size='9x'></FontAwesomeIcon>
<Fade in={this.state.isHoverItem2} className='hover-item-fade'>
<div><p>C/C++、C#、Java、Python、PHP、Ruby、Go、JavaScript等、多数の言語のシンタックスハイライトが使用できます。</p></div>
</Fade>
</div>
</Paper>
</Grid>
<Grid item xs={4}>
<Paper elevation={4} onMouseOver={() => this.setState({ isHoverItem3: true })} onMouseLeave={() => this.setState({ isHoverItem3: false })}>
<h3>ブラウザ上で実行結果を確認</h3>
<div className='hover-item-parent'>
<FontAwesomeIcon icon={faTerminal} color='#55B2B8' className='hover-item-icon' fixedWidth size='9x'></FontAwesomeIcon>
<Fade in={this.state.isHoverItem3} className='hover-item-fade'>
<div>
<p><a href='https://wandbox.org' target='_blank' rel='noopener noreferrer'>Wandbox</a>のWebAPIを使用して、書いたコードの実行結果をブラウザ上で確認できます。</p>
</div>
</Fade>
</div>
</Paper>
</Grid>
</Grid>
</Grid>
<Grid item xs={12} style={{ height: '64px', textAlign: 'right' }}>
<a href='https://github.com/kadoshita/live-share-editor' target='_blank' rel='noopener noreferrer'>
<FontAwesomeIcon icon={faGithub} size='3x'></FontAwesomeIcon>
</a>
<a href='https://twitter.com/intent/tweet?text=ソースコードをリアルタイムで共有できるオンラインエディタ - Live Share Editor&url=https%3A%2F%2Flive-share-editor.azurewebsites.net' target='_blank' rel='noopener noreferrer'>
<FontAwesomeIcon icon={faTwitter} size='3x'></FontAwesomeIcon>
</a>
</Grid>
</Grid >
);
}
}
14 changes: 9 additions & 5 deletions ClientApp/src/components/Layout.js
Original file line number Diff line number Diff line change
@@ -1,17 +1,21 @@
import React, { Component } from 'react';
import { Container } from 'reactstrap';
import { NavMenu } from './NavMenu';
import { ThemeProvider } from '@material-ui/core/styles';
import MainTheme from '../theme';

export class Layout extends Component {
static displayName = Layout.name;

render () {
render() {
return (
<div>
<NavMenu />
<Container>
{this.props.children}
</Container>
<ThemeProvider theme={MainTheme}>
<NavMenu />
<Container>
{this.props.children}
</Container>
</ThemeProvider>
</div>
);
}
Expand Down
2 changes: 1 addition & 1 deletion ClientApp/src/components/NavMenu.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export class NavMenu extends Component {
<header>
<Navbar className="navbar-expand-sm navbar-toggleable-sm ng-white border-bottom box-shadow mb-3" light>
<Container>
<NavbarBrand tag={Link} to="/">live_share_editor</NavbarBrand>
<NavbarBrand tag={Link} to="/">Live Share Editor</NavbarBrand>
<NavbarToggler onClick={this.toggleNavbar} className="mr-2" />
<Collapse className="d-sm-inline-flex flex-sm-row-reverse" isOpen={!this.state.collapsed} navbar>
<ul className="navbar-nav flex-grow">
Expand Down
25 changes: 24 additions & 1 deletion ClientApp/src/custom.css
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
/* Provide sufficient contrast against white background */

a {
color: #0366d6;
color: #55B2B8;
}

code {
Expand All @@ -12,3 +13,25 @@ code {
background-color: #1b6ec2;
border-color: #1861ac;
}

.hover-item-parent {
position: relative;
height: 145px;
}

.hover-item-icon {
position: absolute;
left: 0px;
right: 0px;
margin: auto;
align-content: center;
}

.hover-item-fade {
background-color: rgba(235, 235, 235, 0.6);
position: absolute;
top: 0px;
height: 100%;
display: flex;
align-items: center;
}
9 changes: 9 additions & 0 deletions ClientApp/src/theme.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import { createMuiTheme } from '@material-ui/core/styles';

const palette = {
primary: { main: '#55B2B8' },
secondary: { main: '#F8BBD0' }
};
const themeName = 'main theme color';

export default createMuiTheme({ palette, themeName });

0 comments on commit e7a6f8a

Please sign in to comment.