Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Toolkit
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
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
digital blueprint
Web Component Framework
Toolkit
Commits
d61d8f58
Commit
d61d8f58
authored
5 years ago
by
Bekerle, Patrizio
Committed by
Reiter, Christoph
4 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Add mini-spinner text support
parent
010239f9
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
packages/common/vpu-common-demo.js
+1
-0
1 addition, 0 deletions
packages/common/vpu-common-demo.js
packages/common/vpu-mini-spinner.js
+19
-1
19 additions, 1 deletion
packages/common/vpu-mini-spinner.js
with
20 additions
and
1 deletion
packages/common/vpu-common-demo.js
+
1
−
0
View file @
d61d8f58
...
@@ -99,6 +99,7 @@ class VpuCommonDemo extends LitElement {
...
@@ -99,6 +99,7 @@ class VpuCommonDemo extends LitElement {
<div class="content">
<div class="content">
<h2>Mini Spinner</h2>
<h2>Mini Spinner</h2>
<div class="control">
<div class="control">
<vpu-mini-spinner text="Loading..."></vpu-mini-spinner>
<vpu-mini-spinner></vpu-mini-spinner>
<vpu-mini-spinner></vpu-mini-spinner>
<vpu-mini-spinner style="font-size: 2em"></vpu-mini-spinner>
<vpu-mini-spinner style="font-size: 2em"></vpu-mini-spinner>
<vpu-mini-spinner style="font-size: 3em"></vpu-mini-spinner>
<vpu-mini-spinner style="font-size: 3em"></vpu-mini-spinner>
...
...
This diff is collapsed.
Click to expand it.
packages/common/vpu-mini-spinner.js
+
19
−
1
View file @
d61d8f58
...
@@ -5,10 +5,21 @@ import * as commonUtils from './utils.js';
...
@@ -5,10 +5,21 @@ import * as commonUtils from './utils.js';
class
MiniSpinner
extends
LitElement
{
class
MiniSpinner
extends
LitElement
{
constructor
()
{
constructor
()
{
super
();
super
();
this
.
text
=
""
;
}
static
get
properties
()
{
return
{
text
:
{
type
:
String
},
};
}
}
static
get
styles
()
{
static
get
styles
()
{
// language=css
return
css
`
return
css
`
.outer {
display: flex;
}
.ring {
.ring {
display: inline-block;
display: inline-block;
position: relative;
position: relative;
...
@@ -42,11 +53,18 @@ class MiniSpinner extends LitElement {
...
@@ -42,11 +53,18 @@ class MiniSpinner extends LitElement {
100% {
100% {
transform: rotate(360deg);
transform: rotate(360deg);
}
}
}
.text {
display: inline-block;
margin-left: 0.5em;
font-size: 0.7em;
}`
;
}`
;
}
}
render
()
{
render
()
{
return
html
`<div class="ring"><div></div><div></div><div></div><div></div></div>`
;
const
textHtml
=
this
.
text
!==
""
?
html
`<div class="text">
${
this
.
text
}
</div>`
:
html
``
;
return
html
`<div class="outer"><div class="ring"><div></div><div></div><div></div><div></div></div>
${
textHtml
}
</div>`
;
}
}
}
}
...
...
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