This repository has been archived by the owner on Jan 2, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 74
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add spinner before loading an email or draft
related with #657 with @tuliocasagrande
- Loading branch information
1 parent
ece5e03
commit d1b62b7
Showing
12 changed files
with
143 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
/* | ||
* Copyright (c) 2017 ThoughtWorks, Inc. | ||
* | ||
* Pixelated is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU Affero General Public License as published by | ||
* the Free Software Foundation, either version 3 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* Pixelated is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU Affero General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU Affero General Public License | ||
* along with Pixelated. If not, see <http://www.gnu.org/licenses/>. | ||
*/ | ||
define( | ||
[ | ||
'flight/lib/component', | ||
'views/templates' | ||
], | ||
|
||
function(defineComponent, templates) { | ||
'use strict'; | ||
|
||
return defineComponent(spinner); | ||
|
||
function spinner() { | ||
this.render = function () { | ||
this.$node.html(templates.mails.spinner()); | ||
}; | ||
|
||
this.after('initialize', function () { | ||
this.render(); | ||
}); | ||
} | ||
} | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
$offset: 187; | ||
$duration: 1.4s; | ||
|
||
.spinner-section { | ||
margin: auto; | ||
width: 35px; | ||
margin-top: 40%; | ||
} | ||
|
||
#spinner { | ||
animation: rotator $duration linear infinite; | ||
} | ||
|
||
@keyframes rotator { | ||
0% { transform: rotate(0deg); } | ||
100% { transform: rotate(270deg); } | ||
} | ||
|
||
.path { | ||
stroke-dasharray: $offset; | ||
stroke-dashoffset: 0; | ||
transform-origin: center; | ||
animation: | ||
dash $duration ease-in-out infinite, | ||
colors ($duration*4) ease-in-out infinite; | ||
} | ||
|
||
@keyframes colors { | ||
0% { stroke: $dark_blue; } | ||
50% { stroke: $middle_blue; } | ||
100% { stroke: $dark_blue; } | ||
} | ||
|
||
@keyframes dash { | ||
0% { stroke-dashoffset: $offset; } | ||
50% { | ||
stroke-dashoffset: $offset/4; | ||
transform:rotate(135deg); | ||
} | ||
100% { | ||
stroke-dashoffset: $offset; | ||
transform:rotate(450deg); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<div class="spinner-section"> | ||
<svg id="spinner" width="35px" height="35px" viewBox="0 0 66 66" xmlns="http://www.w3.org/2000/svg"> | ||
<circle class="path" fill="none" stroke-width="6" stroke-linecap="round" cx="33" cy="33" r="30"></circle> | ||
</svg> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
describeComponent('mail_view/ui/spinner', function () { | ||
'use strict'; | ||
|
||
describe('spinner on initialization', function () { | ||
|
||
it('should render the spinner svg', function () { | ||
this.setupComponent(); | ||
expect(this.$node.html()).toMatch('<svg id="spinner"'); | ||
}); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters