├── .editorconfig ├── .eslintignore ├── .eslintrc ├── .gitignore ├── .npmignore ├── .travis.yml ├── LICENSE ├── README.md ├── config ├── bs-config.js ├── colors.config.js ├── ef.config.js ├── rollup.base.js ├── rollup.dev.js └── rollup.prod.js ├── dist ├── favicon.png └── index.html ├── package-lock.json ├── package.json ├── src ├── components │ ├── _template │ │ ├── index.js │ │ ├── style.css │ │ └── tpl.ef │ ├── article │ │ ├── index.js │ │ ├── style.css │ │ └── tpl.ef │ ├── banner_logo │ │ ├── index.js │ │ ├── style.css │ │ └── tpl.ef │ ├── body │ │ ├── index.js │ │ ├── style.css │ │ └── tpl.ef │ ├── drawer │ │ ├── index.js │ │ ├── item.ef │ │ ├── section.ef │ │ ├── style.css │ │ └── tpl.ef │ ├── footer │ │ ├── index.js │ │ ├── style.css │ │ └── tpl.ef │ ├── header │ │ ├── index.js │ │ ├── style.css │ │ └── tpl.ef │ ├── logo_page │ │ ├── btn.ef │ │ ├── index.js │ │ ├── style.css │ │ └── tpl.ef │ ├── page │ │ ├── index.js │ │ ├── style.css │ │ └── tpl.ef │ └── text_logo │ │ ├── index.js │ │ ├── style.css │ │ └── tpl.ef ├── demo │ ├── components │ │ ├── logo │ │ │ ├── index.js │ │ │ ├── tpl.ef │ │ │ └── tpl.ef.bak │ │ └── section │ │ │ ├── index.js │ │ │ └── tpl.ef │ ├── demo.js │ ├── loader.js │ └── style.css ├── global.css ├── neonclear.js ├── utils │ └── styled.js └── variables.css └── test ├── favicon.png └── index.html /.editorconfig: -------------------------------------------------------------------------------- 1 | root = true 2 | 3 | [*] 4 | charset = utf-8 5 | indent_style = tab 6 | indent_size = 2 7 | end_of_line = lf 8 | insert_final_newline = true 9 | trim_trailing_whitespace = true 10 | 11 | [package.json] 12 | indent_style = space 13 | -------------------------------------------------------------------------------- /.eslintignore: -------------------------------------------------------------------------------- 1 | build/*.js 2 | config/*.js 3 | test/*.js 4 | *.json 5 | *.ef 6 | *.eft 7 | *.css 8 | -------------------------------------------------------------------------------- /.eslintrc: -------------------------------------------------------------------------------- 1 | { 2 | "env": { 3 | "browser": true, 4 | "commonjs": true, 5 | "es6": true 6 | }, 7 | "globals": { 8 | "process": true 9 | }, 10 | "extends": "eslint:recommended", 11 | "parserOptions": { 12 | "ecmaVersion": 6, 13 | "sourceType": "module", 14 | "ecmaFeatures": { 15 | "experimentalObjectRestSpread": true 16 | } 17 | }, 18 | "rules": { 19 | "accessor-pairs": "error", 20 | "array-bracket-spacing": [ 21 | "error", 22 | "never" 23 | ], 24 | "array-callback-return": "error", 25 | "arrow-body-style": "error", 26 | "arrow-parens": [ 27 | "error", 28 | "as-needed", 29 | { 30 | "requireForBlockBody": true 31 | } 32 | ], 33 | "arrow-spacing": [ 34 | "error", 35 | { 36 | "after": true, 37 | "before": true 38 | } 39 | ], 40 | "block-scoped-var": "error", 41 | "block-spacing": "error", 42 | "brace-style": [ 43 | "error", 44 | "1tbs" 45 | ], 46 | "callback-return": "error", 47 | "camelcase": "warn", 48 | "class-methods-use-this": "error", 49 | "comma-dangle": [ 50 | "error", 51 | "only-multiline" 52 | ], 53 | "comma-spacing": "off", 54 | "comma-style": [ 55 | "error", 56 | "last" 57 | ], 58 | "complexity": "error", 59 | "computed-property-spacing": [ 60 | "error", 61 | "never" 62 | ], 63 | "consistent-return": "off", 64 | "consistent-this": "error", 65 | "curly": "off", 66 | "default-case": "error", 67 | "dot-location": "off", 68 | "dot-notation": "error", 69 | "eol-last": "off", 70 | "eqeqeq": "error", 71 | "func-call-spacing": "error", 72 | "func-names": [ 73 | "error", 74 | "never" 75 | ], 76 | "func-style": [ 77 | "off", 78 | "expression" 79 | ], 80 | "generator-star-spacing": "error", 81 | "global-require": "error", 82 | "guard-for-in": "off", 83 | "handle-callback-err": "error", 84 | "id-blacklist": "error", 85 | "id-length": "off", 86 | "id-match": "error", 87 | "indent": "off", 88 | "init-declarations": "error", 89 | "jsx-quotes": "error", 90 | "key-spacing": "error", 91 | "keyword-spacing": [ 92 | "error", 93 | { 94 | "after": true, 95 | "before": true 96 | } 97 | ], 98 | "line-comment-position": "error", 99 | "linebreak-style": [ 100 | "off" 101 | ], 102 | "lines-around-comment": "error", 103 | "lines-around-directive": "off", 104 | "max-depth": "error", 105 | "max-len": "off", 106 | "max-lines": "off", 107 | "max-nested-callbacks": "error", 108 | "max-params": "error", 109 | "max-statements": "off", 110 | "max-statements-per-line": "error", 111 | "multiline-ternary": "error", 112 | "new-parens": "error", 113 | "newline-after-var": "off", 114 | "newline-before-return": "off", 115 | "newline-per-chained-call": "error", 116 | "no-alert": "error", 117 | "no-array-constructor": "error", 118 | "no-bitwise": "error", 119 | "no-caller": "error", 120 | "no-catch-shadow": "error", 121 | "no-confusing-arrow": "error", 122 | "no-console": "off", 123 | "no-continue": "error", 124 | "no-div-regex": "error", 125 | "no-duplicate-imports": "error", 126 | "no-else-return": "off", 127 | "no-empty-function": "error", 128 | "no-eq-null": "error", 129 | "no-eval": "error", 130 | "no-extend-native": "error", 131 | "no-extra-bind": "error", 132 | "no-extra-label": "error", 133 | "no-extra-parens": "off", 134 | "no-floating-decimal": "error", 135 | "no-global-assign": "error", 136 | "no-implicit-globals": "error", 137 | "no-implied-eval": "error", 138 | "no-inline-comments": "error", 139 | "no-invalid-this": "off", 140 | "no-iterator": "error", 141 | "no-label-var": "error", 142 | "no-labels": "error", 143 | "no-lone-blocks": "error", 144 | "no-lonely-if": "error", 145 | "no-loop-func": "error", 146 | "no-magic-numbers": "off", 147 | "no-mixed-operators": "off", 148 | "no-mixed-requires": "error", 149 | "no-multi-spaces": "error", 150 | "no-multi-str": "error", 151 | "no-multiple-empty-lines": "error", 152 | "no-negated-condition": "error", 153 | "no-nested-ternary": "error", 154 | "no-new": "error", 155 | "no-new-func": "error", 156 | "no-new-object": "error", 157 | "no-new-require": "error", 158 | "no-new-wrappers": "error", 159 | "no-octal-escape": "error", 160 | "no-param-reassign": "off", 161 | "no-path-concat": "error", 162 | "no-plusplus": [ 163 | "error", 164 | { 165 | "allowForLoopAfterthoughts": true 166 | } 167 | ], 168 | "no-process-env": "off", 169 | "no-process-exit": "error", 170 | "no-proto": "error", 171 | "no-prototype-builtins": "error", 172 | "no-restricted-globals": "error", 173 | "no-restricted-imports": "error", 174 | "no-restricted-modules": "error", 175 | "no-restricted-properties": "error", 176 | "no-restricted-syntax": "error", 177 | "no-return-assign": "error", 178 | "no-script-url": "error", 179 | "no-self-compare": "error", 180 | "no-sequences": "error", 181 | "no-shadow": "off", 182 | "no-shadow-restricted-names": "error", 183 | "no-spaced-func": "error", 184 | "no-sync": "error", 185 | "no-tabs": "off", 186 | "no-template-curly-in-string": "error", 187 | "no-ternary": "error", 188 | "no-throw-literal": "error", 189 | "no-trailing-spaces": "error", 190 | "no-undef-init": "error", 191 | "no-undefined": "error", 192 | "no-underscore-dangle": "off", 193 | "no-unmodified-loop-condition": "error", 194 | "no-unneeded-ternary": "error", 195 | "no-unsafe-negation": "error", 196 | "no-unused-expressions": "error", 197 | "no-use-before-define": "error", 198 | "no-useless-call": "error", 199 | "no-useless-computed-key": "error", 200 | "no-useless-concat": "error", 201 | "no-useless-constructor": "error", 202 | "no-useless-escape": "error", 203 | "no-useless-rename": "error", 204 | "no-var": "error", 205 | "no-void": "error", 206 | "no-warning-comments": "error", 207 | "no-whitespace-before-property": "error", 208 | "no-with": "error", 209 | "object-curly-newline": "off", 210 | "object-curly-spacing": [ 211 | "off", 212 | "never" 213 | ], 214 | "object-property-newline": "off", 215 | "object-shorthand": "off", 216 | "one-var": "off", 217 | "one-var-declaration-per-line": "error", 218 | "operator-assignment": "error", 219 | "operator-linebreak": "error", 220 | "padded-blocks": "off", 221 | "prefer-arrow-callback": "error", 222 | "prefer-const": "off", 223 | "prefer-numeric-literals": "error", 224 | "prefer-reflect": "off", 225 | "prefer-rest-params": "error", 226 | "prefer-spread": "error", 227 | "prefer-template": "error", 228 | "quote-props": "off", 229 | "quotes": "off", 230 | "radix": "error", 231 | "require-jsdoc": "off", 232 | "rest-spread-spacing": [ 233 | "error", 234 | "never" 235 | ], 236 | "semi": [ 237 | "warn", 238 | "never" 239 | ], 240 | "semi-spacing": [ 241 | "error", 242 | { 243 | "after": true, 244 | "before": false 245 | } 246 | ], 247 | "sort-imports": "off", 248 | "sort-keys": "off", 249 | "sort-vars": "off", 250 | "space-before-blocks": "error", 251 | "space-before-function-paren": "off", 252 | "space-in-parens": [ 253 | "error", 254 | "never" 255 | ], 256 | "space-infix-ops": "error", 257 | "space-unary-ops": [ 258 | "error", 259 | { 260 | "nonwords": false, 261 | "words": false 262 | } 263 | ], 264 | "spaced-comment": [ 265 | "error", 266 | "always" 267 | ], 268 | "strict": "off", 269 | "symbol-description": "error", 270 | "template-curly-spacing": [ 271 | "error", 272 | "never" 273 | ], 274 | "unicode-bom": [ 275 | "error", 276 | "never" 277 | ], 278 | "valid-jsdoc": "error", 279 | "vars-on-top": "error", 280 | "wrap-iife": "error", 281 | "wrap-regex": "error", 282 | "yield-star-spacing": "error", 283 | "yoda": [ 284 | "error", 285 | "never" 286 | ], 287 | } 288 | } 289 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Generated files 2 | bin/ 3 | gen/ 4 | 5 | # Log Files 6 | *.log 7 | *.log.* 8 | 9 | # Temp Files 10 | *~ 11 | *.*~ 12 | .fuse_* 13 | yarn.lock 14 | cache/ 15 | temp/ 16 | 17 | # Project files 18 | dist/*.js 19 | dist/*.map 20 | test/*.js 21 | test/*.map 22 | 23 | # node modules 24 | node_modules/ 25 | *.tar 26 | -------------------------------------------------------------------------------- /.npmignore: -------------------------------------------------------------------------------- 1 | # Generated files 2 | gen/ 3 | 4 | # Log Files 5 | *.log 6 | *.log.* 7 | 8 | # Temp Files 9 | *~ 10 | *.*~ 11 | .fuse_* 12 | yarn.lock 13 | cache/ 14 | 15 | # Project files 16 | plugins/ 17 | test/ 18 | dist/*.map 19 | dist/*.html 20 | 21 | # node modules 22 | node_modules/ 23 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | script: npm run build 2 | language: node_js 3 | node_js: 4 | - '8' 5 | env: 6 | - BUILD_ENV=CI 7 | cache: 8 | directories: 9 | - node_modules 10 | notifications: 11 | webhooks: https://fathomless-fjord-24024.herokuapp.com/notify 12 | deploy: 13 | provider: releases 14 | api_key: 15 | secure: sHmU/NhAzRpZ8TkC1yDEyZ7FaPdDOxDIi3oq4QgU+6PAQRROdr14N52hz15EuvF4Rh2tKdcjv8y6M+Q6zOjzLVBcfKdTVchp9yOSctzReJd3rmZngv/6vxSyBT1/7LWRmqPJXClvP4Z3OTrCFE/FYrcQuW/SBeb1hPOFT1Jnj7m63zXvwUtl0xMwG7grEvHV3so3RkyVFSEXnImv2BCrWMW7h04mBWUfDitSyUen9/G4FSTF/D8kPi95Ra2qK7o5P13CfDjAvPGhQGRG3++53PiBUJCsqucFKNhwW9yM8OWKYc21QsGQEBcvHu++iEGxUqaaPNwvC/BHOXM/kceWT/q/E9ZEL0p9YjtjHrTj7y/xFGe+eujlUyeckSt6kyxQj9VNq/uJMD2qgUoFH1tWX+gETcLXnKK/4WkgUjRIPSeGpcpTJtTF45fmV1Zd5HxoN3zl1iOfvedCXGIzkqeMhaw3irlZTCypISa5eXv2l+JeizZA7t7dI3Ir43G55oWPzIiNfoS+Xzmb4+HefA66Jp5o0Fi0IFSATYVcyEscj+ooT/O7vT1bPgGxGnjd+Clc4fJAGy/1wtNjVas41/xklwsmiZROQKmAE1FTE6XQv/kGONeaZwm9ReMBsTih/l7YFB/mAOWz5cXZtNcLiZUN4RmwXkJF3kXlllAy1f4HjE8= 16 | file: 17 | - dist/neonclear.js 18 | - dist/neonclear.js.map 19 | skip_cleanup: true 20 | on: 21 | tags: true 22 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2017 Yukino Song 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # [Neonclear](https://neon.atm.re) 2 | [](https://app.fossa.io/projects/git%2Bhttps%3A%2F%2Fgithub.com%2FTheNeuronProject%2FNeonclear?ref=badge_shield) 3 | 4 | An [ef-based](https://github.com/ClassicOldSong/ef.js) frontend UI library 5 | 6 | ## Run a test 7 | ``` 8 | $ git clone https://github.com/ClassicOldSong/Neonclear.git 9 | $ cd Neonclear 10 | $ npm install 11 | $ npm run dev 12 | ``` 13 | Then you can test it out in the opening browser window. 14 | 15 | ## Build from source 16 | ``` 17 | $ git clone https://github.com/ClassicOldSong/Neonclear.git 18 | $ cd Neonclear 19 | $ npm install 20 | $ npm run build 21 | ``` 22 | Then you can get the fresh-built result at the `dist` folder. 23 | 24 | **Note:** All debugging messages are disabled in the production version 25 | 26 | ## License 27 | [MIT](http://cos.mit-license.org/) 28 | 29 | 30 | [](https://app.fossa.io/projects/git%2Bhttps%3A%2F%2Fgithub.com%2FTheNeuronProject%2FNeonclear?ref=badge_large) 31 | -------------------------------------------------------------------------------- /config/bs-config.js: -------------------------------------------------------------------------------- 1 | 2 | /* 3 | |-------------------------------------------------------------------------- 4 | | Browser-sync config file 5 | |-------------------------------------------------------------------------- 6 | | 7 | | For up-to-date information about the options: 8 | | http://www.browsersync.io/docs/options/ 9 | | 10 | | There are more options than you see here, these are just the ones that are 11 | | set internally. See the website for more info. 12 | | 13 | | 14 | */ 15 | export default { 16 | "ui": false, 17 | "files": "test/index.html", 18 | "watchOptions": {}, 19 | "server": { 20 | baseDir: "./test" 21 | }, 22 | "proxy": false, 23 | "port": 3000, 24 | "middleware": false, 25 | "serveStatic": [], 26 | "ghostMode": { 27 | "clicks": true, 28 | "scroll": true, 29 | "forms": { 30 | "submit": true, 31 | "inputs": true, 32 | "toggles": true 33 | } 34 | }, 35 | "logLevel": "info", 36 | "logPrefix": "RD", 37 | "logConnections": false, 38 | "logFileChanges": true, 39 | "logSnippet": true, 40 | "rewriteRules": false, 41 | "open": "local", 42 | "browser": "default", 43 | "cors": false, 44 | "xip": false, 45 | "hostnameSuffix": false, 46 | "reloadOnRestart": false, 47 | "notify": false, 48 | "scrollProportionally": true, 49 | "scrollThrottle": 0, 50 | "scrollRestoreTechnique": "window.name", 51 | "scrollElements": [], 52 | "scrollElementMapping": [], 53 | "reloadDelay": 0, 54 | "reloadDebounce": 0, 55 | "reloadThrottle": 0, 56 | "plugins": [], 57 | "injectChanges": true, 58 | "startPath": null, 59 | "minify": true, 60 | "host": null, 61 | "localOnly": false, 62 | "codeSync": true, 63 | "timestamps": true, 64 | "clientEvents": [ 65 | "scroll", 66 | "scroll:element", 67 | "input:text", 68 | "input:toggles", 69 | "form:submit", 70 | "form:reset", 71 | "click" 72 | ], 73 | "socket": { 74 | "socketIoOptions": { 75 | "log": false 76 | }, 77 | "socketIoClientConfig": { 78 | "reconnectionAttempts": 50 79 | }, 80 | "path": "/browser-sync/socket.io", 81 | "clientPath": "/browser-sync", 82 | "namespace": "/browser-sync", 83 | "clients": { 84 | "heartbeatTimeout": 5000 85 | } 86 | }, 87 | "tagNames": { 88 | "less": "link", 89 | "scss": "link", 90 | "css": "link", 91 | "jpg": "img", 92 | "jpeg": "img", 93 | "png": "img", 94 | "svg": "img", 95 | "gif": "img", 96 | "js": "script" 97 | } 98 | }; 99 | -------------------------------------------------------------------------------- /config/colors.config.js: -------------------------------------------------------------------------------- 1 | export default { 2 | colorLeft: '#00fffa', 3 | colorRight: '#00b9ee', 4 | colorShadow: 'rgba(56, 239, 222, 0.5)' 5 | } 6 | -------------------------------------------------------------------------------- /config/ef.config.js: -------------------------------------------------------------------------------- 1 | export default { 2 | input: 'src/neonclear.js', 3 | name: 'neon', 4 | bundle: 'neonclear', 5 | devPath: 'test', 6 | proPath: 'dist', 7 | extract: false, 8 | combineStyleTags: true 9 | } 10 | -------------------------------------------------------------------------------- /config/rollup.base.js: -------------------------------------------------------------------------------- 1 | import path from 'path' 2 | import chalk from 'chalk' 3 | 4 | // Rollup plugins 5 | import buble from 'rollup-plugin-buble' 6 | import eslint from 'rollup-plugin-eslint' 7 | import resolve from 'rollup-plugin-node-resolve' 8 | import commonjs from 'rollup-plugin-commonjs' 9 | import replace from 'rollup-plugin-replace' 10 | import uglify from 'rollup-plugin-uglify' 11 | import progress from 'rollup-plugin-progress' 12 | import json from 'rollup-plugin-json' 13 | import eft from 'rollup-plugin-eft' 14 | import postcss from 'rollup-plugin-postcss' 15 | 16 | // Postcss plugins 17 | import simplevars from 'postcss-simple-vars' 18 | import nested from 'postcss-nested' 19 | import cssnext from 'postcss-cssnext' 20 | import postcssimport from 'postcss-import' 21 | import cssnano from 'cssnano' 22 | 23 | // CSS variables 24 | import colors from './colors.config.js' 25 | 26 | // ef configuration 27 | import efConfig from './ef.config.js' 28 | const { 29 | input, 30 | name, 31 | bundle, 32 | devPath, 33 | proPath, 34 | extract, 35 | combineStyleTags 36 | } = efConfig 37 | 38 | // Log build environment 39 | console.log('Target:', chalk.bold.green(process.env.NODE_ENV || 'development')) 40 | switch (process.env.BUILD_ENV) { 41 | case 'DEMO': { 42 | console.log(chalk.cyan('+----=+| DEMO BUILD |+=----+')) 43 | break 44 | } 45 | case 'CI': { 46 | console.log(chalk.green('+----=+| CI BUILD |+=----+')) 47 | break 48 | } 49 | default: { 50 | console.log(chalk.yellow('+----=+| NORMAL BUILD |+=----+')) 51 | } 52 | } 53 | 54 | export default { 55 | input, 56 | name, 57 | bundle: path.normalize(bundle), 58 | devPath: path.normalize(devPath), 59 | proPath: path.normalize(proPath), 60 | plugins: [ 61 | progress({ 62 | clearLine: false 63 | }), 64 | eslint(), 65 | resolve({ 66 | jsnext: true, 67 | main: true, 68 | browser: true, 69 | }), 70 | commonjs(), 71 | json(), 72 | eft(), 73 | postcss({ 74 | plugins: [ 75 | simplevars({ variables: colors }), 76 | postcssimport(), 77 | nested(), 78 | cssnext({ warnForDuplicates: false }), 79 | cssnano() 80 | ], 81 | modules: true, 82 | combineStyleTags: true 83 | }), 84 | replace({ 85 | 'process.env.NODE_ENV': `'${process.env.NODE_ENV || 'development'}'` 86 | }), 87 | buble({ 88 | transforms: { 89 | modules: false, 90 | dangerousForOf: true 91 | }, 92 | objectAssign: 'Object.assign' 93 | }), 94 | (process.env.NODE_ENV === 'production' && uglify()) 95 | ] 96 | } 97 | -------------------------------------------------------------------------------- /config/rollup.dev.js: -------------------------------------------------------------------------------- 1 | // Import base config 2 | import base from './rollup.base' 3 | // Import browsersync config 4 | import bsConfig from './bs-config' 5 | // Import dev plugins 6 | import browsersync from 'rollup-plugin-browsersync' 7 | 8 | const {input, name, plugins, devPath, bundle} = base 9 | 10 | // Add browser-sync plugin 11 | plugins.push(browsersync(bsConfig)) 12 | 13 | 14 | const config = { 15 | input, 16 | output: { 17 | name, 18 | file: `${devPath}/${bundle}.js`, 19 | format: 'iife', 20 | sourcemap: true, 21 | }, 22 | plugins, 23 | watch: { 24 | chokidar: true, 25 | include: 'src/**' 26 | } 27 | } 28 | 29 | // Load demo script 30 | if (process.env.BUILD_ENV === 'DEMO') config.input = 'src/demo/loader.js' 31 | 32 | delete base.bundle 33 | delete base.devPath 34 | delete base.proPath 35 | 36 | export default config 37 | -------------------------------------------------------------------------------- /config/rollup.prod.js: -------------------------------------------------------------------------------- 1 | // Import base config 2 | import base from './rollup.base' 3 | 4 | const {input, name, plugins, proPath, bundle} = base 5 | 6 | const config = { 7 | input, 8 | output: { 9 | name, 10 | file: `${proPath}/${bundle}.js`, 11 | format: 'umd', 12 | sourcemap: true, 13 | globals: { 14 | 'ef-core': 'ef' 15 | } 16 | }, 17 | plugins, 18 | external: ['ef-core'] 19 | } 20 | 21 | // Load demo script 22 | if (process.env.BUILD_ENV === 'DEMO') { 23 | config.input = 'src/demo/loader.js' 24 | config.external.push('neonclear') 25 | config.output.globals.neonclear = 'neon' 26 | } 27 | 28 | delete base.bundle 29 | delete base.devPath 30 | delete base.proPath 31 | 32 | export default config 33 | -------------------------------------------------------------------------------- /dist/favicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheNeuronProject/Neonclear/109c170109b514c601060df0336dd1f2bc8ee178/dist/favicon.png -------------------------------------------------------------------------------- /dist/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 |
4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 |Javascript is required for this site.
16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "neonclear", 3 | "version": "0.1.0-alpha.4", 4 | "description": "An ef-based frontend UI library", 5 | "main": "dist/neonclear.full.js", 6 | "module": "src/neonclear.js", 7 | "unpkg": "dist/neonclear.js", 8 | "scripts": { 9 | "dev": "BUILD_ENV=DEMO rollup -c ./config/rollup.dev.js -w", 10 | "build": "NODE_ENV=production rollup -c ./config/rollup.prod.js", 11 | "lint": "eslint --ext .js src" 12 | }, 13 | "repository": { 14 | "type": "git", 15 | "url": "git+https://github.com/TheNeuronProject/Neonclear.git" 16 | }, 17 | "keywords": [ 18 | "template", 19 | "framework", 20 | "ef", 21 | "ui" 22 | ], 23 | "author": "ClassicOldSong", 24 | "license": "MIT", 25 | "bugs": { 26 | "url": "https://github.com/TheNeuronProject/Neonclear/issues" 27 | }, 28 | "homepage": "https://neon.atm.re", 29 | "devDependencies": { 30 | "chalk": "^2.4.1", 31 | "chokidar": "^2.0.3", 32 | "cssnano": "^3.10.0", 33 | "eslint": "^4.19.1", 34 | "postcss-cssnext": "^3.1.0", 35 | "postcss-import": "^11.1.0", 36 | "postcss-modules": "^1.1.0", 37 | "postcss-nested": "^3.0.0", 38 | "postcss-simple-vars": "^4.1.0", 39 | "rollup": "^0.58.2", 40 | "rollup-plugin-browsersync": "^0.2.6", 41 | "rollup-plugin-buble": "^0.19.2", 42 | "rollup-plugin-commonjs": "^9.1.3", 43 | "rollup-plugin-eft": "^0.3.0", 44 | "rollup-plugin-eslint": "^4.0.0", 45 | "rollup-plugin-json": "^2.3.0", 46 | "rollup-plugin-node-resolve": "^3.3.0", 47 | "rollup-plugin-postcss": "^1.6.1", 48 | "rollup-plugin-progress": "^0.4.0", 49 | "rollup-plugin-replace": "^2.0.0", 50 | "rollup-plugin-uglify": "^3.0.0" 51 | }, 52 | "dependencies": { 53 | "ef.js": "^0.8.1", 54 | "normalize.css": "^8.0.0" 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /src/components/_template/index.js: -------------------------------------------------------------------------------- 1 | // Import basic elements 2 | import tpl from './tpl.ef' 3 | import style from './style.css' 4 | import styled from '../../utils/styled.js' 5 | 6 | // Apply style to the component 7 | const ModuleName = styled(tpl, style) 8 | 9 | // Export the module 10 | export { ModuleName } 11 | -------------------------------------------------------------------------------- /src/components/_template/style.css: -------------------------------------------------------------------------------- 1 | /* Write the style of the module here. 2 | * No manual namespace needed, it will be done automatically 3 | */ 4 | 5 | @import '../../variables.css'; 6 | -------------------------------------------------------------------------------- /src/components/_template/tpl.ef: -------------------------------------------------------------------------------- 1 | Write your template here: 2 | >div.{{style.something}} 3 | -------------------------------------------------------------------------------- /src/components/article/index.js: -------------------------------------------------------------------------------- 1 | // Import basic elements 2 | import tpl from './tpl.ef' 3 | import style from './style.css' 4 | import styled from '../../utils/styled.js' 5 | 6 | const Article = styled(tpl, style) 7 | 8 | // Export the module 9 | export { Article } 10 | -------------------------------------------------------------------------------- /src/components/article/style.css: -------------------------------------------------------------------------------- 1 | /* Write the style of the module here. 2 | * No manual namespace needed, it will be done automatically 3 | */ 4 | 5 | @import '../../variables.css'; 6 | 7 | .article { 8 | width: 100%; 9 | position: relative; 10 | & article { 11 | position: relative; 12 | margin: 0 auto; 13 | width: 100%; 14 | max-width: 1200px; 15 | padding: 10px; 16 | } 17 | & hr { 18 | border: none; 19 | border-bottom: #88888888 1px solid; 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /src/components/article/tpl.ef: -------------------------------------------------------------------------------- 1 | Write your template here: 2 | >div.{{style.article}} 3 | #id = {{id}} 4 | >article 5 | >h1 6 | .{{title = Title}} 7 | >div 8 | .by {{author = Author}}, created {{time = 1990-1-1}} 9 | >hr 10 | +contents 11 | -------------------------------------------------------------------------------- /src/components/banner_logo/index.js: -------------------------------------------------------------------------------- 1 | // Import basic elements 2 | import tpl from './tpl.ef' 3 | import style from './style.css' 4 | import styled from '../../utils/styled.js' 5 | 6 | const BannerLogo = class extends styled(tpl, style) { 7 | constructor(text) { 8 | super({ 9 | $data: {text} 10 | }) 11 | } 12 | } 13 | 14 | // Export the module 15 | export { BannerLogo } 16 | -------------------------------------------------------------------------------- /src/components/banner_logo/style.css: -------------------------------------------------------------------------------- 1 | /* Write the style of the module here. 2 | * No manual namespace needed, it will be done automatically 3 | */ 4 | 5 | @import '../../variables.css'; 6 | 7 | .banner_logo { 8 | height: 100px; 9 | width: 460px; 10 | max-width: 100%; 11 | font-size: 80px; 12 | line-height: 100px; 13 | text-align: center; 14 | font-family: 'Megrim', cursive; 15 | background: var(--gradient-90); 16 | color: #FFF; 17 | user-select: none; 18 | cursor: default; 19 | overflow: hidden; 20 | } 21 | -------------------------------------------------------------------------------- /src/components/banner_logo/tpl.ef: -------------------------------------------------------------------------------- 1 | Write your template here: 2 | >div.{{style.banner_logo}} 3 | .{{text}} 4 | -------------------------------------------------------------------------------- /src/components/body/index.js: -------------------------------------------------------------------------------- 1 | // Import basic elements 2 | import tpl from './tpl.ef' 3 | import style from './style.css' 4 | import styled from '../../utils/styled.js' 5 | 6 | const Body = styled(tpl, style) 7 | 8 | // Export the module 9 | export { Body } 10 | -------------------------------------------------------------------------------- /src/components/body/style.css: -------------------------------------------------------------------------------- 1 | /* Write the style of the module here. 2 | * No manual namespace needed, it will be done automatically 3 | */ 4 | 5 | @import '../../variables.css'; 6 | 7 | .neonclear { 8 | font-family: 'Abel', sans-serif; 9 | } 10 | -------------------------------------------------------------------------------- /src/components/body/tpl.ef: -------------------------------------------------------------------------------- 1 | >body.{{style.neonclear}}.{{style.names}} 2 | +contents 3 | -------------------------------------------------------------------------------- /src/components/drawer/index.js: -------------------------------------------------------------------------------- 1 | // Import basic elements 2 | import tpl from './tpl.ef' 3 | import section from './section.ef' 4 | import item from './item.ef' 5 | import style from './style.css' 6 | import styled from '../../utils/styled.js' 7 | import { inform, exec } from 'ef-core' 8 | 9 | const Drawer = styled(tpl, style) 10 | 11 | const DrawerSection = styled(section, style) 12 | 13 | const makeActive = ({state: {$data}, value}) => { 14 | if (value) $data.style.activeClass = style.active 15 | else $data.style.activeClass = '' 16 | } 17 | 18 | const DrawerItem = class extends styled(item, style) { 19 | constructor(state) { 20 | inform() 21 | // Init component 22 | super() 23 | // Make subscriptions 24 | this.$subscribe('active', makeActive) 25 | // Apply user state 26 | this.$update(state) 27 | // Trigger render 28 | exec() 29 | } 30 | } 31 | 32 | // Export the module 33 | export { Drawer, DrawerSection, DrawerItem } 34 | -------------------------------------------------------------------------------- /src/components/drawer/item.ef: -------------------------------------------------------------------------------- 1 | >li.{{style.activeClass}} 2 | @click = click 3 | >span 4 | .{{title = Item Title}} 5 | -------------------------------------------------------------------------------- /src/components/drawer/section.ef: -------------------------------------------------------------------------------- 1 | >section 2 | >h3 3 | .{{title = Section Title}} 4 | >ul 5 | +items 6 | -------------------------------------------------------------------------------- /src/components/drawer/style.css: -------------------------------------------------------------------------------- 1 | /* Write the style of the module here. 2 | * No manual namespace needed, it will be done automatically 3 | */ 4 | 5 | @import '../../variables.css'; 6 | 7 | $framecolor: #88888888; 8 | 9 | .drawer { 10 | position: fixed; 11 | top: 0; 12 | left: 0; 13 | width: 0; 14 | height: 100vh; 15 | width: 100vw; 16 | max-width: 320px; 17 | transform: translate3d(-320px, 0, 0); 18 | transition: transform cubic-bezier(0.18, 0.89, 0.32, 1.06) .5s; 19 | background: linear-gradient(-30deg, #000, #333); 20 | outline: none; 21 | & .menu_button { 22 | position: absolute; 23 | box-sizing: border-box; 24 | top: 10px; 25 | right: 10px; 26 | transform: translate3d(60px, 0, 0); 27 | height: 40px; 28 | width: 40px; 29 | border: $framecolor 2px solid; 30 | color: $framecolor; 31 | user-select: none; 32 | cursor: pointer; 33 | transition: transform cubic-bezier(0.18, 0.89, 0.32, 0.92) .5s; 34 | & i { 35 | height: 100%; 36 | line-height: 36px; 37 | width: 100%; 38 | text-align: center; 39 | font-size: 30px; 40 | } 41 | &.retract { 42 | visibility: hidden; 43 | outline: none; 44 | } 45 | } 46 | &:focus { 47 | transform: translate3d(-20px, 0, 0); 48 | & .menu_button { 49 | transform: translate3d(0, 0, 0); 50 | &.expand { 51 | visibility: hidden; 52 | } 53 | &.retract { 54 | visibility: visible; 55 | } 56 | } 57 | } 58 | & h3 { 59 | position: relative; 60 | &::after { 61 | content: ''; 62 | height: 2px; 63 | width: 24px; 64 | position: absolute; 65 | bottom: -5px; 66 | left: 0; 67 | background: var(--gradient-90); 68 | transition: width .2s; 69 | } 70 | &:hover { 71 | &::after { 72 | width: 30px; 73 | } 74 | } 75 | } 76 | & ul { 77 | width: 100%; 78 | padding-left: 16px; 79 | box-sizing: border-box; 80 | list-style: none; 81 | position: relative; 82 | & li { 83 | font-weight: lighter; 84 | cursor: pointer; 85 | margin: 8px 0; 86 | position: relative; 87 | & span { 88 | position: relative; 89 | display: inline-block; 90 | &::after { 91 | content: ''; 92 | width: 0; 93 | height: 2px; 94 | position: absolute; 95 | bottom: -2px; 96 | left: 0; 97 | background-color: #FFF; 98 | transition: width .2s; 99 | } 100 | } 101 | &::before { 102 | content: ''; 103 | opacity: 0; 104 | transform: translate3d(-15px, 6px, 0) rotate(45deg); 105 | border-top: #FFF 2px solid; 106 | border-right: #FFF 2px solid; 107 | height: 6px; 108 | width: 6px; 109 | box-sizing: border-box; 110 | position: absolute; 111 | top: 0; 112 | left: 0; 113 | transition: transform .2s, opacity .2s; 114 | pointer-events: none; 115 | } 116 | &.active::before { 117 | opacity: 1; 118 | transform: translate3d(-12px, 6px, 0) rotate(45deg); 119 | } 120 | &:hover { 121 | & span::after { 122 | width: 100%; 123 | } 124 | } 125 | } 126 | } 127 | } 128 | 129 | .holder { 130 | width: 100%; 131 | padding: 0 20px 0 30px; 132 | color: #FFF; 133 | box-sizing: border-box; 134 | & h1 { 135 | display: inline-block; 136 | margin: 0; 137 | height: 60px; 138 | line-height: 60px; 139 | background: var(--gradient-90); 140 | -webkit-background-clip: text; 141 | -webkit-text-fill-color: transparent; 142 | text-shadow: $colorShadow 0px 2px 3px; 143 | } 144 | } 145 | -------------------------------------------------------------------------------- /src/components/drawer/tpl.ef: -------------------------------------------------------------------------------- 1 | Write your template here: 2 | >div.{{style.drawer}} 3 | #tabindex = 0 4 | >div.{{style.menu_button}}.{{style.retract}} 5 | #onclick 6 | #tabindex = 0 7 | >i.material-icons 8 | .menu 9 | >div.{{style.menu_button}}.{{style.expand}} 10 | #onclick 11 | >i.material-icons 12 | .menu 13 | >div.{{style.holder}} 14 | >h1 15 | .{{title = Menu}} 16 | +contents 17 | -------------------------------------------------------------------------------- /src/components/footer/index.js: -------------------------------------------------------------------------------- 1 | // Import basic elements 2 | import tpl from './tpl.ef' 3 | import style from './style.css' 4 | import styled from '../../utils/styled.js' 5 | 6 | const Footer = class extends styled(tpl, style) { 7 | constructor(author, year) { 8 | if (!year) year = (new Date()).getFullYear() 9 | super({ 10 | $data: {author, year} 11 | }) 12 | } 13 | } 14 | 15 | // Export the module 16 | export { Footer } 17 | -------------------------------------------------------------------------------- /src/components/footer/style.css: -------------------------------------------------------------------------------- 1 | /* Write the style of the module here. 2 | * No manual namespace needed, it will be done automatically 3 | */ 4 | 5 | @import '../../variables.css'; 6 | 7 | .footer { 8 | height: 150px; 9 | border: 0; 10 | border-bottom: 2px solid; 11 | border-image: var(--gradient-90); 12 | border-image-slice: 1; 13 | box-shadow: #FFFFFF33 0px -2px 4px; 14 | position: relative; 15 | display: flex; 16 | flex-direction: column; 17 | justify-content: center; 18 | & a { 19 | color: #000; 20 | text-decoration: none; 21 | background: var(--gradient-90); 22 | -webkit-background-clip: text; 23 | -webkit-text-fill-color: transparent; 24 | } 25 | &::before { 26 | content: ''; 27 | position: absolute; 28 | top: 0; 29 | left: 0; 30 | height: 100%; 31 | width: 100%; 32 | backdrop-filter: blur(20px); 33 | background: hsla(0,0%,100%,.7); 34 | z-index: -1; 35 | } 36 | } 37 | 38 | .copyright { 39 | text-align: center; 40 | flex-grow: 0; 41 | min-height: 18px; 42 | line-height: 18px; 43 | font-size: 14px; 44 | } 45 | -------------------------------------------------------------------------------- /src/components/footer/tpl.ef: -------------------------------------------------------------------------------- 1 | Write your template here: 2 | >footer.{{style.footer}} 3 | >p.{{style.copyright}} 4 | .Copyright © {{year}} {{author}} 5 | >br 6 | .Built with & 7 | >b 8 | >a 9 | #href = https://neon.atm.re 10 | #rel = noopener 11 | #target = _blank 12 | .Neonclear 13 | -------------------------------------------------------------------------------- /src/components/header/index.js: -------------------------------------------------------------------------------- 1 | // Import basic elements 2 | import tpl from './tpl.ef' 3 | import style from './style.css' 4 | import styled from '../../utils/styled.js' 5 | import { inform, exec } from 'ef-core' 6 | 7 | const scrollTop = () => { 8 | window.scrollTo(0, 0) 9 | } 10 | 11 | const Header = class extends styled(tpl, style) { 12 | constructor(state) { 13 | inform() 14 | // Apply methods 15 | super({$methods: {scrollTop}}) 16 | // Apply user state 17 | this.$update(state) 18 | // Trigger render 19 | exec() 20 | } 21 | } 22 | 23 | // Export the module 24 | export { Header } 25 | -------------------------------------------------------------------------------- /src/components/header/style.css: -------------------------------------------------------------------------------- 1 | /* Write the style of the module here. 2 | * No manual namespace needed, it will be done automatically 3 | */ 4 | 5 | @import '../../variables.css'; 6 | 7 | .header { 8 | height: 60px; 9 | width: 100%; 10 | border: 0; 11 | border-bottom: 2px solid; 12 | border-image: var(--gradient-90); 13 | border-image-slice: 1; 14 | box-shadow: $colorShadow 0px 2px 4px; 15 | font-family: 'PT Sans Narrow', sans-serif; 16 | position: relative; 17 | top: 0; 18 | line-height: 60px; 19 | position: fixed; 20 | top: 0; 21 | left: 0; 22 | &::before { 23 | content: ''; 24 | position: absolute; 25 | top: 0; 26 | left: 0; 27 | height: 100%; 28 | width: 100%; 29 | backdrop-filter: blur(20px); 30 | background: hsla(0, 0%, 100%, .7); 31 | z-index: -1; 32 | } 33 | } 34 | 35 | .left { 36 | float: left; 37 | height: 100%; 38 | padding-left: 10px; 39 | } 40 | 41 | .container { 42 | position: relative; 43 | height: 100%; 44 | width: 100%; 45 | box-sizing: border-box; 46 | } 47 | -------------------------------------------------------------------------------- /src/components/header/tpl.ef: -------------------------------------------------------------------------------- 1 | >header.{{style.header}} 2 | @dblclick = scrollTop 3 | >div.{{style.container}}.{{style.classes}} 4 | >div.{{style.left}} 5 | +left 6 | -middle 7 | -right 8 | -------------------------------------------------------------------------------- /src/components/logo_page/btn.ef: -------------------------------------------------------------------------------- 1 | Write your template here: 2 | >div.{{style.button}} 3 | @click = click 4 | .{{caption = Caption}} 5 | -------------------------------------------------------------------------------- /src/components/logo_page/index.js: -------------------------------------------------------------------------------- 1 | // Import basic elements 2 | import tpl from './tpl.ef' 3 | import btn from './btn.ef' 4 | import style from './style.css' 5 | import styled from '../../utils/styled.js' 6 | 7 | const LogoPage = styled(tpl, style) 8 | 9 | const LogoButton = styled(btn, style) 10 | 11 | // Export the module 12 | export { LogoPage, LogoButton } 13 | -------------------------------------------------------------------------------- /src/components/logo_page/style.css: -------------------------------------------------------------------------------- 1 | /* Write the style of the module here. 2 | * No manual namespace needed, it will be done automatically 3 | */ 4 | 5 | @import '../../variables.css'; 6 | 7 | .page { 8 | height: 100%; 9 | width: 100%; 10 | display: flex; 11 | flex-direction: column; 12 | justify-content: center; 13 | align-items: center; 14 | } 15 | 16 | .caption { 17 | margin: 20px; 18 | text-align: center; 19 | } 20 | 21 | 22 | .button { 23 | height: 40px; 24 | min-width: 40px; 25 | padding: 0 8px; 26 | line-height: 40px; 27 | font-size: 20px; 28 | background: var(--gradient-90); 29 | -webkit-background-clip: text; 30 | -webkit-text-fill-color: transparent; 31 | border: 2px solid; 32 | border-image: var(--gradient-90); 33 | border-image-slice: 1; 34 | position: relative; 35 | display: inline-block; 36 | margin: 0 5px; 37 | cursor: pointer; 38 | user-select: none; 39 | box-shadow: $colorShadow 0px 0px 0px; 40 | transition: box-shadow .2s; 41 | &:hover { 42 | box-shadow: $colorShadow 0px 3px 5px;; 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /src/components/logo_page/tpl.ef: -------------------------------------------------------------------------------- 1 | Write your template here: 2 | >section.{{style.page}}.{{classes}} 3 | -logo 4 | >p.{{style.caption}} 5 | .{{caption}} 6 | >div.{{style.buttons}} 7 | +buttons 8 | -------------------------------------------------------------------------------- /src/components/page/index.js: -------------------------------------------------------------------------------- 1 | // Import basic elements 2 | import tpl from './tpl.ef' 3 | import style from './style.css' 4 | import styled from '../../utils/styled.js' 5 | 6 | const Page = styled(tpl, style) 7 | 8 | // Export the module 9 | export { Page } 10 | -------------------------------------------------------------------------------- /src/components/page/style.css: -------------------------------------------------------------------------------- 1 | /* Write the style of the module here. 2 | * No manual namespace needed, it will be done automatically 3 | */ 4 | 5 | @import '../../variables.css'; 6 | 7 | .page { 8 | width: 100%; 9 | overflow: hidden; 10 | } 11 | -------------------------------------------------------------------------------- /src/components/page/tpl.ef: -------------------------------------------------------------------------------- 1 | Write your template here: 2 | >section.{{style.page}}.{{classes}} 3 | +contents 4 | -------------------------------------------------------------------------------- /src/components/text_logo/index.js: -------------------------------------------------------------------------------- 1 | // Import basic elements 2 | import tpl from './tpl.ef' 3 | import style from './style.css' 4 | import styled from '../../utils/styled.js' 5 | 6 | const TextLogo = class extends styled(tpl, style) { 7 | constructor(text) { 8 | super({ 9 | $data: {text} 10 | }) 11 | } 12 | } 13 | 14 | // Export the module 15 | export { TextLogo } 16 | -------------------------------------------------------------------------------- /src/components/text_logo/style.css: -------------------------------------------------------------------------------- 1 | /* Write the style of the module here. 2 | * No manual namespace needed, it will be done automatically 3 | */ 4 | 5 | @import '../../variables.css'; 6 | 7 | .text_logo { 8 | height: 100%; 9 | font-size: 40px; 10 | font-family: 'Megrim', cursive; 11 | background: var(--gradient-90); 12 | -webkit-background-clip: text; 13 | -webkit-text-fill-color: transparent; 14 | user-select: none; 15 | cursor: default; 16 | } 17 | -------------------------------------------------------------------------------- /src/components/text_logo/tpl.ef: -------------------------------------------------------------------------------- 1 | Write your template here: 2 | >div.{{style.text_logo}}.{{style.names}} 3 | .{{text}} 4 | -------------------------------------------------------------------------------- /src/demo/components/logo/index.js: -------------------------------------------------------------------------------- 1 | // Import basic elements 2 | import tpl from './tpl.ef' 3 | import style from '../../style.css' 4 | import styled from '../../../utils/styled.js' 5 | 6 | // Apply style to the component 7 | const Logo = class extends styled(tpl, style) { 8 | constructor(colorLeft, colorRight) { 9 | const $data = {} 10 | if (colorLeft) $data.colorLeft = colorLeft 11 | if (colorRight) $data.colorRight = colorRight 12 | super({$data}) 13 | } 14 | } 15 | 16 | // Export the module 17 | export default Logo 18 | -------------------------------------------------------------------------------- /src/demo/components/logo/tpl.ef: -------------------------------------------------------------------------------- 1 | >svg.{{style.logo}} 2 | #width = 100% 3 | #height = 100% 4 | #viewBox = 0 0 2048 1024 5 | #version = 1.1 6 | #xmlns = http://www.w3.org/2000/svg 7 | #xmlns:xlink = http://www.w3.org/1999/xlink 8 | #xml:space = preserve 9 | #style = fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:1.41421; 10 | >path 11 | #d = M645.657,133.657l-567.514,567.514l189.172,189.172l567.514,-567.514l-189.172,-189.172Z 12 | #style = fill:url(#_Linear1); 13 | >path 14 | #d = M1213.17,133.657l-567.514,567.514l189.172,189.172l567.514,-567.514l-189.172,-189.172Z 15 | #style = fill:url(#_Linear2); 16 | >path 17 | #d = M1496.93,606.586l283.757,283.757l189.172,-189.172l-283.757,-283.757l-189.172,189.172Z 18 | #style = fill:url(#_Linear3); 19 | >path 20 | #d = M1780.68,133.657l-378.342,378.343l189.171,189.171l378.343,-378.342l-189.172,-189.172Z 21 | #style = fill:url(#_Linear4); 22 | >defs 23 | >linearGradient 24 | #id = _Linear1 25 | #x1 = 0 26 | #y1 = 0 27 | #x2 = 1 28 | #y2 = 0 29 | #gradientUnits = userSpaceOnUse 30 | #gradientTransform = matrix(567.514,-567.514,189.171,189.171,172.729,795.757) 31 | >stop 32 | #offset = 0 33 | #style = stop-color:{{colorLeft = #00fffa}};stop-opacity:1 34 | >stop 35 | #offset = 1 36 | #style = stop-color:{{colorRight = #00b9ee}};stop-opacity:1 37 | >linearGradient 38 | #id = _Linear2 39 | #x1 = 0 40 | #y1 = 0 41 | #x2 = 1 42 | #y2 = 0 43 | #gradientUnits = userSpaceOnUse 44 | #gradientTransform = matrix(567.514,-567.514,189.171,189.171,740.243,795.757) 45 | >stop 46 | #offset = 0 47 | #style = stop-color:{{colorLeft}};stop-opacity:1 48 | >stop 49 | #offset = 1 50 | #style = stop-color:{{colorRight}};stop-opacity:1 51 | >linearGradient 52 | #id = _Linear3 53 | #x1 = 0 54 | #y1 = 0 55 | #x2 = 1 56 | #y2 = 0 57 | #gradientUnits = userSpaceOnUse 58 | #gradientTransform = matrix(-283.757,-283.757,189.171,-189.171,1875.27,795.757) 59 | >stop 60 | #offset = 0 61 | #style = stop-color:{{colorLeft}};stop-opacity:1 62 | >stop 63 | #offset = 1 64 | #style = stop-color:{{colorRight}};stop-opacity:1 65 | >linearGradient 66 | #id = _Linear4 67 | #x1 = 0 68 | #y1 = 0 69 | #x2 = 1 70 | #y2 = 0 71 | #gradientUnits = userSpaceOnUse 72 | #gradientTransform = matrix(378.343,-378.343,189.171,189.171,1496.93,606.586) 73 | >stop 74 | #offset = 0 75 | #style = stop-color:{{colorLeft}};stop-opacity:1 76 | >stop 77 | #offset = 1 78 | #style = stop-color:{{colorRight}};stop-opacity:1 79 | -------------------------------------------------------------------------------- /src/demo/components/logo/tpl.ef.bak: -------------------------------------------------------------------------------- 1 | >svg 2 | #width = 100% 3 | #height = 100% 4 | #viewBox = 0 0 2048 1024 5 | #version = 1.1 6 | #xmlns = http://www.w3.org/2000/svg 7 | #xmlns:xlink = http://www.w3.org/1999/xlink 8 | #xml:space = preserve 9 | #style = fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:1.41421; 10 | >g 11 | >g 12 | #id = N 13 | >path 14 | #d = M645.657,133.657l-567.514,567.514l189.172,189.172l567.514,-567.514l-189.172,-189.172Z 15 | #style = fill:url(#_Linear1); 16 | >path 17 | #d = M1213.17,133.657l-567.514,567.514l189.172,189.172l567.514,-567.514l-189.172,-189.172Z 18 | #style = fill:url(#_Linear2); 19 | >g 20 | #id = C 21 | >path 22 | #d = M1496.93,606.586l283.757,283.757l189.172,-189.172l-283.757,-283.757l-189.172,189.172Z 23 | #style = fill:url(#_Linear3); 24 | >path 25 | #d = M1780.68,133.657l-378.342,378.343l189.171,189.171l378.343,-378.342l-189.172,-189.172Z 26 | #style = fill:url(#_Linear4); 27 | >g 28 | >g 29 | #id = N1 30 | >path 31 | #d = M645.657,133.657l-567.514,567.514l189.172,189.172l567.514,-567.514l-189.172,-189.172Z" style = fill:url(#_Linear5); 32 | >path 33 | #d = M1213.17,133.657l-567.514,567.514l189.172,189.172l567.514,-567.514l-189.172,-189.172Z" style = fill:url(#_Linear6); 34 | >g 35 | #id= C1 36 | >path 37 | #d = M1496.93,606.586l283.757,283.757l189.172,-189.172l-283.757,-283.757l-189.172,189.172Z" style = fill:url(#_Linear7); 38 | >path 39 | #d = M1780.68,133.657l-378.342,378.343l189.171,189.171l378.343,-378.342l-189.172,-189.172Z" style = fill:url(#_Linear8); 40 | >defs 41 | >linearGradient 42 | #id = _Linear1 43 | #x1 = 0 44 | #y1 = 0 45 | #x2 = 1 46 | #y2 = 0 47 | #gradientUnits = userSpaceOnUse 48 | #gradientTransform = matrix(567.514,-567.514,189.171,189.171,172.729,795.757) 49 | >stop 50 | #offset = 0 51 | #style = stop-color:#b200ff;stop-opacity:1 52 | >stop 53 | #offset = 1 54 | #style = stop-color:#6f00e8;stop-opacity:1 55 | >linearGradient 56 | #id = _Linear2 57 | #x1 = 0 58 | #y1 = 0 59 | #x2 = 1 60 | #y2 = 0 61 | #gradientUnits = userSpaceOnUse 62 | #gradientTransform = matrix(567.514,-567.514,189.171,189.171,172.729,795.757) 63 | >stop 64 | #offset = 0 65 | #style = stop-color:#b200ff;stop-opacity:1 66 | >stop 67 | #offset = 1 68 | #style = stop-color:#6f00e8;stop-opacity:1 69 | >linearGradient 70 | #id = _Linear3 71 | #x1 = 0 72 | #y1 = 0 73 | #x2 = 1 74 | #y2 = 0 75 | #gradientUnits = userSpaceOnUse 76 | #gradientTransform = matrix(-283.757,-283.757,189.171,-189.171,1875.27,795.757) 77 | >stop 78 | #offset = 0 79 | #style = stop-color:#b200ff;stop-opacity:1 80 | >stop 81 | #offset = 1 82 | #style = stop-color:#6f00e8;stop-opacity:1 83 | >linearGradient 84 | #id = _Linear4 85 | #x1 = 0 86 | #y1 = 0 87 | #x2 = 1 88 | #y2 = 0 89 | #gradientUnits = userSpaceOnUse 90 | #gradientTransform = matrix(378.343,-378.343,189.171,189.171,1496.93,606.586) 91 | >stop 92 | #offset = 0 93 | #style = stop-color:#b200ff;stop-opacity:1 94 | >stop 95 | #offset = 1 96 | #style = stop-color:#6f00e8;stop-opacity:1 97 | >linearGradient 98 | #id = _Linear5 99 | #x1 = 0 100 | #y1 = 0 101 | #x2 = 1 102 | #y2 = 0 103 | #gradientUnits = userSpaceOnUse 104 | #gradientTransform = matrix(567.514,-567.514,189.171,189.171,172.729,795.757) 105 | >stop 106 | #offset = 0 107 | #style = stop-color:#b200ff;stop-opacity:1 108 | >stop 109 | #offset = 1 110 | #style = stop-color:#6f00e8;stop-opacity:1 111 | >linearGradient 112 | #id = _Linear6 113 | #x1 = 0 114 | #y1 = 0 115 | #x2 = 1 116 | #y2 = 0 117 | #gradientUnits = userSpaceOnUse 118 | #gradientTransform = matrix(567.514,-567.514,189.171,189.171,172.729,795.757) 119 | >stop 120 | #offset = 0 121 | #style = stop-color:#b200ff;stop-opacity:1 122 | >stop 123 | #offset = 1 124 | #style = stop-color:#6f00e8;stop-opacity:1 125 | >linearGradient 126 | #id = _Linear7 127 | #x1 = 0 128 | #y1 = 0 129 | #x2 = 1 130 | #y2 = 0 131 | #gradientUnits = userSpaceOnUse 132 | #gradientTransform = matrix(-283.757,-283.757,189.171,-189.171,1875.27,795.757) 133 | >stop 134 | #offset = 0 135 | #style = stop-color:#b200ff;stop-opacity:1 136 | >stop 137 | #offset = 1 138 | #style = stop-color:#6f00e8;stop-opacity:1 139 | >linearGradient 140 | #id = _Linear8 141 | #x1 = 0 142 | #y1 = 0 143 | #x2 = 1 144 | #y2 = 0 145 | #gradientUnits = userSpaceOnUse 146 | #gradientTransform = matrix(378.343,-378.343,189.171,189.171,1496.93,606.586) 147 | >stop 148 | #offset = 0 149 | #style = stop-color:#b200ff;stop-opacity:1 150 | >stop 151 | #offset = 1 152 | #style = stop-color:#6f00e8;stop-opacity:1 153 | -------------------------------------------------------------------------------- /src/demo/components/section/index.js: -------------------------------------------------------------------------------- 1 | // Import basic elements 2 | import tpl from './tpl.ef' 3 | import style from '../../style.css' 4 | import styled from '../../../utils/styled.js' 5 | 6 | // Apply style to the component 7 | const Section = styled(tpl, style) 8 | 9 | // Export the module 10 | export default Section 11 | -------------------------------------------------------------------------------- /src/demo/components/section/tpl.ef: -------------------------------------------------------------------------------- 1 | Write your template here: 2 | >div.{{style.section}} 3 | #id = {{id}} 4 | >article 5 | >h1 6 | .{{title = Title}} 7 | +contents 8 | -------------------------------------------------------------------------------- /src/demo/demo.js: -------------------------------------------------------------------------------- 1 | // Import basic elements 2 | import { 3 | Body, Header, TextLogo, LogoButton, Page, 4 | LogoPage, Footer, Drawer, DrawerSection, DrawerItem 5 | } from '../neonclear.js' 6 | 7 | import {inform, exec, mountOptions} from 'ef-core' 8 | 9 | import Logo from './components/logo' 10 | import Section from './components/section' 11 | 12 | import style from './style.css' 13 | 14 | const author = 'Yukino Song' 15 | 16 | inform() 17 | const body = new Body() 18 | const header = new Header({$data: {style: {classes: style.header}}}) 19 | const logo = new TextLogo('Neonclear') 20 | const BL = new Logo() 21 | const buttonSoon = new LogoButton({$data: {caption: 'Coming Soon...'}}) 22 | const buttonGH = new LogoButton({ 23 | $data: { 24 | caption: 'View on GitHub' 25 | }, 26 | $methods: { 27 | click: function() { 28 | window.open('https://github.com/TheNeuronProject/Neonclear') 29 | } 30 | } 31 | }) 32 | const LP = new LogoPage({ 33 | $data: { 34 | caption: 'The ef.js based progressive UI framework', 35 | classes: style.demo 36 | }, 37 | logo: BL, 38 | buttons: [buttonSoon, buttonGH] 39 | }) 40 | const page1 = new Page({ 41 | $data: { 42 | classes: style.page 43 | }, 44 | contents: [new Section({$data: {title: 'Create websites with minimal design.', id: 'intro'}})] 45 | }) 46 | const footer = new Footer(author) 47 | const drawer = new Drawer({ 48 | contents: [ 49 | new DrawerSection({ 50 | $data: { 51 | title: 'Intro' 52 | }, 53 | items: [ 54 | new DrawerItem({ 55 | $data: { 56 | title: 'ef.js', 57 | active: true 58 | }, 59 | $methods: { 60 | click() { 61 | window.open('https://ef.js.org') 62 | } 63 | } 64 | }) 65 | ] 66 | }), 67 | new DrawerSection({ 68 | $data: { 69 | title: 'Usage' 70 | } 71 | }), 72 | new DrawerSection({ 73 | $data: { 74 | title: 'Components' 75 | }, 76 | items: [ 77 | new DrawerItem({ 78 | $data: { 79 | title: 'bPlayer-ef' 80 | }, 81 | $methods: { 82 | click() { 83 | window.open('https://bplayer-ef.ccoooss.com') 84 | } 85 | } 86 | }) 87 | ] 88 | }), 89 | new DrawerSection({ 90 | $data: { 91 | title: 'About' 92 | }, 93 | items: [ 94 | new DrawerItem({ 95 | $data: { 96 | title: 'Author' 97 | }, 98 | $methods: { 99 | click() { 100 | window.open('https://ccoooss.com') 101 | } 102 | } 103 | }), 104 | new DrawerItem({ 105 | $data: { 106 | title: 'TheNeuronProject' 107 | }, 108 | $methods: { 109 | click() { 110 | window.open('https://github.com/TheNeuronProject') 111 | } 112 | } 113 | }), 114 | new DrawerItem({ 115 | $data: { 116 | title: 'Donate' 117 | }, 118 | $methods: { 119 | click() { 120 | window.open('https://www.patreon.com/classicoldsong') 121 | } 122 | } 123 | }) 124 | ] 125 | }) 126 | ] 127 | }) 128 | body.contents.push(LP, page1, footer, header, drawer) 129 | header.left.push(logo) 130 | body.$mount({target: document.body, option: mountOptions.REPLACE}) 131 | exec() 132 | 133 | window.$body = body 134 | 135 | const ls = ` 136 | color: #0ddf79; 137 | ` 138 | console.warn('%c[NEON]', ls, 'This is a DEMO build of Neonclear. Additional contents are included in this bundle. DO NOT use this build in your project.') 139 | -------------------------------------------------------------------------------- /src/demo/loader.js: -------------------------------------------------------------------------------- 1 | import './demo.js' 2 | -------------------------------------------------------------------------------- /src/demo/style.css: -------------------------------------------------------------------------------- 1 | /* Write the style of the module here. 2 | * No manual namespace needed, it will be done automatically 3 | */ 4 | 5 | @import '../variables.css'; 6 | 7 | html { 8 | background-image: url('https://i.loli.net/2017/08/03/59820ac27a362.png'); 9 | background-size: cover; 10 | background-position: center; 11 | background-attachment: fixed; 12 | } 13 | 14 | .demo { 15 | & p { 16 | background: var(--gradient-90); 17 | -webkit-background-clip: text; 18 | -webkit-text-fill-color: transparent; 19 | } 20 | } 21 | 22 | .logo { 23 | max-width: 600px; 24 | height: auto; 25 | filter: drop-shadow(0 5px 10px $colorShadow); 26 | } 27 | 28 | .header { 29 | padding-left: 50px; 30 | } 31 | 32 | .page { 33 | backdrop-filter: blur(10px); 34 | background: rgba(0,0,0,.5); 35 | color: #FFF; 36 | } 37 | 38 | .section { 39 | position: relative; 40 | margin: 0 auto; 41 | width: 100%; 42 | max-width: 1200px; 43 | padding: 0 10px; 44 | } 45 | -------------------------------------------------------------------------------- /src/global.css: -------------------------------------------------------------------------------- 1 | @import url('https://fonts.googleapis.com/css?family=PT+Sans+Narrow'); 2 | @import url('https://fonts.googleapis.com/css?family=Megrim'); 3 | 4 | html, body { 5 | height: 100%; 6 | } 7 | -------------------------------------------------------------------------------- /src/neonclear.js: -------------------------------------------------------------------------------- 1 | // Version 2 | import { version } from '../package.json' 3 | // Normalize 4 | import 'normalize.css' 5 | // Import global style 6 | import './global.css' 7 | // Import utilities 8 | import styled from './utils/styled.js' 9 | 10 | // Add fonts 11 | const fonts = ['Megrim', 'Abel', 'Material Icons'] 12 | 13 | const fontLink = document.createElement('link') 14 | fontLink.rel = 'stylesheet' 15 | fontLink.href = `https://fonts.googleapis.com/css?family=${fonts.map(item => item.replace(/\s/g, '+')).join('|')}` 16 | ;(document.head || document.getElementsByTagName('head')[0]).appendChild(fontLink) 17 | 18 | // Export every module 19 | export * from './components/body' 20 | export * from './components/header' 21 | export * from './components/footer' 22 | export * from './components/text_logo' 23 | export * from './components/banner_logo' 24 | export * from './components/page' 25 | export * from './components/logo_page' 26 | export * from './components/drawer' 27 | export * from './components/article' 28 | 29 | // Export utilities 30 | export { styled } 31 | 32 | // Log style 33 | const ls = ` 34 | color: #b200fb; 35 | ` 36 | if (process.env.NODE_ENV !== 'production') console.log('%c[NEON]', ls, `Neonclear v${version} loaded!`) 37 | -------------------------------------------------------------------------------- /src/utils/styled.js: -------------------------------------------------------------------------------- 1 | import { inform, exec } from 'ef-core' 2 | 3 | // Return a styled component 4 | export default (component, style) => { 5 | const styledComponent = class extends component { 6 | constructor(state) { 7 | // Hold render 8 | inform() 9 | // Apply style 10 | super({$data: {style}}) 11 | // Apply user state 12 | this.$update(state) 13 | // Unhold render 14 | exec() 15 | } 16 | } 17 | return styledComponent 18 | } 19 | -------------------------------------------------------------------------------- /src/variables.css: -------------------------------------------------------------------------------- 1 | :root { 2 | --gradient-90: linear-gradient(90deg, $colorLeft, $colorRight); 3 | } 4 | -------------------------------------------------------------------------------- /test/favicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheNeuronProject/Neonclear/109c170109b514c601060df0336dd1f2bc8ee178/test/favicon.png -------------------------------------------------------------------------------- /test/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 |Javascript is required for this site.
16 | 17 | 18 | 19 | --------------------------------------------------------------------------------