Skip to content

Commit

Permalink
initial (broken) commit
Browse files Browse the repository at this point in the history
  • Loading branch information
Kilian committed Nov 14, 2015
0 parents commit 85d8819
Show file tree
Hide file tree
Showing 23 changed files with 886 additions and 0 deletions.
20 changes: 20 additions & 0 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"stage": 0,
"env": {
"development": {
"plugins": ["react-transform"],
"extra": {
"react-transform": {
"transforms": [{
"transform": "react-transform-hmr",
"imports": ["react"],
"locals": ["module"]
}, {
"transform": "react-transform-catch-errors",
"imports": ["react", "redbox-react"]
}]
}
}
}
}
}
19 changes: 19 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
root = true

[*]
indent_style = tab
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true

[*.{json,js,jsx,html,css}]
indent_style = space
indent_size = 2

[.eslintrc]
indent_style = space
indent_size = 2

[*.md]
trim_trailing_whitespace = false
21 changes: 21 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"extends": "airbnb",
"env": {
"browser": true,
"mocha": true,
"node": true
},
"rules": {
"react/jsx-uses-react": 2,
"react/jsx-uses-vars": 2,
"react/react-in-jsx-scope": 2,

"no-var": 0,
"vars-on-top": 0,
"comma-dangle": 0,
"no-use-before-define": 0
},
"plugins": [
"react"
]
}
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* text=auto
34 changes: 34 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# Logs
logs
*.log

# Runtime data
pids
*.pid
*.seed

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov

# Coverage directory used by tools like istanbul
coverage

# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
.grunt

# node-waf configuration
.lock-wscript

# Compiled binary addons (http://nodejs.org/api/addons.html)
build/Release

# Dependency directory
# https://www.npmjs.org/doc/misc/npm-faq.html#should-i-check-my-node_modules-folder-into-git
node_modules

# OSX
.DS_Store

# App packaged
dist
release
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
The MIT License (MIT)

Copyright (c) 2015 Kilian Valkhof

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
27 changes: 27 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# FromScratch

A simple autosaving scratchpad using Fira code. Built with Electron, React and Webpack using https://github.com/chentsulin/electron-react-boilerplate

## Currently broken :(

* Writing the file to disk on change somehow triggers a second paste, tab and newline (Problem in React/Electron)
* When built, the Fira Code font isn't loaded correctly. (Problem in ...Webpack?)

### Usage
```sh
# Download from git
git clone https://github.com/kilian/fromscratch.git

# Install dependencies
cd fromscratch && npm install

# build and run
npm build
electron main.js

# or run dev version
npm run hot-server

#in a different terminal:
npm run start-hot
```
11 changes: 11 additions & 0 deletions app/app.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>FromScratch</title>
</head>
<body>
<div id="react-root"></div>
<script src="../dist/bundle.js"></script>
</body>
</html>
Binary file added app/assets/font/FiraCode-Regular.otf
Binary file not shown.
Binary file added app/assets/img/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
147 changes: 147 additions & 0 deletions app/assets/img/icon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
25 changes: 25 additions & 0 deletions app/assets/style/_cm-theme.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
.cm-s-fromscratch {
&.CodeMirror {
background: $bgColor;
color: $textColor;
}
div.CodeMirror-selected {
background: lighten($bgColor, 6%);
color: lighten($textColor, 15%);
}
.CodeMirror-line::selection,
.CodeMirror-line > span::selection,
.CodeMirror-line > span > span::selection {
background: lighten($bgColor, 6%);
color: lighten($textColor, 15%);
}
.CodeMirror-cursor {
border-left: 1px solid darken($textColor,5%);
}
.CodeMirror-activeline-background {
background: lighten($bgColor, 6%);
}
}


.CodeMirror-measure {display:none !important;}
62 changes: 62 additions & 0 deletions app/assets/style/app.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
@charset "UTF-8";

$bgColor: rgb(0, 43, 54);
$textColor: rgb(130, 150, 150);

@font-face {
font-family: "FiraCode";
src: url(../font/FiraCode-Regular.otf) format("opentype");
font-weight:normal;
font-style:normal;
}

html {
box-sizing: border-box;
height:100%;
width: 100%;
overflow: hidden;
}
*, *:before, *:after {
box-sizing: inherit;
margin:0;
padding:0;
}

body {
height:100%;
min-height:100%;
font-family:"FiraCode";
overflow:hidden;
font-size:100%;
line-height:1.25;
background:$bgColor;
color:$textColor;
-webkit-font-feature-settings:"liga", "dlig";
font-feature-settings:"liga", "dlig";
padding:0;
margin:0;
-webkit-overflow-scrolling: touch;
}

#react-root,
.ReactCodeMirror {
position:absolute;
top:0;
right:0;
bottom:0;
left:0;
}

.CodeMirror {
margin:3rem;
width:calc(100% - 6rem);
height:100%;
background:inherit;
color:inherit;
font-family:inherit;
font-size:inherit;
line-height:inherit;
}

@import "../../../node_modules/react-codemirror/node_modules/codemirror/lib/codemirror.css";
@import "_cm-theme.scss"
Loading

0 comments on commit 85d8819

Please sign in to comment.