Skip to content
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

feat: add Browser Mockup #67

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 50 additions & 0 deletions layer/components/Lego/BrowserMockup/index.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
<script lang="ts" setup>
defineProps<{
url: {
type: String;
required: true;
};
colored: {
type: Boolean;
default: false;
};
}>(); // Add a semicolon at the end
</script>
<template>
<div
class="w-full h-full rounded-2xl border rounded-lg overflow-hidden flex flex-col"
>
<div class="flex space-x-8 h-12 bg-white flex items-center px-4 border-b">
<div class="flex gap-2 w-20">
<div
class="w-3 h-3 rounded-full bg-gray-200/40 border hover:bg-red-400 transition-colors duration-200 ease-in-out cursor-pointer"
:class="{ 'bg-red-400': colored }"
></div>
<div
class="w-3 h-3 rounded-full bg-gray-200/40 border hover:bg-yellow-400 transition-colors duration-200 ease-in-out cursor-pointer"
:class="{ 'bg-yellow-400': colored }"
></div>
<div
class="w-3 h-3 rounded-full bg-gray-200/40 border hover:bg-green-400 transition-colors duration-200 ease-in-out cursor-pointer"
:class="{ 'bg-green-400': colored }"
></div>
</div>
<div class="flex-1" v-if="url">
<div
class="w-60 border bg-gray-200/40 rounded-md px-2 py-1 hover:bg-white transition-colors duration-200 ease-in-out cursor-pointer"
>
<div class="flex items-center">
<p
class="text-xs text-center text-nowrap text-gray-400 font-light overflow-hidden"
>
{{ url }}
</p>
</div>
</div>
</div>
</div>
<div class="flex-1 p-5 bg-white">
<slot />
</div>
</div>
</template>
1,166 changes: 1,166 additions & 0 deletions layer/yarn.lock

Large diffs are not rendered by default.

9 changes: 9 additions & 0 deletions website/components/BrowserMockup/Demo.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<script lang="ts" setup></script>

<template>
<LegoBrowserMockup>
<div>
<p>Welcome On Nuxt-Lego</p>
</div>
</LegoBrowserMockup>
</template>
31 changes: 31 additions & 0 deletions website/content/docs/2.components/11.browser-mockup.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
---
title: Browser Mockup
description: Create a mockup box resembling an operating system window.
new: true
---

::code-example
#preview
:browser-mockup-demo
#code
codegen{src="website/components/BrowserMockup/Demo.vue" lang="vue"}
::

## Anatomy

```vue
<template>
<LegoBrowserMockup url="url" colored="false">
<!-- Your Content -->
</LegoBrowserMockup>
</template>
```

## API Reference

### Root

| Prop | Default | Types | Description |
| ------- | ------- | --------- | ------------------------------------ |
| url | - | `string` | Url for the website in website bar |
| colored | false | `boolean` | If you want icons colored by default |