Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
chip-ahoyto
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
João Magalhães
chip-ahoyto
Commits
25bdd180
Verified
Commit
25bdd180
authored
2 years ago
by
João Magalhães
Browse files
Options
Downloads
Patches
Plain Diff
feat: better button color
parent
ccc0cbfb
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Pipeline
#722
passed
2 years ago
Stage: build
Stage: deploy
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
examples/web/index.css
+10
-2
10 additions, 2 deletions
examples/web/index.css
examples/web/index.html
+1
-1
1 addition, 1 deletion
examples/web/index.html
examples/web/index.ts
+9
-2
9 additions, 2 deletions
examples/web/index.ts
with
20 additions
and
5 deletions
examples/web/index.css
+
10
−
2
View file @
25bdd180
...
@@ -83,10 +83,8 @@ p {
...
@@ -83,10 +83,8 @@ p {
.main
>
.side-left
.canvas-container.fullscreen
>
.canvas
{
.main
>
.side-left
.canvas-container.fullscreen
>
.canvas
{
border
:
none
;
border
:
none
;
height
:
100%
;
margin
:
0px
0px
0px
0px
;
margin
:
0px
0px
0px
0px
;
padding
:
0px
0px
0px
0px
;
padding
:
0px
0px
0px
0px
;
width
:
100%
;
}
}
.main
>
.side-right
{
.main
>
.side-right
{
...
@@ -286,10 +284,18 @@ p {
...
@@ -286,10 +284,18 @@ p {
background-color
:
#50cb93
;
background-color
:
#50cb93
;
}
}
.tiny-button.red
:hover
{
background-color
:
#e63946
;
}
.tiny-button
:active
{
.tiny-button
:active
{
background-color
:
#2a9d8f
;
background-color
:
#2a9d8f
;
}
}
.tiny-button.red
:active
{
background-color
:
#bf2a37
;
}
.tiny-button
>
img
{
.tiny-button
>
img
{
margin-right
:
6px
;
margin-right
:
6px
;
margin-top
:
2px
;
margin-top
:
2px
;
...
@@ -454,6 +460,7 @@ p {
...
@@ -454,6 +460,7 @@ p {
.modal-container
>
.modal
.modal-text
{
.modal-container
>
.modal
.modal-text
{
font-size
:
20px
;
font-size
:
20px
;
line-height
:
26px
;
}
}
.modal-container
>
.modal
.modal-buttons
{
.modal-container
>
.modal
.modal-buttons
{
...
@@ -464,6 +471,7 @@ p {
...
@@ -464,6 +471,7 @@ p {
.modal-container
>
.modal
.modal-buttons
>
.tiny-button
{
.modal-container
>
.modal
.modal-buttons
>
.tiny-button
{
margin-right
:
12px
;
margin-right
:
12px
;
min-width
:
120px
;
}
}
.modal-container
>
.modal
.modal-buttons
>
.tiny-button
:last-child
{
.modal-container
>
.modal
.modal-buttons
>
.tiny-button
:last-child
{
...
...
This diff is collapsed.
Click to expand it.
examples/web/index.html
+
1
−
1
View file @
25bdd180
...
@@ -81,7 +81,7 @@
...
@@ -81,7 +81,7 @@
<h2
id=
"modal-title"
class=
"modal-title"
>
Alert
</h2>
<h2
id=
"modal-title"
class=
"modal-title"
>
Alert
</h2>
<p
id=
"modal-text"
class=
"modal-text"
>
Are you sure you want to cancel the operation?
</p>
<p
id=
"modal-text"
class=
"modal-text"
>
Are you sure you want to cancel the operation?
</p>
<div
class=
"modal-buttons"
>
<div
class=
"modal-buttons"
>
<span
id=
"modal-cancel"
class=
"tiny-button border padded-large"
>
Cancel
</span>
<span
id=
"modal-cancel"
class=
"tiny-button
red
border padded-large"
>
Cancel
</span>
<span
id=
"modal-confirm"
class=
"tiny-button border padded-large"
>
Confirm
</span>
<span
id=
"modal-confirm"
class=
"tiny-button border padded-large"
>
Confirm
</span>
</div>
</div>
</div>
</div>
...
...
This diff is collapsed.
Click to expand it.
examples/web/index.ts
+
9
−
2
View file @
25bdd180
...
@@ -395,7 +395,7 @@ const registerButtons = () => {
...
@@ -395,7 +395,7 @@ const registerButtons = () => {
const
buttonBenchmark
=
document
.
getElementById
(
"
button-benchmark
"
);
const
buttonBenchmark
=
document
.
getElementById
(
"
button-benchmark
"
);
buttonBenchmark
.
addEventListener
(
"
click
"
,
async
()
=>
{
buttonBenchmark
.
addEventListener
(
"
click
"
,
async
()
=>
{
const
result
=
await
showModal
(
const
result
=
await
showModal
(
"
Are you sure you want to start a benchmark?
"
,
"
Are you sure you want to start a benchmark?
\n
The benchmark is considered an expensive operation!
"
,
"
Confirm
"
"
Confirm
"
);
);
if
(
!
result
)
return
;
if
(
!
result
)
return
;
...
@@ -475,6 +475,12 @@ const registerModal = () => {
...
@@ -475,6 +475,12 @@ const registerModal = () => {
modalConfirm
.
addEventListener
(
"
click
"
,
()
=>
{
modalConfirm
.
addEventListener
(
"
click
"
,
()
=>
{
hideModal
(
true
);
hideModal
(
true
);
});
});
document
.
addEventListener
(
"
keydown
"
,
(
event
)
=>
{
if
(
event
.
key
===
"
Escape
"
)
{
hideModal
(
false
);
}
});
};
};
const
initBase
=
async
()
=>
{
const
initBase
=
async
()
=>
{
...
@@ -542,7 +548,7 @@ const showModal = async (
...
@@ -542,7 +548,7 @@ const showModal = async (
const
modalText
=
document
.
getElementById
(
"
modal-text
"
);
const
modalText
=
document
.
getElementById
(
"
modal-text
"
);
modalContainer
.
classList
.
add
(
"
visible
"
);
modalContainer
.
classList
.
add
(
"
visible
"
);
modalTitle
.
textContent
=
title
;
modalTitle
.
textContent
=
title
;
modalText
.
textContent
=
message
;
modalText
.
innerHTML
=
message
.
replace
(
/
\n
/g
,
"
<br/>
"
)
;
const
result
=
(
await
new
Promise
((
resolve
)
=>
{
const
result
=
(
await
new
Promise
((
resolve
)
=>
{
global
.
modalCallback
=
resolve
;
global
.
modalCallback
=
resolve
;
}))
as
boolean
;
}))
as
boolean
;
...
@@ -553,6 +559,7 @@ const hideModal = async (result = true) => {
...
@@ -553,6 +559,7 @@ const hideModal = async (result = true) => {
const
modalContainer
=
document
.
getElementById
(
"
modal-container
"
);
const
modalContainer
=
document
.
getElementById
(
"
modal-container
"
);
modalContainer
.
classList
.
remove
(
"
visible
"
);
modalContainer
.
classList
.
remove
(
"
visible
"
);
if
(
global
.
modalCallback
)
global
.
modalCallback
(
result
);
if
(
global
.
modalCallback
)
global
.
modalCallback
(
result
);
global
.
modalCallback
=
null
;
};
};
const
setVersion
=
(
value
:
string
)
=>
{
const
setVersion
=
(
value
:
string
)
=>
{
...
...
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