Skip to content

Commit

Permalink
feat(citSci): style tweaks, onboarding fix, background image fix
Browse files Browse the repository at this point in the history
- fixed placement of minicheckbox
- smaller volume and no download on label example audio
- moved some onboarding into a factory so that different components can add steps
- fixed background image service so that it actually works:w
  • Loading branch information
peichins committed Jun 27, 2019
1 parent 537bcd9 commit 8e836b7
Show file tree
Hide file tree
Showing 15 changed files with 250 additions and 200 deletions.
9 changes: 7 additions & 2 deletions src/app/annotationLibrary/annotationItem.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,21 @@ angular.module("bawApp.components.annotationItem", [])
templateUrl: "annotationLibrary/annotationItem.tpl.html",
controller: [
"$scope",
"$http",
function ($scope, $http) {
function ($scope) {

this.audioElement = {
volume: 1,
position: 0
};

$scope.showDownload = this.download === undefined ? true : this.download;
$scope.miniVolume = this.miniVolume === undefined ? false : this.miniVolume;


}],
bindings: {
annotation: "=annotation",
download: "<",
miniVolume: "<"
}
});
3 changes: 2 additions & 1 deletion src/app/annotationLibrary/annotationItem.tpl.html
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,9 @@
<previous-play-next audio-element-model="$ctrl.audioElement"></previous-play-next>
<volume-slider
class="form-group form-group-without-feedback progressCell"
ng-class="{'mini-volume': miniVolume}"
audio-element-model="$ctrl.audioElement"></volume-slider>
<download media="$ctrl.annotation.media"></download>
<download ng-if="showDownload" media="$ctrl.annotation.media"></download>


</div>
16 changes: 13 additions & 3 deletions src/app/audioControls/_volumeControl.scss
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
//noinspection CssInvalidHtmlTagReference
volume-slider {

width: 200px;

&.mini-volume .volume-container {
max-width: 100px;
}


position: relative;

#volumeControl-mute {
Expand Down Expand Up @@ -29,14 +34,18 @@ volume-slider {

}

#volumeControl-slider {
.btn-group {



.volumeControl-slider {

-webkit-appearance: none;
position:relative;
display: inline-block;
vertical-align: middle;
width: calc(100% - 45px);
margin-left: 45px;
left: 46px;
border-left: none;


Expand Down Expand Up @@ -119,6 +128,7 @@ volume-slider {
}
}

}

}

Expand Down
5 changes: 2 additions & 3 deletions src/app/audioControls/volumeSlider.tpl.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

<div class="btn-group">
<div class="btn-group volume-container">
<button id="volumeControl-mute"
class="btn btn-default"
ng-click="toggleMute()"
Expand All @@ -8,8 +8,7 @@
<span></span>
</button>

<input id="volumeControl-slider"
class="form-control btn btn-default"
<input class="volumeControl-slider form-control btn btn-default"
type="range" ng-model="$ctrl.audioElementModel.volume"
max="1" min="0" step="0.01"
ng-disabled="$ctrl.audioElementModel.muted"
Expand Down
10 changes: 8 additions & 2 deletions src/app/citizenScience/citizenScience.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,14 @@ class CitizenScienceAboutController {

$scope.study = $routeParams.studyName;

// todo: random background image or background image slideshow (but from dataset ... how?)
//backgroundImage.currentBackground = paths.site.assets.backgrounds.citizenScience;
var backgroundFiles = {
"bristlebird": "2.jpg",
"koala-verification": "3.jpg"
};
var backgroundFile = backgroundFiles.hasOwnProperty($routeParams.studyName) ? backgroundFiles[$routeParams.studyName] : "1.jpg";


backgroundImage.currentBackground = paths.site.assets.backgrounds.citizenScience + backgroundFile;
}
}

Expand Down
109 changes: 9 additions & 100 deletions src/app/citizenScience/labels/textLabels/_citizenScienceLabels.scss
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,15 @@

#label-buttons, .label-check {

padding-top: 8px;

