Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @extends('layouts.app')
- @section('content')
- <div class="container">
- <div class="news-article">
- <h1>{{ $berita->judul }}</h1>
- <p class="meta-info">
- <span class="author">Penulis: {{ $berita->author }}</span> |
- <span class="date">{{ $berita->created_at->format('d F Y') }}</span>
- </p>
- <div class="content">
- <p>{{ $berita->konten }}</p>
- </div>
- <div class="actions">
- <a href="{{ route('berita.edit', $berita->id_berita) }}" class="btn btn-warning">Edit</a>
- <form action="{{ route('berita.destroy', $berita->id_berita) }}" method="POST" style="display:inline;">
- @csrf
- @method('DELETE')
- <button type="submit" class="btn btn-danger">Hapus</button>
- </form>
- </div>
- </div>
- </div>
- @endsection
- @section('css')
- <style>
- .container {
- width: 90%;
- max-width: 960px;
- margin: 0 auto;
- }
- .news-article {
- background-color: #ffffff;
- padding: 30px;
- border-radius: 8px;
- box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
- margin-bottom: 30px;
- }
- h1 {
- font-size: 2.5rem;
- font-weight: bold;
- margin-bottom: 15px;
- color: #333;
- }
- .meta-info {
- font-size: 0.9rem;
- color: #777;
- margin-bottom: 20px;
- }
- .author, .date {
- margin-right: 10px;
- }
- .content {
- font-size: 1.15rem;
- line-height: 1.8;
- color: #555;
- margin-bottom: 20px;
- }
- .actions {
- display: flex;
- gap: 15px;
- margin-top: 20px;
- }
- .actions .btn {
- padding: 10px 20px;
- text-align: center;
- border-radius: 5px;
- font-size: 14px;
- border: none;
- }
- .btn-warning {
- background-color: #ffc107;
- color: white;
- transition: background-color 0.3s;
- }
- .btn-warning:hover {
- background-color: #e0a800;
- }
- .btn-danger {
- background-color: #dc3545;
- color: white;
- transition: background-color 0.3s;
- }
- .btn-danger:hover {
- background-color: #c82333;
- }
- /* Responsive Design */
- @media (max-width: 768px) {
- .news-article {
- padding: 20px;
- }
- h1 {
- font-size: 2rem;
- }
- .content {
- font-size: 1rem;
- }
- .actions {
- flex-direction: column;
- gap: 10px;
- }
- .btn {
- width: 100%;
- padding: 12px;
- font-size: 16px;
- }
- }
- </style>
- @endsection
Advertisement
Add Comment
Please, Sign In to add comment