screen_rotation
Copied to Clipboard
<!DOCTYPE html> <html> <head> <meta charset="UTF-8" /> <script src="https://cdnjs.cloudflare.com/ajax/libs/react/17.0.2/umd/react.development.js"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/react-dom/17.0.2/umd/react-dom.development.js"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/babel-standalone/6.26.0/babel.min.js"></script> </head> <body> <div id="app"></div> <script type="text/babel"> const { useState } = React; function App() { const [uuid1, setUuid1] = useState("550e8400-e29b-41d4-a716-446655440000"); const [uuid2, setUuid2] = useState("550e8400-e29b-41d4-a716-446655440000"); const areUUIDsEqual = () => { return uuid1 === uuid2 ? "UUIDs are equal." : "UUIDs are not equal."; } return ( <div className='container'> <h3 className='title'>React Js UUID Comparison Example</h3> <p className='uuid-paragraph'>UUID 1: {uuid1}</p> <p className='uuid-paragraph'>UUID 2: {uuid2}</p> <p className='uuid-equality'>{areUUIDsEqual()}</p> </div> ); } ReactDOM.render(<App />, document.getElementById("app")); </script> <style> .container { max-width: 500px; margin: 0 auto; padding: 20px; border-radius: 8px; box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1); display: flex; flex-direction: column; align-items: center; justify-content: center; } .title { font-size: 24px; font-weight: bold; margin: 0; color: #333; } .uuid-paragraph { font-size: 18px; margin: 10px 0; color: #555; } .uuid-equality { font-size: 20px; font-weight: bold; margin-top: 20px; color: #4CAF50; /* Green color for equality */ } </style> </body> </html>