mirror of
https://github.com/darksaid98/new-phone-who-dis.git
synced 2026-12-04 22:16:40 +00:00
Merge pull request #68 from project-error/fix/zoom
Fixed issues with using non standard `zoom` css property
This commit is contained in:
5 files changed
+36
-27
No files matched your search
+8
-2
@@ -1,12 +1,13 @@
|
|||||||
.PhoneWrapper {
|
.PhoneWrapper {
|
||||||
width: 100vw;
|
width: 100vw;
|
||||||
height: 100vh;
|
height: 100vh;
|
||||||
|
position: relative;
|
||||||
}
|
}
|
||||||
|
|
||||||
.Phone {
|
.Phone {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
bottom: 0vh;
|
bottom: 0;
|
||||||
right: 0vh;
|
right: 0;
|
||||||
width: 500px;
|
width: 500px;
|
||||||
height: 1000px;
|
height: 1000px;
|
||||||
background-size: cover;
|
background-size: cover;
|
||||||
@@ -58,3 +59,8 @@
|
|||||||
*::-webkit-scrollbar-thumb {
|
*::-webkit-scrollbar-thumb {
|
||||||
background-color: #666;
|
background-color: #666;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
.zoomProp {
|
||||||
|
transform: scale(10);
|
||||||
|
}
|
||||||
+5
-2
@@ -324,8 +324,11 @@ function Phone() {
|
|||||||
return (
|
return (
|
||||||
<ThemeProvider theme={currentTheme()}>
|
<ThemeProvider theme={currentTheme()}>
|
||||||
<div className='PhoneWrapper'>
|
<div className='PhoneWrapper'>
|
||||||
<div style={{ zoom: settings.zoom }}>
|
<div>
|
||||||
<div className='Phone'>
|
<div
|
||||||
|
className='Phone'
|
||||||
|
style={{ transformOrigin: 'right bottom', transform: `scale(${settings.zoom}` }}
|
||||||
|
>
|
||||||
<div
|
<div
|
||||||
className='PhoneFrame'
|
className='PhoneFrame'
|
||||||
style={{
|
style={{
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ import {
|
|||||||
interface IProps {
|
interface IProps {
|
||||||
options?: any;
|
options?: any;
|
||||||
label: string;
|
label: string;
|
||||||
value?: string | null;
|
value?: string | number | null;
|
||||||
onClick?: any;
|
onClick?: any;
|
||||||
icon: JSX.Element;
|
icon: JSX.Element;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -11,7 +11,7 @@
|
|||||||
"wallpaper": "minimal.png",
|
"wallpaper": "minimal.png",
|
||||||
"frame": "s10.png",
|
"frame": "s10.png",
|
||||||
"theme": "taso-dark",
|
"theme": "taso-dark",
|
||||||
"zoom": "100%",
|
"zoom": 1,
|
||||||
"ringtone": "pixel",
|
"ringtone": "pixel",
|
||||||
"ringtoneVol": 100
|
"ringtoneVol": 100
|
||||||
},
|
},
|
||||||
@@ -20,7 +20,7 @@
|
|||||||
"logLevel": 1
|
"logLevel": 1
|
||||||
},
|
},
|
||||||
"frames": ["s10.png"],
|
"frames": ["s10.png"],
|
||||||
"zoomOptions": ["120%", "100%", "80%", "60%", "40%"],
|
"zoomOptions": [1, 0.9, 0.8],
|
||||||
"ringtones": ["marimba", "pixel"],
|
"ringtones": ["marimba", "pixel"],
|
||||||
"themes": {
|
"themes": {
|
||||||
"default-dark": {
|
"default-dark": {
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
import React, { useEffect } from 'react';
|
import React, { useEffect } from 'react';
|
||||||
import { AppIcon } from './AppIcon';
|
import { AppIcon } from './AppIcon';
|
||||||
import { Grid, makeStyles } from '@material-ui/core';
|
import { useTranslation } from 'react-i18next';
|
||||||
|
import { Grid, makeStyles, Tooltip, Zoom } from '@material-ui/core';
|
||||||
import { Link } from 'react-router-dom';
|
import { Link } from 'react-router-dom';
|
||||||
import { useKeyboard } from '../../os/keyboard/hooks/useKeyboard';
|
import { useKeyboard } from '../../os/keyboard/hooks/useKeyboard';
|
||||||
|
|
||||||
@@ -13,7 +14,6 @@ const useStyles = makeStyles((theme) => ({
|
|||||||
width: '20%',
|
width: '20%',
|
||||||
},
|
},
|
||||||
tooltip: {
|
tooltip: {
|
||||||
bottom: -8,
|
|
||||||
fontSize: 12,
|
fontSize: 12,
|
||||||
},
|
},
|
||||||
}));
|
}));
|
||||||
@@ -21,6 +21,7 @@ const useStyles = makeStyles((theme) => ({
|
|||||||
export const GridMenu = ({ items, Component = AppIcon }) => {
|
export const GridMenu = ({ items, Component = AppIcon }) => {
|
||||||
const setKey = useKeyboard();
|
const setKey = useKeyboard();
|
||||||
const classes = useStyles();
|
const classes = useStyles();
|
||||||
|
const { t } = useTranslation();
|
||||||
|
|
||||||
useEffect(function registerKeyHandlers() {
|
useEffect(function registerKeyHandlers() {
|
||||||
setKey('ArrowLeft', () => {
|
setKey('ArrowLeft', () => {
|
||||||
@@ -28,32 +29,31 @@ export const GridMenu = ({ items, Component = AppIcon }) => {
|
|||||||
});
|
});
|
||||||
// eslint-disable-next-line
|
// eslint-disable-next-line
|
||||||
}, []);
|
}, []);
|
||||||
|
// TODO: Fix tooltip position to be closer to app icon
|
||||||
return (
|
return (
|
||||||
<Grid container justify='center'>
|
<Grid container justify='center'>
|
||||||
<Grid container item>
|
<Grid container item>
|
||||||
{items &&
|
{items &&
|
||||||
items.length &&
|
items.length &&
|
||||||
items.map((item) => (
|
items.map((item) => (
|
||||||
// <Tooltip
|
<Tooltip
|
||||||
// title={item.id}
|
arrow
|
||||||
// placement='top'
|
|
||||||
// arrow
|
|
||||||
// classes={{ tooltip: classes.tooltip }}
|
|
||||||
// PopperProps={{
|
|
||||||
// anchorEl={}
|
|
||||||
// }}
|
|
||||||
// >
|
|
||||||
<Grid
|
|
||||||
key={item.id}
|
key={item.id}
|
||||||
item
|
title={t(item.nameLocale)}
|
||||||
className={classes.item}
|
placement='top'
|
||||||
component={Link}
|
classes={{ tooltip: classes.tooltip }}
|
||||||
to={item.path}
|
TransitionComponent={Zoom}
|
||||||
>
|
>
|
||||||
<Component {...item} />
|
<Grid
|
||||||
</Grid>
|
key={item.id}
|
||||||
// </Tooltip>
|
item
|
||||||
|
className={classes.item}
|
||||||
|
component={Link}
|
||||||
|
to={item.path}
|
||||||
|
>
|
||||||
|
<Component {...item} />
|
||||||
|
</Grid>
|
||||||
|
</Tooltip>
|
||||||
))}
|
))}
|
||||||
</Grid>
|
</Grid>
|
||||||
</Grid>
|
</Grid>
|
||||||
|
|||||||
Reference in new issue
Block a user