Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit cab3de9
Showing
5 changed files
with
210 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
/dist | ||
/.idea | ||
/vendor | ||
/node_modules | ||
package-lock.json | ||
composer.phar | ||
composer.lock | ||
phpunit.xml | ||
.phpunit.result.cache | ||
.DS_Store | ||
Thumbs.db |
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,39 @@ | ||
{ | ||
"name": "gregoriohc/laravel-nova-theme-responsive", | ||
"description": "A Laravel Nova responsive theme.", | ||
"type": "library", | ||
"homepage": "https://github.com/gregoriohc/laravel-artifacts", | ||
"authors": [ | ||
{ | ||
"name": "Gregorio Hernández Caso", | ||
"email": "gregoriohc@gmail.com", | ||
"homepage": "https://github.com/gregoriohc", | ||
"role": "Developer" | ||
} | ||
], | ||
"keywords": [ | ||
"laravel", | ||
"nova" | ||
], | ||
"license": "MIT", | ||
"require": { | ||
"php": ">=7.1.0" | ||
}, | ||
"autoload": { | ||
"psr-4": { | ||
"Gregoriohc\\LaravelNovaThemeResponsive\\": "src/" | ||
} | ||
}, | ||
"extra": { | ||
"laravel": { | ||
"providers": [ | ||
"Gregoriohc\\LaravelNovaThemeResponsive\\ThemeServiceProvider" | ||
] | ||
} | ||
}, | ||
"config": { | ||
"sort-packages": true | ||
}, | ||
"minimum-stability": "dev", | ||
"prefer-stable": true | ||
} |
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,96 @@ | ||
.hamburger-menu { | ||
padding-left: 1.25em; | ||
position: relative; | ||
height: 19px; | ||
margin-right: 6px; | ||
display: none; | ||
} | ||
|
||
.hamburger-menu:before { | ||
content: ""; | ||
position: absolute; | ||
left: 0; | ||
top: 0.21em; | ||
bottom: 0.21em; | ||
width: 1em; | ||
background: linear-gradient( | ||
to bottom, | ||
black, black 20%, | ||
white 20%, white 40%, | ||
black 40%, black 60%, | ||
white 60%, white 80%, | ||
black 80%, black 100% | ||
); | ||
} | ||
|
||
@media (max-width: 992px) { | ||
.min-w-site { | ||
min-width: auto; | ||
} | ||
|
||
.w-sidebar { | ||
position: absolute; | ||
z-index: 1000; | ||
margin-top: 3.75rem; | ||
} | ||
|
||
.sidebar-hidden { | ||
display: none; | ||
} | ||
|
||
.pt-header { | ||
padding-top: 1.75rem; | ||
} | ||
|
||
.bg-logo { | ||
display: none; | ||
} | ||
|
||
.content { | ||
min-width: auto; | ||
width: 100%; | ||
max-width: none; | ||
} | ||
|
||
.pl-search { | ||
width: 70%; | ||
} | ||
|
||
.hamburger-menu { | ||
display: block; | ||
} | ||
|
||
.btn { | ||
white-space: nowrap; | ||
} | ||
|
||
.px-view { | ||
padding-left: 1.125rem; | ||
padding-right: 1.125rem; | ||
} | ||
|
||
.py-view { | ||
padding-top: 1.125rem; | ||
padding-bottom: 1.125rem; | ||
} | ||
|
||
form .w-1\/2 { | ||
width: 80%; | ||
} | ||
|
||
form .w-1\/2 > div.flex { | ||
display: block; | ||
} | ||
|
||
form > .flex { | ||
display: block; | ||
} | ||
|
||
form > .flex > button { | ||
margin-bottom: 10px; | ||
} | ||
|
||
.content .flex-wrap > .w-1\/3, .content .flex-wrap > .w-2\/3 { | ||
width: 100%; | ||
} | ||
} |
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,31 @@ | ||
function load() { | ||
var viewport = document.querySelector("meta[name=viewport]"); | ||
viewport.setAttribute('content', 'width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0'); | ||
|
||
var contentHeader = document.querySelector('.content .h-header'); | ||
var hamburger = document.createElement("span"); | ||
var sidebar = document.querySelector('.w-sidebar'); | ||
sidebar.classList.add("sidebar-hidden"); | ||
hamburger.html = ''; | ||
hamburger.className = 'hamburger-menu'; | ||
contentHeader.prepend(hamburger); | ||
|
||
hamburger.addEventListener("click", function () { | ||
var sidebar = document.querySelector('.w-sidebar'); | ||
sidebar.classList.toggle("sidebar-hidden"); | ||
}, true); | ||
|
||
var sidebarLinks = document.querySelectorAll('.w-sidebar a, .w-sidebar .cursor-pointer'); | ||
sidebarLinks.forEach(function(sidebarLink) { | ||
sidebarLink.addEventListener("click", function() { | ||
var sidebar = document.querySelector('.w-sidebar'); | ||
var h = document.querySelector('.hamburger-menu'); | ||
var hStyles = getComputedStyle(h); | ||
if (hStyles.getPropertyValue('display') === "block") { | ||
sidebar.classList.add("sidebar-hidden"); | ||
} | ||
}, false); | ||
}); | ||
} | ||
|
||
document.addEventListener("DOMContentLoaded", load, false); |
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,33 @@ | ||
<?php | ||
|
||
namespace Gregoriohc\LaravelNovaThemeResponsive; | ||
|
||
use Laravel\Nova\Nova; | ||
use Laravel\Nova\Events\ServingNova; | ||
use Illuminate\Support\ServiceProvider; | ||
|
||
class ThemeServiceProvider extends ServiceProvider | ||
{ | ||
/** | ||
* Bootstrap any application services. | ||
* | ||
* @return void | ||
*/ | ||
public function boot() | ||
{ | ||
Nova::serving(function (ServingNova $event) { | ||
Nova::style('laravel-nova-theme-responsive', __DIR__.'/../resources/css/theme.css'); | ||
Nova::script('laravel-nova-theme-responsive', __DIR__.'/../resources/js/theme.js'); | ||
}); | ||
} | ||
|
||
/** | ||
* Register any application services. | ||
* | ||
* @return void | ||
*/ | ||
public function register() | ||
{ | ||
// | ||
} | ||
} |