forked from swift502/Sketchbook
-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy path3dPicker.html
More file actions
43 lines (39 loc) · 2.33 KB
/
3dPicker.html
File metadata and controls
43 lines (39 loc) · 2.33 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Sketchfab Model Picker</title>
<link href="https://cdn.jsdelivr.net/npm/daisyui@3.1.0/dist/full.css" rel="stylesheet" type="text/css" />
<script src="https://cdn.tailwindcss.com"></script>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
<script src="https://cdn.jsdelivr.net/npm/vue@2.6.14/dist/vue.js"></script>
</head>
<body class="bg-gray-100">
<div id="picker" class="container mx-auto p-4">
<h1 class="text-3xl font-bold text-center mb-6">Sketchfab Model Picker</h1>
<button @click="openModelPicker('zombie')" class="btn btn-primary">Open Model Picker</button>
<dialog id="model-picker-modal" class="modal" ref="modelPickerModal">
<form method="dialog" class="modal-box w-11/12 max-w-5xl h-full">
<h3 class="font-bold text-lg mb-4">Sketchfab Model Picker</h3>
<div class="flex mb-4">
<input v-model="searchQuery" @keyup.enter="openModelPicker()" type="text" placeholder="Search models..." class="input input-bordered flex-grow" />
<button @click.prevent="openModelPicker()" class="btn btn-primary ml-2"><i class="fas fa-search"></i> Search</button>
</div>
<div class="grid grid-cols-1 md:grid-cols-3 gap-4 overflow-y-auto" style="max-height: calc(100vh - 200px);">
<div v-for="model in models" :key="model.uid" class="card bg-base-100 shadow-xl cursor-pointer" @click="model.downloadModel(model.uid)" :title="'Animations:'+model.animationCount+'\n'+model.description">
<figure><img :src="model.thumbnails.images[0].url" :alt="model.name" class="w-full h-48 object-cover" /></figure>
<div class="card-body">
<h2 class="card-title">{{ model.name }}</h2>
</div>
</div>
</div>
<div class="modal-action">
<button class="btn">Close</button>
</div>
</form>
</dialog>
</div>
<script src="3dPicker.js"></script>
</body>
</html>