-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixed the app layout --indentation and added comments
- Loading branch information
1 parent
90f8617
commit 3d46d04
Showing
1 changed file
with
45 additions
and
45 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 |
---|---|---|
@@ -1,55 +1,55 @@ | ||
<!DOCTYPE html> | ||
<html lang="{{ str_replace('_', '-', app()->getLocale()) }}"> | ||
<head> | ||
<meta charset="utf-8"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1"> | ||
<meta name="csrf-token" content="{{ csrf_token() }}"> | ||
<head> | ||
<meta charset="utf-8"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1"> | ||
<meta name="csrf-token" content="{{ csrf_token() }}"> | ||
|
||
<title>{{ config('app.name', 'Laravel') }}</title> | ||
<title>{{ config('app.name', 'Laravel') }}</title> | ||
|
||
<!-- Fonts --> | ||
<link rel="preconnect" href="https://fonts.bunny.net"> | ||
<link href="https://fonts.bunny.net/css?family=figtree:400,500,600&display=swap" rel="stylesheet" /> | ||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/all.min.css"> | ||
<!-- Fonts --> | ||
<link rel="preconnect" href="https://fonts.bunny.net"> | ||
<link href="https://fonts.bunny.net/css?family=figtree:400,500,600&display=swap" rel="stylesheet"/> | ||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/all.min.css"> | ||
|
||
<!-- Scripts --> | ||
@vite(['resources/css/app.css', 'resources/js/app.js']) | ||
</head> | ||
<body class="font-sans antialiased"> | ||
<div class="min-h-screen bg-white"> | ||
<livewire:navbar /> | ||
<div class="flex relative gap-2 p-2"> | ||
@include('layouts.sidebar') | ||
<!-- Page Content --> | ||
<main class="w-full bg-gray-100 overflow-clip rounded-[16px]"> | ||
{{ $slot }} | ||
</main> | ||
</div> | ||
</div> | ||
<script src="https://cdn.socket.io/4.7.5/socket.io.min.js"></script> | ||
<script src="https://code.jquery.com/jquery-3.7.1.js" integrity="sha256-eKhayi8LEQwp4NKxN+CfCh+3qOVUtJn3QNZ0TciWLP4=" crossorigin="anonymous"></script> | ||
<script> | ||
console.log('Hello from Vite!'); | ||
const socket = io('http://localhost:3000'); | ||
console.log('Socket connected:', socket); | ||
<!-- Scripts --> | ||
@vite(['resources/css/app.css', 'resources/js/app.js']) | ||
</head> | ||
<body class="font-sans antialiased"> | ||
<div class="min-h-screen bg-white"> | ||
<livewire:navbar/> | ||
<div class="flex relative gap-2 p-2"> | ||
@include('layouts.sidebar') | ||
<!-- Page Content --> | ||
<main class="w-full bg-gray-100 overflow-clip rounded-[16px]"> | ||
{{ $slot }} | ||
</main> | ||
</div> | ||
</div> | ||
<script src="https://cdn.socket.io/4.7.5/socket.io.min.js"></script> | ||
<script src="https://code.jquery.com/jquery-3.7.1.js" integrity="sha256-eKhayi8LEQwp4NKxN+CfCh+3qOVUtJn3QNZ0TciWLP4=" | ||
crossorigin="anonymous"></script> | ||
<script> | ||
//Connect to socket.io -- server | ||
const socket = io('http://localhost:3000'); | ||
socket.on('connectedUsers', (data) => { | ||
console.log('Connected users:', data); | ||
Livewire.dispatch('connectedUsers', {onlineUsers: data}); | ||
}); | ||
socket.on('connectedUsers', (data) => { | ||
console.log('Connected users:', data); | ||
Livewire.dispatch('connectedUsers', {onlineUsers: data}); | ||
}); | ||
// Send the username to the server on connection | ||
let authUser = '{{ auth()->user() }}'; | ||
authUser = JSON.parse(authUser.replace(/"/g, '"')); | ||
// Send the username to the server on connection | ||
let authUser = '{{ auth()->user() }}'; | ||
authUser = JSON.parse(authUser.replace(/"/g, '"')); | ||
socket.on('connect', () => { | ||
socket.emit('userConnected', authUser); | ||
console.log('User connected:', authUser); | ||
}); | ||
socket.on('connect', () => { | ||
socket.emit('userConnected', authUser); | ||
console.log('User connected:', authUser); | ||
}); | ||
socket.on('disconnect', () => { | ||
socket.emit('userDisconnected', authUser); | ||
}); | ||
</script> | ||
</body> | ||
socket.on('disconnect', () => { | ||
socket.emit('userDisconnected', authUser); | ||
}); | ||
</script> | ||
</body> | ||
</html> |