From 1e9da3cf99112c1aedbc900858b074f67cf12bdd Mon Sep 17 00:00:00 2001 From: zzzmisa Date: Sat, 17 Sep 2022 00:12:12 +0900 Subject: [PATCH] Make it possible to change font --- css/style.css | 2 -- en/index.html | 53 ++++++++++++++++++++++++++++++++++++++++----------- index.html | 53 ++++++++++++++++++++++++++++++++++++++++----------- js/fonts.js | 6 ++++++ js/index.js | 17 ++++++++++++----- 5 files changed, 102 insertions(+), 29 deletions(-) create mode 100644 js/fonts.js diff --git a/css/style.css b/css/style.css index cb78d29..cf45b2b 100755 --- a/css/style.css +++ b/css/style.css @@ -8,8 +8,6 @@ justify-content: center; text-align: center; - /* コンテンツのフォント */ - font-family: "Lato", sans-serif; font-size: 60px; color: white; diff --git a/en/index.html b/en/index.html index 2a43de0..69e4c50 100644 --- a/en/index.html +++ b/en/index.html @@ -8,8 +8,9 @@ - - + + + Generator of simple featured images @@ -185,20 +186,50 @@

Generator of simple featured images

-
-

- -

-
+

+ +

x
-
+

+ +

+
+
+
+ +

+

+

+ +

- + Pick

+

+
+ + -
+ diff --git a/index.html b/index.html index d27c80f..26dadbe 100644 --- a/index.html +++ b/index.html @@ -8,8 +8,9 @@ - - + + + アイキャッチ画像が簡単に作れるジェネレ @@ -184,20 +185,50 @@

アイキャッチ画像が簡単に作れるジェネレ
-
-

- -

-
+

+ +

x
-
+

+ +

+
+
+
+ +

+

+

+ +

- + 選択

+

+
+ + -
+ diff --git a/js/fonts.js b/js/fonts.js new file mode 100644 index 0000000..2e40d14 --- /dev/null +++ b/js/fonts.js @@ -0,0 +1,6 @@ +export default [ + { name: "BIZ UDPGothic", fontFamily: '"BIZ UDPGothic", sans-serif' }, + { name: "Lato", fontFamily: '"Lato", sans-serif' }, + { name: "Oswald", fontFamily: '"Oswald", sans-serif' }, + { name: "Train One", fontFamily: '"Train One", cursive' }, +]; diff --git a/js/index.js b/js/index.js index 33b409d..b2f3464 100644 --- a/js/index.js +++ b/js/index.js @@ -1,17 +1,20 @@ import icons from "./icons.js"; import webgradients from "./webgradients.js"; +import fonts from "./fonts.js"; var app = new Vue({ el: "#app", data: { iconsModalFlg: false, gradientsModalFlg: false, + fontsModalFlg: false, title: "Eye Catch Maker", title_en: "Featured image maker", icon: "fa fa-eye", color: "to left top, #05FBFF, #1E00FF", width: 780, height: 520, + font: fonts[1], items: [ { title: "サンプル1", @@ -33,7 +36,6 @@ var app = new Vue({ }, ], keyword: "", - webgradients: webgradients, loading: false, zoomPercentage: 100, }, @@ -44,6 +46,12 @@ var app = new Vue({ } }, computed: { + fonts: function () { + return fonts; + }, + webgradients: function () { + return webgradients; + }, cssForPreview: function () { return { zoom: this.zoomPercentage + "%", @@ -56,6 +64,7 @@ var app = new Vue({ width: this.width + "px", height: this.height + "px", background: "linear-gradient(" + this.color + ")", + fontFamily: this.font.fontFamily, }; }, searchedIcons: function () { @@ -104,10 +113,8 @@ var app = new Vue({ selectGradient: function (selectedGradient) { this.color = selectedGradient; }, - linearGradientForRoop: function (color) { - return { - background: "linear-gradient(" + color + ")", - }; + selectFont: function (selectedFont) { + this.font = selectedFont; }, }, });