Updated to latest
0
Modules/Theme/Config/.gitkeep
Normal file
5
Modules/Theme/Config/config.php
Normal file
@@ -0,0 +1,5 @@
|
||||
<?php
|
||||
|
||||
return [
|
||||
'name' => 'Theme'
|
||||
];
|
||||
0
Modules/Theme/Console/.gitkeep
Normal file
0
Modules/Theme/Database/Migrations/.gitkeep
Normal file
0
Modules/Theme/Database/Seeders/.gitkeep
Normal file
21
Modules/Theme/Database/Seeders/ThemeDatabaseSeeder.php
Normal file
@@ -0,0 +1,21 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Theme\Database\Seeders;
|
||||
|
||||
use Illuminate\Database\Seeder;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class ThemeDatabaseSeeder extends Seeder
|
||||
{
|
||||
/**
|
||||
* Run the database seeds.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function run()
|
||||
{
|
||||
Model::unguard();
|
||||
|
||||
// $this->call("OthersTableSeeder");
|
||||
}
|
||||
}
|
||||
0
Modules/Theme/Database/factories/.gitkeep
Normal file
0
Modules/Theme/Entities/.gitkeep
Normal file
0
Modules/Theme/Http/Controllers/.gitkeep
Normal file
79
Modules/Theme/Http/Controllers/ThemeController.php
Normal file
@@ -0,0 +1,79 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Theme\Http\Controllers;
|
||||
|
||||
use Illuminate\Contracts\Support\Renderable;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Routing\Controller;
|
||||
|
||||
class ThemeController extends Controller
|
||||
{
|
||||
/**
|
||||
* Display a listing of the resource.
|
||||
* @return Renderable
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
return view('theme::index');
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for creating a new resource.
|
||||
* @return Renderable
|
||||
*/
|
||||
public function create()
|
||||
{
|
||||
return view('theme::create');
|
||||
}
|
||||
|
||||
/**
|
||||
* Store a newly created resource in storage.
|
||||
* @param Request $request
|
||||
* @return Renderable
|
||||
*/
|
||||
public function store(Request $request)
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the specified resource.
|
||||
* @param int $id
|
||||
* @return Renderable
|
||||
*/
|
||||
public function show($id)
|
||||
{
|
||||
return view('theme::show');
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for editing the specified resource.
|
||||
* @param int $id
|
||||
* @return Renderable
|
||||
*/
|
||||
public function edit($id)
|
||||
{
|
||||
return view('theme::edit');
|
||||
}
|
||||
|
||||
/**
|
||||
* Update the specified resource in storage.
|
||||
* @param Request $request
|
||||
* @param int $id
|
||||
* @return Renderable
|
||||
*/
|
||||
public function update(Request $request, $id)
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove the specified resource from storage.
|
||||
* @param int $id
|
||||
* @return Renderable
|
||||
*/
|
||||
public function destroy($id)
|
||||
{
|
||||
//
|
||||
}
|
||||
}
|
||||
0
Modules/Theme/Http/Middleware/.gitkeep
Normal file
0
Modules/Theme/Http/Requests/.gitkeep
Normal file
0
Modules/Theme/Providers/.gitkeep
Normal file
69
Modules/Theme/Providers/RouteServiceProvider.php
Normal file
@@ -0,0 +1,69 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Theme\Providers;
|
||||
|
||||
use Illuminate\Support\Facades\Route;
|
||||
use Illuminate\Foundation\Support\Providers\RouteServiceProvider as ServiceProvider;
|
||||
|
||||
class RouteServiceProvider extends ServiceProvider
|
||||
{
|
||||
/**
|
||||
* The module namespace to assume when generating URLs to actions.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $moduleNamespace = 'Modules\Theme\Http\Controllers';
|
||||
|
||||
/**
|
||||
* Called before routes are registered.
|
||||
*
|
||||
* Register any model bindings or pattern based filters.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function boot()
|
||||
{
|
||||
parent::boot();
|
||||
}
|
||||
|
||||
/**
|
||||
* Define the routes for the application.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function map()
|
||||
{
|
||||
$this->mapApiRoutes();
|
||||
|
||||
$this->mapWebRoutes();
|
||||
}
|
||||
|
||||
/**
|
||||
* Define the "web" routes for the application.
|
||||
*
|
||||
* These routes all receive session state, CSRF protection, etc.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected function mapWebRoutes()
|
||||
{
|
||||
Route::middleware('web')
|
||||
->namespace($this->moduleNamespace)
|
||||
->group(module_path('Theme', '/Routes/web.php'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Define the "api" routes for the application.
|
||||
*
|
||||
* These routes are typically stateless.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected function mapApiRoutes()
|
||||
{
|
||||
Route::prefix('api')
|
||||
->middleware('api')
|
||||
->namespace($this->moduleNamespace)
|
||||
->group(module_path('Theme', '/Routes/api.php'));
|
||||
}
|
||||
}
|
||||
112
Modules/Theme/Providers/ThemeServiceProvider.php
Normal file
@@ -0,0 +1,112 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Theme\Providers;
|
||||
|
||||
use Illuminate\Support\ServiceProvider;
|
||||
use Illuminate\Database\Eloquent\Factory;
|
||||
|
||||
class ThemeServiceProvider extends ServiceProvider
|
||||
{
|
||||
/**
|
||||
* @var string $moduleName
|
||||
*/
|
||||
protected $moduleName = 'Theme';
|
||||
|
||||
/**
|
||||
* @var string $moduleNameLower
|
||||
*/
|
||||
protected $moduleNameLower = 'theme';
|
||||
|
||||
/**
|
||||
* Boot the application events.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function boot()
|
||||
{
|
||||
$this->registerTranslations();
|
||||
$this->registerConfig();
|
||||
$this->registerViews();
|
||||
$this->loadMigrationsFrom(module_path($this->moduleName, 'Database/Migrations'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Register the service provider.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function register()
|
||||
{
|
||||
$this->app->register(RouteServiceProvider::class);
|
||||
}
|
||||
|
||||
/**
|
||||
* Register config.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected function registerConfig()
|
||||
{
|
||||
$this->publishes([
|
||||
module_path($this->moduleName, 'Config/config.php') => config_path($this->moduleNameLower . '.php'),
|
||||
], 'config');
|
||||
$this->mergeConfigFrom(
|
||||
module_path($this->moduleName, 'Config/config.php'), $this->moduleNameLower
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Register views.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function registerViews()
|
||||
{
|
||||
$viewPath = resource_path('views/modules/' . $this->moduleNameLower);
|
||||
|
||||
$sourcePath = module_path($this->moduleName, 'Resources/views');
|
||||
|
||||
$this->publishes([
|
||||
$sourcePath => $viewPath
|
||||
], ['views', $this->moduleNameLower . '-module-views']);
|
||||
|
||||
$this->loadViewsFrom(array_merge($this->getPublishableViewPaths(), [$sourcePath]), $this->moduleNameLower);
|
||||
}
|
||||
|
||||
/**
|
||||
* Register translations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function registerTranslations()
|
||||
{
|
||||
$langPath = resource_path('lang/modules/' . $this->moduleNameLower);
|
||||
|
||||
if (is_dir($langPath)) {
|
||||
$this->loadTranslationsFrom($langPath, $this->moduleNameLower);
|
||||
} else {
|
||||
$this->loadTranslationsFrom(module_path($this->moduleName, 'Resources/lang'), $this->moduleNameLower);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the services provided by the provider.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function provides()
|
||||
{
|
||||
return [];
|
||||
}
|
||||
|
||||
private function getPublishableViewPaths(): array
|
||||
{
|
||||
$paths = [];
|
||||
foreach (\Config::get('view.paths') as $path) {
|
||||
if (is_dir($path . '/modules/' . $this->moduleNameLower)) {
|
||||
$paths[] = $path . '/modules/' . $this->moduleNameLower;
|
||||
}
|
||||
}
|
||||
return $paths;
|
||||
}
|
||||
}
|
||||
1
Modules/Theme/Public/css/theme.css
Normal file
@@ -0,0 +1 @@
|
||||
|
||||
1
Modules/Theme/Public/css/wtialacarte.css
Normal file
@@ -0,0 +1 @@
|
||||
|
||||
BIN
Modules/Theme/Public/fonts/vendor/primevue/resources/themes/aura-light-amber/Inter-italic.var.woff2
vendored
Normal file
BIN
Modules/Theme/Public/fonts/vendor/primevue/resources/themes/aura-light-amber/Inter-roman.var.woff2
vendored
Normal file
2
Modules/Theme/Public/js/theme.js
Normal file
7
Modules/Theme/Public/js/theme.js.LICENSE.txt
Normal file
@@ -0,0 +1,7 @@
|
||||
/*! #__NO_SIDE_EFFECTS__ */
|
||||
|
||||
/**
|
||||
* @vue/shared v3.4.16
|
||||
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
||||
* @license MIT
|
||||
**/
|
||||
5
Modules/Theme/Public/mix-manifest.json
Normal file
@@ -0,0 +1,5 @@
|
||||
{
|
||||
"/js/theme.js": "/js/theme.js?id=19fe2f7a9094d0de480e0ac949d64340",
|
||||
"/css/wtialacarte.css": "/css/wtialacarte.css?id=68b329da9893e34099c7d8ad5cb9c940",
|
||||
"/css/theme.css": "/css/theme.css?id=68b329da9893e34099c7d8ad5cb9c940"
|
||||
}
|
||||
0
Modules/Theme/Resources/assets/.gitkeep
Normal file
387
Modules/Theme/Resources/assets/js/Components/Toggle.vue
Normal file
@@ -0,0 +1,387 @@
|
||||
<template>
|
||||
|
||||
|
||||
<a v-if="authType == 'customer'" href="javascript:void(0)" id="darkSwitch" @click="toggle">
|
||||
<div class="border-1 rounded mr-3" style="padding: 3px 6px;">
|
||||
<i :class="`${store.myTheme == 'dark' ? 'fas fa-moon' : 'fas fa-sun'}`"></i>
|
||||
</div>
|
||||
</a>
|
||||
|
||||
|
||||
<a v-else-if="authType == 'staff'" class="gredient_hover" href="javascript:void(0)" id="darkSwitch" @click="toggle">
|
||||
<i :class="`${store.myTheme == 'dark' ? 'fas fa-moon' : 'fas fa-sun'}`" :data-original-title="`${store.myTheme == 'dark' ? 'Dark Mode' : 'Light Mode'}`"></i>
|
||||
</a>
|
||||
|
||||
|
||||
</template>
|
||||
|
||||
<style>
|
||||
|
||||
html[data-theme='dark'] {
|
||||
|
||||
/*--primary_color: #fff;
|
||||
--secondary_color: #bfbfbfbf;
|
||||
--body_color: #1f1f1f;*/
|
||||
/* --primary_color: rgb(28, 28, 33);*/
|
||||
--shadow: 0 5px 10px #e5e4e6;
|
||||
/*--base_color: #eee;
|
||||
--text-color: #eee;*/
|
||||
/* --base_color: rgb(41, 41, 41);*/
|
||||
/* --border_color: #eee;*/
|
||||
/*--white: #fff;
|
||||
--border_color: #eee;
|
||||
--body_bg: #1f1f1f;
|
||||
|
||||
--background-color: #1f1f1f;
|
||||
--text-color: #fff;
|
||||
--link-color: red;
|
||||
|
||||
|
||||
|
||||
--border_color: hsla(0,0%,93%,1);
|
||||
--bg_white: #1C1C21;
|
||||
--input__bg: #3B3B3B;*/
|
||||
}
|
||||
|
||||
[data-theme="dark"] {
|
||||
|
||||
background-color: #1f1f1f !important;
|
||||
|
||||
p, h1, h2, h3, h4, h5, h6, span, small, div, th, td, svg, .text-900, .job-request-item .tabs .p-button.p-component .p-button-label, footer.home_three_footer .copyright_area .copy_right_text, .text-black-alpha-90, .pricing-switcher label {
|
||||
color: #eee!important;
|
||||
}
|
||||
|
||||
header.amazcartui_header .header_area {
|
||||
.header_topbar_area, .header_top_area, .main_header_area {
|
||||
background-color: rgb(28, 28, 33);
|
||||
border-bottom: 1px solid rgb(28, 28, 33);
|
||||
}
|
||||
}
|
||||
|
||||
footer.home_three_footer .copyright_area .footer_border {
|
||||
border-top: 1px solid #eee;
|
||||
}
|
||||
|
||||
.header_search_field, .p-inputtext, .p-multiselect, textarea, .form-control:focus, .primary_input_field, .thumbnail-btn, .vs__dropdown-toggle, .video-details {
|
||||
color: #fff;
|
||||
background: rgb(51 51 51) !important;
|
||||
}
|
||||
|
||||
.card,
|
||||
.bg-white,
|
||||
.p-multiselect-panel,
|
||||
.p-multiselect-panel .p-multiselect-header,
|
||||
.p-checkbox .p-checkbox-box,
|
||||
#a-la-carte .grid,
|
||||
.p-tabview .p-tabview-nav,
|
||||
.p-tabview .p-tabview-nav li .p-tabview-nav-link,
|
||||
.p-tabview .p-tabview-panels,
|
||||
.p-dialog,
|
||||
.p-dialog .p-dialog-header,
|
||||
.p-dialog .p-dialog-content,
|
||||
.p-dialog .p-dialog-footer,
|
||||
.p-sidebar-header,
|
||||
.p-sidebar-content,
|
||||
.p-paginator,
|
||||
.p-chip,
|
||||
.modal-content,
|
||||
div:where(.swal2-container) div:where(.swal2-popup) {
|
||||
background-color: rgb(28, 28, 33)!important;
|
||||
}
|
||||
|
||||
.modal-header>div.bg-white {
|
||||
box-shadow: 0px 2px 2px 0px rgb(36, 36, 36)!important;
|
||||
}
|
||||
|
||||
.modal-content .modal-body {
|
||||
background-image: none!important;
|
||||
}
|
||||
|
||||
p.placeholder-glow {
|
||||
background-color: #1f1f1f;
|
||||
animation-name: none!important;
|
||||
}
|
||||
|
||||
.vs__open-indicator {
|
||||
fill: #fff;
|
||||
}
|
||||
|
||||
.amaz_primary_btn,
|
||||
.p-button .p-button-label,
|
||||
.p-button .p-button-label
|
||||
.p-message-wrapper,
|
||||
#productShow button,
|
||||
.p-button .p-button-icon-left,
|
||||
.p-button .p-button-label,
|
||||
.p-message .p-message-text,
|
||||
.p-message-icon,
|
||||
.text-dark {
|
||||
color: #000!important;
|
||||
}
|
||||
|
||||
.p-skeleton, .pricing-switcher .fieldset {
|
||||
background-color: rgb(43, 43, 43)!important;
|
||||
}
|
||||
|
||||
.p-float-label > label {
|
||||
color: rgb(187, 192, 196)!important;
|
||||
}
|
||||
|
||||
.p-skeleton::after {
|
||||
background: linear-gradient(90deg, rgba(28, 28, 33, 0), rgba(28, 28, 33, 0.4), rgba(28, 28, 33, 0))
|
||||
}
|
||||
|
||||
.dashboard_bg, header.amazcartui_header .header_area, footer.home_three_footer, .p-datatable .p-datatable-thead>tr>th,
|
||||
.p-datatable .p-datatable-tbody>tr,
|
||||
.pricing-wrapper>label>li,
|
||||
.p-datatable-scrollable .p-frozen-column:not(th) {
|
||||
background-color: #333 !important;
|
||||
}
|
||||
|
||||
.p-dialog .p-dialog-header {
|
||||
|
||||
.p-dialog-header-icon:enabled:hover {
|
||||
background-color: rgb(36, 36, 36);
|
||||
}
|
||||
|
||||
.p-dialog-header-icon:focus {
|
||||
box-shadow: 0 0 0 0.2rem rgb(36, 36, 36);
|
||||
}
|
||||
}
|
||||
|
||||
.job-request-item .tabs .p-button.p-component .p-button-label {
|
||||
color: #eee!important;
|
||||
}
|
||||
|
||||
.job-request-item .tabs .p-button.p-component.active {
|
||||
|
||||
background-color: #ffc107!important;
|
||||
border-color: #ffc107!important;
|
||||
|
||||
.p-button-label {
|
||||
color: #000!important;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
.p-tabview .p-tabview-nav li .p-tabview-nav-link:not(.p-disabled):focus {
|
||||
box-shadow: none!important;
|
||||
border-color: #ffc107!important;
|
||||
color: #ffc107!important;
|
||||
}
|
||||
|
||||
.bg-slate-100,
|
||||
.p-multiselect-panel .p-multiselect-items .p-multiselect-item:not(.p-highlight):not(.p-disabled):hover,
|
||||
.p-paginator .p-paginator-pages .p-paginator-page.p-highlight,
|
||||
.vs__dropdown-option--highlight {
|
||||
background: rgb(43, 43, 43)!important;
|
||||
color: rgb(186, 191, 197)!important;
|
||||
}
|
||||
|
||||
.p-button:focus, .p-inputtext:enabled:focus {
|
||||
box-shadow: none!important;
|
||||
}
|
||||
|
||||
.p-selectbutton .p-button.p-highlight,.p-selectbutton .p-button.p-highlight:before, .step-icon
|
||||
{
|
||||
background: transparent!important;
|
||||
border-color: #ced4da!important;
|
||||
|
||||
}
|
||||
|
||||
.p-multiselect-panel .p-multiselect-items .p-multiselect-item.p-highlight,
|
||||
.vs__dropdown-menu {
|
||||
background: rgb(41, 41, 41)!important;
|
||||
color: rgb(186, 191, 197)!important;
|
||||
}
|
||||
|
||||
.p-multiselect.p-multiselect-chip .p-multiselect-token {
|
||||
background: rgb(54, 54, 54)!important;
|
||||
color: rgb(186, 191, 197)!important;
|
||||
}
|
||||
|
||||
.customer-info-content {
|
||||
.text-white {
|
||||
color: #000!important;
|
||||
}
|
||||
|
||||
.amaz_primary_btn {
|
||||
color: #fff!important;
|
||||
}
|
||||
}
|
||||
|
||||
.p-card {
|
||||
box-shadow: rgba(0, 0, 0, 0.2) 0px 2px 1px -1px, rgba(0, 0, 0, 0.14) 0px 1px 1px 0px, rgba(0, 0, 0, 0.12) 0px 1px 3px 0px;
|
||||
color: rgb(186, 191, 197);
|
||||
background: rgb(28, 28, 33);
|
||||
border-radius: 3px;
|
||||
}
|
||||
|
||||
.exclusive .currency, .exclusive .duration, .currency, .value {
|
||||
color: #fff!important
|
||||
|
||||
}
|
||||
|
||||
.pricing-wrapper .details>p, .pricing-wrapper .details>p strong, .pricing-wrapper .details>p span {
|
||||
color: rgb(191, 191, 191)!important
|
||||
|
||||
}
|
||||
|
||||
.surface-card {
|
||||
border-color: transparent!important;
|
||||
background-color: rgb(51 51 51)!important;
|
||||
box-shadow: rgba(0, 0, 0, 0.2) 0px 2px 1px -1px, rgba(0, 0, 0, 0.14) 0px 1px 1px 0px, rgba(0, 0, 0, 0.12) 0px 1px 3px 0px;
|
||||
|
||||
.text-900 {
|
||||
color: #fff!important;
|
||||
}
|
||||
}
|
||||
|
||||
.dashboard_sidebar_menuList ul li a {
|
||||
color: #eee!important
|
||||
}
|
||||
|
||||
.dashboard_sidebar_menuList ul li a svg path {
|
||||
fill: #eee!important
|
||||
}
|
||||
|
||||
.dashboard_sidebar_menuList ul li a:hover,
|
||||
.dashboard_sidebar_menuList ul li a.active {
|
||||
color: #ffc107!important
|
||||
}
|
||||
|
||||
.dashboard_sidebar_menuList ul li a:hover svg path, .dashboard_sidebar_menuList ul li a.active svg path {
|
||||
fill: #ffc107!important
|
||||
}
|
||||
|
||||
|
||||
|
||||
#screen-meta,
|
||||
#screen-meta-links .show-settings,
|
||||
.bg-gray-50,
|
||||
.white_box_30px {
|
||||
background: rgb(41, 41, 41)!important;
|
||||
color: rgb(186, 191, 197)!important;
|
||||
}
|
||||
|
||||
#main-content #app>div {
|
||||
background: rgb(41, 41, 41)!important;
|
||||
color: rgb(186, 191, 197)!important;
|
||||
border-radius: 15px;
|
||||
|
||||
.invoice_container {
|
||||
background: rgb(28, 28, 33);
|
||||
color: rgb(186, 191, 197)!important;
|
||||
}
|
||||
}
|
||||
|
||||
.white-box.single-summery:hover, .white-box.single-summery.active {
|
||||
background: rgb(41, 41, 41)!important;
|
||||
color: rgb(186, 191, 197)!important;
|
||||
box-shadow: 0 5px 10px #e5e4e6!important;
|
||||
}
|
||||
|
||||
body.admin {
|
||||
|
||||
.main_header_area {
|
||||
background-color: #1f1f1f!important;
|
||||
border-color: #1f1f1f!important;
|
||||
}
|
||||
|
||||
|
||||
.p-dropdown-trigger svg {
|
||||
color: rgb(28, 28, 33)!important;
|
||||
}
|
||||
|
||||
.p-dropdown-panel .p-dropdown-items {
|
||||
background: rgb(28, 28, 33)!important;
|
||||
}
|
||||
|
||||
.p-dropdown-panel .p-dropdown-items .p-dropdown-item.p-highlight,
|
||||
.p-dropdown-panel .p-dropdown-items .p-dropdown-item:not(.p-highlight):not(.p-disabled):hover {
|
||||
background: rgb(41, 41, 41)!important;
|
||||
color: rgb(186, 191, 197)!important;
|
||||
}
|
||||
}
|
||||
|
||||
#creator-studio {
|
||||
.datastyle {
|
||||
background: rgb(28, 28, 33);
|
||||
}
|
||||
|
||||
#video-table .p-dropdown.p-component {
|
||||
border: 1px solid #ced4da;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
</style>
|
||||
|
||||
<script setup>
|
||||
import { onMounted, ref } from 'vue'
|
||||
import { useThemeStore } from "../theme"
|
||||
|
||||
const store = useThemeStore();
|
||||
const authType = window.Auth.role.type;
|
||||
|
||||
const toggle = () => {
|
||||
store.toggleTheme();
|
||||
}
|
||||
|
||||
|
||||
// const setCookie = (name,value,days) => {
|
||||
// var expires = "";
|
||||
// if (days) {
|
||||
// var date = new Date();
|
||||
// date.setTime(date.getTime() + (days*24*60*60*1000));
|
||||
// expires = "; expires=" + date.toUTCString();
|
||||
// }
|
||||
// document.cookie = name + "=" + (value || "") + expires + "; path=/";
|
||||
// }
|
||||
|
||||
// const getCookie = (name) => {
|
||||
// var nameEQ = name + "=";
|
||||
// var ca = document.cookie.split(';');
|
||||
// // the following code allows multiple cookie values and splits them apart
|
||||
// for(var i=0;i < ca.length;i++) {
|
||||
// var c = ca[i];
|
||||
// while (c.charAt(0)==' ') c = c.substring(1,c.length);
|
||||
// if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
|
||||
// }
|
||||
// return null;
|
||||
// }
|
||||
|
||||
// const eraseCookie = (name) => {
|
||||
// document.cookie = name+'=; Max-Age=-99999999;';
|
||||
// }
|
||||
|
||||
// const initTheme = () => {
|
||||
// const e = 0 !== getCookie('dark_mode') && 1 == getCookie('dark_mode') ;
|
||||
// darkSwitch.checked = e, e ? document.body.setAttribute("data-theme", "dark") : document.body.removeAttribute("data-theme")
|
||||
// }
|
||||
|
||||
// const resetTheme = () => {
|
||||
// darkSwitch.checked ? (document.body.setAttribute("data-theme", "dark"), setCookie('dark_mode',"1",365)) : (document.body.removeAttribute("data-theme"), setCookie('dark_mode',"0",365))
|
||||
// }
|
||||
|
||||
|
||||
onMounted(() => {
|
||||
|
||||
//window.addEventListener("DOMContentLoaded", () => {
|
||||
var theme = store.myTheme;
|
||||
if (theme != null) {
|
||||
document.documentElement.setAttribute("data-theme", "dark")
|
||||
} else {
|
||||
// no darkmode
|
||||
document.documentElement.removeAttribute("data-theme")
|
||||
}
|
||||
//});
|
||||
|
||||
// document.addEventListener("DOMContentLoaded", function() {
|
||||
// darkSwitch && (initTheme(), darkSwitch.addEventListener("change", () => {
|
||||
// resetTheme()
|
||||
// }))
|
||||
// });
|
||||
})
|
||||
|
||||
</script>
|
||||
16
Modules/Theme/Resources/assets/js/app.js
Normal file
@@ -0,0 +1,16 @@
|
||||
import { createApp } from "vue";
|
||||
import PrimeVue from 'primevue/config';
|
||||
import 'primevue/resources/themes/aura-light-amber/theme.css'
|
||||
import Toggle from './Components/Toggle';
|
||||
|
||||
import { createPinia } from 'pinia';
|
||||
import piniaPluginPersistedState from "pinia-plugin-persistedstate"
|
||||
|
||||
const pinia = createPinia();
|
||||
pinia.use(piniaPluginPersistedState)
|
||||
|
||||
const themeToggle = document.querySelector('#app-theme');
|
||||
const themeApp = createApp(Toggle);
|
||||
themeApp.use(PrimeVue);
|
||||
themeApp.use(pinia);
|
||||
themeApp.mount(themeToggle);
|
||||
26
Modules/Theme/Resources/assets/js/theme.js
Normal file
@@ -0,0 +1,26 @@
|
||||
import { defineStore } from "pinia";
|
||||
|
||||
export const useThemeStore = defineStore("theme", {
|
||||
state: () => {
|
||||
return {
|
||||
theme: null
|
||||
};
|
||||
},
|
||||
actions: {
|
||||
toggleTheme() {
|
||||
if(this.theme == 'dark'){
|
||||
this.theme = null;
|
||||
document.documentElement.removeAttribute("data-theme")
|
||||
}else{
|
||||
this.theme = 'dark';
|
||||
document.documentElement.setAttribute("data-theme", "dark")
|
||||
}
|
||||
}
|
||||
},
|
||||
getters: {
|
||||
myTheme: (state) => {
|
||||
return state.theme;
|
||||
}
|
||||
},
|
||||
persist: true,
|
||||
});
|
||||
0
Modules/Theme/Resources/assets/sass/app.scss
Normal file
0
Modules/Theme/Resources/lang/.gitkeep
Normal file
0
Modules/Theme/Resources/views/.gitkeep
Normal file
12
Modules/Theme/Resources/views/toggle.blade.php
Normal file
@@ -0,0 +1,12 @@
|
||||
@php
|
||||
$version = '?v=' . filemtime(module_path('Theme', 'Public/js/theme.js')) . md5_file(module_path('Theme', 'Public/js/theme.js'));
|
||||
@endphp
|
||||
|
||||
<li id="app-theme"></li>
|
||||
|
||||
@push('scripts')
|
||||
<script>
|
||||
window.Auth = @json(\Modules\Theme\Services\App::auth());
|
||||
</script>
|
||||
<script src="{{ asset('Modules/Theme/Public/js/theme.js'.$version) }}"></script>
|
||||
@endpush
|
||||
0
Modules/Theme/Routes/.gitkeep
Normal file
18
Modules/Theme/Routes/api.php
Normal file
@@ -0,0 +1,18 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| API Routes
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Here is where you can register API routes for your application. These
|
||||
| routes are loaded by the RouteServiceProvider within a group which
|
||||
| is assigned the "api" middleware group. Enjoy building your API!
|
||||
|
|
||||
*/
|
||||
|
||||
Route::middleware('auth:api')->get('/theme', function (Request $request) {
|
||||
return $request->user();
|
||||
});
|
||||
16
Modules/Theme/Routes/web.php
Normal file
@@ -0,0 +1,16 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Web Routes
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Here is where you can register web routes for your application. These
|
||||
| routes are loaded by the RouteServiceProvider within a group which
|
||||
| contains the "web" middleware group. Now create something great!
|
||||
|
|
||||
*/
|
||||
|
||||
Route::prefix('theme')->group(function() {
|
||||
Route::get('/', 'ThemeController@index');
|
||||
});
|
||||
16
Modules/Theme/Services/App.php
Normal file
@@ -0,0 +1,16 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Theme\Services;
|
||||
|
||||
use App\Models\User;
|
||||
|
||||
class App
|
||||
{
|
||||
public static function auth()
|
||||
{
|
||||
return User::query()
|
||||
->with(['role.permissions'])
|
||||
->where('id', auth()->id())
|
||||
->first();
|
||||
}
|
||||
}
|
||||
69
Modules/Theme/Services/AugmentationService.php
Normal file
@@ -0,0 +1,69 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Theme\Services;
|
||||
|
||||
class AugmentationService
|
||||
{
|
||||
public function __construct()
|
||||
{
|
||||
$this->addToggleToMainMenu();
|
||||
$this->addToggleToMenu();
|
||||
}
|
||||
|
||||
public function addToggleToMainMenu()
|
||||
{
|
||||
$path = resource_path('views/frontend/amazy/partials/_mainmenu.blade.php');
|
||||
if (file_exists($path)) {
|
||||
$update = false;
|
||||
$content = file_get_contents($path);
|
||||
if (!preg_match("/\@include\('theme::toggle'\)/", $content)) {
|
||||
$matches = null;
|
||||
preg_match('/<div class="mobile_menu d-block d-lg-none"><\/div>/', $content, $matches);
|
||||
if (count($matches) > 0) {
|
||||
$code = $matches[0];
|
||||
$snippet = "
|
||||
@if (isModuleActive('Theme'))
|
||||
@include('theme::toggle')
|
||||
@endif
|
||||
";
|
||||
$code = $snippet.$code;
|
||||
$content = preg_replace('/<div class="mobile_menu d-block d-lg-none"><\/div>/', $code, $content);
|
||||
//file_put_contents($path, $content);
|
||||
$update = true;
|
||||
}
|
||||
}
|
||||
|
||||
if ($update) {
|
||||
file_put_contents($path, $content);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public function addToggleToMenu()
|
||||
{
|
||||
$path = resource_path('/views/backEnd/partials/_menu.blade.php');
|
||||
if (file_exists($path)) {
|
||||
$update = false;
|
||||
$content = file_get_contents($path);
|
||||
if (!preg_match("/\@include\('theme::toggle'\)/", $content)) {
|
||||
$matches = null;
|
||||
preg_match("/<div class=\"header_notification_warp d-flex align-items-center\">/", $content, $matches);
|
||||
if (count($matches) > 0) {
|
||||
$code = $matches[0];
|
||||
$snippet = "
|
||||
@if (isModuleActive('Theme'))
|
||||
@include('theme::toggle')
|
||||
@endif
|
||||
";
|
||||
$code = $code.$snippet;
|
||||
$content = preg_replace("/<div class=\"header_notification_warp d-flex align-items-center\">/", $code, $content);
|
||||
$update = true;
|
||||
}
|
||||
}
|
||||
|
||||
if ($update) {
|
||||
file_put_contents($path, $content);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
0
Modules/Theme/Tests/Feature/.gitkeep
Normal file
0
Modules/Theme/Tests/Unit/.gitkeep
Normal file
17
Modules/Theme/Theme.json
Normal file
@@ -0,0 +1,17 @@
|
||||
{
|
||||
"Theme": {
|
||||
"item_id": "2402080201",
|
||||
"migration": [],
|
||||
"names": [],
|
||||
"versions": [
|
||||
"1.0.0"
|
||||
],
|
||||
"min_system_version":"3.2",
|
||||
"url": [
|
||||
"https://bigherodesign.com/contact"
|
||||
],
|
||||
"notes": [
|
||||
"This is Dark Mode Theme module for Amazcart. Thanks for using. Amazecrt version required 3.2"
|
||||
]
|
||||
}
|
||||
}
|
||||
23
Modules/Theme/composer.json
Normal file
@@ -0,0 +1,23 @@
|
||||
{
|
||||
"name": "nwidart/theme",
|
||||
"description": "",
|
||||
"authors": [
|
||||
{
|
||||
"name": "Nicolas Widart",
|
||||
"email": "n.widart@gmail.com"
|
||||
}
|
||||
],
|
||||
"extra": {
|
||||
"laravel": {
|
||||
"providers": [],
|
||||
"aliases": {
|
||||
|
||||
}
|
||||
}
|
||||
},
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"Modules\\Theme\\": ""
|
||||
}
|
||||
}
|
||||
}
|
||||
4
Modules/Theme/mix-manifest.json
Normal file
@@ -0,0 +1,4 @@
|
||||
{
|
||||
"/Public/js/theme.js": "/Public/js/theme.js",
|
||||
"/Public/css/theme.css": "/Public/css/theme.css"
|
||||
}
|
||||
13
Modules/Theme/module.json
Normal file
@@ -0,0 +1,13 @@
|
||||
{
|
||||
"name": "Theme",
|
||||
"alias": "theme",
|
||||
"description": "",
|
||||
"keywords": [],
|
||||
"priority": 0,
|
||||
"providers": [
|
||||
"Modules\\Theme\\Providers\\ThemeServiceProvider"
|
||||
],
|
||||
"aliases": {},
|
||||
"files": [],
|
||||
"requires": []
|
||||
}
|
||||
9475
Modules/Theme/package-lock.json
generated
Normal file
29
Modules/Theme/package.json
Normal file
@@ -0,0 +1,29 @@
|
||||
{
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"dev": "npm run development",
|
||||
"development": "mix",
|
||||
"watch": "mix watch",
|
||||
"watch-poll": "mix watch -- --watch-options-poll=1000",
|
||||
"hot": "mix watch --hot",
|
||||
"prod": "npm run production",
|
||||
"production": "mix --production"
|
||||
},
|
||||
"devDependencies": {
|
||||
"autoprefixer": "^10.4.14",
|
||||
"axios": "1.4.0",
|
||||
"dotenv": "^10.0.0",
|
||||
"dotenv-expand": "^5.1.0",
|
||||
"laravel-mix": "^6.0.31",
|
||||
"laravel-mix-merge-manifest": "^2.0.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"axios": "^1.3.4",
|
||||
"jquery": "^3.6.4",
|
||||
"pinia": "^2.1.7",
|
||||
"pinia-plugin-persistedstate": "^3.2.1",
|
||||
"primevue": "^3.48.1",
|
||||
"vue": "^3.2.45",
|
||||
"vue-loader": "^17.4.2"
|
||||
}
|
||||
}
|
||||
15
Modules/Theme/webpack.mix.js
Normal file
@@ -0,0 +1,15 @@
|
||||
const dotenvExpand = require('dotenv-expand');
|
||||
dotenvExpand(require('dotenv').config({ path: '../../.env'/*, debug: true*/}));
|
||||
|
||||
const mix = require('laravel-mix');
|
||||
require('laravel-mix-merge-manifest');
|
||||
|
||||
mix.setPublicPath('./Public').mergeManifest();
|
||||
|
||||
mix.js(__dirname + '/Resources/assets/js/app.js', 'js/theme.js').vue()
|
||||
.sass( __dirname + '/Resources/assets/sass/app.scss','css/theme.css');
|
||||
|
||||
|
||||
if (mix.inProduction()) {
|
||||
mix.version();
|
||||
}
|
||||
@@ -71,5 +71,6 @@
|
||||
"RegistrationFormSteps": true,
|
||||
"RegistrationAgreement": true,
|
||||
"WTIJobBoard": true,
|
||||
"WTIALaCarte": true
|
||||
"WTIALaCarte": true,
|
||||
"Theme": true
|
||||
}
|
||||
|
Before Width: | Height: | Size: 27 KiB After Width: | Height: | Size: 71 KiB |
|
Before Width: | Height: | Size: 26 KiB After Width: | Height: | Size: 71 KiB |
|
Before Width: | Height: | Size: 30 KiB After Width: | Height: | Size: 74 KiB |
|
Before Width: | Height: | Size: 28 KiB After Width: | Height: | Size: 74 KiB |
|
Before Width: | Height: | Size: 30 KiB After Width: | Height: | Size: 77 KiB |
|
Before Width: | Height: | Size: 32 KiB After Width: | Height: | Size: 78 KiB |
|
Before Width: | Height: | Size: 39 KiB After Width: | Height: | Size: 87 KiB |
|
Before Width: | Height: | Size: 16 KiB After Width: | Height: | Size: 40 KiB |
|
Before Width: | Height: | Size: 18 KiB After Width: | Height: | Size: 47 KiB |
|
Before Width: | Height: | Size: 21 KiB After Width: | Height: | Size: 54 KiB |
@@ -55,7 +55,12 @@
|
||||
</div>
|
||||
<div class="header_right d-flex justify-content-between align-items-center">
|
||||
<div class="header_notification_warp d-flex align-items-center">
|
||||
@include('studioplus::create-studio')
|
||||
|
||||
@if (isModuleActive('Theme') && auth()->user()->role->type == 'staff')
|
||||
@include('theme::toggle')
|
||||
@endif
|
||||
|
||||
@include('studioplus::create-studio')
|
||||
|
||||
@if(auth()->user()->role->type != 'affiliate' && auth()->user()->role->type != 'customer' && auth()->user()->role->type != 'staff')
|
||||
|
||||
|
||||
@@ -250,16 +250,16 @@ $menus3 = \Modules\Menu\Entities\Menu::where('menu_position', 'footer_menu_3')->
|
||||
<div class="footer_border m-0"></div>
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="copy_right_text d-flex align-items-center gap_20 flex-wrap justify-content-between">
|
||||
<div class="copy_right_text d-flex align-items-center gap_20 flex-wrap justify-content-center">
|
||||
@php echo app('general_setting')->footer_copy_right; @endphp
|
||||
<div class="footer_list_links">
|
||||
@foreach($sectionWidgets->where('section','3') as $page)
|
||||
@if(!isModuleActive('Lead') && $page->pageData->module == 'Lead')
|
||||
@continue
|
||||
@endif
|
||||
<a href="{{ url($page->pageData->slug) }}">{{$page->name}}</a>
|
||||
@endforeach
|
||||
</div>
|
||||
<!--<div class="footer_list_links">-->
|
||||
<!-- @foreach($sectionWidgets->where('section','3') as $page)-->
|
||||
<!-- @if(!isModuleActive('Lead') && $page->pageData->module == 'Lead')-->
|
||||
<!-- @continue-->
|
||||
<!-- @endif-->
|
||||
<!-- <a href="{{ url($page->pageData->slug) }}">{{$page->name}}</a>-->
|
||||
<!-- @endforeach-->
|
||||
<!--</div>-->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -156,6 +156,9 @@
|
||||
<i class="ti-search"></i>
|
||||
</div>
|
||||
</div>
|
||||
@if (isModuleActive('Theme'))
|
||||
@include('theme::toggle')
|
||||
@endif
|
||||
@if (isModuleActive('StaffPortal'))
|
||||
@include('staffportal::components._frontend_profile_menu')
|
||||
@endif
|
||||
|
||||