Skip to content

Commit

Permalink
UI Improvement
Browse files Browse the repository at this point in the history
  • Loading branch information
SupianIDz committed Aug 3, 2020
1 parent 5877579 commit a7cb617
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 67 deletions.
21 changes: 0 additions & 21 deletions resources/assets/dist/sudo.css
Original file line number Diff line number Diff line change
Expand Up @@ -50,31 +50,10 @@
padding: 5px;
}

.octopyid-sudo-interface form {
margin-top: 5px;
}

.octopyid-sudo-info-line {
margin-bottom: 5px;
}

.octopyid-sudo-btn-reset {
-webkit-appearance: none;
-moz-appearance: none;
cursor: pointer;
border: 0;
margin: 5px 0 15px 0;
padding: 6px 10px;
background: rgba(50, 159, 185, 0.8);
color: #FFFFFF;
border-radius: 34px;
border-bottom: 1px solid;
}

.octopyid-sudo-btn-reset:hover {
background: #329FB9;
}

.octopyid-sudo-font-bold {
font-weight: bold;
}
Expand Down
2 changes: 1 addition & 1 deletion resources/assets/dist/sudo.min.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

21 changes: 0 additions & 21 deletions resources/assets/sass/app.scss
Original file line number Diff line number Diff line change
Expand Up @@ -47,33 +47,12 @@
td {
padding: 5px;
}

form {
margin-top: 5px;
}
}

&-info-line {
margin-bottom: 5px;
}

&-btn-reset {
-webkit-appearance: none;
-moz-appearance: none;
cursor: pointer;
border: 0;
margin: 5px 0 15px 0;
padding: 6px 10px;
background: rgba(50, 159, 185, 0.8);
color: #FFFFFF;
border-radius: 34px;
border-bottom: 1px solid;

&:hover {
background: #329FB9;
}
}

&-font-bold {
font-weight: bold;
}
Expand Down
48 changes: 24 additions & 24 deletions resources/views/selector.blade.php
Original file line number Diff line number Diff line change
@@ -1,31 +1,30 @@
<link rel="stylesheet" href="/vendor/octopyid/sudo/sudo.css?{{ microtime() }}">
<link rel="stylesheet" href="/vendor/octopyid/sudo/sudo.min.css">
<link rel="stylesheet" href="/vendor/octopyid/sudo/tail.min.css">

<div class="octopyid-sudo">
<div class="octopyid-sudo-btn {{ $hasSudoed ? 'octopyid-sudo-btn-has-sudoed' : '' }}" style="position: relative;"
<div class="octopyid-sudo-btn {{ $hasSudoed ? 'octopyid-sudo-btn-has-sudoed' : '' }}"
style="position: relative;"
id="octopyid-sudo-toggle">
<img src="/vendor/octopyid/sudo/sudo.svg">
</div>

<div class="octopyid-sudo-interface {{ $hasSudoed ? 'octopyid-sudo-interface-has-sudoed' : '' }} hidden"
<div class="octopyid-sudo-interface octopyid-sudo-interface-has-sudoed hidden"
id="octopyid-sudo-interface">
@if ($hasSudoed)
@if ($originalUser)
<div class="octopyid-sudo-info-line">
<table>
<tr>
<td class="octopyid-sudo-font-bold">Sign In As</td>
<td class="octopyid-sudo-font-bold">:</td>
<td>{{ $currentUser->name }}</td>
</tr>
<tr>
<td class="octopyid-sudo-font-bold">My Account</td>
<td class="octopyid-sudo-font-bold">:</td>
<td>{{ $originalUser->name }}</td>
</tr>
</table>
</div>
@endif
<div class="octopyid-sudo-info-line">
<table>
<tr>
<td class="octopyid-sudo-font-bold">Sign In As</td>
<td class="octopyid-sudo-font-bold">:</td>
<td>{{ $currentUser->name }}</td>
</tr>
<tr>
<td class="octopyid-sudo-font-bold">My Account</td>
<td class="octopyid-sudo-font-bold">:</td>
<td>{{ $originalUser->name }}</td>
</tr>
</table>
</div>
@endif
<form method="POST" action="{{ route('sudo.signin') }}">
{!! csrf_field() !!}
Expand All @@ -42,15 +41,16 @@

<script type="text/javascript" src="/vendor/octopyid/sudo/tail.min.js"></script>
<script type="text/javascript">
const button = document.getElementById('octopyid-sudo-toggle');
const element = document.getElementById('octopyid-sudo-interface');
button.addEventListener('click', event => element.classList.toggle('hidden'));
document.addEventListener('DOMContentLoaded', () => {
tail.select(document.getElementById('octopy-sudo-select'), {
search: true,
width: '100%'
});
});
const button = document.getElementById('octopyid-sudo-toggle');
const element = document.getElementById('octopyid-sudo-interface');
button.addEventListener('click', event => element.classList.toggle('hidden'));
</script>

0 comments on commit a7cb617

Please sign in to comment.