aider/_posts
Paul Gauthier a372fff409 aider: Made the video responsive to prevent overflow on mobile devices.
# Aider chat conversation:

USER: the video overflows the width of the browser on mobile

ASSISTANT: To fix the video overflowing the width of the browser on mobile devices, we can add some CSS styles to make the video responsive. Here are the changes:

_posts/2024-05-02-browser.md
<source>
<<<<<<< SEARCH
<video width="1060" height="1080" controls loop poster="/assets/browser.jpg">
  <source src="/assets/aider-browser-social.mp4" type="video/mp4">
  <a href="/assets/aider-browser-social.mp4">Aider browser UI demo video</a>
</video>
=======
<div class="video-container">
  <video controls loop poster="/assets/browser.jpg">
    <source src="/assets/aider-browser-social.mp4" type="video/mp4">
    <a href="/assets/aider-browser-social.mp4">Aider browser UI demo video</a>
  </video>
</div>

<style>
.video-container {
  position: relative;
  padding-bottom: 56.25%; /* 16:9 aspect ratio */
  height: 0;
  overflow: hidden;
}

.video-container video {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}
</style>
>>>>>>> REPLACE
</source>

The changes:

1. Wrap the `<video>` element inside a `<div>` with class `video-container`.
2. Remove the `width` and `height` attributes from the `<video>` element.
3. Add a `<style>` block with CSS for the `video-container` class:
   - Set `position: relative` on the container.
   - Use `padding-bottom: 56.25%` to maintain a 16:9 aspect ratio.
   - Set `height: 0` and `overflow: hidden` to contain the video.
4. Add CSS for the `video` element inside `video-container`:
   - Set `position: absolute` to position it within the container.
   - Set `top: 0`, `left: 0`, `width: 100%`, `height: 100%` to make it fill the container.

These changes will make the video responsive and fit within the width of the browser on mobile devices while maintaining its aspect ratio.
2024-05-02 18:02:10 -07:00
..
2023-05-25-ctags.md Link more blog articles 2024-02-19 13:25:43 -08:00
2023-07-02-benchmarks.md Link more blog articles 2024-02-19 13:25:43 -08:00
2023-10-22-repomap.md Link more blog articles 2024-02-19 13:25:43 -08:00
2023-11-06-benchmarks-1106.md Added post symlink 2024-02-19 13:08:49 -08:00
2023-11-06-benchmarks-speed-1106.md layout 2024-02-19 14:49:23 -08:00
2023-12-21-unified-diffs.md Link more blog articles 2024-02-19 13:25:43 -08:00
2024-01-25-benchmarks-0125.md Link more blog articles 2024-02-19 13:25:43 -08:00
2024-03-08-claude-3.md Added --opus 2024-04-18 17:09:43 -07:00
2024-04-09-gpt-4-turbo.md copy 2024-04-09 17:13:12 -07:00
2024-05-02-browser.md aider: Made the video responsive to prevent overflow on mobile devices. 2024-05-02 18:02:10 -07:00