Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Tailorbird
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Künstlerische Gestaltung
Tailorbird
Commits
7e81177c
Commit
7e81177c
authored
2 years ago
by
Jakob Yanagibashi
Browse files
Options
Downloads
Patches
Plain Diff
Output version info to about modal
parent
30fbcd10
No related branches found
No related tags found
No related merge requests found
Pipeline
#258280
passed
2 years ago
Stage: test
Changes
3
Pipelines
2
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
css/main.css
+10
-0
10 additions, 0 deletions
css/main.css
main.js
+36
-19
36 additions, 19 deletions
main.js
vite.config.js
+14
-0
14 additions, 0 deletions
vite.config.js
with
60 additions
and
19 deletions
css/main.css
+
10
−
0
View file @
7e81177c
...
@@ -156,6 +156,16 @@ article#tools-list-buttons {
...
@@ -156,6 +156,16 @@ article#tools-list-buttons {
height
:
2.5rem
;
height
:
2.5rem
;
}
}
#helpDialog
ul
{
list-style-type
:
none
;
padding
:
0
;
}
#helpDialog
ul
>
li
>
span
.helpControlText
{
position
:
absolute
;
left
:
3rem
;
}
/* Zdog */
/* Zdog */
.zdog-canvas
{
.zdog-canvas
{
...
...
This diff is collapsed.
Click to expand it.
main.js
+
36
−
19
View file @
7e81177c
...
@@ -9,6 +9,20 @@ import * as Zdog from "zdog";
...
@@ -9,6 +9,20 @@ import * as Zdog from "zdog";
import
"
@fortawesome/fontawesome-free/css/fontawesome.css
"
;
import
"
@fortawesome/fontawesome-free/css/fontawesome.css
"
;
import
"
@fortawesome/fontawesome-free/css/solid.css
"
;
import
"
@fortawesome/fontawesome-free/css/solid.css
"
;
var
aboutText
=
`
</h1>
<p>Version:
${
import
.
meta
.
env
.
VITE_APP_DATE
}
(
${
import
.
meta
.
env
.
VITE_APP_HASH
}
)</p>
`
;
if
(
import
.
meta
.
env
.
VITE_APP_BRANCH
==
"
dev
"
)
{
aboutText
=
`
<i class="fa-solid fa-kiwi-bird fa-bounce"></i> BETA</h1>
<p>Version:
${
import
.
meta
.
env
.
VITE_APP_DATE
}
(
${
import
.
meta
.
env
.
VITE_APP_BRANCH
}
${
import
.
meta
.
env
.
VITE_APP_HASH
}
)</p>
`
;
}
document
.
querySelector
(
"
#app
"
).
innerHTML
=
`
document
.
querySelector
(
"
#app
"
).
innerHTML
=
`
<main>
<main>
<section id="viewer">
<section id="viewer">
...
@@ -106,15 +120,14 @@ document.querySelector("#app").innerHTML = `
...
@@ -106,15 +120,14 @@ document.querySelector("#app").innerHTML = `
<!-- Dialogs -->
<!-- Dialogs -->
<dialog id="helpDialog">
<dialog id="helpDialog">
<h1>Tailorbird 3D</h1>
<h1>Tailorbird 3D
${
aboutText
}
<p>
${
new
Date
().
toISOString
()
}
</p>
<h2><i class="fa-solid fa-keyboard"></i> Controls</h2>
<h2>Controls</h2>
<p>
<p>
<ul>
<ul>
<li>Zoom: Scroll wheel</li>
<li>
<i class="fa-solid fa-magnifying-glass"></i> <span class="helpControlText">
Zoom: Scroll wheel</
span></
li>
<li>
Drag:
Rotate horizontally</li>
<li>
<i class="fa-solid fa-left-right"></i> <span class="helpControlText">
Rotate horizontally
: Drag</span>
</li>
<li>
Shift+Drag: Rotate vertically
</li>
<li>
<i class="fa-solid fa-up-down"></i> <span class="helpControlText">Rotate vertically: Shift+Drag</span>
</li>
<li>Opt/Alt+Drag
: Move
</li>
<li>
<i class="fa-solid fa-up-down-left-right"></i> <span class="helpControlText">Move:
Opt/Alt+Drag
</span>
</li>
</ul>
</ul>
</p>
</p>
<form method="dialog">
<form method="dialog">
...
@@ -874,9 +887,9 @@ G28
...
@@ -874,9 +887,9 @@ G28
document
document
.
getElementById
(
"
settingsDialog
"
)
.
getElementById
(
"
settingsDialog
"
)
.
addEventListener
(
"
close
"
,
function
onClose
()
{
.
addEventListener
(
"
close
"
,
function
onClose
(
e
)
{
// Check if Apply button was pressed
// Check if Apply button was pressed
if
(
e
vent
.
target
.
returnValue
!=
"
apply
"
)
return
;
if
(
e
.
target
.
returnValue
!=
"
apply
"
)
return
;
const
data
=
new
FormData
(
document
.
querySelector
(
"
#settingsForm
"
));
const
data
=
new
FormData
(
document
.
querySelector
(
"
#settingsForm
"
));
// Grid display
// Grid display
...
@@ -918,18 +931,18 @@ G28
...
@@ -918,18 +931,18 @@ G28
document
document
.
getElementById
(
"
saveDialog
"
)
.
getElementById
(
"
saveDialog
"
)
.
addEventListener
(
"
close
"
,
function
onClose
()
{
.
addEventListener
(
"
close
"
,
function
onClose
(
e
)
{
// Check if Load button was pressed
// Check if Load button was pressed
if
(
e
vent
.
target
.
returnValue
!=
"
save
"
)
return
;
if
(
e
.
target
.
returnValue
!=
"
save
"
)
return
;
const
inputEl
=
document
.
getElementById
(
"
saveDialogInput
"
);
const
inputEl
=
document
.
getElementById
(
"
saveDialogInput
"
);
saveProject
(
inputEl
.
value
);
saveProject
(
inputEl
.
value
);
});
});
document
document
.
getElementById
(
"
loadDialog
"
)
.
getElementById
(
"
loadDialog
"
)
.
addEventListener
(
"
close
"
,
function
onClose
()
{
.
addEventListener
(
"
close
"
,
function
onClose
(
e
)
{
// Check if Load button was pressed
// Check if Load button was pressed
if
(
e
vent
.
target
.
returnValue
!=
"
load
"
)
return
;
if
(
e
.
target
.
returnValue
!=
"
load
"
)
return
;
const
inputEl
=
document
.
getElementById
(
"
loadDialogInput
"
);
const
inputEl
=
document
.
getElementById
(
"
loadDialogInput
"
);
const
saveInputEl
=
document
.
getElementById
(
"
saveDialogInput
"
);
const
saveInputEl
=
document
.
getElementById
(
"
saveDialogInput
"
);
loadProject
(
inputEl
.
value
);
loadProject
(
inputEl
.
value
);
...
@@ -939,9 +952,9 @@ G28
...
@@ -939,9 +952,9 @@ G28
document
document
.
getElementById
(
"
helpDialog
"
)
.
getElementById
(
"
helpDialog
"
)
.
addEventListener
(
"
close
"
,
function
onClose
()
{
.
addEventListener
(
"
close
"
,
function
onClose
(
e
)
{
// Check if Load button was pressed
// Check if Load button was pressed
switch
(
e
vent
.
target
.
returnValue
)
{
switch
(
e
.
target
.
returnValue
)
{
case
"
example1
"
:
case
"
example1
"
:
window
.
currentProject
=
getPresetModelVase
();
window
.
currentProject
=
getPresetModelVase
();
break
;
break
;
...
@@ -955,9 +968,9 @@ G28
...
@@ -955,9 +968,9 @@ G28
document
document
.
getElementById
(
"
addLineDialog
"
)
.
getElementById
(
"
addLineDialog
"
)
.
addEventListener
(
"
close
"
,
function
onClose
()
{
.
addEventListener
(
"
close
"
,
function
onClose
(
e
)
{
// Check if Add button was pressed
// Check if Add button was pressed
if
(
e
vent
.
target
.
returnValue
!=
"
add
"
)
return
;
if
(
e
.
target
.
returnValue
!=
"
add
"
)
return
;
let
inputX
=
document
.
getElementById
(
"
addLineInputX
"
);
let
inputX
=
document
.
getElementById
(
"
addLineInputX
"
);
let
inputY
=
document
.
getElementById
(
"
addLineInputY
"
);
let
inputY
=
document
.
getElementById
(
"
addLineInputY
"
);
...
@@ -1024,9 +1037,9 @@ G28
...
@@ -1024,9 +1037,9 @@ G28
document
document
.
getElementById
(
"
addArcDialog
"
)
.
getElementById
(
"
addArcDialog
"
)
.
addEventListener
(
"
close
"
,
function
onClose
()
{
.
addEventListener
(
"
close
"
,
function
onClose
(
e
)
{
// Check if Add button was pressed
// Check if Add button was pressed
if
(
e
vent
.
target
.
returnValue
!=
"
add
"
)
return
;
if
(
e
.
target
.
returnValue
!=
"
add
"
)
return
;
const
size
=
document
.
getElementById
(
"
addArcInputSize
"
);
const
size
=
document
.
getElementById
(
"
addArcInputSize
"
);
const
data
=
new
FormData
(
document
.
querySelector
(
"
#addArcForm
"
));
const
data
=
new
FormData
(
document
.
querySelector
(
"
#addArcForm
"
));
...
@@ -1048,4 +1061,8 @@ window.onload = function () {
...
@@ -1048,4 +1061,8 @@ window.onload = function () {
window
.
selectedListEntries
=
[];
window
.
selectedListEntries
=
[];
initIllo
();
initIllo
();
initEventListeners
();
initEventListeners
();
if
(
localStorage
.
getItem
(
"
splashSeen
"
)
!==
"
1
"
)
{
localStorage
.
setItem
(
"
splashSeen
"
,
"
1
"
);
document
.
getElementById
(
"
helpDialog
"
).
showModal
();
}
};
};
This diff is collapsed.
Click to expand it.
vite.config.js
+
14
−
0
View file @
7e81177c
import
{
defineConfig
}
from
'
vite
'
import
*
as
child
from
"
child_process
"
;
const
commitDate
=
new
Date
(
child
.
execSync
(
'
git log -1 --format=%cI
'
).
toString
().
trimEnd
()).
toDateString
();
const
branchName
=
child
.
execSync
(
'
git rev-parse --abbrev-ref HEAD
'
).
toString
().
trimEnd
();
const
commitHash
=
child
.
execSync
(
'
git rev-parse --short HEAD
'
).
toString
().
trimEnd
();
export
default
defineConfig
({
define
:
{
'
import.meta.env.VITE_APP_DATE
'
:
JSON
.
stringify
(
commitDate
),
'
import.meta.env.VITE_APP_BRANCH
'
:
JSON
.
stringify
(
branchName
),
'
import.meta.env.VITE_APP_HASH
'
:
JSON
.
stringify
(
commitHash
),
}
});
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment