-
Notifications
You must be signed in to change notification settings - Fork 639
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #383 from jakejarrett/settings-page
Basic Settings Page
- Loading branch information
Showing
7 changed files
with
159 additions
and
11 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
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,19 @@ | ||
'use strict'; | ||
|
||
app.controller('SettingsCtrl', function ($scope, $rootScope) { | ||
$scope.notificationSettings = function() { | ||
window.localStorage.notificationToggle = $scope.notification; | ||
}; | ||
|
||
$scope.init = function() { | ||
if(window.localStorage.notificationToggle === undefined) { | ||
window.localStorage.notificationToggle = true; | ||
$scope.notification = true; | ||
} | ||
else { | ||
$scope.notification = JSON.parse(window.localStorage.notificationToggle); | ||
} | ||
}; | ||
|
||
$scope.init(); | ||
}); |
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,83 @@ | ||
.settingsView { | ||
width: 90%; | ||
} | ||
|
||
.settings-hr { | ||
display: block; | ||
height: 1px; | ||
border: 0; | ||
border-top: 1px solid #3e3e40; | ||
margin: 1em 0; | ||
padding: 0; | ||
} | ||
|
||
.settings-container { | ||
width: auto; | ||
} | ||
|
||
.leftSide { | ||
width: 400px; | ||
} | ||
|
||
.rightSide { | ||
padding-top: 10px; | ||
} | ||
|
||
.full-flex { | ||
width: 100%; | ||
display: flex; | ||
flex-wrap: wrap; | ||
align-items: center; | ||
justify-content: center; | ||
margin-bottom: 10px; | ||
} | ||
// Switch for Settings | ||
.onoffswitch { | ||
position: relative; | ||
width: 50px; | ||
-webkit-user-select:none; | ||
} | ||
.onoffswitch-checkbox { | ||
display: none; | ||
} | ||
.onoffswitch-label { | ||
display: block; | ||
overflow: hidden; | ||
cursor: pointer; | ||
height: 15px; | ||
padding: 0; | ||
line-height: 15px; | ||
border: 1px solid transparent; | ||
border-radius: 25px; | ||
background-color: #222326; | ||
} | ||
.onoffswitch-label:before { | ||
content: ""; | ||
display: block; | ||
width: 24px; | ||
margin: -5px; | ||
background: #525252; | ||
position: absolute; top: 0; bottom: 0; | ||
right: 31px; | ||
border: 1px solid transparent; | ||
border-radius: 25px; | ||
} | ||
.onoffswitch-checkbox:checked + .onoffswitch-label { | ||
background-color: #FF5500; | ||
border: 1px solid transparent; | ||
border-radius: 25px; | ||
} | ||
.onoffswitch-checkbox:checked + .onoffswitch-label, .onoffswitch-checkbox:checked + .onoffswitch-label:before { | ||
border-color: #FF5500; | ||
border: 1px solid transparent; | ||
border-radius: 25px; | ||
} | ||
.onoffswitch-checkbox:checked + .onoffswitch-label .onoffswitch-inner { | ||
margin-left: 0; | ||
} | ||
.onoffswitch-checkbox:checked + .onoffswitch-label:before { | ||
right: 0px; | ||
background-color: #FF5500; | ||
box-shadow: 3px 6px 18px 0px rgba(0, 0, 0, 0.2); | ||
border: 1px solid rgba(0, 0, 0, .3); | ||
} |
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,22 @@ | ||
<div class="settingsView"> | ||
|
||
<h2 class="settings">Settings</h2> | ||
<hr class="settings-hr" /> | ||
|
||
<!-- Notifications & Switch --> | ||
<div class="full-flex"> | ||
<div class="settings-container leftSide"> | ||
<h2>Notifications</h2> | ||
<label ng-if="notification == false">Song Notifications Disabled </label> | ||
<label ng-if="notification == true">Song Notifications Enabled </label> | ||
</div> | ||
<div class="settings-container rightSide"> | ||
<div class="onoffswitch"> | ||
<input type="checkbox" class="onoffswitch-checkbox" name="notifications" id="notificationSettings" ng-model="notification" ng-change="notificationSettings()" ng-checked="notification"> | ||
<label class="onoffswitch-label" for="notificationSettings"></label> | ||
</div> | ||
</div> | ||
</div> | ||
|
||
<div ng-include="'views/common/loading.html'"></div> | ||
</div> |