mirror of
https://github.com/woodchen-ink/CoverView.git
synced 2025-07-18 14:01:56 +08:00
feat: add option to choose mobile theme
This commit is contained in:
parent
036f788eeb
commit
2045e3783a
BIN
src/assets/images/theme6.webp
Normal file
BIN
src/assets/images/theme6.webp
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.9 KiB |
@ -12,6 +12,7 @@ import theme2 from '../assets/images/theme2.webp'
|
||||
import theme3 from '../assets/images/theme3.webp'
|
||||
import theme4 from '../assets/images/theme4.webp'
|
||||
import theme5 from '../assets/images/theme5.webp'
|
||||
import theme6 from '../assets/images/theme6.webp'
|
||||
|
||||
|
||||
|
||||
@ -24,7 +25,7 @@ const defaultSettings = {
|
||||
icon: { 'label': 'react', 'value': 'react' },
|
||||
devIconOptions: {},
|
||||
font: 'font-Anek',
|
||||
theme: 'mobile',
|
||||
theme: 'stylish',
|
||||
customIcon: '',
|
||||
platform: 'hashnode'
|
||||
|
||||
@ -237,23 +238,29 @@ class Editor extends React.Component {
|
||||
|
||||
<img src={theme1} alt="basic theme"
|
||||
onClick={(e) => this.setState({ theme: "basic" })}
|
||||
className="opacity-60 cursor-pointer border-gray-100 hover:scale-105 duration-300 hover:border-gray-200 border m-2 "
|
||||
className=" cursor-pointer border-gray-100 hover:scale-105 duration-300 hover:border-gray-200 border m-2 "
|
||||
/>
|
||||
<img src={theme2} alt="basic theme"
|
||||
onClick={(e) => this.setState({ theme: "modern" })}
|
||||
className="opacity-60 cursor-pointer border-gray-100 hover:scale-105 hover:border-gray-200 duration-300 border m-2 "
|
||||
className="cursor-pointer border-gray-100 hover:scale-105 hover:border-gray-200 duration-300 border m-2 "
|
||||
/>
|
||||
<img src={theme3} alt="basic theme"
|
||||
onClick={(e) => this.setState({ theme: "stylish" })}
|
||||
className="opacity-60 cursor-pointer border border-gray-100 hover:border-gray-200 hover:scale-105 duration-300 m-2"
|
||||
/>
|
||||
<img src={theme4} alt="basic theme"
|
||||
onClick={(e) => this.setState({ theme: "preview" })}
|
||||
className="opacity-60 cursor-pointer border border-gray-100 hover:border-gray-200 hover:scale-105 duration-300 m-2"
|
||||
className=" cursor-pointer border border-gray-100 hover:border-gray-200 hover:scale-105 duration-300 m-2"
|
||||
/>
|
||||
|
||||
<img src={theme5} alt="basic theme"
|
||||
onClick={(e) => this.setState({ theme: "outline" })}
|
||||
className="opacity-60 cursor-pointer border border-gray-100 hover:border-gray-200 hover:scale-105 duration-300 m-2"
|
||||
className=" cursor-pointer border border-gray-100 hover:border-gray-200 hover:scale-105 duration-300 m-2"
|
||||
/>
|
||||
|
||||
<img src={theme4} alt="basic theme"
|
||||
onClick={(e) => this.setState({ theme: "preview" })}
|
||||
className=" cursor-pointer border border-gray-100 hover:border-gray-200 hover:scale-105 duration-300 m-2"
|
||||
/>
|
||||
<img src={theme6} alt="basic theme"
|
||||
onClick={(e) => this.setState({ theme: "mobile" })}
|
||||
className=" cursor-pointer border border-gray-100 hover:border-gray-200 hover:scale-105 duration-300 m-2"
|
||||
/>
|
||||
</div>
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
import React, { useState } from 'react';
|
||||
|
||||
const MobileMockupTheme = ({ config }) => {
|
||||
const { bgColor, platform, title } = config;
|
||||
const { bgColor, platform, title,font } = config;
|
||||
|
||||
const [image, setImage] = useState()
|
||||
|
||||
@ -14,7 +14,7 @@ const MobileMockupTheme = ({ config }) => {
|
||||
>
|
||||
|
||||
|
||||
<h1 className="text-2xl w-1/2 md:text-4xl px-4 text-white font-bold text-left">{title}</h1>
|
||||
<h1 className={`${font} text-2xl w-1/2 md:text-4xl px-4 text-white font-bold text-left`}>{title}</h1>
|
||||
|
||||
<div className="w-5/12 mx-auto m-4 mt-10 group mx-auto h-full shadow-lg flex flex-col bg-white border-t-8 border-x-8 border-gray-800 rounded-t-3xl border-white">
|
||||
<div className="bg-gray-800 h-8 w-full p-2 pb-3 flex items-center rounded-t">
|
||||
|
@ -1,7 +1,7 @@
|
||||
import React, { useState } from 'react';
|
||||
|
||||
const PreviewTheme = ({ config }) => {
|
||||
const { bgColor, platform,title } = config;
|
||||
const { bgColor, platform, title, font } = config;
|
||||
|
||||
const [image, setImage] = useState()
|
||||
|
||||
@ -14,7 +14,7 @@ const PreviewTheme = ({ config }) => {
|
||||
>
|
||||
|
||||
|
||||
<h1 className="text-2xl md:text-3xl p-10 text-white font-bold text-center">{title}</h1>
|
||||
<h1 className={`${font} text-2xl md:text-3xl p-10 text-white font-bold text-center`}>{title}</h1>
|
||||
|
||||
<div className="w-10/12 group mx-auto mt-auto mb-0 shadow-lg flex flex-col bg-white rounded-t-xl border-white">
|
||||
<div className="bg-gray-800 h-8 w-full p-2 flex items-center rounded-t-xl">
|
||||
|
Loading…
x
Reference in New Issue
Block a user