Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
G
Graphics generator
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Alexa Valentová
Graphics generator
Commits
727ea618
Commit
727ea618
authored
8 months ago
by
Tomi Valentová
Browse files
Options
Downloads
Patches
Plain Diff
add reels
parent
65ce763f
No related branches found
No related tags found
No related merge requests found
Pipeline
#19597
passed
8 months ago
Stage: build
Stage: test_deploy
Changes
3
Pipelines
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
VERSION
+1
-1
1 addition, 1 deletion
VERSION
frontend/src/views/reel/Reel.vue
+12
-3
12 additions, 3 deletions
frontend/src/views/reel/Reel.vue
frontend/src/views/reel/canvas.js
+61
-6
61 additions, 6 deletions
frontend/src/views/reel/canvas.js
with
74 additions
and
10 deletions
VERSION
+
1
−
1
View file @
727ea618
2.1
1
.0
2.1
2
.0
This diff is collapsed.
Click to expand it.
frontend/src/views/reel/Reel.vue
+
12
−
3
View file @
727ea618
...
...
@@ -44,13 +44,14 @@ export default {
background
:
COLORS
.
black
,
mainText
:
COLORS
.
white
,
highlightedText
:
COLORS
.
yellow1
,
contractedByText
:
COLORS
.
black
contractedByText
:
COLORS
.
white
},
},
};
return
{
mainText
:
null
,
nameText
:
null
,
mainImage
:
null
,
contractedBy
:
DEFAULT_CONTRACTOR
,
gradientHeightMultiplier
:
1
,
...
...
@@ -70,6 +71,7 @@ export default {
const
canvasProperties
=
{
mainImage
:
this
.
mainImage
,
mainText
:
this
.
mainText
,
nameText
:
this
.
nameText
,
contractedBy
:
this
.
contractedBy
,
colors
:
this
.
colors
,
};
...
...
@@ -86,7 +88,7 @@ export default {
},
mounted
()
{
this
.
$watch
(
(
vm
)
=>
[
vm
.
mainText
,
vm
.
contractedBy
,
vm
.
colors
],
(
vm
)
=>
[
vm
.
mainText
,
vm
.
nameText
,
vm
.
contractedBy
,
vm
.
colors
],
async
(
value
)
=>
{
if
(
this
.
autoRedraw
)
{
await
this
.
reloadCanvasProperties
();
...
...
@@ -138,12 +140,19 @@ export default {
zIndex=
"10"
/>
<ShortTextInput
name=
"Jméno"
v-model=
"nameText"
:important=
"false"
zIndex=
"9"
/>
<LongTextInput
name=
"Text"
v-model=
"mainText"
:important=
"true"
:highlightable=
"true"
zIndex=
"
9
"
zIndex=
"
8
"
/>
<ShortTextInput
...
...
This diff is collapsed.
Click to expand it.
frontend/src/views/reel/canvas.js
+
61
−
6
View file @
727ea618
...
...
@@ -8,20 +8,21 @@ import {
import
COLORS
from
"
../../colors
"
;
import
{
PaddedHighlightingTextbox
}
from
"
../../components/canvas/textbox
"
;
import
bg
ImageSource
from
"
../../assets/
template/social_cover_large_text/background
.png
"
;
import
logo
ImageSource
from
"
../../assets/
logos/default-light
.png
"
;
let
mainImage
=
null
;
let
logoImage
=
null
;
let
mainImageSource
=
null
;
let
contractedByTextbox
=
null
;
let
mainTextBox
=
null
;
let
nameText
=
null
;
const
redraw
=
async
(
canvas
,
options
)
=>
{
clearObjects
([
contractedByTextbox
,
mainTextBox
],
canvas
);
clearObjects
([
contractedByTextbox
,
mainTextBox
,
nameText
],
canvas
);
const
contractedByTextSize
=
Math
.
ceil
(
canvas
.
height
*
0.01
);
const
contractedByTextMaxWidth
=
Math
.
ceil
(
canvas
.
width
*
0.9
);
const
contractedByTextBottomMargin
=
Math
.
ceil
(
canvas
.
width
*
0.02
);
const
contractedByTextSideMargin
=
Math
.
ceil
(
canvas
.
width
*
0.03
);
const
contractedByTextSize
=
Math
.
ceil
(
canvas
.
height
*
0.013
);
const
contractedByTextBottomMargin
=
Math
.
ceil
(
canvas
.
width
*
0.04
);
const
contractedByTextSideMargin
=
Math
.
ceil
(
canvas
.
width
*
0.05
);
const
mainTextMarginTop
=
Math
.
ceil
(
canvas
.
height
*
0.15
);
const
mainTextMarginLeft
=
Math
.
ceil
(
canvas
.
width
*
0.05
);
...
...
@@ -30,6 +31,13 @@ const redraw = async (canvas, options) => {
const
mainTextMaxLines
=
7
;
const
mainTextLineHeight
=
0.85
;
const
nameTextMarginLeft
=
Math
.
ceil
(
canvas
.
width
*
0.05
);
const
nameTextMarginTop
=
Math
.
ceil
(
canvas
.
height
*
0.1
);
const
nameTextSize
=
Math
.
ceil
(
canvas
.
height
*
0.05
);
const
logoWidth
=
Math
.
ceil
(
canvas
.
width
*
0.3
);
const
logoSideMargin
=
Math
.
ceil
(
canvas
.
width
*
0.04
);
canvas
.
preserveObjectStacking
=
true
;
/* BEGIN Main image render */
...
...
@@ -70,6 +78,22 @@ const redraw = async (canvas, options) => {
/* END Main image render */
/* BEGIN Name text render */
if
(
options
.
nameText
!==
null
)
{
nameText
=
new
fabric
.
Text
(
`
${
options
.
nameText
}
:`
,
{
left
:
nameTextMarginLeft
,
top
:
nameTextMarginTop
,
fontFamily
:
"
Bebas Neue
"
,
fontSize
:
nameTextSize
,
fill
:
"
#fff
"
,
selectable
:
false
,
zIndex
:
40
,
});
canvas
.
add
(
nameText
);
}
/* BEGIN Main text render */
if
(
options
.
mainText
!==
null
)
{
...
...
@@ -105,6 +129,37 @@ const redraw = async (canvas, options) => {
/* END Main text render */
/* BEGIN Logo render */
if
(
logoImage
===
null
)
{
if
(
logoImage
!==
null
)
{
canvas
.
remove
(
logoImage
);
}
const
logoImageElement
=
new
Image
();
await
new
Promise
((
resolve
)
=>
{
logoImageElement
.
onload
=
()
=>
{
resolve
();
};
logoImageElement
.
src
=
logoImageSource
;
});
logoImage
=
new
fabric
.
Image
(
logoImageElement
,
{
selectable
:
false
});
logoImage
.
scaleToWidth
(
logoWidth
);
logoImage
.
set
({
left
:
logoSideMargin
,
top
:
canvas
.
height
-
logoSideMargin
-
logoImage
.
getScaledHeight
(),
zIndex
:
11
,
});
canvas
.
add
(
logoImage
);
}
/* END Logo render */
/* BEGIN Contracted by render */
if
(
options
.
contractedBy
!==
null
)
{
...
...
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