-
Notifications
You must be signed in to change notification settings - Fork 0
+667
−362
Merged
Changes from 1 commit
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
35c07de
Fjernet felt som ikke brukes
e034a68
feat: Added layout (header/footer) and featured movie component
philiphn 576ceb2
Update AI_Deklarasjon.md
philiphn 8585336
Merge branch 'main' into layout
kevinnt e1ec174
Merged with main, og kjørt Prettier og Lint
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains hidden or 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,122 +1,13 @@ | ||
| import { useState } from 'react' | ||
| import heroImg from './assets/hero.png' | ||
| import reactLogo from './assets/react.svg' | ||
| import viteLogo from './assets/vite.svg' | ||
| import './App.css' | ||
| import "./index.css"; | ||
| import { Layout } from "./components/layout/Layout"; | ||
| import { FeaturedMovie } from "./components/FeaturedMovie"; | ||
|
|
||
| function App() { | ||
| const [count, setCount] = useState(0) | ||
|
|
||
| return ( | ||
| <> | ||
| <section id="center"> | ||
| <div className="hero"> | ||
| <img src={heroImg} className="base" width="170" height="179" alt="" /> | ||
| <img src={reactLogo} className="framework" alt="React logo" /> | ||
| <img src={viteLogo} className="vite" alt="Vite logo" /> | ||
| </div> | ||
| <div> | ||
| <h1>Get started</h1> | ||
| <p> | ||
| Edit <code>src/App.tsx</code> and save to test <code>HMR</code> | ||
| </p> | ||
| </div> | ||
| <button | ||
| type="button" | ||
| className="counter" | ||
| onClick={() => setCount((count) => count + 1)} | ||
| > | ||
| Count is {count} | ||
| </button> | ||
| </section> | ||
|
|
||
| <div className="ticks"></div> | ||
|
|
||
| <section id="next-steps"> | ||
| <div id="docs"> | ||
| <svg className="icon" role="presentation" aria-hidden="true"> | ||
| <use href="/icons.svg#documentation-icon"></use> | ||
| </svg> | ||
| <h2>Documentation</h2> | ||
| <p>Your questions, answered</p> | ||
| <ul> | ||
| <li> | ||
| <a href="https://vite.dev/" target="_blank"> | ||
| <img className="logo" src={viteLogo} alt="" /> | ||
| Explore Vite | ||
| </a> | ||
| </li> | ||
| <li> | ||
| <a href="https://react.dev/" target="_blank"> | ||
| <img className="button-icon" src={reactLogo} alt="" /> | ||
| Learn more | ||
| </a> | ||
| </li> | ||
| </ul> | ||
| </div> | ||
| <div id="social"> | ||
| <svg className="icon" role="presentation" aria-hidden="true"> | ||
| <use href="/icons.svg#social-icon"></use> | ||
| </svg> | ||
| <h2>Connect with us</h2> | ||
| <p>Join the Vite community</p> | ||
| <ul> | ||
| <li> | ||
| <a href="https://github.com/vitejs/vite" target="_blank"> | ||
| <svg | ||
| className="button-icon" | ||
| role="presentation" | ||
| aria-hidden="true" | ||
| > | ||
| <use href="/icons.svg#github-icon"></use> | ||
| </svg> | ||
| GitHub | ||
| </a> | ||
| </li> | ||
| <li> | ||
| <a href="https://chat.vite.dev/" target="_blank"> | ||
| <svg | ||
| className="button-icon" | ||
| role="presentation" | ||
| aria-hidden="true" | ||
| > | ||
| <use href="/icons.svg#discord-icon"></use> | ||
| </svg> | ||
| Discord | ||
| </a> | ||
| </li> | ||
| <li> | ||
| <a href="https://x.com/vite_js" target="_blank"> | ||
| <svg | ||
| className="button-icon" | ||
| role="presentation" | ||
| aria-hidden="true" | ||
| > | ||
| <use href="/icons.svg#x-icon"></use> | ||
| </svg> | ||
| X.com | ||
| </a> | ||
| </li> | ||
| <li> | ||
| <a href="https://bsky.app/profile/vite.dev" target="_blank"> | ||
| <svg | ||
| className="button-icon" | ||
| role="presentation" | ||
| aria-hidden="true" | ||
| > | ||
| <use href="/icons.svg#bluesky-icon"></use> | ||
| </svg> | ||
| Bluesky | ||
| </a> | ||
| </li> | ||
| </ul> | ||
| </div> | ||
| </section> | ||
|
|
||
| <div className="ticks"></div> | ||
| <section id="spacer"></section> | ||
| </> | ||
| ) | ||
| <Layout> | ||
| <FeaturedMovie /> | ||
| </Layout> | ||
| ); | ||
| } | ||
|
|
||
| export default App | ||
| export default App; |
This file contains hidden or 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,56 @@ | ||
| import { featuredMovie as movie, featuredReview as review, genres } from '../data/mockData'; | ||
|
|
||
| const IMAGE_BASE = 'https://image.tmdb.org/t/p'; | ||
| const DICE = ['⚀', '⚁', '⚂', '⚃', '⚄', '⚅']; | ||
|
|
||
| export function FeaturedMovie() { | ||
| const year = movie.release_date.slice(0, 4); | ||
| const hours = Math.floor(movie.runtime / 60); | ||
| const minutes = movie.runtime % 60; | ||
| const genreNames = movie.genre_ids.map((id) => genres[id]); | ||
| const rounded = Math.round(movie.average_rating); | ||
|
|
||
| return ( | ||
| <section className="featured"> | ||
| {/* Venstre: tekst */} | ||
| <div className="featured-content"> | ||
| <p className="featured-label">Utvalgt fra topplisten</p> | ||
| <h1 className="featured-title">{movie.title}</h1> | ||
|
|
||
| <p className="featured-meta"> | ||
| <span>{year}</span> | ||
| <span>{hours}t {minutes}m</span> | ||
| <span>{genreNames.join(' / ')}</span> | ||
| <span>Regi: {movie.director}</span> | ||
| </p> | ||
|
|
||
| <div className="featured-rating"> | ||
| <span className="featured-dice" aria-hidden="true">{DICE[rounded - 1]}</span> | ||
| <div> | ||
| <p className="featured-rating-title">Terningkast {movie.average_rating.toFixed(1)}</p> | ||
| <p className="featured-rating-count">Basert på {movie.review_count} anmeldelser</p> | ||
| </div> | ||
| </div> | ||
|
|
||
| <blockquote className="featured-quote"> | ||
| <p>«{review.text}»</p> | ||
| <footer>— {review.author}, {review.date}</footer> | ||
| </blockquote> | ||
|
|
||
| <div className="featured-buttons"> | ||
| <a href={`/film/${movie.id}`} className="button-white">Les mer om filmen</a> | ||
| <button type="button" className="button-outline">Legg i min liste</button> | ||
| </div> | ||
| </div> | ||
|
|
||
| {/* Høyre: plakat */} | ||
| <img | ||
| className="featured-poster" | ||
| src={`${IMAGE_BASE}/w342${movie.poster_path}`} | ||
| alt={`Plakat for ${movie.title}`} | ||
| width="342" | ||
| height="513" | ||
| /> | ||
| </section> | ||
| ); | ||
| } |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.