-
Notifications
You must be signed in to change notification settings - Fork 89
Experimental Workload: Responsive Design #453
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
issackjohn
wants to merge
12
commits into
WebKit:main
Choose a base branch
from
issackjohn:responsive-design
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
5530186
workload
issackjohn f77190b
Addressing PR comments part 1
issackjohn ee8f0cb
add matchMedia to responsive design (#32)
issackjohn 52ee54e
Add disconnected callback (#33)
issackjohn 06332b5
Capture sync async work for getBoundingRectAndElementFromPoint (#34)
issackjohn 7d09b69
Capture sync async with getBoundingClientRect (#35)
issackjohn 2b39bb9
Remove nested iframe, add double RAF (#37)
issackjohn f534edc
Add content visibility change handler for video grid (#39)
issackjohn 477964e
nit: remove extra new line.
issackjohn 350a70c
Add responsive design benchmark back
issackjohn 75f70bc
fix build break
issackjohn cc37f6c
Move Responsive-Design suite to experimental/tests.mjs and sync with …
issackjohn 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 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
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
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
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
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,114 @@ | ||
| # Cooking With Lit and TailwindCSS | ||
|
|
||
| A single-page cooking website built with [Lit](https://lit.dev/) and [Tailwind CSS](https://tailwindcss.com/). | ||
|
|
||
| ## Table of Contents | ||
|
|
||
| - [Introduction](#introduction) | ||
| - [Installation](#installation) | ||
| - [Usage](#usage) | ||
| - [Production](#production) | ||
| - [Project Structure](#project-structure) | ||
| - [Components](#components) | ||
| - [Data Sources](#data-sources) | ||
|
|
||
| ## Introduction | ||
|
|
||
| This project is a responsive cooking website that showcases recipes, articles, and cooking videos. It is built using Lit for efficient web components and Tailwind CSS for styling. The app features interactive components like a chat window, recipe cards, and a video grid, providing users with an engaging experience. | ||
|
|
||
| ## Installation | ||
|
|
||
| Ensure you have [Node.js](https://nodejs.org/en) installed. | ||
|
|
||
| ```bash | ||
| npm install | ||
| ``` | ||
|
|
||
| ## Usage | ||
|
|
||
| To run the app in development mode with live reloading: | ||
|
|
||
| ```bash | ||
| npm run dev | ||
| ``` | ||
|
|
||
| The script above runs the following commands concurrently, scanning your template files for classes, build your CSS, and launch the development server: | ||
|
|
||
| - Tailwind CSS for Main Styles: | ||
|
|
||
| ```bash | ||
| npm run dev:main-css | ||
| ``` | ||
|
|
||
| Compiles input.css into tailwind.generated.css and watches for changes. | ||
|
|
||
| - Tailwind CSS for Chat Window Styles: | ||
|
|
||
| ```bash | ||
| npm run dev:chat-window-css | ||
| ``` | ||
|
|
||
| Compiles styles specific to the chat window into tailwind.chat-window.generated.css. | ||
|
|
||
| - Rollup watch | ||
|
|
||
| ```bash | ||
| npm run dev:rollup | ||
| ``` | ||
|
|
||
| Bundles the JavaScript files using Rollup and watches for changes. | ||
|
|
||
| - Development Server | ||
| ```bash | ||
| npm run dev:serve | ||
| ``` | ||
| Runs a development server with live reloading | ||
|
|
||
| Access the app at http://localhost:8000 (default port). | ||
|
|
||
| ## Production | ||
|
|
||
| To build and serve the production version of the app, run the following command: | ||
|
|
||
| ```bash | ||
| npm run build | ||
| npm run serve | ||
| ``` | ||
|
|
||
| The command will: | ||
|
|
||
| - Compile and minify the CSS files. | ||
| - Bundle and minify JavaScript files using Rollup. | ||
| - Copy necessary assets to the `dist/` directory. | ||
|
|
||
| ## Project Structure | ||
|
|
||
| ``` | ||
| ├── dist/ # Production build output | ||
| ├── public/ # Public assets like images | ||
| ├── src/ | ||
| │ ├── data/ # Data files (recipes, articles, etc.) | ||
| │ ├── lib/ | ||
| │ │ └── components/ # Lit components | ||
| │ ├── input.css # Tailwind CSS input file | ||
| │ └── app.js # Main JavaScript entry point | ||
| ├── index.html # Main HTML file | ||
| ├── package.json # NPM configuration | ||
| ├── tailwind.chat-window.config.js # Tailwind CSS configuration | ||
| ├── tailwind.config.js # Tailwind CSS configuration | ||
| └── rollup.config.js # Rollup bundler configuration | ||
| ``` | ||
|
|
||
| ## Components | ||
|
|
||
| #### CookingApp (cooking-app.js) | ||
|
|
||
| The root component that composes all other components to build the app interface. | ||
|
|
||
| ## Data Sources | ||
|
|
||
| The app uses static data files located in the `src/data/` directory: | ||
|
|
||
| ## Icons | ||
|
|
||
| The icons used in this project are from [Heroicons](https://github.com/tailwindlabs/heroicons/blob/master/LICENSE). |
Large diffs are not rendered by default.
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 |
|---|---|---|
| @@ -0,0 +1,61 @@ | ||
| <!DOCTYPE html> | ||
| <html lang="en"> | ||
| <head> | ||
| <meta charset="UTF-8" /> | ||
| <meta name="viewport" content="width=device-width, initial-scale=1.0" /> | ||
| <title>Cooking with Lit and Tailwind</title> | ||
| <script type="module" src="app.js"></script> | ||
| <style> | ||
| body, | ||
| html { | ||
| margin: 0; | ||
| width: 100%; | ||
| height: 100%; | ||
| } | ||
| body { | ||
| overflow: auto; | ||
| } | ||
| </style> | ||
| <!-- Preload links autogenerated by Rollup --> | ||
| <link rel="preload" as="image" href="./public/images/5-healthy-smoothie.webp"> | ||
| <link rel="preload" as="image" href="./public/images/beef-stroganoff.webp"> | ||
| <link rel="preload" as="image" href="./public/images/beef-tacos.webp"> | ||
| <link rel="preload" as="image" href="./public/images/best-comfort-food.webp"> | ||
| <link rel="preload" as="image" href="./public/images/bread-at-home.webp"> | ||
| <link rel="preload" as="image" href="./public/images/caesar-salad.webp"> | ||
| <link rel="preload" as="image" href="./public/images/chicken-alfredo.webp"> | ||
| <link rel="preload" as="image" href="./public/images/chocolate-cake.webp"> | ||
| <link rel="preload" as="image" href="./public/images/chocolate-chip-cookies.webp"> | ||
| <link rel="preload" as="image" href="./public/images/fruit-salad.webp"> | ||
| <link rel="preload" as="image" href="./public/images/garlic-bread.webp"> | ||
| <link rel="preload" as="image" href="./public/images/gluten-free-baking.webp"> | ||
| <link rel="preload" as="image" href="./public/images/greek-salad.webp"> | ||
| <link rel="preload" as="image" href="./public/images/homemade-pizza.webp"> | ||
| <link rel="preload" as="image" href="./public/images/icons-outline.webp"> | ||
| <link rel="preload" as="image" href="./public/images/lemon-drizzle-cake.webp"> | ||
| <link rel="preload" as="image" href="./public/images/low-carb-desserts.webp"> | ||
| <link rel="preload" as="image" href="./public/images/margherita-pizza.webp"> | ||
| <link rel="preload" as="image" href="./public/images/mastering-art-of-french-cooking.webp"> | ||
| <link rel="preload" as="image" href="./public/images/meal-prepping.webp"> | ||
| <link rel="preload" as="image" href="./public/images/mediterranean-cuisine.webp"> | ||
| <link rel="preload" as="image" href="./public/images/pancakes.webp"> | ||
| <link rel="preload" as="image" href="./public/images/plant-based-protein.webp"> | ||
| <link rel="preload" as="image" href="./public/images/quinoa-stuffed-peppers.webp"> | ||
| <link rel="preload" as="image" href="./public/images/ramen-noodles.webp"> | ||
| <link rel="preload" as="image" href="./public/images/seasonal-salads.webp"> | ||
| <link rel="preload" as="image" href="./public/images/shrimp-paella.webp"> | ||
| <link rel="preload" as="image" href="./public/images/spaghetti-carbonara.webp"> | ||
| <link rel="preload" as="image" href="./public/images/superfoods-you-should-include.webp"> | ||
| <link rel="preload" as="image" href="./public/images/sushi-platter.webp"> | ||
| <link rel="preload" as="image" href="./public/images/thai-green-curry.webp"> | ||
| <link rel="preload" as="image" href="./public/images/tomato-soup.webp"> | ||
| <link rel="preload" as="image" href="./public/images/vegan-burger.webp"> | ||
| <link rel="preload" as="image" href="./public/images/vegan-desserts.webp"> | ||
| <link rel="preload" as="image" href="./public/images/vegetable-stir-fry.webp"> | ||
| <link rel="preload" as="image" href="./public/images/vegetarian-stir-fry.webp"> | ||
| <link rel="preload" as="image" href="./public/images/week-night-dinners.webp"> | ||
| </head> | ||
| <body> | ||
| <cooking-app></cooking-app> | ||
| </body> | ||
| </html> |
Binary file added
BIN
+45.9 KB
experimental/responsive-design/dist/public/images/5-healthy-smoothie.webp
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+106 KB
experimental/responsive-design/dist/public/images/beef-stroganoff.webp
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+22.7 KB
experimental/responsive-design/dist/public/images/best-comfort-food.webp
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+41.9 KB
experimental/responsive-design/dist/public/images/chicken-alfredo.webp
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+29.3 KB
experimental/responsive-design/dist/public/images/chocolate-cake.webp
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+33.4 KB
experimental/responsive-design/dist/public/images/chocolate-chip-cookies.webp
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+106 KB
experimental/responsive-design/dist/public/images/gluten-free-baking.webp
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+55.1 KB
experimental/responsive-design/dist/public/images/homemade-pizza.webp
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+33.8 KB
experimental/responsive-design/dist/public/images/lemon-drizzle-cake.webp
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+75.2 KB
experimental/responsive-design/dist/public/images/low-carb-desserts.webp
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+40.1 KB
experimental/responsive-design/dist/public/images/margherita-pizza.webp
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+39.9 KB
...ental/responsive-design/dist/public/images/mastering-art-of-french-cooking.webp
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+53.2 KB
experimental/responsive-design/dist/public/images/mediterranean-cuisine.webp
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+42.3 KB
experimental/responsive-design/dist/public/images/plant-based-protein.webp
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+66.5 KB
experimental/responsive-design/dist/public/images/quinoa-stuffed-peppers.webp
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+114 KB
experimental/responsive-design/dist/public/images/seasonal-salads.webp
Oops, something went wrong.
Oops, something went wrong.
Binary file added
BIN
+43.2 KB
experimental/responsive-design/dist/public/images/spaghetti-carbonara.webp
Oops, something went wrong.
Binary file added
BIN
+51.2 KB
...imental/responsive-design/dist/public/images/superfoods-you-should-include.webp
Oops, something went wrong.
Oops, something went wrong.
Binary file added
BIN
+69.5 KB
experimental/responsive-design/dist/public/images/thai-green-curry.webp
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Binary file added
BIN
+37.9 KB
experimental/responsive-design/dist/public/images/vegan-desserts.webp
Oops, something went wrong.
Binary file added
BIN
+37.8 KB
experimental/responsive-design/dist/public/images/vegetable-stir-fry.webp
Oops, something went wrong.
Binary file added
BIN
+42.2 KB
experimental/responsive-design/dist/public/images/vegetarian-stir-fry.webp
Oops, something went wrong.
Binary file added
BIN
+40.1 KB
experimental/responsive-design/dist/public/images/week-night-dinners.webp
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 |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| <!DOCTYPE html> | ||
| <html lang="en"> | ||
| <head> | ||
| <meta charset="UTF-8" /> | ||
| <meta name="viewport" content="width=device-width, initial-scale=1.0" /> | ||
| <title>Cooking with Lit and Tailwind</title> | ||
| <script type="module" src="app.js"></script> | ||
| <style> | ||
| body, | ||
| html { | ||
| margin: 0; | ||
| width: 100%; | ||
| height: 100%; | ||
| } | ||
| body { | ||
| overflow: auto; | ||
| } | ||
| </style> | ||
| </head> | ||
| <body> | ||
| <cooking-app></cooking-app> | ||
| </body> | ||
| </html> |
Oops, something went wrong.
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.