a {

display: inline-block;
margin-left: auto;
margin-right: auto;
margin-top: 5px;
width: auto;
padding: 5px 8px 5px 8px;
padding: 2px 1px 2px 1px;
font-size: 18px;
cursor: pointer;
line-height: 1em;
Expand All @@ -28,11 +29,10 @@

&:hover {
.label-check-shell {
background-color: rgba(60,60,60,0.8);
background-color: rgba(60, 60, 60, 0.8);
}
}


&.example-toggle {
text-decoration: none;

Expand Down Expand Up @@ -62,6 +62,8 @@

.label-value-text {

padding-left: 0.1em;

}

.label-check-shell {
Expand All @@ -74,7 +76,7 @@
margin-left: 0.3em;
margin-right: 0.3em;
vertical-align: middle;
background: rgba(0,0,0,0.5);
background: rgba(0, 0, 0, 0.5);

}

Expand All @@ -96,7 +98,7 @@
}
&.no {
b {
color: #d00900;
color: #ff2c25;
&:before {
content: "\f00d";
}
Expand All @@ -105,6 +107,7 @@

b {
font-size: 1.3em;
text-shadow: 0px 2px 0px rgba(0, 0, 0, 1);
&.grey {
color: #666666;
opacity: 0.5;
Expand All @@ -113,101 +116,7 @@

}










/*
a {
.label-value-text {
width: 40px;
display: inline-block;
}
&.empty {
}
&.yes {
i {
b {
color: #8cc967;
&:before {
content: "\f00c";
}
}
}
}
&.maybe {
i {
b {
color: #ffbc3e;
&:before {
content: "\f128";
padding-left:0.18em;
}
}
}
}
&.no {
i {
b {
color: #d00900;
&:before {
content: "\f00d";
padding-left:0.06em;
}
}
}
}
i {
position: relative;
height:1em;
&:before {
content: "\f096";
position:absolute;
top:0.15em;
left:0px;
}
&.radio:before {
content: "\f10c";
}
b {
position: absolute;
top:0.15em;
font-size: 0.9em;
&.grey {
color: #666666;
opacity: 0.5;
}
}
}
}
i {
display: inline-block;
text-align: left;
vertical-align: middle;
width: 1.0em;
font-size: 2em;
position: relative;
top: -0.25em;
}
*/


}



}

16 changes: 10 additions & 6 deletions src/app/citizenScience/labels/textLabels/labels.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,18 @@ angular.module("bawApp.components.citizenScienceTextLabels",
.component("citizenScienceTextLabels", {
templateUrl: "citizenScience/labels/textLabels/labels.tpl.html",
controller: [
"$scope",
"SampleLabels",
function ($scope, SampleLabels) {
//console.log("dataset progress component scope");console.log($scope);
"onboardingService",
function (onboardingService) {

var self = this;

console.log(self);
onboardingService.addSteps([
{
element: "label-check:first-of-type div",
intro: `Make your selection about whether ${this.labels[0].name} is in the recording`,
order: 5
}

]);


}],
Expand Down
9 changes: 9 additions & 0 deletions src/app/citizenScience/labels/thumbLabels/_thumbs.scss
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,15 @@ $triangle: '<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.o
top:0px;
left:0px;


.label-check {
padding-top: 0px;
}

.label-check-shell {
margin-left:0px;
}

}

}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
style="background-image: url(/public/citizen_science/labels/images/{{$ctrl.label.examples[currentExample].image}})"
>&nbsp;
</div>
<annotation-item annotation="$ctrl.label.examples[currentExample].annotation" class="dark"></annotation-item>
<annotation-item annotation="$ctrl.label.examples[currentExample].annotation" download="false" mini-volume="true" class="dark"></annotation-item>
</div>

</div>
38 changes: 37 additions & 1 deletion src/app/citizenScience/labels/thumbLabels/labels.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,14 @@ angular.module("bawApp.components.citizenScienceThumbLabels",
"annotationLibraryCommon",
"AudioEvent",
"SampleLabels",
"onboardingService",
function ($scope,
$http,
CitizenScienceCommon,
libraryCommon,
AudioEventService,
SampleLabels) {
SampleLabels,
onboardingService) {

var self = this;

Expand Down Expand Up @@ -113,6 +115,40 @@ angular.module("bawApp.components.citizenScienceThumbLabels",
console.error("Failed to load citizen science example item response.", httpResponse);
});
};


onboardingService.addSteps([
{
element: ".citizen-science-thumb",
intro: "See if you can identify the events that are in these small spectrogram thumbnails in the audio clip above. " +
"Tap the thumbnail for a closer look and to listen to the audio.",
order: 5
},
{
element: ".label-check a",
intro: "Use the checkbox to indicate if the this kind of event occurs in the audio clip above",
order: 5

},
{
element: ".label-examples-annotations .label-check a",
intro: "You can also use this checkbox to select the call",
order: 5

}

]);

onboardingService.addCallbacks({
onBeforeStart: function () {
$scope.$broadcast("show-label-details");
},
onExit: function () {
$scope.$broadcast("hide-label-details");
}
});


}],
bindings: {
labels: "=",
Expand Down
Loading

0 comments on commit 8e836b7

Please sign in to comment.