Code Monkey home page Code Monkey logo

Comments (4)

joseDaKing avatar joseDaKing commented on August 19, 2024 2

Implementation can be implemented with css clip path, because all browsers support css clip path with inline svg

from masked-view.

KingAmo avatar KingAmo commented on August 19, 2024 1

+1

i don't have the skill to help, but i also need this feature

from masked-view.

msvargas avatar msvargas commented on August 19, 2024 1

This works better for me:

import React from 'react';
import { View } from 'react-native';

function MaskedViewWeb({ maskElement, ...props }) {
	return React.createElement(View, props, maskElement);
}

export default MaskedViewWeb;

from masked-view.

Julia20011974 avatar Julia20011974 commented on August 19, 2024

Hello, everyone, i just used css - inset-
important idea, you have 2 blocks,
first - back,
second - front,
they lie on top of each other, and when you just get value, that show part back, and hide front,
also important, they lie pixel by pixel, it for your text that your pixels don't brake

!!!!!!
it's using styled for web, i mean

import styled from 'styled-components',

not in

import styled from 'styled-components/native'

   const inset = `inset(0 0 0 ${val}%)`;
   const inlineStyles = {clipPath: inset, WebkitClipPath: inset};
          <Wrapper>
            <Back>
              Upload {val}%
            </Back>
            <Front style={inlineStyles}>
              Upload {val}%
            </Front>
          </Wrapper>
const Back = styled.div`
  background: red;
  color: white;
  width: 100%;
  height: 100%;
  align-items: center;
  display: flex;
  justify-content: center;
`;
const Front = styled.div`
  height: 50px;
  position: absolute;
  top: 0;
  text-align: center;
  width: 100%;
  background: white;
  color:  red;
  clip-path: inset(0 0 0 0);
  transition: clip-path 0.3s ease-in;
  align-items: center;
  display: flex;
  justify-content: center;
`;

from masked-view.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.