前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >一个模拟 macOS 桌面样式的个人简介展示页

一个模拟 macOS 桌面样式的个人简介展示页

作者头像
老鱼的日常
发布2023-08-25 10:48:41
1480
发布2023-08-25 10:48:41
举报
文章被收录于专栏:程序员老鱼呀程序员老鱼呀

Playground macOS是一个模拟 macOS 桌面样式的个人简介展示页。它使用了React、Redux及tailwindcss开发,支持暗模式和亮模式。

使用 React + Zustand + UnoCSS + TypeScript + Vite.

安装

代码语言:javascript
复制
git clone https://github.com/Renovamen/playground-macos.git myproject
cd myprojec

安装依赖

代码语言:javascript
复制
yarn i

调试模式(http://localhost:3000

代码语言:javascript
复制
yarn dev

构建

代码语言:javascript
复制
yarn build

示例

暗模式

亮模式

Github地址:https://github.com/Renovamen/playground-macos

Demo地址:https://portfolio.zxh.io/

示例代码:

代码语言:javascript
复制
import React, { useState, useEffect } from "react";
import { Rnd } from "react-rnd";
import { useWindowSize } from "~/hooks";
import { useStore } from "~/stores";
import { minMarginX, minMarginY, appBarHeight } from "~/utils";

const FullIcon = ({ size }: { size: number }) => {
  return (
    <svg
      className="icon"
      viewBox="0 0 13 13"
      width={size}
      height={size}
      xmlns="http://www.w3.org/2000/svg"
      fillRule="evenodd"
      clipRule="evenodd"
      strokeLinejoin="round"
      strokeMiterlimit={2}
    >
      <path d="M9.26 12.03L.006 2.73v9.3H9.26zM2.735.012l9.3 9.3v-9.3h-9.3z" />
    </svg>
  );
};

const ExitFullIcon = ({ size }: { size: number }) => {
  return (
    <svg
      className="icon"
      viewBox="0 0 19 19"
      width={size}
      height={size}
      xmlns="http://www.w3.org/2000/svg"
      fillRule="evenodd"
      clipRule="evenodd"
      strokeLinejoin="round"
      strokeMiterlimit={2}
    >
      <path d="M18.373 9.23L9.75.606V9.23h8.624zM.6 9.742l8.623 8.624V9.742H.599z" />
    </svg>
  );
};

End

本文参与 腾讯云自媒体分享计划,分享自微信公众号。
原始发表:2023-08-23,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 老鱼的日常 微信公众号,前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体分享计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
目录
  • 安装
  • 示例
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档