ferdysetia_aan

TK3 - No.1 - show.blade.php

Jul 26th, 2025
505
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 3.14 KB | None | 0 0
  1. @extends('layouts.app')
  2.  
  3. @section('content')
  4.     <div class="container">
  5.         <div class="news-article">
  6.             <h1>{{ $berita->judul }}</h1>
  7.             <p class="meta-info">
  8.                 <span class="author">Penulis: {{ $berita->author }}</span> |
  9.                 <span class="date">{{ $berita->created_at->format('d F Y') }}</span>
  10.             </p>
  11.             <div class="content">
  12.                 <p>{{ $berita->konten }}</p>
  13.             </div>
  14.  
  15.             <div class="actions">
  16.                 <a href="{{ route('berita.edit', $berita->id_berita) }}" class="btn btn-warning">Edit</a>
  17.  
  18.                 <form action="{{ route('berita.destroy', $berita->id_berita) }}" method="POST" style="display:inline;">
  19.                     @csrf
  20.                     @method('DELETE')
  21.                     <button type="submit" class="btn btn-danger">Hapus</button>
  22.                 </form>
  23.             </div>
  24.         </div>
  25.     </div>
  26. @endsection
  27.  
  28. @section('css')
  29.     <style>
  30.         .container {
  31.             width: 90%;
  32.             max-width: 960px;
  33.             margin: 0 auto;
  34.         }
  35.  
  36.         .news-article {
  37.             background-color: #ffffff;
  38.            padding: 30px;
  39.             border-radius: 8px;
  40.             box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  41.             margin-bottom: 30px;
  42.         }
  43.  
  44.         h1 {
  45.             font-size: 2.5rem;
  46.             font-weight: bold;
  47.             margin-bottom: 15px;
  48.             color: #333;
  49.        }
  50.  
  51.         .meta-info {
  52.             font-size: 0.9rem;
  53.             color: #777;
  54.            margin-bottom: 20px;
  55.         }
  56.  
  57.         .author, .date {
  58.             margin-right: 10px;
  59.         }
  60.  
  61.         .content {
  62.             font-size: 1.15rem;
  63.             line-height: 1.8;
  64.             color: #555;
  65.            margin-bottom: 20px;
  66.         }
  67.  
  68.         .actions {
  69.             display: flex;
  70.             gap: 15px;
  71.             margin-top: 20px;
  72.         }
  73.  
  74.         .actions .btn {
  75.             padding: 10px 20px;
  76.             text-align: center;
  77.             border-radius: 5px;
  78.             font-size: 14px;
  79.             border: none;
  80.         }
  81.  
  82.         .btn-warning {
  83.             background-color: #ffc107;
  84.            color: white;
  85.             transition: background-color 0.3s;
  86.         }
  87.  
  88.         .btn-warning:hover {
  89.             background-color: #e0a800;
  90.        }
  91.  
  92.         .btn-danger {
  93.             background-color: #dc3545;
  94.            color: white;
  95.             transition: background-color 0.3s;
  96.         }
  97.  
  98.         .btn-danger:hover {
  99.             background-color: #c82333;
  100.        }
  101.  
  102.         /* Responsive Design */
  103.         @media (max-width: 768px) {
  104.             .news-article {
  105.                 padding: 20px;
  106.             }
  107.  
  108.             h1 {
  109.                 font-size: 2rem;
  110.             }
  111.  
  112.             .content {
  113.                 font-size: 1rem;
  114.             }
  115.  
  116.             .actions {
  117.                 flex-direction: column;
  118.                 gap: 10px;
  119.             }
  120.  
  121.             .btn {
  122.                 width: 100%;
  123.                 padding: 12px;
  124.                 font-size: 16px;
  125.             }
  126.         }
  127.     </style>
  128. @endsection
  129.  
Advertisement
Add Comment
Please, Sign In to add comment