Przeglądaj źródła

done leaf theme

Help-14 3 lat temu
rodzic
commit
4b8712cd65

+ 3 - 5
src/main.go

@@ -91,11 +91,9 @@ func watchChanges() {
 		}
 	}()
 
-	err = watcher.Add(filepath.Join(pwd, "data", "data.yaml"))
-	err = watcher.Add(filepath.Join(pwd, "data", "config.yaml"))
-	if err != nil {
-		log.Fatal(err)
-	}
+	watcher.Add(filepath.Join(pwd, "data", "data.yaml"))
+	watcher.Add(filepath.Join(pwd, "data", "config.yaml"))
+	watcher.Add(filepath.Join(pwd, "themes", appConfig.Website.Theme, "index.html"))
 	<-done
 }
 

+ 8 - 0
src/themes/leaf/css/leaf.css

@@ -0,0 +1,8 @@
+body {
+    background-color: var(--bgColor);
+    color: var(--foreground);
+}
+
+.accent {
+    color: var(--accentColor)
+}

Plik diff jest za duży
+ 0 - 0
src/themes/leaf/css/tailwind.min.css


+ 19 - 33
src/themes/leaf/index.html

@@ -8,49 +8,35 @@
     <meta name="viewport" content="width=device-width, initial-scale=1">
     <link rel="icon" type="image/png" href="/common/assets/favicon.ico" />
     <link rel="stylesheet" href="/common/css/core.css">
-    <link href="https://unpkg.com/tailwindcss@^1.0/dist/tailwind.min.css" rel="stylesheet">
+    <link href="/theme/css/tailwind.min.css" rel="stylesheet">
     <link rel="stylesheet" href="/common/css/all.min.css">
+    <link rel="stylesheet" href="/theme/css/leaf.css">
     <link rel="stylesheet" href="/common/css/custom.css">
 </head>
 
 <body>
-    <div class="w-full h-full relative ">
-        <div class="absolute inset-0">
-            <div class="grid grid-flow-row auto-rows-max">
-                {{range .Contents}}
-                <h4 class="strong">{{.Title}}</h4>
-                <div class="grid grid-cols-4 gap-4">
-                    {{range .Columns}}
-                    <div>
-                        <h6 class="accent">{{.Title}}</h6>
-                        <div class="grid grid-flow-row auto-rows-max">
-                            {{range .Bookmarks}}
-                            <div>
-                                <button
-                                    class="hover:bg-gray-600 rounded-lg p-3 border-0 border-transparent content-center items-center"
-                                    onclick="window.open('{{.Url}}')">
-                                    <div class="flex">
-                                        <div class="flex-none" style="width: 32px; height: 32px;">
-                                            {{if .IsImage}}
-                                            <img src="{{.Icon}}" class="icon">
-                                            {{else if .IsSVG}}
-                                            <svg-file src="{{.Icon}}" class="svg-icon"></svg-file>
-                                            {{else}}
-                                            <i class="{{.Icon}} fa-xl icon"></i>
-                                            {{end}}
-                                        </div>
-                                        <div class="grow ml-3">
-                                            <h6>{{.Name}}</h6>
-                                        </div>
-                                    </div>
-                                </button>
+    <div class="grid place-items-center h-screen">
+        <div class="flex">
+            <div class="shrink place-items-center inset-0">
+                <div class="grid grid-flow-row auto-rows-max">
+                    {{range .Contents}}
+                    <p class="font-semibold uppercase mt-8 mb-4 text-2xl">{{.Title}}:</p>
+                    <div class="grid grid-cols-4 gap-4">
+                        {{range .Columns}}
+                        <div class="rounded-lg p-3" style="background-color: #404040;">
+                            <h6 class="accent mb-3 uppercase ">{{.Title}}</h6>
+                            <div class="grid grid-flow-row auto-rows-max">
+                                {{range .Bookmarks}}
+                                <div>
+                                    <a href="{{.Url}}" class="text-gray-500 hover:text-green-500">{{.Name}}</a>
+                                </div>
+                                {{end}}
                             </div>
-                            {{end}}
                         </div>
+                        {{end}}
                     </div>
                     {{end}}
                 </div>
-                {{end}}
             </div>
         </div>
     </div>

Niektóre pliki nie zostały wyświetlone z powodu dużej ilości zmienionych plików