Skip to content

Commit

Permalink
chore: update cartoon template
Browse files Browse the repository at this point in the history
  • Loading branch information
byodian committed Dec 1, 2024
1 parent 2ae42ea commit 45adb3a
Show file tree
Hide file tree
Showing 16 changed files with 111 additions and 96 deletions.
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,8 @@
"lint-staged": "^15.2.10",
"postcss": "^8",
"tailwindcss": "^3.4.1",
"typescript": "^5"
"typescript": "^5",
"vercel": "39.1.1"
},
"lint-staged": {
"src/**/*.{ts,tsx}": [
Expand Down
129 changes: 57 additions & 72 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions public/images/cartoon-star-inner.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions public/images/cartoon-star-left-blue.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions public/images/cartoon-star-left-green.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes
3 changes: 3 additions & 0 deletions public/images/cartoon-star-left-yellow.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions public/images/cartoon-star-right-blue.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions public/images/cartoon-star-right-green.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions public/images/cartoon-star-right-purple.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions public/images/cartoon-star-right-yellow.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion src/components/header/export-dialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ export function ExportImageDialog({
</div>
<div className="mt-4 sm:mt-auto ml-auto">
<Button onClick={exportImages} disabled={previewImages.length === 0 || isExporting}>
{isExporting ? (
{previewImages.length === 0 || isExporting ? (
<Loader2 className="w-4 h-4 mr-2 animate-spin" />
) : (
<Download className="w-4 h-4 mr-2" />
Expand Down
6 changes: 4 additions & 2 deletions src/theme/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import {
cartoonBlue,
cartoonGreen,
cartoonPurple,
cartoonTemplate,
Expand All @@ -15,8 +16,8 @@ import type { ArticleModuleTemplate, ThemeColorItem } from '@/types'

export const DEFAULT_TEMPLATES = [
{ label: '简约科技风格', value: 'wechat-post-1', disabled: false, template: techTemplate },
{ label: '黑白苹果风格', value: 'apple-style', disabled: false, template: simpleTemplate },
{ label: '卡通风格', value: 'cartoon-style', disabled: false, template: cartoonTemplate },
{ label: '简约黑白风格', value: 'apple-style', disabled: false, template: simpleTemplate },
{ label: '简约卡通风格', value: 'cartoon-style', disabled: false, template: cartoonTemplate },
{ label: '更多模版尽情期待', value: 'post-more', disabled: true, template: null },
] as const

Expand All @@ -42,6 +43,7 @@ export const DEFAULT_THEME_COLOR_MAP: Record<string, ThemeColorItem[]> = {
{ value: '#b38aef', label: 'purple', theme: cartoonPurple },
{ value: '#cdea9c', label: 'green', theme: cartoonGreen },
{ value: '#ffe97f', label: 'yellow', theme: cartoonYellow },
{ value: '#516cf5', label: 'blue', theme: cartoonBlue },
],
'default': [
{ value: '#4383ec', label: 'tech_blue', theme: techBlue },
Expand Down
14 changes: 8 additions & 6 deletions src/theme/templates/cartoon-template/cartoon-color-variables.ts
Original file line number Diff line number Diff line change
@@ -1,22 +1,24 @@
import type { ThemeConfig } from '@/types'

export const cartoonPurple: ThemeConfig = createCartoonThemeColor('#e3dceb', '#ffe36c', '#c0a1f1')
export const cartoonGreen: ThemeConfig = createCartoonThemeColor('#cdea9c', '#ffe36c', '#99c64c')
export const cartoonYellow: ThemeConfig = createCartoonThemeColor('#ffe97f', '#ffbf74', '#ff773d')
export const cartoonPurple: ThemeConfig = createCartoonThemeColor('#e3dceb', '#000', '#ffe36c', '#c0a1f1', 'purple')
export const cartoonGreen: ThemeConfig = createCartoonThemeColor('#cdea9c', '#000', '#ffe36c', '#99c64c', 'green')
export const cartoonYellow: ThemeConfig = createCartoonThemeColor('#ffe97f', '#000', '#ffbf74', '#ff773d', 'yellow')
export const cartoonBlue: ThemeConfig = createCartoonThemeColor('#516CF5', '#fff', '#FFCF4D', '#000', 'blue')

function createCartoonThemeColor(containerBgColor: string, titleBgPrimaryColor: string, titleBgSecondaryColor: string) {
function createCartoonThemeColor(containerBgColor: string, containerColor: string, titleBgPrimaryColor: string, titleBgSecondaryColor: string, starIconColor: string) {
return {
hero: {
container: {
background: containerBgColor,
foreground: '#333',
backgroundImageLeft: `url(/images/cartoon-star-left-${starIconColor}.svg)`,
backgroundImageRight: `url(/images/cartoon-star-right-${starIconColor}.svg)`,
foreground: containerColor,
},
title: {
foreground: '#fff',
background: 'transparent',
},
content: {
foreground: '#000',
background: 'transparent',
},
},
Expand Down
Loading

0 comments on commit 45adb3a

Please sign in to comment.