redesign & code BIP39 (#1)

* redesign & code BIP39

* optimize the UI after hide private infomation

* toggle button styles in table

* responsive web design & add filter effect when hide private data

* translate into chinese

* transtate update

* modify meta tag

* decrease container's width

* favicon & site title

* page header

* language test

* layout fine-turning

* Add ignores

* Update compile script

* Correct replace styling behavior

* Add deploy shell script

* Move assets to root, change according image src

* update content: form__recovery_phrase__hint

* Remove `.DS_Store`

* Add Google GA script

* Update favicon tag and 'loading' zh translation

* remove tippyjs

* remove tippyjs files

* remove npm package

Co-authored-by: Franco Chen <chenhuifan.gg@gmail.com>
This commit is contained in:
AmagiDDmxh
2021-07-06 17:17:25 +08:00
committed by GitHub
parent c4f0c2908f
commit 919acaa0bb
28 changed files with 6765 additions and 8061 deletions

View File

@@ -7,43 +7,47 @@ from io import open
# It removes script and style tags and replaces with the file content.
f = open('src/index.html', "r", encoding="utf-8")
page = f.read()
f.close()
def compile(sourcefile):
f = open(os.path.join("src", sourcefile), "r", encoding="utf-8")
page = f.read()
f.close()
# Script tags
scriptsFinder = re.compile("""<script src="(.*)"></script>""")
scripts = scriptsFinder.findall(page)
for script in scripts:
filename = os.path.join("src", script)
s = open(filename, "r", encoding="utf-8")
scriptContent = "<script>%s</script>" % s.read()
s.close()
scriptTag = """<script src="%s"></script>""" % script
page = page.replace(scriptTag, scriptContent)
# Style tags
stylesFinder = re.compile("""<link rel="stylesheet" href="(.*)" />""")
styles = stylesFinder.findall(page)
for style in styles:
filename = os.path.join("src", style)
s = open(filename, "r", encoding="utf-8")
print("Writing " + filename + " into html")
styleContent = "<style>%s</style>" % s.read()
s.close()
styleTag = """<link rel="stylesheet" href="%s" />""" % style
page = page.replace(styleTag, styleContent)
# Write the standalone file
f = open(sourcefile, 'w', encoding="utf-8")
f.write(page)
f.close()
print(str(datetime.datetime.now()) + " - DONE Compiled: " + sourcefile)
# Script tags
filenames = ['index.html', 'index-zh.html']
scriptsFinder = re.compile("""<script src="(.*)"></script>""")
scripts = scriptsFinder.findall(page)
for script in scripts:
filename = os.path.join("src", script)
s = open(filename, "r", encoding="utf-8")
scriptContent = "<script>%s</script>" % s.read()
s.close()
scriptTag = """<script src="%s"></script>""" % script
page = page.replace(scriptTag, scriptContent)
# Style tags
stylesFinder = re.compile("""<link rel="stylesheet" href="(.*)">""")
styles = stylesFinder.findall(page)
for style in styles:
filename = os.path.join("src", style)
s = open(filename, "r", encoding="utf-8")
styleContent = "<style>%s</style>" % s.read()
s.close()
styleTag = """<link rel="stylesheet" href="%s">""" % style
page = page.replace(styleTag, styleContent)
# Write the standalone file
f = open('bip39-standalone.html', 'w', encoding="utf-8")
f.write(page)
f.close()
print("%s - DONE" % datetime.datetime.now())
for filename in filenames:
compile(filename)