...
channel mock previewer with V0 by vercel

My First Web App Using V0 by Vercel | A YouTube Channel Mock up Previewer

My First Web App Using V0 by Vercel | A YouTube Channel Mock up Previewer

Using v0 by Vercel

My First try at creating a Web App, its pretty cool what you can do with the power of AI. This was unheard of around a couple of years ago.

By just typing a simple prompt you can create your ideas into reality.

Imagine just by saying to a computer what you want your app to be it can generate it in just a couple of seconds. You can also make edits on the fly to refine and perfect your designs. Its just awesome.
here is a link to what I have just created using this amazing tool.


https://b_C60UnkL5Fdv.v0.build/

Here is the code for this web app:

'use client'

import { useState, useRef } from 'react'
import { Button } from "@/components/ui/button"
import { Label } from "@/components/ui/label"
import { Tabs, TabsContent, TabsList, TabsTrigger } from "@/components/ui/tabs"
import { Maximize2, Minimize2, Upload, ZoomIn, ZoomOut } from 'lucide-react'

export default function Component() {
  const [banner, setBanner] = useState('/placeholder.svg?height=200&width=1280')
  const [avatar, setAvatar] = useState('/placeholder.svg?height=80&width=80')
  const [watermark, setWatermark] = useState('/placeholder.svg?height=40&width=40')
  const [channelName, setChannelName] = useState('Channel Name')
  const [isFullScreen, setIsFullScreen] = useState(false)
  const [activeDevice, setActiveDevice] = useState('mobile')
  const [zoomLevel, setZoomLevel] = useState(1)

  const bannerInputRef = useRef(null)
  const avatarInputRef = useRef(null)
  const watermarkInputRef = useRef(null)

  const handleImageUpload = (event, setter) => {
    const file = event.target.files[0]
    if (file) {
      const reader = new FileReader()
      reader.onload = (e) => setter(e.target.result)
      reader.readAsDataURL(file)
    }
  }

  const toggleFullScreen = () => {
    setIsFullScreen(!isFullScreen)
  }

  const handleZoomIn = () => {
    setZoomLevel(prevZoom => Math.min(prevZoom + 0.1, 2))
  }

  const handleZoomOut = () => {
    setZoomLevel(prevZoom => Math.max(prevZoom - 0.1, 0.5))
  }

  const DevicePreview = ({ device }) => {
    const sizes = {
      mobile: 'w-64',
      tablet: 'w-[768px]',
      desktop: 'w-[1024px]',
      hdtv: 'w-[1920px]'
    }

    return (
      <div className={`mx-auto ${sizes[device]} overflow-hidden bg-[#0f0f0f] shadow-lg relative border-4 border-gray-700`}>
        <div className="relative">
          <img src={banner} alt="Channel Banner" className="w-full h-32 object-cover" />
          <img src={avatar} alt="Channel Avatar" className="absolute bottom-0 left-4 transform translate-y-1/2 w-16 h-16 rounded-full border-4 border-[#0f0f0f]" />
          <img src={watermark} alt="Watermark" className="absolute top-2 right-2 w-8 h-8" />
        </div>
        <div className="p-4">
          <h2 className="text-xl font-bold text-white">{channelName}</h2>
          <p className="text-sm text-gray-400">1M subscribers</p>
        </div>
        <div className="px-4 pb-4 grid grid-cols-2 gap-4">
          <div className="space-y-2">
            <img src="/placeholder.svg?height=120&width=210" alt="Video Thumbnail" className="w-full aspect-video object-cover rounded" />
            <h3 className="text-sm font-semibold text-white">Video Title 1</h3>
            <p className="text-xs text-gray-400">10K views • 2 days ago</p>
          </div>
          <div className="space-y-2">
            <img src="/placeholder.svg?height=120&width=210" alt="Video Thumbnail" className="w-full aspect-video object-cover rounded" />
            <h3 className="text-sm font-semibold text-white">Video Title 2</h3>
            <p className="text-xs text-gray-400">8K views • 3 days ago</p>
          </div>
          <div className="space-y-2">
            <img src="/placeholder.svg?height=120&width=210" alt="Video Thumbnail" className="w-full aspect-video object-cover rounded" />
            <h3 className="text-sm font-semibold text-white">Video Title 3</h3>
            <p className="text-xs text-gray-400">15K views • 1 week ago</p>
          </div>
          <div className="space-y-2">
            <img src="/placeholder.svg?height=120&width=210" alt="Video Thumbnail" className="w-full aspect-video object-cover rounded" />
            <h3 className="text-sm font-semibold text-white">Video Title 4</h3>
            <p className="text-xs text-gray-400">5K views • 2 weeks ago</p>
          </div>
        </div>
      </div>
    )
  }

  return (
    <div className={`min-h-screen ${isFullScreen ? 'fixed inset-0 z-50' : ''} bg-gray-800 text-gray-100`}>
      <div className="container mx-auto p-4">
        <h1 className="text-2xl font-bold mb-4">YouTube Channel Mockup</h1>
        <div className={`grid ${isFullScreen ? '' : 'grid-cols-1 lg:grid-cols-3'} gap-4`}>
          {!isFullScreen && (
            <div className="lg:col-span-1">
              <h2 className="text-xl font-semibold mb-4">Upload Channel Assets</h2>
              <div className="space-y-4">
                <div>
                  <Label htmlFor="banner" className="block mb-2">Banner Image</Label>
                  <Button 
                    onClick={() => bannerInputRef.current.click()} 
                    variant="outline" 
                    className="w-full lg:w-3/4 bg-gray-700 text-gray-300 hover:bg-gray-600"
                  >
                    <Upload className="mr-2 h-4 w-4" /> Choose Banner
                  </Button>
                  <input
                    id="banner"
                    ref={bannerInputRef}
                    type="file"
                    accept="image/*"
                    onChange={(e) => handleImageUpload(e, setBanner)}
                    className="hidden"
                  />
                </div>
                <div>
                  <Label htmlFor="avatar" className="block mb-2">Channel Avatar</Label>
                  <Button 
                    onClick={() => avatarInputRef.current.click()} 
                    variant="outline" 
                    className="w-full lg:w-3/4 bg-gray-700 text-gray-300 hover:bg-gray-600"
                  >
                    <Upload className="mr-2 h-4 w-4" /> Choose Avatar
                  </Button>
                  <input
                    id="avatar"
                    ref={avatarInputRef}
                    type="file"
                    accept="image/*"
                    onChange={(e) => handleImageUpload(e, setAvatar)}
                    className="hidden"
                  />
                </div>
                <div>
                  <Label htmlFor="watermark" className="block mb-2">Watermark</Label>
                  <Button 
                    onClick={() => watermarkInputRef.current.click()} 
                    variant="outline" 
                    className="w-full lg:w-3/4 bg-gray-700 text-gray-300 hover:bg-gray-600"
                  >
                    <Upload className="mr-2 h-4 w-4" /> Choose Watermark
                  </Button>
                  <input
                    id="watermark"
                    ref={watermarkInputRef}
                    type="file"
                    accept="image/*"
                    onChange={(e) => handleImageUpload(e, setWatermark)}
                    className="hidden"
                  />
                </div>
                <div>
                  <Label htmlFor="channelName" className="block mb-2">Channel Name</Label>
                  <input
                    id="channelName"
                    value={channelName}
                    onChange={(e) => setChannelName(e.target.value)}
                    placeholder="Enter channel name"
                    className="w-full lg:w-3/4 px-3 py-2 bg-gray-700 text-gray-100 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500"
                  />
                </div>
              </div>
            </div>
          )}
          <div className={`${isFullScreen ? '' : 'lg:col-span-2'} bg-gray-200 p-4 rounded-lg relative`}>
            <div className="flex justify-between items-center mb-4">
              <h2 className="text-xl font-semibold text-gray-800">Device Preview</h2>
              <div className="flex space-x-2">
                <Button onClick={handleZoomOut} variant="outline" size="icon" className="bg-gray-300 text-gray-800 hover:bg-gray-400">
                  <ZoomOut className="h-4 w-4" />
                </Button>
                <Button onClick={handleZoomIn} variant="outline" size="icon" className="bg-gray-300 text-gray-800 hover:bg-gray-400">
                  <ZoomIn className="h-4 w-4" />
                </Button>
                <Button onClick={toggleFullScreen} variant="outline" size="icon" className="bg-gray-300 text-gray-800 hover:bg-gray-400">
                  {isFullScreen ? <Minimize2 className="h-4 w-4" /> : <Maximize2 className="h-4 w-4" />}
                </Button>
              </div>
            </div>
            <div className="h-px bg-gray-300 mb-4"></div>
            <Tabs value={activeDevice} onValueChange={setActiveDevice} className="w-full">
              <TabsList className="grid w-full grid-cols-4 bg-gray-300">
                <TabsTrigger value="mobile" className="data-[state=active]:bg-gray-100 text-gray-800">Mobile</TabsTrigger>
                <TabsTrigger value="tablet" className="data-[state=active]:bg-gray-100 text-gray-800">Tablet</TabsTrigger>
                <TabsTrigger value="desktop" className="data-[state=active]:bg-gray-100 text-gray-800">Desktop</TabsTrigger>
                <TabsTrigger value="hdtv" className="data-[state=active]:bg-gray-100 text-gray-800">HD TV</TabsTrigger>
              </TabsList>
              <TabsContent value={activeDevice} className="overflow-x-auto mt-4">
                <div style={{ transform: `scale(${zoomLevel})`, transformOrigin: 'top left', transition: 'transform 0.3s ease-in-out' }}>
                  <DevicePreview device={activeDevice} />
                </div>
              </TabsContent>
            </Tabs>
            <div className="absolute bottom-8 left-8 w-48 h-36 bg-gray-800 rounded overflow-hidden shadow-lg border-2 border-gray-600">
              <div className="relative w-full h-full">
                <div className="absolute inset-0 bg-gradient-to-r from-blue-500 to-purple-500 animate-gradient"></div>
                <img src={watermark} alt="Watermark Preview" className="absolute bottom-2 right-2 w-8 h-8 opacity-75" />
              </div>
            </div>
          </div>
        </div>
      </div>
    </div>
  )
}

This is a working Progress and I hope to add in more features and enhancements.

Hopefully this can become a fully pledge web app in a couple of days, and maybe even a mobile app in the future.

V0 uses a credit system wherein you are given a set number of message that you can send to there ai chat bot, the higher the plan you choose the more messages and the higher the priority you are in there system.
Visit there pricing are to learn more https://v0.dev/pricing

Leave a Reply

Your email address will not be published. Required fields are marked *

en_USEnglish
Seraphinite AcceleratorOptimized by Seraphinite Accelerator
Turns on site high speed to be attractive for people and search engines.