From 860d8c9b205984e9ebbfc4776d9c85eeb820f17c Mon Sep 17 00:00:00 2001 From: Jason Date: Tue, 29 Nov 2022 09:49:55 +0000 Subject: [PATCH 1/3] Implement Font Selection --- js/prettygcodeview.js | 14 +++++++++++++- pgcode.html | 25 ++++++++++++++----------- 2 files changed, 27 insertions(+), 12 deletions(-) diff --git a/js/prettygcodeview.js b/js/prettygcodeview.js index c01026b..23fca58 100644 --- a/js/prettygcodeview.js +++ b/js/prettygcodeview.js @@ -17,6 +17,7 @@ $(function () { this.showNozzle=true; this.highlightCurrentLayer=true; this.show2d=true; + this.font="Brush Script"; }; var pgSettings = new PGSettings(); window.PGCSettings=pgSettings; @@ -338,6 +339,11 @@ $(function () { //todo handle finish change for this gui.add(pgSettings, 'perspectiveCamera'); + + gui.add(pgSettings, 'font', ["Ariel", "Brush Script", "Courier New", "Helvetica", "Times", "Verdana"]).onFinishChange(function(){ + InitFont(); + });; + var folder = gui.addFolder('Windows');//hidden. // folder.add(pgSettings, 'showState').onFinishChange(updateWindowStates).listen(); @@ -355,6 +361,12 @@ $(function () { } } + function InitFont() + { + var font = pgSettings.font === "Brush Script" ? "'Brush Script MT', cursive" : pgSettings.font; + $('.pgLogo').css({"font-family" : font}); + $('.pgclabel').css({"font-family" : font}); + } self.initScene = function () { if (!viewInitialized) { @@ -556,7 +568,7 @@ $(function () { scene.background = new THREE.Color(0xd0d0d0); else scene.background = null;//new THREE.Color(0xd0d0d0); - + InitFont(); //for debugging window.myScene = scene; diff --git a/pgcode.html b/pgcode.html index 3d10cd1..c0d4345 100644 --- a/pgcode.html +++ b/pgcode.html @@ -120,21 +120,24 @@ color: white; } + .pgLogo + { + position: absolute; + top: 12px; + left: 24px; + color: #38bfff; + z-index: 10; + /* background: rgb(119 85 85 / 45%); */ + font-family: 'Brush Script MT', cursive; + font-size: large; + text-shadow: 2px 2px 2px rgb(51, 51, 51); + } + /* h1 { font-family: "Architects Daughter"; font-size: 24px; font-style: normal; font-variant: normal; font-weight: 700; line-height: 26.4px; } h3 { font-family: "Architects Daughter"; font-size: 14px; font-style: normal; font-variant: normal; font-weight: 700; line-height: 15.4px; } p { font-family: "Architects Daughter"; font-size: 14px; font-style: normal; font-variant: normal; font-weight: 400; line-height: 20px; } blockquote { font-family: "Architects Daughter"; font-size: 21px; font-style: normal; font-variant: normal; font-weight: 400; line-height: 30px; } pre { font-family: "Architects Daughter"; font-size: 13px; font-style: normal; font-variant: normal; font-weight: 400; line-height: 18.5714px; } */ -
+ From 5e625fe195cf80a6a99621217152d9f2c1b19a5d Mon Sep 17 00:00:00 2001 From: Jason Date: Tue, 29 Nov 2022 12:12:23 +0000 Subject: [PATCH 2/3] Move font initialise --- js/prettygcodeview.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/js/prettygcodeview.js b/js/prettygcodeview.js index 23fca58..fa924d9 100644 --- a/js/prettygcodeview.js +++ b/js/prettygcodeview.js @@ -343,7 +343,7 @@ $(function () { gui.add(pgSettings, 'font', ["Ariel", "Brush Script", "Courier New", "Helvetica", "Times", "Verdana"]).onFinishChange(function(){ InitFont(); });; - + InitFont(); var folder = gui.addFolder('Windows');//hidden. // folder.add(pgSettings, 'showState').onFinishChange(updateWindowStates).listen(); @@ -568,7 +568,7 @@ $(function () { scene.background = new THREE.Color(0xd0d0d0); else scene.background = null;//new THREE.Color(0xd0d0d0); - InitFont(); + //for debugging window.myScene = scene; From 350355f4a66202334ff762a5aaf976da45da0456 Mon Sep 17 00:00:00 2001 From: Jason Date: Tue, 29 Nov 2022 12:25:23 +0000 Subject: [PATCH 3/3] Load cancelled prints --- js/prettygcodeview.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/js/prettygcodeview.js b/js/prettygcodeview.js index fa924d9..4184e09 100644 --- a/js/prettygcodeview.js +++ b/js/prettygcodeview.js @@ -390,10 +390,11 @@ $(function () { if($(".pgconnection").hasClass("connected")) $(".pgconnection").removeClass("connected") } + $("#status-state").html(newState.state) $("#status-elapsed").html(new Date(newState.printTime * 1000).toISOString().substr(11, 8)) $("#status-done").html(newState.perDone.toString()+"%") - if(newState.printTimeLeft) + if(newState.printTimeLeft && Number.isFinite(newState.printTimeLeft)) $("#status-eta").html(new Date(newState.printTimeLeft * 1000).toISOString().substr(11, 8)) //todo. find another place for this?