
MyKK.us
A minimalist, responsive web page for MyKK.us that displays a Krispy Kreme-themed image, optimized for different viewport sizes, and redirects to the official Krispy Kreme website upon clicking. The image is centered both vertically and horizontally, ensuring it is never cropped, with different image resolutions served based on the deviceβs screen size.
Features
- Responsive Images: Uses the HTML
<picture>element to serve different image sizes based on viewport width:mykk-800x1063.jpgfor screens β€800px (phones).mykk-1653-1136.jpgfor screens β€1653px (tablets/small laptops).mykk-1680x1050.jpgfor screens β€1680px (laptops).mykk-1920x1080.jpgfor screens β€1920px (desktops).mykk-2560x1440.jpegfor screens β€2560px (high-res displays).mykk-3648x2736.jpegfor screens >2560px (4K displays).mykk-3508x2480.jpgas the fallback image.
- No Cropping: Images are displayed using
object-fit: containto ensure the entire image is visible without cropping. - Centered Alignment: Images are centered both vertically and horizontally using Flexbox and
object-position: center. - Mobile Optimization: On smaller screens (β€768px), images fit the full width with natural height, maintaining aspect ratio.
- Click Redirect: Clicking the image redirects to Krispy Kremeβs official website.
- Clean Design: Minimal CSS with a fallback background color for empty space around images.
Project Structure
mykk.us/
βββ index.html # Main HTML file
βββ images/ # Directory for image assets
β βββ mykk-800x1063.jpg
β βββ mykk-1653-1136.jpg
β βββ mykk-1680x1050.jpg
β βββ mykk-1920x1080.jpg
β βββ mykk-2560x1440.jpeg
β βββ mykk-3508x2480.jpg
β βββ mykk-3648x2736.jpeg
βββ README.md # This file
Setup
-
Clone the Repository:
git clone https://github.com/MichalAFerber/mykk.us.git cd mykk.us -
Add Image Assets:
- Place the required images (
mykk-*.jpg/jpeg) in theimages/directory. - Update the
<source>and<img>srcset/srcattributes inindex.htmlwith the correct paths or URLs to your images (e.g.,https://mykk.us/images/mykk-800x1063.jpg).
- Place the required images (
-
Host the Website:
-
Local Development: Use a local server like
live-serveror Pythonβs HTTP server:python -m http.server 8000Then open
http://localhost:8000in your browser. -
Deploy: Upload the files to a web server or hosting service (e.g., GitHub Pages, Netlify, or your own server). Ensure the
images/directory is accessible.
-
-
Test Responsiveness:
- Use browser developer tools to simulate different screen sizes.
- Verify that the correct image loads based on viewport width and that it is centered without cropping.
Usage
- Open the website (https://mykk.us) in a browser.
- The appropriate image will load based on your deviceβs viewport size.
- Click the image to be redirected to https://www.krispykreme.com/.
Customization
- Image Paths: Replace placeholder paths (
/images/mykk-*.jpg) inindex.htmlwith actual URLs or file paths (e.g.,https://mykk.us/images/mykk-800x1063.jpg). - Background Color: Modify
background-color: #f0f0f0in the<style>section ofindex.htmlto change the color of empty space around images. - Breakpoints: Adjust the
mediaqueries in the<source>tags (e.g.,max-width: 800px) to change which image is served for specific viewport sizes. - Image Optimization: Compress images to reduce load times, especially for mobile devices.
Notes
- Ensure images are optimized for web use to improve performance.
- Test across various devices and screen sizes to confirm proper image selection and centering.
- The fallback background color (
#f0f0f0) can be customized to match your design or Krispy Kremeβs branding. - If hosting images externally, ensure the URLs are reliable and accessible.
- The website is live at https://mykk.us.
License
This project is for personal or demonstration purposes. Ensure you have permission to use and distribute the Krispy Kreme-themed images.