From: jloup Date: Mon, 7 May 2018 11:40:12 +0000 (+0200) Subject: Add fontello icons. X-Git-Tag: v0.0.8~6 X-Git-Url: https://git.immae.eu/?p=perso%2FImmae%2FProjets%2FCryptomonnaies%2FCryptoportfolio%2FFront.git;a=commitdiff_plain;h=bf5deb87cef2b6f1370c808821dfb631d00590f6 Add fontello icons. --- diff --git a/cmd/web/.gitignore b/cmd/web/.gitignore index 7a7ecee..f233aa5 100644 --- a/cmd/web/.gitignore +++ b/cmd/web/.gitignore @@ -2,3 +2,5 @@ bower_components/ node_modules/ build/ npm-debug.log +.fontello +static/fontello \ No newline at end of file diff --git a/cmd/web/Makefile b/cmd/web/Makefile index 85bba5b..02ff826 100644 --- a/cmd/web/Makefile +++ b/cmd/web/Makefile @@ -6,15 +6,14 @@ SRC_DIR=js BUILD_DIR=build/js JSX_SRC= header_footer.jsx main.jsx signup.jsx signin.jsx otp.jsx poloniex.jsx password_reset.jsx change_password.jsx JS_SRC= cookies.js app.js api.js -STATIC_FILES= index.html style.css +STATIC_FILES= index.html style.css fontello.css +STATIC_FILES+=$(addprefix fonts/, fontello.eot fontello.svg fontello.ttf fontello.woff fontello.woff2) JSX_OBJS=$(addprefix $(BUILD_DIR)/,$(JSX_SRC:.jsx=.js)) JS_OBJS=$(addprefix $(BUILD_DIR)/,$(JS_SRC)) ICONS=$(addprefix $(STATIC_BUILD_DIR)/icons/black/, $(notdir $(wildcard static/icons/black/*.svg))) ICONS+=$(addprefix $(STATIC_BUILD_DIR)/icons/color/, $(notdir $(wildcard static/icons/color/*.svg))) STATIC_BUILD_DIR=build/static -$(info $(ICONS)) - install: node --version npm --version @@ -33,6 +32,7 @@ $(STATIC_BUILD_DIR): mkdir -p $@ mkdir -p $@/icons/black mkdir -p $@/icons/color + mkdir -p $@/fonts $(BUILD_DIR)/%.js: $(SRC_DIR)/%.jsx eslint --fix $< @@ -59,3 +59,38 @@ release: $(STATIC_BUILD_DIR) build/webapp.tar.gz clean: rm -rf build rm -rf node_modules + + +FONT_DIR = ./static/fontello +FONTELLO_HOST ?= http://fontello.com + +fontopen: + @if test ! `which curl` ; then \ + echo 'Install curl first.' >&2 ; \ + exit 128 ; \ + fi + curl --silent --show-error --fail --output .fontello \ + --form "config=@fontello_config.json" \ + ${FONTELLO_HOST} + x-www-browser ${FONTELLO_HOST}/`cat .fontello` + + +fontsave: + @if test ! `which unzip` ; then \ + echo 'Install unzip first.' >&2 ; \ + exit 128 ; \ + fi + @if test ! -e .fontello ; then \ + echo 'Run `make fontopen` first.' >&2 ; \ + exit 128 ; \ + fi + rm -rf .fontello.src .fontello.zip + curl --silent --show-error --fail --output .fontello.zip \ + ${FONTELLO_HOST}/`cat .fontello`/get + unzip .fontello.zip -d .fontello.src + rm -rf ${FONT_DIR} + mv `find ./.fontello.src -maxdepth 1 -name 'fontello-*'` ${FONT_DIR} + rm -rf .fontello.src .fontello.zip + cp ${FONT_DIR}/font/* static/fonts/ + cp ${FONT_DIR}/css/fontello-codes.css static/fontello.css + rm -rf ${FONT_DIR} \ No newline at end of file diff --git a/cmd/web/fontello_config.json b/cmd/web/fontello_config.json new file mode 100644 index 0000000..4ebb1f0 --- /dev/null +++ b/cmd/web/fontello_config.json @@ -0,0 +1,34 @@ +{ + "name": "", + "css_prefix_text": "icon-", + "css_use_suffix": false, + "hinting": true, + "units_per_em": 1000, + "ascent": 850, + "glyphs": [ + { + "uid": "43ab845088317bd348dee1d975700c48", + "css": "ok-circled", + "code": 59392, + "src": "fontawesome" + }, + { + "uid": "0f4cae16f34ae243a6144c18a003f2d8", + "css": "cancel-circled", + "code": 59393, + "src": "fontawesome" + }, + { + "uid": "f2aa28a2548ed3d2be718d087b65ee21", + "css": "key", + "code": 59394, + "src": "fontawesome" + }, + { + "uid": "8b80d36d4ef43889db10bc1f0dc9a862", + "css": "user", + "code": 59395, + "src": "fontawesome" + } + ] +} \ No newline at end of file diff --git a/cmd/web/static/fontello.css b/cmd/web/static/fontello.css new file mode 100644 index 0000000..ba4e933 --- /dev/null +++ b/cmd/web/static/fontello.css @@ -0,0 +1,6 @@ + +.icon-ok-circled:before { content: '\e800'; } /* '' */ +.icon-cancel-circled:before { content: '\e801'; } /* '' */ +.icon-key:before { content: '\e802'; } /* '' */ +.icon-user:before { content: '\e803'; } /* '' */ +.icon-hourglass-2:before { content: '\f252'; } /* '' */ \ No newline at end of file diff --git a/cmd/web/static/fonts/fontello.eot b/cmd/web/static/fonts/fontello.eot new file mode 100644 index 0000000..14932cc Binary files /dev/null and b/cmd/web/static/fonts/fontello.eot differ diff --git a/cmd/web/static/fonts/fontello.svg b/cmd/web/static/fonts/fontello.svg new file mode 100644 index 0000000..dce8334 --- /dev/null +++ b/cmd/web/static/fonts/fontello.svg @@ -0,0 +1,20 @@ + + + +Copyright (C) 2018 by original authors @ fontello.com + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/cmd/web/static/fonts/fontello.ttf b/cmd/web/static/fonts/fontello.ttf new file mode 100644 index 0000000..ab1efb3 Binary files /dev/null and b/cmd/web/static/fonts/fontello.ttf differ diff --git a/cmd/web/static/fonts/fontello.woff b/cmd/web/static/fonts/fontello.woff new file mode 100644 index 0000000..6faf045 Binary files /dev/null and b/cmd/web/static/fonts/fontello.woff differ diff --git a/cmd/web/static/fonts/fontello.woff2 b/cmd/web/static/fonts/fontello.woff2 new file mode 100644 index 0000000..8e41726 Binary files /dev/null and b/cmd/web/static/fonts/fontello.woff2 differ diff --git a/cmd/web/static/index.html b/cmd/web/static/index.html index bf3bd19..6e68a21 100644 --- a/cmd/web/static/index.html +++ b/cmd/web/static/index.html @@ -11,8 +11,8 @@ Cryptoportfolio - +