Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
R
RLG Maker
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Romain DELEAU
RLG Maker
Commits
54b517a4
Commit
54b517a4
authored
Jan 26, 2023
by
Romain DELEAU
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Dynamic width for task
parent
c114060a
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
32 additions
and
7 deletions
+32
-7
app.module.ts
src/app/app.module.ts
+4
-1
task.component.html
src/app/pieces/task/task.component.html
+3
-3
task.component.scss
src/app/pieces/task/task.component.scss
+4
-3
task.component.ts
src/app/pieces/task/task.component.ts
+21
-0
No files found.
src/app/app.module.ts
View file @
54b517a4
...
...
@@ -11,6 +11,8 @@ import { GameContextComponent } from './pieces/game-context/game-context.compone
import
{
TaskComponent
}
from
'./pieces/task/task.component'
;
import
{
AnnexeTaskComponent
}
from
'./pieces/annexe-task/annexe-task.component'
;
import
{
FormsModule
}
from
'@angular/forms'
;
@
NgModule
({
declarations
:
[
AppComponent
,
...
...
@@ -24,7 +26,8 @@ import { AnnexeTaskComponent } from './pieces/annexe-task/annexe-task.component'
],
imports
:
[
BrowserModule
,
AppRoutingModule
AppRoutingModule
,
FormsModule
,
],
providers
:
[],
bootstrap
:
[
AppComponent
]
...
...
src/app/pieces/task/task.component.html
View file @
54b517a4
<div
class=
"piece"
>
<div
class=
"piece"
[
ngStyle
]="{'
width
'
:
pieceWidth
}"
>
<div
class=
"piece-attach piece-attach-left"
></div>
<div
class=
"piece-attach piece-attach-right"
></div>
...
...
@@ -15,8 +15,8 @@
<option
value=
"1"
>
1
</option>
</select>
<div
class=
"piece-form-bottom-duration"
>
<input
name=
"value"
type=
"text"
value=
"1
"
/>
<select
name=
"unite"
>
<input
name=
"value"
type=
"text"
[(
ngModel
)]="
duration
"
(
input
)="
durationChange
()
"
/>
<select
name=
"unite"
[(
ngModel
)]="
durationUnit
"
(
change
)="
durationChange
()"
>
<option
selected
value=
"UT"
>
UT
</option>
<option
value=
"min"
>
min
</option>
<option
value=
"tours"
>
tours
</option>
...
...
src/app/pieces/task/task.component.scss
View file @
54b517a4
...
...
@@ -5,6 +5,7 @@
height
:
400px
;
position
:
relative
;
background-color
:
var
(
--
piece-background-color
);
transition
:
all
0
.5s
ease
;
&
-attach
{
z-index
:
1
;
...
...
@@ -89,17 +90,17 @@
&
-bottom
{
display
:
flex
;
flex-direction
:
row
;
margin-bottom
:
25
px
;
margin-bottom
:
10
px
;
justify-content
:
space-between
;
&
-duration
{
input
{
border-top-right-radius
:
0px
;
border-bottom-right-radius
:
0px
;
width
:
5
0px
;
width
:
2
0px
;
z-index
:
2
;
}
select
{
width
:
5
0px
;
width
:
6
0px
;
border-top-left-radius
:
0px
;
border-bottom-left-radius
:
0px
;
z-index
:
1
;
...
...
src/app/pieces/task/task.component.ts
View file @
54b517a4
...
...
@@ -12,4 +12,25 @@ export class TaskComponent implements OnInit {
ngOnInit
():
void
{
}
durationUnit
:
String
=
'UT'
;
duration
:
number
=
1
;
pieceWidth
=
'400px'
;
durationChange
():
void
{
if
(
this
.
durationUnit
===
'UT'
)
{
if
(
this
.
duration
==
1
)
{
this
.
pieceWidth
=
'400px'
;
}
else
if
(
this
.
duration
==
2
)
{
this
.
pieceWidth
=
'800px'
;
}
else
if
(
this
.
duration
>=
3
)
{
this
.
pieceWidth
=
'1200px'
;
}
}
else
{
this
.
pieceWidth
=
'400px'
;
}
console
.
log
(
'largeur : '
+
this
.
pieceWidth
);
console
.
log
(
'durationUnit : '
+
this
.
durationUnit
);
console
.
log
(
'duration : '
+
this
.
duration
);
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment