投稿時間:2023-01-06 07:09:03 RSSフィード2023-01-06 07:00 分まとめ(14件)

カテゴリー等 サイト名等 記事タイトル・トレンドワード等 リンクURL 頻出ワード・要約等/検索ボリューム 登録日
IT ビジネス+IT 最新ニュース ispace「月面着陸船打ち上げ」は何がスゴい? 歴史に名を刻める理由 https://www.sbbit.jp/article/cont1/101622?ref=rss falcon 2023-01-06 06:40:00
IT ビジネス+IT 最新ニュース 課題山積み、2023年の日本のものづくりはどうなる?世界に勝つ「日本流」製造業DXとは https://www.sbbit.jp/article/cont1/101764?ref=rss 2023-01-06 06:10:00
AWS AWS News Blog Amazon S3 Encrypts New Objects By Default https://aws.amazon.com/blogs/aws/amazon-s3-encrypts-new-objects-by-default/ Amazon S Encrypts New Objects By DefaultAt AWS security is job zero Starting today Amazon Simple Storage Service Amazon S encrypts all new objects by default Now S automatically applies server side encryption SSE S for each new object unless you specify a different encryption option SSE S was first launched in As Jeff wrote at the time “Amazon S server side encryption handles … 2023-01-05 21:03:09
js JavaScriptタグが付けられた新着投稿 - Qiita VSCode で動く Teams Toolkit での F5 デバッグをカスタマイズしよう https://qiita.com/girlie_mac/items/050bd5cc1c3fa5d14e47 teamstoolkit 2023-01-06 06:42:31
海外TECH Ars Technica WhatsApp just made it harder to censor citizens with Internet shutdowns https://arstechnica.com/?p=1908147 internet 2023-01-05 21:09:50
海外TECH DEV Community Create a Post Editor Similar to Twitter with a Responsive Images Grid with tailwindcss https://dev.to/ayka_code/create-a-post-editor-similar-to-twitter-with-a-responsive-images-grid-with-tailwindcss-j7a Create a Post Editor Similar to Twitter with a Responsive Images Grid with tailwindcssCheck my original blog post for better UI Create a Post Editor Similar to Twitter with a Responsive Images Grid with tailwindcssIn this tutorial we will create a React component for a social media post editor that allows the user to write posts and display a grid of selected images while preserving their aspect ratio The component also allows the user to remove images from the grid We re going to use Tailwindcss and nextjs in this tutorial so make sure to install and configure your project following Tailwind css with Nextjs guide To get started let s import the necessary dependencies and create a functional component called PostEditorImages import React useEffect useState from react const PostEditorImages images removeImage gt component code goes here Our component will accept two props images an array of images of type File representing the images to be displayed in the grid removeImage a function that removes an image from the images array and updates the state of the parent component Next let s set up some state variables that we will use to control the layout of the image grid const imagesContainerGrid setImagesContainerGrid useState grid cols grid rows const aspectRatios setAspectRatios useState The imagesContainerGrid state variable will hold a string of CSS class names that define a grid template columns of and rows of The aspectRatios state variable will hold an object that maps the index of each image to its aspect ratio Now let s write a useEffect hook that updates the imagesContainerGrid state variable based on the number of images useEffect gt setImagesContainerGrid images length gt grid cols grid rows h px images length gt grid cols grid cols images This useEffect hook will run every time the images prop changes If there are three or more images it will set the imagesContainerGrid state variable to a string that specifies a grid with two columns and two rows with a fixed height of px If there are two or more images it will set the imagesContainerGrid state variable to a string that specifies a grid with two columns If there is only one image it will set the imagesContainerGrid state variable to a string that specifies a grid with one column Now let s write a useEffect hook that calculates the aspect ratio of each image and updates the aspectRatios state variable useEffect gt images forEach image index gt const reader new FileReader reader onload function event const data event target result const img new Image img src data img onload function const gcd a b gt b a gcd b a b const numerator img width gcd img width img height const denominator img height gcd img width img height setAspectRatios ratios gt ratios index numerator denominator reader readAsDataURL image images This code iterates over an array of images and calculates the aspect ratio of each image It does this by Creating a FileReader object for each image which allows the code to read the contents of the file as a data URL Setting an onload event handler for the FileReader object which is called when the file has been successfully read The event handler creates a new image object sets its src property to the data URL and sets an onload event handler for the image object The onload event handler for the image object calculates the aspect ratio of the image by dividing the width by the greatest common divisor of the width and height and dividing the height by the greatest common divisor It then updates the aspectRatios state variable by creating a new object that spreads the existing aspect ratios and adds a new key value pair for the current image s index and aspect ratio Finally the code calls the readAsDataURL method on the FileReader object passing in the image file as an argument This starts the process of reading the file as a data URL Finally let s render the image grid in the component s JSX return lt div className grid area images grid gap imagesContainerGrid gt display the selected images images length gt amp amp images map image index gt lt div key image name className relative rounded md style backgroundImage url URL createObjectURL image backgroundSize cover backgroundPosition center center backgroundRepeat no repeat width height aspectRatio aspectRatios index gt lt button className absolute flex items center justify center top text sm right p text white rounded full w h shadow md bg black bg opacity hover bg opacity onClick gt removeImage index gt lt span gt X lt span gt lt button gt lt div gt lt div gt This JSX creates a div of grid area images that will be defined in the parent component with the grid class and the imagesContainerGrid class which defines the layout of the image grid Inside the div it maps over the images array and renders a div for each image Each image div has a background image set to the image file and the aspectRatio style property set to the aspect ratio of the image The div also has a remove button that calls the removeImage function and passes in the index of the image to be removed That s it With these simple steps we have created a React component that displays a grid of images selected by the user and allows the user to remove images from the grid To use the component we need to create the SocialMediaTextEditor component which represents the text editor for the the social media app const SocialMediaTextEditor gt const text setText useState state to store the text const images setImages useState state to store the images const imageContainerRef useRef const handleTextChange event gt setText event target value const handleImageChange event gt update the images state by concatenating the selected files with the existing ones setImages images event target files const removeImage index gt create a new array with the selected image removed const newImages images newImages splice index setImages newImages return Here we have the handleTextChange to save the latest value of the text field the handleImageChange and removeImage functions are responsible for adding and removing images from the images list Now lets define and style the post editor component using grid template areas with tailwindcss return lt div className rounded lg p grid gap y grid cols px px fr grid rows px fr minmax max content px grid template areas profile p post empty p post empty p images empty p postActions gt lt div gt The SocialMediaTextEditor component contains a profile area where you can add a profile image The post area represents the text field where the user can write their post The p p and p represent a px gap that is defined in the grid cols px px fr layout The postActions area holds the upload images button and the post button The emptyX fills in the profile area in all grid rows except the first row giving the component a similar style to the Twitter post editor Now let s define the JSX code for the profile text field and displayed images ⁠ profile area lt div className grid area profile rounded full bg red gt post area lt textarea className w full resize none grid area post h fit p rounded lg text gray focus outline none placeholder Write your post here value text onChange handleChange gt display selected images lt PostEditorImages images images removeImage removeImage gt ⁠ Now add the jsx code that will allow us to select images from the local system display selected images lt PostEditorImages images images removeImage removeImage gt lt div className grid area postActions flex flex row justify between gt lt div className justify self start flex flex row gap gt add the input element to select images lt label htmlFor image upload className cursor pointer gt lt FaImage size color rgb gt lt label gt lt input id image upload type file accept image multiple onChange handleImageChange className hidden gt lt div gt lt button className bg red justify self end hover bg red text white font bold py px rounded full gt Post lt button gt lt div gt ⁠ You can import the FaImage component from react icons package That s it You now have a fully functional social media post editor component with a responsive display images grid and a style similar to the Twitter post editor Of course you still need to create the logic for uploading the images to the server I hope this tutorial was helpful in showing you how to display and manage a grid of images in a React app Happy coding 2023-01-05 21:02:17
海外TECH Engadget Peloton will pay $19 million for not reporting fatal Tread+ safety issues immediately https://www.engadget.com/peloton-tread-plus-recall-settlement-214734408.html?src=rss Peloton will pay million for not reporting fatal Tread safety issues immediatelyPeloton is ready to end its battle with regulators over Tread safety issues The fitness equipment maker has agreed to pay just over million to settle Consumer Product Safety Commission charges that it broke the law through its response to both injury reports and the ensuing recall The company started receiving reports of people pets and objects being pulled under the Tread as far back as December but didn t quot immediately quot report them as required by law according to the CPSC By the time Peloton filed a report there were over known incidents that included a child s death and injuries The firm is also accused of knowingly distributing treadmills after the recall began in May Couriers delivered units according to the CPSC On top of the payout the deal requires that Peloton institute a compliance program and provide yearly nbsp In a statement to Engadget a spokesperson said Peloton was quot pleased quot to settle with the CPSC and would cooperate on improving product safety The representative added that the company was still seeking approval for a rear guard that would bolster Tread safeguards The settlement comes more than a year after a public fight over the Tread design When the CPSC issued a warning against using the treadmill after reports of injuries Peloton claimed the alert was quot inaccurate and misleading quot and insisted that customers could still use the exercise gear as long as they followed instructions The company agreed to voluntarily recall its hardware weeks later but that came after reported incidents at the time Peloton has a clear incentive to call a truce The brand had a terrible with plunging sales as the pandemic recovery saw would be customers visit gyms or otherwise step outside It turned to a number of tactics in a bid to trim costs and boost sales including machine price cuts offset by a subscription fee hike and a switch to third party manufacturing The settlement both ends the threat of further legal trouble and lets Peloton focus on rebuilding its business including the possible return of the Tread in question 2023-01-05 21:47:34
海外TECH Engadget Sorry, but you still have to push this $3,800 electric-assist stroller https://www.engadget.com/gluxkind-self-driving-stroller-ces-2023-213705431.html?src=rss Sorry but you still have to push this electric assist strollerNon parents may not believe it but pushing a pram around can be a fairly strenuous task especially when the train gets rough It s a full body workout to push two kids under four in my old Uppababy Vista which weighed the same as an iceberg and had the turning circle of the Titanic To remedy this Canadian startup GlüxKind has developed an electrically assisted stroller that ll make pushing easier and can even drive itself albeit only when your kid isn t on board The GlüxKind Ella is the brainchild of Anne Hunger and Kevin Huang a couple who were less than whelmed when looking for a stroller for their own daughter They decided to build their own device by strapping an electric skateboard to a regular stroller and started developing their product from there The device has three modes the first of which is to add electric assist to the wheels as you re pushing it around Trying this in an admittedly limited demo at CES it feels very much like the sort of power boost you get with an e bike You still have to push this thing around but you only have to make a fairly meager level of effort before the motor kicks in and helps you out As well as easier forward motion you ll also find turning to be a lot snappier than you may expect useful too when you re trying to maneuver your rugrat in tight spaces It ll also prove useful when going uphill or if you re carrying lots of groceries in Ella s surprisingly large cargo space I m told that the battery will last for around eight hours of mixed use and you ll need to charge it at the end of every day more or les You can also set the pram to rock your baby to sleep moving backwards and forwards by about a foot This I m sure will be a godsend to parents who are otherwise praying for divine intervention at am as their precious child refuses to sleep I m aware that there are some safety caveats about using such a feature on a regular basis but being able to call on the feature in a pinch will surely be an instant sell to some harangued parents The last mode and the most eye catching is self driving where the stroller will drive ahead of you by a couple of feet It ll maintain power when going up hill and brake so it stays close to you when you re going down the other side But crucially the system is designed to not work if you put your kid in the seat and expect the pram to do all of the work A weight sensor in the bassinet and stroller chair will block the function if it detects the presence of a child A product like this is understandably going to be at the higher end of the price scale and when it hits Kickstarter this spring the first units will set you back Once that early bird special is done with the price is likely to climb a little higher but for that you ll also get built in GPS so you can track where your pram is if you ve asked friends and family to babysit GlüxKind also has plans to build out a community feature to find and connect like minded parents ーthe sort of whom are also prepared to spend north of four grand on a self driving stroller 2023-01-05 21:37:05
Cisco Cisco Blog The future of retail is now, at NRF https://blogs.cisco.com/retail/the-future-of-retail-is-now-nrf2023 The future of retail is now at NRFBetween customer expectations and a consumer experience that delivers there s a bridge Cisco is showcasing how we help retailers thrive at NRF Connect with us at NRF Booth 2023-01-05 21:39:50
Linux OMG! Ubuntu! How to Highlight Mouse Cursor in Ubuntu https://www.omgubuntu.co.uk/2023/01/highlight-mouse-cursor-ubuntu How to Highlight Mouse Cursor in UbuntuIf you record screencasts make online tutorials or stream your Ubuntu desktop when gaming you may find it useful to highlight your mouse cursor on screen Using some kind of highlight effect on your mouse cursor helps you or anyone watching you see where the mouse pointer is cursors are typically small and hard to spot and draws attention to what s underneath your pointer useful in tutorials or during a presentation Users of macOS and Windows have access to a mountain of apps tools and add ons that provide all kinds of fancy mouse cursor effects and some of the most This post How to Highlight Mouse Cursor in Ubuntu is from OMG Ubuntu Do not reproduce elsewhere without permission 2023-01-05 21:05:10
ニュース BBC News - Home Ukraine war: Kyiv rejects Putin's 'trivial' Christmas truce https://www.bbc.co.uk/news/world-64178912?at_medium=RSS&at_campaign=KARANGA propaganda 2023-01-05 21:49:45
ニュース BBC News - Home Chelsea 0-1 Manchester City: Riyad Mahrez goal moves champions within five points of Arsenal https://www.bbc.co.uk/sport/football/64113785?at_medium=RSS&at_campaign=KARANGA Chelsea Manchester City Riyad Mahrez goal moves champions within five points of ArsenalChampions Manchester City move to within five points of Arsenal at the top of the Premier League with a win at Chelsea 2023-01-05 21:52:36
ニュース BBC News - Home Lazio racism: Fans' chants mean part of stadium to be closed https://www.bbc.co.uk/sport/football/64181999?at_medium=RSS&at_campaign=KARANGA lecce 2023-01-05 21:02:21
北海道 北海道新聞 バイデン氏「反応しない」 停戦命令に不信感 https://www.hokkaido-np.co.jp/article/784007/ 米大統領 2023-01-06 06:22:00

コメント

このブログの人気の投稿

投稿時間:2021-06-17 05:05:34 RSSフィード2021-06-17 05:00 分まとめ(1274件)

投稿時間:2021-06-20 02:06:12 RSSフィード2021-06-20 02:00 分まとめ(3871件)

投稿時間:2020-12-01 09:41:49 RSSフィード2020-12-01 09:00 分まとめ(69件)